[PATCH] D57154: [WebAssembly] Support __float128
Dan Gohman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 24 06:38:23 PST 2019
sunfish created this revision.
sunfish added reviewers: sbc100, dschuff, aheejin.
Herald added a subscriber: jgravelle-google.
This enables support for the "__float128" keyword.
Repository:
rL LLVM
https://reviews.llvm.org/D57154
Files:
lib/Basic/Targets/OSTargets.h
test/Preprocessor/init.c
Index: test/Preprocessor/init.c
===================================================================
--- test/Preprocessor/init.c
+++ test/Preprocessor/init.c
@@ -9154,6 +9154,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 __FLT_DENORM_MIN__ 1.40129846e-45F
// WEBASSEMBLY-NEXT:#define __FLT_DIG__ 6
// WEBASSEMBLY-NEXT:#define __FLT_EPSILON__ 1.19209290e-7F
Index: lib/Basic/Targets/OSTargets.h
===================================================================
--- lib/Basic/Targets/OSTargets.h
+++ lib/Basic/Targets/OSTargets.h
@@ -771,6 +771,8 @@
// 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 @@
: OSTargetInfo<Target>(Triple, Opts) {
this->MCountName = "__mcount";
this->TheCXXABI.set(TargetCXXABI::WebAssembly);
+ this->HasFloat128 = true;
}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57154.183302.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190124/1a7d9a57/attachment.bin>
More information about the llvm-commits
mailing list