[PATCH] D12633: Implement ACLE 2.0 macros of chapters 6.6 and 6.7 for [ARM] and [Aarch64] targets

Renato Golin via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 9 06:33:21 PDT 2015


rengolin added inline comments.

================
Comment at: lib/Basic/Targets.cpp:4785
@@ +4784,3 @@
+    if (Opts.C99 && !Opts.Freestanding) {
+      Builder.defineMacro("__ARM_FP_FENV_ROUNDING", "1");
+      Builder.defineMacro("__STDC_IEC_559__", "1");
----------------
I'm not convinced by the runtime rounding being depending on C99, or why it's not possible in freestanding environments.

================
Comment at: lib/Basic/Targets.cpp:4790
@@ -4779,1 +4789,3 @@
+    if (!Opts.C11)
+      Builder.defineMacro("__SUPPORT_SNAN__", "1");
   }
----------------
Er, well, the ACLE doc says it wasn't adopted in C11, but that doesn't mean that it was present in all others, just that there is a proposal for C11 which wasn't accepted.

I think this macro needs some other mechanism to be set, and unless Clang/LLVM supports signaling NANs unconditionally, we shouldn't add it.

================
Comment at: lib/Basic/Targets.cpp:5270
@@ +5269,3 @@
+    if (Opts.C99 && !Opts.Freestanding) {
+      Builder.defineMacro("__ARM_FP_FENV_ROUNDING", "1");
+      Builder.defineMacro("__STDC_IEC_559__", "1");
----------------
same comments as above.


http://reviews.llvm.org/D12633





More information about the cfe-commits mailing list