diff options
author | YunQiang Su <syq@debian.org> | 2024-06-21 11:53:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-21 11:53:08 +0800 |
commit | 89881480030f48f83af668175b70a9798edca2fb (patch) | |
tree | dcc9680d4a5d3bb7093aad3d15b4d368dd752c7a /llvm/unittests/Analysis/TargetLibraryInfoTest.cpp | |
parent | f3c4dae6f2c44f1a7f130c4cf4b2861b62402b48 (diff) | |
download | llvm-89881480030f48f83af668175b70a9798edca2fb.zip llvm-89881480030f48f83af668175b70a9798edca2fb.tar.gz llvm-89881480030f48f83af668175b70a9798edca2fb.tar.bz2 |
Intrinsic: introduce minimumnum and maximumnum (#93841)
Currently, on different platform, the behaivor of llvm.minnum is
different if one operand is sNaN:
When we compare sNaN vs NUM:
ARM/AArch64/PowerPC: follow the IEEE754-2008's minNUM: return qNaN.
RISC-V/Hexagon follow the IEEE754-2019's minimumNumber: return NUM. X86:
Returns NUM but not same with IEEE754-2019's minimumNumber as
+0.0 is not always greater than -0.0.
MIPS/LoongArch/Generic: return NUM.
LIBCALL: returns qNaN.
So, let's introduce llvm.minmumnum/llvm.maximumnum, which always follow
IEEE754-2019's minimumNumber/maximumNumber.
Half-fix: #93033
Diffstat (limited to 'llvm/unittests/Analysis/TargetLibraryInfoTest.cpp')
-rw-r--r-- | llvm/unittests/Analysis/TargetLibraryInfoTest.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp index 1fe94e2..5192ebd 100644 --- a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp +++ b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp @@ -188,6 +188,12 @@ TEST_F(TargetLibraryInfoTest, ValidProto) { "declare double @fmin(double, double)\n" "declare float @fminf(float, float)\n" "declare x86_fp80 @fminl(x86_fp80, x86_fp80)\n" + "declare double @fmaximum_num(double, double)\n" + "declare float @fmaximum_numf(float, float)\n" + "declare x86_fp80 @fmaximum_numl(x86_fp80, x86_fp80)\n" + "declare double @fminimum_num(double, double)\n" + "declare float @fminimum_numf(float, float)\n" + "declare x86_fp80 @fminimum_numl(x86_fp80, x86_fp80)\n" "declare double @fmod(double, double)\n" "declare float @fmodf(float, float)\n" "declare x86_fp80 @fmodl(x86_fp80, x86_fp80)\n" @@ -660,4 +666,4 @@ protected: TEST_F(TLITestAarch64, TestFrem) { EXPECT_EQ(getScalarName(Instruction::FRem, Type::getDoubleTy(Ctx)), "fmod"); EXPECT_EQ(getScalarName(Instruction::FRem, Type::getFloatTy(Ctx)), "fmodf"); -}
\ No newline at end of file +} |