aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Targets/WebAssembly.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2024-04-30 11:15:53 -0700
committerGitHub <noreply@github.com>2024-04-30 11:15:53 -0700
commit7662f95f2c767ae3c9b22eb4bdedb07ffcf258b7 (patch)
tree060e3ae04edfe9472651f0e43715fba6d3ec1ed0 /clang/lib/Basic/Targets/WebAssembly.cpp
parentd2353695f8cb864f88475d3a921249b0dcbcc6f4 (diff)
downloadllvm-7662f95f2c767ae3c9b22eb4bdedb07ffcf258b7.zip
llvm-7662f95f2c767ae3c9b22eb4bdedb07ffcf258b7.tar.gz
llvm-7662f95f2c767ae3c9b22eb4bdedb07ffcf258b7.tar.bz2
[WebAssembly] Add preprocessor define for half-precision (#90528)
This adds the preprocessor define for the half-precision feature and also adds preprocessor tests.
Diffstat (limited to 'clang/lib/Basic/Targets/WebAssembly.cpp')
-rw-r--r--clang/lib/Basic/Targets/WebAssembly.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets/WebAssembly.cpp b/clang/lib/Basic/Targets/WebAssembly.cpp
index 0db7b66..1f0418b 100644
--- a/clang/lib/Basic/Targets/WebAssembly.cpp
+++ b/clang/lib/Basic/Targets/WebAssembly.cpp
@@ -100,6 +100,8 @@ void WebAssemblyTargetInfo::getTargetDefines(const LangOptions &Opts,
Builder.defineMacro("__wasm_extended_const__");
if (HasMultiMemory)
Builder.defineMacro("__wasm_multimemory__");
+ if (HasHalfPrecision)
+ Builder.defineMacro("__wasm_half_precision__");
Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");