[HLSL] add cos library function
authorJoshua Batista <jbatista@microsoft.com>
Wed, 16 Nov 2022 20:06:43 +0000 (12:06 -0800)
committerXiang Li <python3kgae@outlook.com>
Wed, 16 Nov 2022 20:54:11 +0000 (12:54 -0800)
commit9777e98a610f3128f8a79c13211ca5f05b26f9eb
tree8f7921d84b942c0b4e886acf4c4587ad796361b9
parent709e23a1c1245bc59d523f066de940bd51715125
[HLSL] add cos library function

This change exposes the cos library function for HLSL,
excluding long, int, and long long doubles.
Cos is supported for all scalar, vector, and matrix types.

Long and long long double support is missing in this patch because those types
don't exist in HLSL. Int is missing because the cos function only works on floating type arguments.

The full documentation of the HLSL cos function is available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-cos

Reviewed By: python3kgae

Differential Revision: https://reviews.llvm.org/D134921
clang/lib/Headers/hlsl/hlsl_intrinsics.h
clang/test/CodeGenHLSL/builtins/cos.hlsl [new file with mode: 0644]