[PATCH] D95948: Stop traping on sNaN in __builtin_isnan

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 3 12:33:46 PST 2021


mibintc added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3011
+        Builder.CreateSub(llvm::ConstantInt::get(IntTy, ExpMask), AbsV);
+    V = Builder.CreateLShr(Sub, llvm::ConstantInt::get(IntTy, bitsize - 1));
+    if (bitsize > 32)
----------------
thopre wrote:
> mibintc wrote:
> > the comment at line 3001 doesn't show the lshr or the compare to zero
> This logical right shift will move the sign bit to bit0 and set all other bits to 0. The result will be 1 (true) if sign bit is set (sub is negative) or 0 (false) otherwise. That matches the comment. Would you like me to add a comment here to make it more explicit?
No, that's OK, you don't need to do that. thanks.  I'd like to see what other reviewers say, thanks for working on this!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95948



More information about the cfe-commits mailing list