diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2020-05-26 19:24:05 +0700 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2020-05-26 19:24:58 +0700 |
commit | 4d20e31f736c76785e03367c036183474459ef9a (patch) | |
tree | 0c81adb1196238ec79c3bd6e09c949a7b407852f /llvm/lib/Analysis/ValueTracking.cpp | |
parent | f368040c14f4bdac718798db28299a68adc42695 (diff) | |
download | llvm-4d20e31f736c76785e03367c036183474459ef9a.zip llvm-4d20e31f736c76785e03367c036183474459ef9a.tar.gz llvm-4d20e31f736c76785e03367c036183474459ef9a.tar.bz2 |
[FPEnv] Intrinsic llvm.roundeven
This intrinsic implements IEEE-754 operation roundToIntegralTiesToEven,
and performs rounding to the nearest integer value, rounding halfway
cases to even. The intrinsic represents the missed case of IEEE-754
rounding operations and now llvm provides full support of the rounding
operations defined by the standard.
Differential Revision: https://reviews.llvm.org/D75670
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 1b73a20..545dab7 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -3227,6 +3227,10 @@ Intrinsic::ID llvm::getIntrinsicForCallSite(const CallBase &CB, case LibFunc_roundf: case LibFunc_roundl: return Intrinsic::round; + case LibFunc_roundeven: + case LibFunc_roundevenf: + case LibFunc_roundevenl: + return Intrinsic::roundeven; case LibFunc_pow: case LibFunc_powf: case LibFunc_powl: @@ -3567,6 +3571,7 @@ bool llvm::isKnownNeverNaN(const Value *V, const TargetLibraryInfo *TLI, case Intrinsic::rint: case Intrinsic::nearbyint: case Intrinsic::round: + case Intrinsic::roundeven: return isKnownNeverNaN(II->getArgOperand(0), TLI, Depth + 1); case Intrinsic::sqrt: return isKnownNeverNaN(II->getArgOperand(0), TLI, Depth + 1) && |