[PATCH] D105477: Define __LONGDOUBLE64 macro

Jake Egan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 6 06:33:40 PDT 2021


Jake-Egan created this revision.
Herald added subscribers: kbarton, nemanjai.
Jake-Egan requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105477

Files:
  clang/lib/Basic/Targets/PPC.cpp
  clang/test/Preprocessor/init-ppc.c


Index: clang/test/Preprocessor/init-ppc.c
===================================================================
--- clang/test/Preprocessor/init-ppc.c
+++ clang/test/Preprocessor/init-ppc.c
@@ -512,6 +512,7 @@
 // PPC-AIX:#define __LDBL_MIN_10_EXP__ (-307)
 // PPC-AIX:#define __LDBL_MIN_EXP__ (-1021)
 // PPC-AIX:#define __LDBL_MIN__ 2.2250738585072014e-308L
+// PPC-AIX:#define __LONGDOUBLE64 1
 // PPC-AIX:#define __LONG_LONG_MAX__ 9223372036854775807LL
 // PPC-AIX:#define __LONG_MAX__ 2147483647L
 // PPC-AIX-NOT:#define __LP64__ 1
Index: clang/lib/Basic/Targets/PPC.cpp
===================================================================
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -172,6 +172,10 @@
       Builder.defineMacro("__LONG_DOUBLE_IBM128__");
   }
 
+  if (getTriple().isOSAIX() && LongDoubleWidth == 64) {
+    Builder.defineMacro("__LONGDOUBLE64");
+  }
+
   // Define this for elfv2 (64-bit only) or 64-bit darwin.
   if (ABI == "elfv2" ||
       (getTriple().getOS() == llvm::Triple::Darwin && PointerWidth == 64))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105477.356703.patch
Type: text/x-patch
Size: 1065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210706/d17eea5c/attachment.bin>


More information about the cfe-commits mailing list