# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #! CHECKER Intrinsics is enabled #! RUN force_jit: true, options: "--compiler-encode-intrinsics=true", entry: "_GLOBAL::main" #! EVENT /Compilation,.*_GLOBAL::main/ #! METHOD "_GLOBAL::main" #! PASS_AFTER "IrBuilder" #! INST "Abs " #! INST "Min " #! ASM_METHOD "_GLOBAL::main" #! ASM_NOT x64: /call.*r\d+/ #! CHECKER Intrinsics is disable #! RUN force_jit: true, options: "--compiler-encode-intrinsics=false", entry: "_GLOBAL::main" #! EVENT /Compilation,.*_GLOBAL::main/ #! METHOD "_GLOBAL::main" #! PASS_AFTER "IrBuilder" #! INST "Intrinsic.MathAbsI64" #! INST "Intrinsic.MathMinI64" #! INST_NOT "Abs " #! INST_NOT "Min " #! ASM_METHOD "_GLOBAL::main" #! ASM_INST "Intrinsic.MathAbsI64" #! ASM x64: /call.*r\d+/, arm64: "bl" #! ASM_INST "Intrinsic.MathMinI64" #! ASM x64: /call.*r\d+/, arm64: "bl" .record Math .function i64 Math.minI64(i64 a0, i64 a1) .function i64 Math.absI64(i64 a0) .function i64 main() { movi.64 v0, -1 movi.64 v1, 0 call.short Math.absI64, v0 sta v0 call.short Math.minI64, v0, v1 return }