aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorJoshua Batista <jbatista@microsoft.com>2022-11-10 22:49:35 -0800
committerXiang Li <python3kgae@outlook.com>2022-11-10 23:30:27 -0800
commita5d14f757bb1afa47925d7d77bea6bf73bbe0434 (patch)
tree5cbb8b028b8c425ed7a794a0cddd9505ef98fdd0 /clang/lib/Sema/SemaChecking.cpp
parent1099498e3f35b2ad4b021ba3888b590259124e74 (diff)
downloadllvm-a5d14f757bb1afa47925d7d77bea6bf73bbe0434.zip
llvm-a5d14f757bb1afa47925d7d77bea6bf73bbe0434.tar.gz
llvm-a5d14f757bb1afa47925d7d77bea6bf73bbe0434.tar.bz2
Add builtin_elementwise_sin and builtin_elementwise_cos
Add codegen for llvm cos and sin elementwise builtins The sin and cos elementwise builtins are necessary for HLSL codegen. Tests were added to make sure that the expected errors are encountered when these functions are given inputs of incompatible types. The new builtins are restricted to floating point types only. Reviewed By: craig.topper, fhahn Differential Revision: https://reviews.llvm.org/D135011
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 003f74e..f46a4d3 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -2574,8 +2574,10 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
// These builtins restrict the element type to floating point
// types only.
case Builtin::BI__builtin_elementwise_ceil:
+ case Builtin::BI__builtin_elementwise_cos:
case Builtin::BI__builtin_elementwise_floor:
case Builtin::BI__builtin_elementwise_roundeven:
+ case Builtin::BI__builtin_elementwise_sin:
case Builtin::BI__builtin_elementwise_trunc: {
if (PrepareBuiltinElementwiseMathOneArgCall(TheCall))
return ExprError();