[PATCH] D112932: Use llvm.is_fpclass to implement FP classification functions

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 14 07:03:09 PST 2022


arsenm requested changes to this revision.
arsenm added a comment.
This revision now requires changes to proceed.
Herald added a subscriber: wdng.

I think the __builtin_isfpclass part should be a separate patch from the rest of the functions. Also needs sema tests for the handling of the immediate argument



================
Comment at: clang/include/clang/Basic/Builtins.def:485
+BUILTIN(__builtin_issignaling, "i.", "FnctE")
+BUILTIN(__builtin_isfpclass,   "iCi.", "FnctE")
 
----------------
Should use I to mark the isfpclass test mask given you don't try to handle the variable case


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3116-3117
+    Expr::EvalResult Result;
+    if (!E->getArg(0)->EvaluateAsInt(Result, CGM.getContext()))
+      break;
+    uint64_t Test = Result.Val.getInt().getLimitedValue();
----------------
Should enforce constant argument with "I" builtin constraint


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112932



More information about the cfe-commits mailing list