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/lib/CodeGen/TargetLoweringBase.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/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index ff684c7c..be28f72 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -909,6 +909,7 @@ void TargetLoweringBase::initActions() { ISD::FMINNUM, ISD::FMAXNUM, ISD::FMINNUM_IEEE, ISD::FMAXNUM_IEEE, ISD::FMINIMUM, ISD::FMAXIMUM, + ISD::FMINIMUMNUM, ISD::FMAXIMUMNUM, ISD::FMAD, ISD::SMIN, ISD::SMAX, ISD::UMIN, ISD::UMAX, ISD::ABS, |