|
| 1 | +// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ |
| 2 | +// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ |
| 3 | +// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s |
| 4 | +// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ |
| 5 | +// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ |
| 6 | +// RUN: -D__HLSL_ENABLE_16_BIT -o - | FileCheck %s --check-prefix=NO_HALF |
| 7 | + |
| 8 | +// CHECK: define noundef half @ |
| 9 | +// CHECK: call half @llvm.pow.f16( |
| 10 | +// NO_HALF: define noundef float @"?test_pow_half@@YA$halff@$halff@0@Z"( |
| 11 | +// NO_HALF: call float @llvm.pow.f32( |
| 12 | +half test_pow_half(half p0, half p1) |
| 13 | +{ |
| 14 | + return pow(p0, p1); |
| 15 | +} |
| 16 | +// CHECK: define noundef <2 x half> @"?test_pow_half2@@YAT?$__vector@$f16@$01@__clang@@T12@0@Z"( |
| 17 | +// CHECK: call <2 x half> @llvm.pow.v2f16 |
| 18 | +// NO_HALF: define noundef <2 x float> @"?test_pow_float2@@YAT?$__vector@M$01@__clang@@T12@0@Z"( |
| 19 | +// NO_HALF: call <2 x float> @llvm.pow.v2f32( |
| 20 | +half2 test_pow_half2(half2 p0, half2 p1) |
| 21 | +{ |
| 22 | + return pow(p0, p1); |
| 23 | +} |
| 24 | +// CHECK: define noundef <3 x half> @"?test_pow_half3@@YAT?$__vector@$f16@$02@__clang@@T12@0@Z"( |
| 25 | +// CHECK: call <3 x half> @llvm.pow.v3f16 |
| 26 | +// NO_HALF: define noundef <3 x float> @"?test_pow_float3@@YAT?$__vector@M$02@__clang@@T12@0@Z"( |
| 27 | +// NO_HALF: call <3 x float> @llvm.pow.v3f32( |
| 28 | +half3 test_pow_half3(half3 p0, half3 p1) |
| 29 | +{ |
| 30 | + return pow(p0, p1); |
| 31 | +} |
| 32 | +// CHECK: define noundef <4 x half> @"?test_pow_half4@@YAT?$__vector@$f16@$03@__clang@@T12@0@Z"( |
| 33 | +// CHECK: call <4 x half> @llvm.pow.v4f16 |
| 34 | +// NO_HALF: define noundef <4 x float> @"?test_pow_float4@@YAT?$__vector@M$03@__clang@@T12@0@Z"( |
| 35 | +// NO_HALF: call <4 x float> @llvm.pow.v4f32( |
| 36 | +half4 test_pow_half4(half4 p0, half4 p1) |
| 37 | +{ |
| 38 | + return pow(p0, p1); |
| 39 | +} |
| 40 | + |
| 41 | +// CHECK: define noundef float @"?test_pow_float@@YAMMM@Z"( |
| 42 | +// CHECK: call float @llvm.pow.f32( |
| 43 | +float test_pow_float(float p0, float p1) |
| 44 | +{ |
| 45 | + return pow(p0, p1); |
| 46 | +} |
| 47 | +// CHECK: define noundef <2 x float> @"?test_pow_float2@@YAT?$__vector@M$01@__clang@@T12@0@Z"( |
| 48 | +// CHECK: call <2 x float> @llvm.pow.v2f32 |
| 49 | +float2 test_pow_float2(float2 p0, float2 p1) |
| 50 | +{ |
| 51 | + return pow(p0, p1); |
| 52 | +} |
| 53 | +// CHECK: define noundef <3 x float> @"?test_pow_float3@@YAT?$__vector@M$02@__clang@@T12@0@Z"( |
| 54 | +// CHECK: call <3 x float> @llvm.pow.v3f32 |
| 55 | +float3 test_pow_float3(float3 p0, float3 p1) |
| 56 | +{ |
| 57 | + return pow(p0, p1); |
| 58 | +} |
| 59 | +// CHECK: define noundef <4 x float> @"?test_pow_float4@@YAT?$__vector@M$03@__clang@@T12@0@Z"( |
| 60 | +// CHECK: call <4 x float> @llvm.pow.v4f32 |
| 61 | +float4 test_pow_float4(float4 p0, float4 p1) |
| 62 | +{ |
| 63 | + return pow(p0, p1); |
| 64 | +} |
| 65 | + |
| 66 | +// CHECK: define noundef double @"?test_pow_double@@YANNN@Z"( |
| 67 | +// CHECK: call double @llvm.pow.f64( |
| 68 | +double test_pow_double(double p0, double p1) |
| 69 | +{ |
| 70 | + return pow(p0, p1); |
| 71 | +} |
| 72 | +// CHECK: define noundef <2 x double> @"?test_pow_double2@@YAT?$__vector@N$01@__clang@@T12@0@Z"( |
| 73 | +// CHECK: call <2 x double> @llvm.pow.v2f64 |
| 74 | +double2 test_pow_double2(double2 p0, double2 p1) |
| 75 | +{ |
| 76 | + return pow(p0, p1); |
| 77 | +} |
| 78 | +// CHECK: define noundef <3 x double> @"?test_pow_double3@@YAT?$__vector@N$02@__clang@@T12@0@Z"( |
| 79 | +// CHECK: call <3 x double> @llvm.pow.v3f64 |
| 80 | +double3 test_pow_double3(double3 p0, double3 p1) |
| 81 | +{ |
| 82 | + return pow(p0, p1); |
| 83 | +} |
| 84 | +// CHECK: define noundef <4 x double> @"?test_pow_double4@@YAT?$__vector@N$03@__clang@@T12@0@Z"( |
| 85 | +// CHECK: call <4 x double> @llvm.pow.v4f64 |
| 86 | +double4 test_pow_double4(double4 p0, double4 p1) |
| 87 | +{ |
| 88 | + return pow(p0, p1); |
| 89 | +} |
0 commit comments