[PATCH] D148533: ValueTracking: Improve trunc handling in computeKnownFPClass

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 03:57:13 PDT 2023


arsenm marked 2 inline comments as done.
arsenm added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4612
+        // Sign should be preserved
+        Known.SignBit = KnownSrc.SignBit;
         break;
----------------
foad wrote:
> Seems reasonable but is this actually documented anywhere (when the result is zero)?
Spec states:



> The trunc functions use IEC 60559 rounding toward zero (regardless of the current
> rounding direction).
> — trunc(±0) returns ±0.
> — trunc(±∞) returns ±∞.




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148533/new/

https://reviews.llvm.org/D148533



More information about the llvm-commits mailing list