Debian Codegraph @

clang/test/CodeGenHLSL/builtins/asfloat.hlsl

raw
1 // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -fnative-int16-type -emit-llvm -O1 -o - | FileCheck %s
2
3 // CHECK: define {{.*}}test_uint{{.*}}(i32 {{.*}} [[VAL:%.*]]){{.*}}
4 // CHECK: bitcast i32 [[VAL]] to float
5 float test_uint(uint p0) {
6 return asfloat(p0);
7 }
8
9 // CHECK: define {{.*}}test_int{{.*}}(i32 {{.*}} [[VAL:%.*]]){{.*}}
10 // CHECK: bitcast i32 [[VAL]] to float
11 float test_int(int p0) {
12 return asfloat(p0);
13 }
14
15 // CHECK: define {{.*}}test_float{{.*}}(float {{.*}} [[VAL:%.*]]){{.*}}
16 // CHECK-NOT: bitcast
17 // CHECK: ret float [[VAL]]
18 float test_float(float p0) {
19 return asfloat(p0);
20 }
21
22 // CHECK: define {{.*}}test_vector_uint{{.*}}(<4 x i32> {{.*}} [[VAL:%.*]]){{.*}}
23 // CHECK: bitcast <4 x i32> [[VAL]] to <4 x float>
24
25 float4 test_vector_uint(uint4 p0) {
26 return asfloat(p0);
27 }
28
29 // CHECK: define {{.*}}test_vector_int{{.*}}(<4 x i32> {{.*}} [[VAL:%.*]]){{.*}}
30 // CHECK: bitcast <4 x i32> [[VAL]] to <4 x float>
31 float4 test_vector_int(int4 p0) {
32 return asfloat(p0);
33 }
34
35 // CHECK: define {{.*}}test_vector_float{{.*}}(<4 x float> {{.*}} [[VAL:%.*]]){{.*}}
36 // CHECK-NOT: bitcast
37 // CHECK: ret <4 x float> [[VAL]]
38 float4 test_vector_float(float4 p0) {
39 return asfloat(p0);
40 }