[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / clang / test / CodeGenHLSL / builtins / firstbithigh.hlsl
blobdebf6b6d3e3f5ac70eaa8fb4c9c19cf91e261774
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 -DTARGET=dx
4 // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
5 // RUN:   spirv-unknown-vulkan-compute %s -fnative-half-type \
6 // RUN: -emit-llvm -disable-llvm-passes \
7 // RUN:   -o - | FileCheck %s -DTARGET=spv
9 #ifdef __HLSL_ENABLE_16_BIT
10 // CHECK-LABEL: test_firstbithigh_ushort
11 // CHECK: call i32 @llvm.[[TARGET]].firstbituhigh.i16
12 uint test_firstbithigh_ushort(uint16_t p0) {
13   return firstbithigh(p0);
16 // CHECK-LABEL: test_firstbithigh_ushort2
17 // CHECK: call <2 x i32> @llvm.[[TARGET]].firstbituhigh.v2i16
18 uint2 test_firstbithigh_ushort2(uint16_t2 p0) {
19   return firstbithigh(p0);
22 // CHECK-LABEL: test_firstbithigh_ushort3
23 // CHECK: call <3 x i32> @llvm.[[TARGET]].firstbituhigh.v3i16
24 uint3 test_firstbithigh_ushort3(uint16_t3 p0) {
25   return firstbithigh(p0);
28 // CHECK-LABEL: test_firstbithigh_ushort4
29 // CHECK: call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i16
30 uint4 test_firstbithigh_ushort4(uint16_t4 p0) {
31   return firstbithigh(p0);
34 // CHECK-LABEL: test_firstbithigh_short
35 // CHECK: call i32 @llvm.[[TARGET]].firstbitshigh.i16
36 uint test_firstbithigh_short(int16_t p0) {
37   return firstbithigh(p0);
40 // CHECK-LABEL: test_firstbithigh_short2
41 // CHECK: call <2 x i32> @llvm.[[TARGET]].firstbitshigh.v2i16
42 uint2 test_firstbithigh_short2(int16_t2 p0) {
43   return firstbithigh(p0);
46 // CHECK-LABEL: test_firstbithigh_short3
47 // CHECK: call <3 x i32> @llvm.[[TARGET]].firstbitshigh.v3i16
48 uint3 test_firstbithigh_short3(int16_t3 p0) {
49   return firstbithigh(p0);
52 // CHECK-LABEL: test_firstbithigh_short4
53 // CHECK: call <4 x i32> @llvm.[[TARGET]].firstbitshigh.v4i16
54 uint4 test_firstbithigh_short4(int16_t4 p0) {
55   return firstbithigh(p0);
57 #endif // __HLSL_ENABLE_16_BIT
59 // CHECK-LABEL: test_firstbithigh_uint
60 // CHECK: call i32 @llvm.[[TARGET]].firstbituhigh.i32
61 uint test_firstbithigh_uint(uint p0) {
62   return firstbithigh(p0);
65 // CHECK-LABEL: test_firstbithigh_uint2
66 // CHECK: call <2 x i32> @llvm.[[TARGET]].firstbituhigh.v2i32
67 uint2 test_firstbithigh_uint2(uint2 p0) {
68   return firstbithigh(p0);
71 // CHECK-LABEL: test_firstbithigh_uint3
72 // CHECK: call <3 x i32> @llvm.[[TARGET]].firstbituhigh.v3i32
73 uint3 test_firstbithigh_uint3(uint3 p0) {
74   return firstbithigh(p0);
77 // CHECK-LABEL: test_firstbithigh_uint4
78 // CHECK: call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i32
79 uint4 test_firstbithigh_uint4(uint4 p0) {
80   return firstbithigh(p0);
83 // CHECK-LABEL: test_firstbithigh_ulong
84 // CHECK: call i32 @llvm.[[TARGET]].firstbituhigh.i64
85 uint test_firstbithigh_ulong(uint64_t p0) {
86   return firstbithigh(p0);
89 // CHECK-LABEL: test_firstbithigh_ulong2
90 // CHECK: call <2 x i32> @llvm.[[TARGET]].firstbituhigh.v2i64
91 uint2 test_firstbithigh_ulong2(uint64_t2 p0) {
92   return firstbithigh(p0);
95 // CHECK-LABEL: test_firstbithigh_ulong3
96 // CHECK: call <3 x i32> @llvm.[[TARGET]].firstbituhigh.v3i64
97 uint3 test_firstbithigh_ulong3(uint64_t3 p0) {
98   return firstbithigh(p0);
101 // CHECK-LABEL: test_firstbithigh_ulong4
102 // CHECK: call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i64
103 uint4 test_firstbithigh_ulong4(uint64_t4 p0) {
104   return firstbithigh(p0);
107 // CHECK-LABEL: test_firstbithigh_int
108 // CHECK: call i32 @llvm.[[TARGET]].firstbitshigh.i32
109 uint test_firstbithigh_int(int p0) {
110   return firstbithigh(p0);
113 // CHECK-LABEL: test_firstbithigh_int2
114 // CHECK: call <2 x i32> @llvm.[[TARGET]].firstbitshigh.v2i32
115 uint2 test_firstbithigh_int2(int2 p0) {
116   return firstbithigh(p0);
119 // CHECK-LABEL: test_firstbithigh_int3
120 // CHECK: call <3 x i32> @llvm.[[TARGET]].firstbitshigh.v3i32
121 uint3 test_firstbithigh_int3(int3 p0) {
122   return firstbithigh(p0);
125 // CHECK-LABEL: test_firstbithigh_int4
126 // CHECK: call <4 x i32> @llvm.[[TARGET]].firstbitshigh.v4i32
127 uint4 test_firstbithigh_int4(int4 p0) {
128   return firstbithigh(p0);
131 // CHECK-LABEL: test_firstbithigh_long
132 // CHECK: call i32 @llvm.[[TARGET]].firstbitshigh.i64
133 uint test_firstbithigh_long(int64_t p0) {
134   return firstbithigh(p0);
137 // CHECK-LABEL: test_firstbithigh_long2
138 // CHECK: call <2 x i32> @llvm.[[TARGET]].firstbitshigh.v2i64
139 uint2 test_firstbithigh_long2(int64_t2 p0) {
140   return firstbithigh(p0);
143 // CHECK-LABEL: test_firstbithigh_long3
144 // CHECK: call <3 x i32> @llvm.[[TARGET]].firstbitshigh.v3i64
145 uint3 test_firstbithigh_long3(int64_t3 p0) {
146   return firstbithigh(p0);
149 // CHECK-LABEL: test_firstbithigh_long4
150 // CHECK: call <4 x i32> @llvm.[[TARGET]].firstbitshigh.v4i64
151 uint4 test_firstbithigh_long4(int64_t4 p0) {
152   return firstbithigh(p0);