[PATCH] D155394: [clang][Interp] Implement __builtin_fpclassify

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 17 11:03:02 PDT 2023


aaron.ballman added a subscriber: jcranmer-intel.
aaron.ballman added inline comments.


================
Comment at: clang/test/AST/Interp/builtin-functions.cpp:121-130
+  char classify_nan     [__builtin_fpclassify(+1, -1, -1, -1, -1, __builtin_nan(""))];
+  char classify_snan    [__builtin_fpclassify(+1, -1, -1, -1, -1, __builtin_nans(""))];
+  char classify_inf     [__builtin_fpclassify(-1, +1, -1, -1, -1, __builtin_inf())];
+  char classify_neg_inf [__builtin_fpclassify(-1, +1, -1, -1, -1, -__builtin_inf())];
+  char classify_normal  [__builtin_fpclassify(-1, -1, +1, -1, -1, 1.539)];
+  char classify_normal2 [__builtin_fpclassify(-1, -1, +1, -1, -1, 1e-307)];
+  char classify_denorm  [__builtin_fpclassify(-1, -1, -1, +1, -1, 1e-308)];
----------------
One thing we should test is that promotion does not happen on the final argument (converting it from `float` to `double`) -- @jcranmer-intel can you think of a good way to test that in this case?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155394



More information about the cfe-commits mailing list