mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Add minnum / maxnum intrinsics
These are named following the IEEE-754 names for these functions, rather than the libm fmin / fmax to avoid possible ambiguities. Some languages may implement something resembling fmin / fmax which return NaN if either operand is to propagate errors. These implement the IEEE-754 semantics of returning the other operand if either is a NaN representing missing data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220341 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -36,6 +36,8 @@ static inline bool isTriviallyVectorizable(Intrinsic::ID ID) {
|
||||
case Intrinsic::log10:
|
||||
case Intrinsic::log2:
|
||||
case Intrinsic::fabs:
|
||||
case Intrinsic::minnum:
|
||||
case Intrinsic::maxnum:
|
||||
case Intrinsic::copysign:
|
||||
case Intrinsic::floor:
|
||||
case Intrinsic::ceil:
|
||||
@@ -153,6 +155,14 @@ getIntrinsicIDForCall(CallInst *CI, const TargetLibraryInfo *TLI) {
|
||||
case LibFunc::fabsf:
|
||||
case LibFunc::fabsl:
|
||||
return checkUnaryFloatSignature(*CI, Intrinsic::fabs);
|
||||
case LibFunc::fmin:
|
||||
case LibFunc::fminf:
|
||||
case LibFunc::fminl:
|
||||
return checkBinaryFloatSignature(*CI, Intrinsic::minnum);
|
||||
case LibFunc::fmax:
|
||||
case LibFunc::fmaxf:
|
||||
case LibFunc::fmaxl:
|
||||
return checkBinaryFloatSignature(*CI, Intrinsic::maxnum);
|
||||
case LibFunc::copysign:
|
||||
case LibFunc::copysignf:
|
||||
case LibFunc::copysignl:
|
||||
|
Reference in New Issue
Block a user