1 // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
\r
2 // RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
\r
3 // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
\r
4 // RUN: --check-prefixes=CHECK,NATIVE_HALF
\r
5 // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
\r
6 // RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
\r
7 // RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
\r
9 // NATIVE_HALF: define noundef half @
\r
10 // NATIVE_HALF: call half @llvm.fabs.f16(half
\r
11 // NO_HALF: call float @llvm.fabs.f32(float
\r
12 // NATIVE_HALF: ret half
\r
13 // NO_HALF: ret float
\r
14 half test_length_half(half p0)
\r
18 // NATIVE_HALF: define noundef half @
\r
19 // NATIVE_HALF: %hlsl.length = call half @llvm.dx.length.v2f16
\r
20 // NO_HALF: %hlsl.length = call float @llvm.dx.length.v2f32(
\r
21 // NATIVE_HALF: ret half %hlsl.length
\r
22 // NO_HALF: ret float %hlsl.length
\r
23 half test_length_half2(half2 p0)
\r
27 // NATIVE_HALF: define noundef half @
\r
28 // NATIVE_HALF: %hlsl.length = call half @llvm.dx.length.v3f16
\r
29 // NO_HALF: %hlsl.length = call float @llvm.dx.length.v3f32(
\r
30 // NATIVE_HALF: ret half %hlsl.length
\r
31 // NO_HALF: ret float %hlsl.length
\r
32 half test_length_half3(half3 p0)
\r
36 // NATIVE_HALF: define noundef half @
\r
37 // NATIVE_HALF: %hlsl.length = call half @llvm.dx.length.v4f16
\r
38 // NO_HALF: %hlsl.length = call float @llvm.dx.length.v4f32(
\r
39 // NATIVE_HALF: ret half %hlsl.length
\r
40 // NO_HALF: ret float %hlsl.length
\r
41 half test_length_half4(half4 p0)
\r
46 // CHECK: define noundef float @
\r
47 // CHECK: call float @llvm.fabs.f32(float
\r
49 float test_length_float(float p0)
\r
53 // CHECK: define noundef float @
\r
54 // CHECK: %hlsl.length = call float @llvm.dx.length.v2f32(
\r
55 // CHECK: ret float %hlsl.length
\r
56 float test_length_float2(float2 p0)
\r
60 // CHECK: define noundef float @
\r
61 // CHECK: %hlsl.length = call float @llvm.dx.length.v3f32(
\r
62 // CHECK: ret float %hlsl.length
\r
63 float test_length_float3(float3 p0)
\r
67 // CHECK: define noundef float @
\r
68 // CHECK: %hlsl.length = call float @llvm.dx.length.v4f32(
\r
69 // CHECK: ret float %hlsl.length
\r
70 float test_length_float4(float4 p0)
\r