[PATCH] D118110: [CMake] [Clang] Add CMake build option to specify long double format on PowerPC

Jinsong Ji via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 25 08:39:20 PST 2022


jsji added a comment.

In D118110#3269450 <https://reviews.llvm.org/D118110#3269450>, @nemanjai wrote:

> It is probably not worth the effort since there won't be that many test cases that test the front end's IR generation for `long double`, but there should be a way to set up lit to know the default through its configuration files.

Yes, that is not a must for now, but we should try to do it .

> There's one thing uncertain: whether this config only applies to ppc64le?

Let us apply it to ppc64le only for now.



================
Comment at: clang/CMakeLists.txt:240
 
+set(ENABLE_PPC_IEEELONGDOUBLE OFF CACHE BOOL
+    "Enable IEEE binary128 as default long double format on PowerPC.")
----------------
nemanjai wrote:
> Do we need any error checking here? What happens if someone erroneously sets this on an AIX build (or big endian Linux, FreeBSD, etc.)?
How about `CLANG_DEFAULT_IEEELONGDOUBLE_ON_PPC_LINUX` similar to `CLANG_DEFAULT_PIE_ON_LINUX`?


================
Comment at: clang/include/clang/Driver/ToolChain.h:413
+  /// Check whether use IEEE binary128 as long double format by default.
+  bool useIEEELongDouble() const;
+
----------------
defaultToIEEELongDouble?


================
Comment at: clang/lib/Driver/ToolChain.cpp:113
+bool ToolChain::useIEEELongDouble() const {
+  return ENABLE_PPC_IEEELONGDOUBLE;
+}
----------------
Check OS here ?

eg: CLANG_DEFAULT_IEEELONGDOUBLE_ON_PPC_LINUX && OS.Linux() 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118110



More information about the cfe-commits mailing list