Teach clang that long double == double on powerpc

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Teach clang that long double == double on powerpc

Mark Kettenis
On OpenBSD/powerpc long double is the same as double.  The diff below
(from George Koehler for ports llvm) makes it so.

ok?


Index: gnu/llvm/tools/clang/lib/Basic/Targets/PPC.h
===================================================================
RCS file: /cvs/src/gnu/llvm/tools/clang/lib/Basic/Targets/PPC.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 PPC.h
--- gnu/llvm/tools/clang/lib/Basic/Targets/PPC.h 27 Jan 2019 16:43:02 -0000 1.1.1.2
+++ gnu/llvm/tools/clang/lib/Basic/Targets/PPC.h 10 Feb 2019 13:45:42 -0000
@@ -328,9 +328,15 @@ public:
       break;
     }
 
-    if (getTriple().getOS() == llvm::Triple::FreeBSD) {
+    switch (getTriple().getOS()) {
+    case llvm::Triple::FreeBSD:
+    case llvm::Triple::NetBSD:
+    case llvm::Triple::OpenBSD:
       LongDoubleWidth = LongDoubleAlign = 64;
       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+      break;
+    default:
+      break;
     }
 
     // PPC32 supports atomics up to 4 bytes.