1 // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
2 // RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \
3 // RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF
4 // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
5 // RUN: -emit-llvm -disable-llvm-passes -o - | \
6 // RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF
8 // NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) half @_Z13test_pow_half
9 // NATIVE_HALF: call reassoc nnan ninf nsz arcp afn half @llvm.pow.f16(
10 // NO_HALF-LABEL: define noundef nofpclass(nan inf) float @_Z13test_pow_half
11 // NO_HALF: call reassoc nnan ninf nsz arcp afn float @llvm.pow.f32(
12 half test_pow_half(half p0, half p1) { return pow(p0, p1); }
13 // NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) <2 x half> @_Z14test_pow_half2
14 // NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <2 x half> @llvm.pow.v2f16
15 // NO_HALF-LABEL: define noundef nofpclass(nan inf) <2 x float> @_Z14test_pow_half2
16 // NO_HALF: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.pow.v2f32(
17 half2 test_pow_half2(half2 p0, half2 p1) { return pow(p0, p1); }
18 // NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) <3 x half> @_Z14test_pow_half3
19 // NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.pow.v3f16
20 // NO_HALF-LABEL: define noundef nofpclass(nan inf) <3 x float> @_Z14test_pow_half3
21 // NO_HALF: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.pow.v3f32(
22 half3 test_pow_half3(half3 p0, half3 p1) { return pow(p0, p1); }
23 // NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) <4 x half> @_Z14test_pow_half4
24 // NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.pow.v4f16
25 // NO_HALF-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z14test_pow_half4
26 // NO_HALF: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.pow.v4f32(
27 half4 test_pow_half4(half4 p0, half4 p1) { return pow(p0, p1); }
29 // CHECK-LABEL: define noundef nofpclass(nan inf) float @_Z14test_pow_float
30 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.pow.f32(
31 float test_pow_float(float p0, float p1) { return pow(p0, p1); }
32 // CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> @_Z15test_pow_float2
33 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.pow.v2f32
34 float2 test_pow_float2(float2 p0, float2 p1) { return pow(p0, p1); }
35 // CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> @_Z15test_pow_float3
36 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.pow.v3f32
37 float3 test_pow_float3(float3 p0, float3 p1) { return pow(p0, p1); }
38 // CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z15test_pow_float4
39 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.pow.v4f32
40 float4 test_pow_float4(float4 p0, float4 p1) { return pow(p0, p1); }