Add builtin_elementwise_sin and builtin_elementwise_cos
authorJoshua Batista <jbatista@microsoft.com>
Fri, 11 Nov 2022 06:49:35 +0000 (22:49 -0800)
committerXiang Li <python3kgae@outlook.com>
Fri, 11 Nov 2022 07:30:27 +0000 (23:30 -0800)
commita5d14f757bb1afa47925d7d77bea6bf73bbe0434
tree5cbb8b028b8c425ed7a794a0cddd9505ef98fdd0
parent1099498e3f35b2ad4b021ba3888b590259124e74
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
clang/docs/LanguageExtensions.rst
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/Builtins.def
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/builtins-elementwise-math.c
clang/test/Sema/aarch64-sve-vector-trig-ops.c [new file with mode: 0644]
clang/test/Sema/builtins-elementwise-math.c
clang/test/Sema/riscv-sve-vector-trig-ops.c [new file with mode: 0644]
clang/test/SemaCXX/builtins-elementwise-math.cpp