xref: /llvm-project/clang/test/CodeGenHLSL/builtins/cos.hlsl (revision 762f1b17b2815ccdfb4e5cb5412cb6210db92f73)
1c2063de1SGreg Roth// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
2c2063de1SGreg Roth// RUN:  -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \
3c2063de1SGreg Roth// RUN:  FileCheck %s --check-prefixes=CHECK,NATIVE_HALF
4c2063de1SGreg Roth// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
5c2063de1SGreg Roth// RUN:  -emit-llvm -disable-llvm-passes -o - | \
6c2063de1SGreg Roth// RUN:  FileCheck %s --check-prefixes=CHECK,NO_HALF
79777e98aSJoshua Batista
8*762f1b17SSarah Spall// NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) half @_Z13test_cos_half
9*762f1b17SSarah Spall// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn half @llvm.cos.f16(
10*762f1b17SSarah Spall// NO_HALF-LABEL: define noundef nofpclass(nan inf) float @_Z13test_cos_half
11*762f1b17SSarah Spall// NO_HALF: call reassoc nnan ninf nsz arcp afn float @llvm.cos.f32(
12c9b1f1c3SFarzon Lotfihalf test_cos_half(half p0) { return cos(p0); }
13*762f1b17SSarah Spall// NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) <2 x half> @_Z14test_cos_half2
14*762f1b17SSarah Spall// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <2 x half> @llvm.cos.v2f16
15*762f1b17SSarah Spall// NO_HALF-LABEL: define noundef nofpclass(nan inf) <2 x float> @_Z14test_cos_half2
16*762f1b17SSarah Spall// NO_HALF: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cos.v2f32(
17c9b1f1c3SFarzon Lotfihalf2 test_cos_half2(half2 p0) { return cos(p0); }
18*762f1b17SSarah Spall// NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) <3 x half> @_Z14test_cos_half3
19*762f1b17SSarah Spall// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.cos.v3f16
20*762f1b17SSarah Spall// NO_HALF-LABEL: define noundef nofpclass(nan inf) <3 x float> @_Z14test_cos_half3
21*762f1b17SSarah Spall// NO_HALF: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cos.v3f32(
22c9b1f1c3SFarzon Lotfihalf3 test_cos_half3(half3 p0) { return cos(p0); }
23*762f1b17SSarah Spall// NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) <4 x half> @_Z14test_cos_half4
24*762f1b17SSarah Spall// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.cos.v4f16
25*762f1b17SSarah Spall// NO_HALF-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z14test_cos_half4
26*762f1b17SSarah Spall// NO_HALF: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cos.v4f32(
27c9b1f1c3SFarzon Lotfihalf4 test_cos_half4(half4 p0) { return cos(p0); }
289777e98aSJoshua Batista
29*762f1b17SSarah Spall// CHECK-LABEL: define noundef nofpclass(nan inf) float @_Z14test_cos_float
30*762f1b17SSarah Spall// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cos.f32(
31c9b1f1c3SFarzon Lotfifloat test_cos_float(float p0) { return cos(p0); }
32*762f1b17SSarah Spall// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> @_Z15test_cos_float2
33*762f1b17SSarah Spall// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cos.v2f32
34c9b1f1c3SFarzon Lotfifloat2 test_cos_float2(float2 p0) { return cos(p0); }
35*762f1b17SSarah Spall// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> @_Z15test_cos_float3
36*762f1b17SSarah Spall// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cos.v3f32
37c9b1f1c3SFarzon Lotfifloat3 test_cos_float3(float3 p0) { return cos(p0); }
38*762f1b17SSarah Spall// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z15test_cos_float4
39*762f1b17SSarah Spall// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cos.v4f32
40c9b1f1c3SFarzon Lotfifloat4 test_cos_float4(float4 p0) { return cos(p0); }
41