r352100 - [WebAssembly] Support __float128

Dan Gohman via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 24 12:33:28 PST 2019


Author: djg
Date: Thu Jan 24 12:33:28 2019
New Revision: 352100

URL: http://llvm.org/viewvc/llvm-project?rev=352100&view=rev
Log:
[WebAssembly] Support __float128

This enables support for the "__float128" keyword.

Differential Revision: https://reviews.llvm.org/D57154

Modified:
    cfe/trunk/lib/Basic/Targets/OSTargets.h
    cfe/trunk/test/Preprocessor/init.c

Modified: cfe/trunk/lib/Basic/Targets/OSTargets.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/OSTargets.h?rev=352100&r1=352099&r2=352100&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/OSTargets.h (original)
+++ cfe/trunk/lib/Basic/Targets/OSTargets.h Thu Jan 24 12:33:28 2019
@@ -771,6 +771,8 @@ class LLVM_LIBRARY_VISIBILITY WebAssembl
     // Follow g++ convention and predefine _GNU_SOURCE for C++.
     if (Opts.CPlusPlus)
       Builder.defineMacro("_GNU_SOURCE");
+    // Indicate that we have __float128.
+    Builder.defineMacro("__FLOAT128__");
   }
 
 public:
@@ -779,6 +781,7 @@ public:
       : OSTargetInfo<Target>(Triple, Opts) {
     this->MCountName = "__mcount";
     this->TheCXXABI.set(TargetCXXABI::WebAssembly);
+    this->HasFloat128 = true;
   }
 };
 

Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=352100&r1=352099&r2=352100&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Thu Jan 24 12:33:28 2019
@@ -9159,6 +9159,7 @@
 // WEBASSEMBLY-NEXT:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
 // WEBASSEMBLY-NOT:#define __ELF__
 // WEBASSEMBLY-NEXT:#define __FINITE_MATH_ONLY__ 0
+// WEBASSEMBLY-NEXT:#define __FLOAT128__ 1
 // WEBASSEMBLY-NEXT:#define __FLT16_DECIMAL_DIG__ 5
 // WEBASSEMBLY-NEXT:#define __FLT16_DENORM_MIN__ 5.9604644775390625e-8F16
 // WEBASSEMBLY-NEXT:#define __FLT16_DIG__ 3




More information about the cfe-commits mailing list