|
| 1 | +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ |
| 2 | +// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ |
| 3 | +// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ |
| 4 | +// RUN: --check-prefixes=CHECK,NATIVE_HALF |
| 5 | +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ |
| 6 | +// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ |
| 7 | +// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF |
| 8 | + |
| 9 | +// NATIVE_HALF: define noundef half @ |
| 10 | +// NATIVE_HALF: %elt.exp2 = call half @llvm.exp2.f16( |
| 11 | +// NATIVE_HALF: ret half %elt.exp2 |
| 12 | +// NO_HALF: define noundef float @"?test_exp2_half@@YA$halff@$halff@@Z"( |
| 13 | +// NO_HALF: %elt.exp2 = call float @llvm.exp2.f32( |
| 14 | +// NO_HALF: ret float %elt.exp2 |
| 15 | +half test_exp2_half(half p0) { return exp2(p0); } |
| 16 | +// NATIVE_HALF: define noundef <2 x half> @ |
| 17 | +// NATIVE_HALF: %elt.exp2 = call <2 x half> @llvm.exp2.v2f16 |
| 18 | +// NATIVE_HALF: ret <2 x half> %elt.exp2 |
| 19 | +// NO_HALF: define noundef <2 x float> @ |
| 20 | +// NO_HALF: %elt.exp2 = call <2 x float> @llvm.exp2.v2f32( |
| 21 | +// NO_HALF: ret <2 x float> %elt.exp2 |
| 22 | +half2 test_exp2_half2(half2 p0) { return exp2(p0); } |
| 23 | +// NATIVE_HALF: define noundef <3 x half> @ |
| 24 | +// NATIVE_HALF: %elt.exp2 = call <3 x half> @llvm.exp2.v3f16 |
| 25 | +// NATIVE_HALF: ret <3 x half> %elt.exp2 |
| 26 | +// NO_HALF: define noundef <3 x float> @ |
| 27 | +// NO_HALF: %elt.exp2 = call <3 x float> @llvm.exp2.v3f32( |
| 28 | +// NO_HALF: ret <3 x float> %elt.exp2 |
| 29 | +half3 test_exp2_half3(half3 p0) { return exp2(p0); } |
| 30 | +// NATIVE_HALF: define noundef <4 x half> @ |
| 31 | +// NATIVE_HALF: %elt.exp2 = call <4 x half> @llvm.exp2.v4f16 |
| 32 | +// NATIVE_HALF: ret <4 x half> %elt.exp2 |
| 33 | +// NO_HALF: define noundef <4 x float> @ |
| 34 | +// NO_HALF: %elt.exp2 = call <4 x float> @llvm.exp2.v4f32( |
| 35 | +// NO_HALF: ret <4 x float> %elt.exp2 |
| 36 | +half4 test_exp2_half4(half4 p0) { return exp2(p0); } |
| 37 | + |
| 38 | +// CHECK: define noundef float @ |
| 39 | +// CHECK: %elt.exp2 = call float @llvm.exp2.f32( |
| 40 | +// CHECK: ret float %elt.exp2 |
| 41 | +float test_exp2_float(float p0) { return exp2(p0); } |
| 42 | +// CHECK: define noundef <2 x float> @ |
| 43 | +// CHECK: %elt.exp2 = call <2 x float> @llvm.exp2.v2f32 |
| 44 | +// CHECK: ret <2 x float> %elt.exp2 |
| 45 | +float2 test_exp2_float2(float2 p0) { return exp2(p0); } |
| 46 | +// CHECK: define noundef <3 x float> @ |
| 47 | +// CHECK: %elt.exp2 = call <3 x float> @llvm.exp2.v3f32 |
| 48 | +// CHECK: ret <3 x float> %elt.exp2 |
| 49 | +float3 test_exp2_float3(float3 p0) { return exp2(p0); } |
| 50 | +// CHECK: define noundef <4 x float> @ |
| 51 | +// CHECK: %elt.exp2 = call <4 x float> @llvm.exp2.v4f32 |
| 52 | +// CHECK: ret <4 x float> %elt.exp2 |
| 53 | +float4 test_exp2_float4(float4 p0) { return exp2(p0); } |
0 commit comments