aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorSarah Spall <sarahspall@microsoft.com>2025-03-26 07:54:13 -0700
committerGitHub <noreply@github.com>2025-03-26 07:54:13 -0700
commitc3e08c8f07ded9ef0d1ad2f3fb04e98d839479b1 (patch)
treef72764c4040183cb881586f889e0f9d9f1b288d4 /clang/lib/Frontend/InitPreprocessor.cpp
parent1cc07a0865c1828792fbc7427d175c4ce753a27d (diff)
downloadllvm-c3e08c8f07ded9ef0d1ad2f3fb04e98d839479b1.zip
llvm-c3e08c8f07ded9ef0d1ad2f3fb04e98d839479b1.tar.gz
llvm-c3e08c8f07ded9ef0d1ad2f3fb04e98d839479b1.tar.bz2
[HLSL] Add new double overloads for math builtins (#132979)
Add double overloads which cast the double to a float and call the float builtin. Makes these double overloads conditional on hlsl version 202x or earlier. Add tests Closes #128228
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 1a816cb..0b54665 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -394,6 +394,10 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
// HLSL Version
Builder.defineMacro("__HLSL_VERSION",
Twine((unsigned)LangOpts.getHLSLVersion()));
+ Builder.defineMacro("__HLSL_202x",
+ Twine((unsigned)LangOptions::HLSLLangStd::HLSL_202x));
+ Builder.defineMacro("__HLSL_202y",
+ Twine((unsigned)LangOptions::HLSLLangStd::HLSL_202y));
if (LangOpts.NativeHalfType)
Builder.defineMacro("__HLSL_ENABLE_16_BIT", "1");