diff options
-rw-r--r-- | flang/lib/Optimizer/Builder/IntrinsicCall.cpp | 24 | ||||
-rw-r--r-- | flang/test/Lower/Intrinsics/acosh.f90 | 20 | ||||
-rw-r--r-- | flang/test/Lower/Intrinsics/asin.f90 | 20 | ||||
-rw-r--r-- | flang/test/Lower/Intrinsics/asinh.f90 | 21 | ||||
-rw-r--r-- | flang/test/Lower/Intrinsics/atanh.f90 | 20 |
5 files changed, 65 insertions, 40 deletions
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp index 9a80e36..3dc8d21 100644 --- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp +++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp @@ -1057,8 +1057,10 @@ static constexpr MathOperation mathOperations[] = { {"acos", "cacos", genFuncType<Ty::Complex<8>, Ty::Complex<8>>, genLibCall}, {"acos", RTNAME_STRING(CAcosF128), FuncTypeComplex16Complex16, genLibF128Call}, - {"acosh", "acoshf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall}, - {"acosh", "acosh", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall}, + {"acosh", "acoshf", genFuncType<Ty::Real<4>, Ty::Real<4>>, + genMathOp<mlir::math::AcoshOp>}, + {"acosh", "acosh", genFuncType<Ty::Real<8>, Ty::Real<8>>, + genMathOp<mlir::math::AcoshOp>}, {"acosh", RTNAME_STRING(AcoshF128), FuncTypeReal16Real16, genLibF128Call}, {"acosh", "cacoshf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>, genLibCall}, @@ -1082,15 +1084,19 @@ static constexpr MathOperation mathOperations[] = { {"anint", "llvm.round.f80", genFuncType<Ty::Real<10>, Ty::Real<10>>, genMathOp<mlir::LLVM::RoundOp>}, {"anint", RTNAME_STRING(RoundF128), FuncTypeReal16Real16, genLibF128Call}, - {"asin", "asinf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall}, - {"asin", "asin", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall}, + {"asin", "asinf", genFuncType<Ty::Real<4>, Ty::Real<4>>, + genMathOp<mlir::math::AsinOp>}, + {"asin", "asin", genFuncType<Ty::Real<8>, Ty::Real<8>>, + genMathOp<mlir::math::AsinOp>}, {"asin", RTNAME_STRING(AsinF128), FuncTypeReal16Real16, genLibF128Call}, {"asin", "casinf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>, genLibCall}, {"asin", "casin", genFuncType<Ty::Complex<8>, Ty::Complex<8>>, genLibCall}, {"asin", RTNAME_STRING(CAsinF128), FuncTypeComplex16Complex16, genLibF128Call}, - {"asinh", "asinhf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall}, - {"asinh", "asinh", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall}, + {"asinh", "asinhf", genFuncType<Ty::Real<4>, Ty::Real<4>>, + genMathOp<mlir::math::AsinhOp>}, + {"asinh", "asinh", genFuncType<Ty::Real<8>, Ty::Real<8>>, + genMathOp<mlir::math::AsinhOp>}, {"asinh", RTNAME_STRING(AsinhF128), FuncTypeReal16Real16, genLibF128Call}, {"asinh", "casinhf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>, genLibCall}, @@ -1119,8 +1125,10 @@ static constexpr MathOperation mathOperations[] = { genMathOp<mlir::math::Atan2Op>}, {"atan2", RTNAME_STRING(Atan2F128), FuncTypeReal16Real16Real16, genLibF128Call}, - {"atanh", "atanhf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall}, - {"atanh", "atanh", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall}, + {"atanh", "atanhf", genFuncType<Ty::Real<4>, Ty::Real<4>>, + genMathOp<mlir::math::AtanhOp>}, + {"atanh", "atanh", genFuncType<Ty::Real<8>, Ty::Real<8>>, + genMathOp<mlir::math::AtanhOp>}, {"atanh", RTNAME_STRING(AtanhF128), FuncTypeReal16Real16, genLibF128Call}, {"atanh", "catanhf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>, genLibCall}, diff --git a/flang/test/Lower/Intrinsics/acosh.f90 b/flang/test/Lower/Intrinsics/acosh.f90 index bc0d03f..e704153 100644 --- a/flang/test/Lower/Intrinsics/acosh.f90 +++ b/flang/test/Lower/Intrinsics/acosh.f90 @@ -1,9 +1,9 @@ -! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL %s -! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL %s -! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL %s +! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL,FAST %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL,FAST %s +! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL,RELAXED %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL,RELAXED %s +! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL,PRECISE %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL,PRECISE %s function test_real4(x) real :: x, test_real4 @@ -11,7 +11,9 @@ function test_real4(x) end function ! ALL-LABEL: @_QPtest_real4 -! ALL: {{%[A-Za-z0-9._]+}} = fir.call @acoshf({{%[A-Za-z0-9._]+}}) {{.*}}: (f32) -> f32 +! FAST: {{%[A-Za-z0-9._]+}} = math.acosh {{%[A-Za-z0-9._]+}} {{.*}}: f32 +! RELAXED: {{%[A-Za-z0-9._]+}} = math.acosh {{%[A-Za-z0-9._]+}} {{.*}}: f32 +! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @acoshf({{%[A-Za-z0-9._]+}}) {{.*}}: (f32) -> f32 function test_real8(x) real(8) :: x, test_real8 @@ -19,7 +21,9 @@ function test_real8(x) end function ! ALL-LABEL: @_QPtest_real8 -! ALL: {{%[A-Za-z0-9._]+}} = fir.call @acosh({{%[A-Za-z0-9._]+}}) {{.*}}: (f64) -> f64 +! FAST: {{%[A-Za-z0-9._]+}} = math.acosh {{%[A-Za-z0-9._]+}} {{.*}}: f64 +! RELAXED: {{%[A-Za-z0-9._]+}} = math.acosh {{%[A-Za-z0-9._]+}} {{.*}}: f64 +! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @acosh({{%[A-Za-z0-9._]+}}) {{.*}}: (f64) -> f64 function test_complex4(x) complex :: x, test_complex4 diff --git a/flang/test/Lower/Intrinsics/asin.f90 b/flang/test/Lower/Intrinsics/asin.f90 index a2ff6d6..73ca8c5 100644 --- a/flang/test/Lower/Intrinsics/asin.f90 +++ b/flang/test/Lower/Intrinsics/asin.f90 @@ -1,9 +1,9 @@ -! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL %s -! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL %s -! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL %s +! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL,FAST %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL,FAST %s +! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL,RELAXED %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL,RELAXED %s +! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL,PRECISE %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL,PRECISE %s function test_real4(x) real :: x, test_real4 @@ -11,7 +11,9 @@ function test_real4(x) end function ! ALL-LABEL: @_QPtest_real4 -! ALL: {{%[A-Za-z0-9._]+}} = fir.call @asinf({{%[A-Za-z0-9._]+}}) {{.*}}: (f32) -> f32 +! FAST: {{%[A-Za-z0-9._]+}} = math.asin {{%[A-Za-z0-9._]+}} {{.*}}: f32 +! RELAXED: {{%[A-Za-z0-9._]+}} = math.asin {{%[A-Za-z0-9._]+}} {{.*}}: f32 +! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @asinf({{%[A-Za-z0-9._]+}}) {{.*}}: (f32) -> f32 function test_real8(x) real(8) :: x, test_real8 @@ -19,7 +21,9 @@ function test_real8(x) end function ! ALL-LABEL: @_QPtest_real8 -! ALL: {{%[A-Za-z0-9._]+}} = fir.call @asin({{%[A-Za-z0-9._]+}}) {{.*}}: (f64) -> f64 +! FAST: {{%[A-Za-z0-9._]+}} = math.asin {{%[A-Za-z0-9._]+}} {{.*}}: f64 +! RELAXED: {{%[A-Za-z0-9._]+}} = math.asin {{%[A-Za-z0-9._]+}} {{.*}}: f64 +! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @asin({{%[A-Za-z0-9._]+}}) {{.*}}: (f64) -> f64 function test_complex4(x) complex :: x, test_complex4 diff --git a/flang/test/Lower/Intrinsics/asinh.f90 b/flang/test/Lower/Intrinsics/asinh.f90 index 193a8ac..aab666a 100644 --- a/flang/test/Lower/Intrinsics/asinh.f90 +++ b/flang/test/Lower/Intrinsics/asinh.f90 @@ -1,9 +1,9 @@ -! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL %s -! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL %s -! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL %s +! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL,FAST %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL,FAST %s +! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL,RELAXED %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL,RELAXED %s +! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL,PRECISE %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL,PRECISE %s function test_real4(x) real :: x, test_real4 @@ -11,7 +11,9 @@ function test_real4(x) end function ! ALL-LABEL: @_QPtest_real4 -! ALL: {{%[A-Za-z0-9._]+}} = fir.call @asinhf({{%[A-Za-z0-9._]+}}) {{.*}}: (f32) -> f32 +! FAST: {{%[A-Za-z0-9._]+}} = math.asinh {{%[A-Za-z0-9._]+}} {{.*}}: f32 +! RELAXED: {{%[A-Za-z0-9._]+}} = math.asinh {{%[A-Za-z0-9._]+}} {{.*}}: f32 +! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @asinhf({{%[A-Za-z0-9._]+}}) {{.*}}: (f32) -> f32 function test_real8(x) real(8) :: x, test_real8 @@ -19,7 +21,10 @@ function test_real8(x) end function ! ALL-LABEL: @_QPtest_real8 -! ALL: {{%[A-Za-z0-9._]+}} = fir.call @asinh({{%[A-Za-z0-9._]+}}) {{.*}}: (f64) -> f64 +! FAST: {{%[A-Za-z0-9._]+}} = math.asinh {{%[A-Za-z0-9._]+}} {{.*}}: f64 +! RELAXED: {{%[A-Za-z0-9._]+}} = math.asinh {{%[A-Za-z0-9._]+}} {{.*}}: f64 +! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @asinh({{%[A-Za-z0-9._]+}}) {{.*}}: (f64) -> f64 + function test_complex4(x) complex :: x, test_complex4 diff --git a/flang/test/Lower/Intrinsics/atanh.f90 b/flang/test/Lower/Intrinsics/atanh.f90 index a23b64f..255d95f 100644 --- a/flang/test/Lower/Intrinsics/atanh.f90 +++ b/flang/test/Lower/Intrinsics/atanh.f90 @@ -1,9 +1,9 @@ -! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL %s -! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL %s -! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL %s -! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL %s +! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL,FAST %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL,FAST %s +! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL,RELAXED %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL,RELAXED %s +! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL,PRECISE %s +! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL,PRECISE %s function test_real4(x) real :: x, test_real4 @@ -11,7 +11,9 @@ function test_real4(x) end function ! ALL-LABEL: @_QPtest_real4 -! ALL: {{%[A-Za-z0-9._]+}} = fir.call @atanhf({{%[A-Za-z0-9._]+}}) {{.*}}: (f32) -> f32 +! FAST: {{%[A-Za-z0-9._]+}} = math.atanh {{%[A-Za-z0-9._]+}} {{.*}}: f32 +! RELAXED: {{%[A-Za-z0-9._]+}} = math.atanh {{%[A-Za-z0-9._]+}} {{.*}}: f32 +! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @atanhf({{%[A-Za-z0-9._]+}}) {{.*}}: (f32) -> f32 function test_real8(x) real(8) :: x, test_real8 @@ -19,7 +21,9 @@ function test_real8(x) end function ! ALL-LABEL: @_QPtest_real8 -! ALL: {{%[A-Za-z0-9._]+}} = fir.call @atanh({{%[A-Za-z0-9._]+}}) {{.*}}: (f64) -> f64 +! FAST: {{%[A-Za-z0-9._]+}} = math.atanh {{%[A-Za-z0-9._]+}} {{.*}}: f64 +! RELAXED: {{%[A-Za-z0-9._]+}} = math.atanh {{%[A-Za-z0-9._]+}} {{.*}}: f64 +! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @atanh({{%[A-Za-z0-9._]+}}) {{.*}}: (f64) -> f64 function test_complex4(x) complex :: x, test_complex4 |