|
1 | 1 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ |
2 | 2 | // RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ |
3 | | -// RUN: -fnative-int16-type -emit-llvm -o - | FileCheck %s -DTARGET=dx |
| 3 | +// RUN: -fnative-int16-type -emit-llvm -o - | FileCheck %s -DTARGET=dx --check-prefixes=CHECK,DXCHECK |
4 | 4 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ |
5 | 5 | // RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \ |
6 | | -// RUN: -fnative-int16-type -emit-llvm -o - | FileCheck %s -DTARGET=spv |
| 6 | +// RUN: -fnative-int16-type -emit-llvm -o - | FileCheck %s -DTARGET=spv --check-prefixes=CHECK,SPVCHECK |
7 | 7 |
|
8 | 8 | #ifdef __HLSL_ENABLE_16_BIT |
9 | 9 | // CHECK-LABEL: test_firstbithigh_ushort |
10 | | -// CHECK: [[FBH:%.*]] = call i32 @llvm.[[TARGET]].firstbituhigh.i16 |
11 | | -// CHECK: sub i32 15, [[FBH]] |
| 10 | +// CHECK: call i32 @llvm.[[TARGET]].firstbituhigh.i16 |
| 11 | +// DXCHECK: sub i32 15, {{.*}} |
| 12 | +// SPVCHECK-NOT: sub i32 15, {{.*}} |
| 13 | +// DXCHECK: icmp eq i32 {{.*}}, -1 |
| 14 | +// SPVCHECK-NOT: icmp eq i32 {{.*}}, -1 |
| 15 | +// DXCHECK: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
| 16 | +// SPVCHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
12 | 17 | uint test_firstbithigh_ushort(uint16_t p0) { |
13 | 18 | return firstbithigh(p0); |
14 | 19 | } |
15 | 20 |
|
16 | 21 | // CHECK-LABEL: test_firstbithigh_ushort2 |
17 | | -// CHECK: [[FBH:%.*]] = call <2 x i32> @llvm.[[TARGET]].firstbituhigh.v2i16 |
18 | | -// CHECK: sub <2 x i32> splat (i32 15), [[FBH]] |
| 22 | +// CHECK: call <2 x i32> @llvm.[[TARGET]].firstbituhigh.v2i16 |
| 23 | +// DXCHECK: sub <2 x i32> splat (i32 15), {{.*}} |
| 24 | +// SPVCHECK-NOT: sub <2 x i32> splat (i32 15), {{.*}} |
| 25 | +// DXCHECK: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 26 | +// SPVCHECK-NOT: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 27 | +// DXCHECK: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
| 28 | +// SPVCHECK-NOT: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
19 | 29 | uint2 test_firstbithigh_ushort2(uint16_t2 p0) { |
20 | 30 | return firstbithigh(p0); |
21 | 31 | } |
22 | 32 |
|
23 | 33 | // CHECK-LABEL: test_firstbithigh_ushort3 |
24 | | -// CHECK: [[FBH:%.*]] = call <3 x i32> @llvm.[[TARGET]].firstbituhigh.v3i16 |
25 | | -// CHECK: sub <3 x i32> splat (i32 15), [[FBH]] |
| 34 | +// CHECK: call <3 x i32> @llvm.[[TARGET]].firstbituhigh.v3i16 |
| 35 | +// DXCHECK: sub <3 x i32> splat (i32 15), {{.*}} |
| 36 | +// SPVCHECK-NOT: sub <3 x i32> splat (i32 15), {{.*}} |
| 37 | +// DXCHECK: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 38 | +// SPVCHECK-NOT: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 39 | +// DXCHECK: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
| 40 | +// SPVCHECK-NOT: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
26 | 41 | uint3 test_firstbithigh_ushort3(uint16_t3 p0) { |
27 | 42 | return firstbithigh(p0); |
28 | 43 | } |
29 | 44 |
|
30 | 45 | // CHECK-LABEL: test_firstbithigh_ushort4 |
31 | | -// CHECK: [[FBH:%.*]] = call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i16 |
32 | | -// CHECK: sub <4 x i32> splat (i32 15), [[FBH]] |
| 46 | +// CHECK: call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i16 |
| 47 | +// DXCHECK: sub <4 x i32> splat (i32 15), {{.*}} |
| 48 | +// SPVCHECK-NOT: sub <4 x i32> splat (i32 15), {{.*}} |
| 49 | +// DXCHECK: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 50 | +// SPVCHECK-NOT: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 51 | +// DXCHECK: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
| 52 | +// SPVCHECK-NOT: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
33 | 53 | uint4 test_firstbithigh_ushort4(uint16_t4 p0) { |
34 | 54 | return firstbithigh(p0); |
35 | 55 | } |
36 | 56 |
|
37 | 57 | // CHECK-LABEL: test_firstbithigh_short |
38 | | -// CHECK: [[FBH:%.*]] = call i32 @llvm.[[TARGET]].firstbitshigh.i16 |
39 | | -// CHECK: sub i32 15, [[FBH]] |
| 58 | +// CHECK: call i32 @llvm.[[TARGET]].firstbitshigh.i16 |
| 59 | +// DXCHECK: sub i32 15, {{.*}} |
| 60 | +// SPVCHECK-NOT: sub i32 15, {{.*}} |
| 61 | +// DXCHECK: icmp eq i32 {{.*}}, -1 |
| 62 | +// SPVCHECK-NOT: icmp eq i32 {{.*}}, -1 |
| 63 | +// DXCHECK: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
| 64 | +// SPVCHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
40 | 65 | uint test_firstbithigh_short(int16_t p0) { |
41 | 66 | return firstbithigh(p0); |
42 | 67 | } |
43 | 68 |
|
44 | 69 | // CHECK-LABEL: test_firstbithigh_short2 |
45 | | -// CHECK: [[FBH:%.*]] = call <2 x i32> @llvm.[[TARGET]].firstbitshigh.v2i16 |
46 | | -// CHECK: sub <2 x i32> splat (i32 15), [[FBH]] |
| 70 | +// CHECK: call <2 x i32> @llvm.[[TARGET]].firstbitshigh.v2i16 |
| 71 | +// DXCHECK: sub <2 x i32> splat (i32 15), {{.*}} |
| 72 | +// SPVCHECK-NOT: sub <2 x i32> splat (i32 15), {{.*}} |
| 73 | +// DXCHECK: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 74 | +// SPVCHECK-NOT: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 75 | +// DXCHECK: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
| 76 | +// SPVCHECK-NOT: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
47 | 77 | uint2 test_firstbithigh_short2(int16_t2 p0) { |
48 | 78 | return firstbithigh(p0); |
49 | 79 | } |
50 | 80 |
|
51 | 81 | // CHECK-LABEL: test_firstbithigh_short3 |
52 | | -// CHECK: [[FBH:%.*]] = call <3 x i32> @llvm.[[TARGET]].firstbitshigh.v3i16 |
53 | | -// CHECK: sub <3 x i32> splat (i32 15), [[FBH]] |
| 82 | +// CHECK: call <3 x i32> @llvm.[[TARGET]].firstbitshigh.v3i16 |
| 83 | +// DXCHECK: sub <3 x i32> splat (i32 15), {{.*}} |
| 84 | +// SPVCHECK-NOT: sub <3 x i32> splat (i32 15), {{.*}} |
| 85 | +// DXCHECK: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 86 | +// SPVCHECK-NOT: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 87 | +// DXCHECK: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
| 88 | +// SPVCHECK-NOT: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
54 | 89 | uint3 test_firstbithigh_short3(int16_t3 p0) { |
55 | 90 | return firstbithigh(p0); |
56 | 91 | } |
57 | 92 |
|
58 | 93 | // CHECK-LABEL: test_firstbithigh_short4 |
59 | | -// CHECK: [[FBH:%.*]] = call <4 x i32> @llvm.[[TARGET]].firstbitshigh.v4i16 |
60 | | -// CHECK: sub <4 x i32> splat (i32 15), [[FBH]] |
| 94 | +// CHECK: call <4 x i32> @llvm.[[TARGET]].firstbitshigh.v4i16 |
| 95 | +// DXCHECK: sub <4 x i32> splat (i32 15), {{.*}} |
| 96 | +// SPVCHECK-NOT: sub <4 x i32> splat (i32 15), {{.*}} |
| 97 | +// DXCHECK: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 98 | +// SPVCHECK-NOT: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 99 | +// DXCHECK: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
| 100 | +// SPVCHECK-NOT: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
61 | 101 | uint4 test_firstbithigh_short4(int16_t4 p0) { |
62 | 102 | return firstbithigh(p0); |
63 | 103 | } |
64 | 104 | #endif // __HLSL_ENABLE_16_BIT |
65 | 105 |
|
66 | 106 | // CHECK-LABEL: test_firstbithigh_uint |
67 | | -// CHECK: [[FBH:%.*]] = call i32 @llvm.[[TARGET]].firstbituhigh.i32 |
68 | | -// CHECK: sub i32 31, [[FBH]] |
| 107 | +// CHECK: call i32 @llvm.[[TARGET]].firstbituhigh.i32 |
| 108 | +// DXCHECK: sub i32 31, {{.*}} |
| 109 | +// SPVCHECK-NOT: sub i32 31, {{.*}} |
| 110 | +// DXCHECK: icmp eq i32 {{.*}}, -1 |
| 111 | +// SPVCHECK-NOT: icmp eq i32 {{.*}}, -1 |
| 112 | +// DXCHECK: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
| 113 | +// SPVCHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
69 | 114 | uint test_firstbithigh_uint(uint p0) { |
70 | 115 | return firstbithigh(p0); |
71 | 116 | } |
72 | 117 |
|
73 | 118 | // CHECK-LABEL: test_firstbithigh_uint2 |
74 | | -// CHECK: [[FBH:%.*]] = call <2 x i32> @llvm.[[TARGET]].firstbituhigh.v2i32 |
75 | | -// CHECK: sub <2 x i32> splat (i32 31), [[FBH]] |
| 119 | +// CHECK: call <2 x i32> @llvm.[[TARGET]].firstbituhigh.v2i32 |
| 120 | +// DXCHECK: sub <2 x i32> splat (i32 31), {{.*}} |
| 121 | +// SPVCHECK-NOT: sub <2 x i32> splat (i32 31), {{.*}} |
| 122 | +// DXCHECK: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 123 | +// SPVCHECK-NOT: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 124 | +// DXCHECK: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
| 125 | +// SPVCHECK-NOT: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
76 | 126 | uint2 test_firstbithigh_uint2(uint2 p0) { |
77 | 127 | return firstbithigh(p0); |
78 | 128 | } |
79 | 129 |
|
80 | 130 | // CHECK-LABEL: test_firstbithigh_uint3 |
81 | | -// CHECK: [[FBH:%.*]] = call <3 x i32> @llvm.[[TARGET]].firstbituhigh.v3i32 |
82 | | -// CHECK: sub <3 x i32> splat (i32 31), [[FBH]] |
| 131 | +// CHECK: call <3 x i32> @llvm.[[TARGET]].firstbituhigh.v3i32 |
| 132 | +// DXCHECK: sub <3 x i32> splat (i32 31), {{.*}} |
| 133 | +// SPVCHECK-NOT: sub <3 x i32> splat (i32 31), {{.*}} |
| 134 | +// DXCHECK: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 135 | +// SPVCHECK-NOT: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 136 | +// DXCHECK: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
| 137 | +// SPVCHECK-NOT: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
83 | 138 | uint3 test_firstbithigh_uint3(uint3 p0) { |
84 | 139 | return firstbithigh(p0); |
85 | 140 | } |
86 | 141 |
|
87 | 142 | // CHECK-LABEL: test_firstbithigh_uint4 |
88 | | -// CHECK: [[FBH:%.*]] = call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i32 |
89 | | -// CHECK: sub <4 x i32> splat (i32 31), [[FBH]] |
| 143 | +// CHECK: call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i32 |
| 144 | +// DXCHECK: sub <4 x i32> splat (i32 31), {{.*}} |
| 145 | +// SPVCHECK-NOT: sub <4 x i32> splat (i32 31), {{.*}} |
| 146 | +// DXCHECK: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 147 | +// SPVCHECK-NOT: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 148 | +// DXCHECK: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
| 149 | +// SPVCHECK-NOT: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
90 | 150 | uint4 test_firstbithigh_uint4(uint4 p0) { |
91 | 151 | return firstbithigh(p0); |
92 | 152 | } |
93 | 153 |
|
94 | 154 | // CHECK-LABEL: test_firstbithigh_ulong |
95 | | -// CHECK: [[FBH:%.*]] = call i32 @llvm.[[TARGET]].firstbituhigh.i64 |
96 | | -// CHECK: sub i32 63, [[FBH]] |
| 155 | +// CHECK: call i32 @llvm.[[TARGET]].firstbituhigh.i64 |
| 156 | +// DXCHECK: sub i32 63, {{.*}} |
| 157 | +// SPVCHECK-NOT: sub i32 63, {{.*}} |
| 158 | +// DXCHECK: icmp eq i32 {{.*}}, -1 |
| 159 | +// SPVCHECK-NOT: icmp eq i32 {{.*}}, -1 |
| 160 | +// DXCHECK: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
| 161 | +// SPVCHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
97 | 162 | uint test_firstbithigh_ulong(uint64_t p0) { |
98 | 163 | return firstbithigh(p0); |
99 | 164 | } |
100 | 165 |
|
101 | 166 | // CHECK-LABEL: test_firstbithigh_ulong2 |
102 | | -// CHECK: [[FBH:%.*]] = call <2 x i32> @llvm.[[TARGET]].firstbituhigh.v2i64 |
103 | | -// CHECK: sub <2 x i32> splat (i32 63), [[FBH]] |
| 167 | +// CHECK: call <2 x i32> @llvm.[[TARGET]].firstbituhigh.v2i64 |
| 168 | +// DXCHECK: sub <2 x i32> splat (i32 63), {{.*}} |
| 169 | +// SPVCHECK-NOT: sub <2 x i32> splat (i32 63), {{.*}} |
| 170 | +// DXCHECK: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 171 | +// SPVCHECK-NOT: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 172 | +// DXCHECK: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
| 173 | +// SPVCHECK-NOT: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
104 | 174 | uint2 test_firstbithigh_ulong2(uint64_t2 p0) { |
105 | 175 | return firstbithigh(p0); |
106 | 176 | } |
107 | 177 |
|
108 | 178 | // CHECK-LABEL: test_firstbithigh_ulong3 |
109 | | -// CHECK: [[FBH:%.*]] = call <3 x i32> @llvm.[[TARGET]].firstbituhigh.v3i64 |
110 | | -// CHECK: sub <3 x i32> splat (i32 63), [[FBH]] |
| 179 | +// CHECK: call <3 x i32> @llvm.[[TARGET]].firstbituhigh.v3i64 |
| 180 | +// DXCHECK: sub <3 x i32> splat (i32 63), {{.*}} |
| 181 | +// SPVCHECK-NOT: sub <3 x i32> splat (i32 63), {{.*}} |
| 182 | +// DXCHECK: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 183 | +// SPVCHECK-NOT: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 184 | +// DXCHECK: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
| 185 | +// SPVCHECK-NOT: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
111 | 186 | uint3 test_firstbithigh_ulong3(uint64_t3 p0) { |
112 | 187 | return firstbithigh(p0); |
113 | 188 | } |
114 | 189 |
|
115 | 190 | // CHECK-LABEL: test_firstbithigh_ulong4 |
116 | | -// CHECK: [[FBH:%.*]] = call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i64 |
117 | | -// CHECK: sub <4 x i32> splat (i32 63), [[FBH]] |
| 191 | +// CHECK: call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i64 |
| 192 | +// DXCHECK: sub <4 x i32> splat (i32 63), {{.*}} |
| 193 | +// SPVCHECK-NOT: sub <4 x i32> splat (i32 63), {{.*}} |
| 194 | +// DXCHECK: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 195 | +// SPVCHECK-NOT: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 196 | +// DXCHECK: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
| 197 | +// SPVCHECK-NOT: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
118 | 198 | uint4 test_firstbithigh_ulong4(uint64_t4 p0) { |
119 | 199 | return firstbithigh(p0); |
120 | 200 | } |
121 | 201 |
|
122 | 202 | // CHECK-LABEL: test_firstbithigh_int |
123 | | -// CHECK: [[FBH:%.*]] = call i32 @llvm.[[TARGET]].firstbitshigh.i32 |
124 | | -// CHECK: sub i32 31, [[FBH]] |
| 203 | +// CHECK: call i32 @llvm.[[TARGET]].firstbitshigh.i32 |
| 204 | +// DXCHECK: sub i32 31, {{.*}} |
| 205 | +// SPVCHECK-NOT: sub i32 31, {{.*}} |
| 206 | +// DXCHECK: icmp eq i32 {{.*}}, -1 |
| 207 | +// SPVCHECK-NOT: icmp eq i32 {{.*}}, -1 |
| 208 | +// DXCHECK: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
| 209 | +// SPVCHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
125 | 210 | uint test_firstbithigh_int(int p0) { |
126 | 211 | return firstbithigh(p0); |
127 | 212 | } |
128 | 213 |
|
129 | 214 | // CHECK-LABEL: test_firstbithigh_int2 |
130 | | -// CHECK: [[FBH:%.*]] = call <2 x i32> @llvm.[[TARGET]].firstbitshigh.v2i32 |
131 | | -// CHECK: sub <2 x i32> splat (i32 31), [[FBH]] |
| 215 | +// CHECK: call <2 x i32> @llvm.[[TARGET]].firstbitshigh.v2i32 |
| 216 | +// DXCHECK: sub <2 x i32> splat (i32 31), {{.*}} |
| 217 | +// SPVCHECK-NOT: sub <2 x i32> splat (i32 31), {{.*}} |
| 218 | +// DXCHECK: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 219 | +// SPVCHECK-NOT: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 220 | +// DXCHECK: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
| 221 | +// SPVCHECK-NOT: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
132 | 222 | uint2 test_firstbithigh_int2(int2 p0) { |
133 | 223 | return firstbithigh(p0); |
134 | 224 | } |
135 | 225 |
|
136 | 226 | // CHECK-LABEL: test_firstbithigh_int3 |
137 | | -// CHECK: [[FBH:%.*]] = call <3 x i32> @llvm.[[TARGET]].firstbitshigh.v3i32 |
138 | | -// CHECK: sub <3 x i32> splat (i32 31), [[FBH]] |
| 227 | +// CHECK: call <3 x i32> @llvm.[[TARGET]].firstbitshigh.v3i32 |
| 228 | +// DXCHECK: sub <3 x i32> splat (i32 31), {{.*}} |
| 229 | +// SPVCHECK-NOT: sub <3 x i32> splat (i32 31), {{.*}} |
| 230 | +// DXCHECK: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 231 | +// SPVCHECK-NOT: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 232 | +// DXCHECK: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
| 233 | +// SPVCHECK-NOT: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
139 | 234 | uint3 test_firstbithigh_int3(int3 p0) { |
140 | 235 | return firstbithigh(p0); |
141 | 236 | } |
142 | 237 |
|
143 | 238 | // CHECK-LABEL: test_firstbithigh_int4 |
144 | | -// CHECK: [[FBH:%.*]] = call <4 x i32> @llvm.[[TARGET]].firstbitshigh.v4i32 |
145 | | -// CHECK: sub <4 x i32> splat (i32 31), [[FBH]] |
| 239 | +// CHECK: call <4 x i32> @llvm.[[TARGET]].firstbitshigh.v4i32 |
| 240 | +// DXCHECK: sub <4 x i32> splat (i32 31), {{.*}} |
| 241 | +// SPVCHECK-NOT: sub <4 x i32> splat (i32 31), {{.*}} |
| 242 | +// DXCHECK: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 243 | +// SPVCHECK-NOT: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 244 | +// DXCHECK: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
| 245 | +// SPVCHECK-NOT: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
146 | 246 | uint4 test_firstbithigh_int4(int4 p0) { |
147 | 247 | return firstbithigh(p0); |
148 | 248 | } |
149 | 249 |
|
150 | 250 | // CHECK-LABEL: test_firstbithigh_long |
151 | | -// CHECK: [[FBH:%.*]] = call i32 @llvm.[[TARGET]].firstbitshigh.i64 |
152 | | -// CHECK: sub i32 63, [[FBH]] |
| 251 | +// CHECK: call i32 @llvm.[[TARGET]].firstbitshigh.i64 |
| 252 | +// DXCHECK: sub i32 63, {{.*}} |
| 253 | +// SPVCHECK-NOT: sub i32 63, {{.*}} |
| 254 | +// DXCHECK: icmp eq i32 {{.*}}, -1 |
| 255 | +// SPVCHECK-NOT: icmp eq i32 {{.*}}, -1 |
| 256 | +// DXCHECK: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
| 257 | +// SPVCHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}} |
153 | 258 | uint test_firstbithigh_long(int64_t p0) { |
154 | 259 | return firstbithigh(p0); |
155 | 260 | } |
156 | 261 |
|
157 | 262 | // CHECK-LABEL: test_firstbithigh_long2 |
158 | | -// CHECK: [[FBH:%.*]] = call <2 x i32> @llvm.[[TARGET]].firstbitshigh.v2i64 |
159 | | -// CHECK: sub <2 x i32> splat (i32 63), [[FBH]] |
| 263 | +// CHECK: call <2 x i32> @llvm.[[TARGET]].firstbitshigh.v2i64 |
| 264 | +// DXCHECK: sub <2 x i32> splat (i32 63), {{.*}} |
| 265 | +// SPVCHECK-NOT: sub <2 x i32> splat (i32 63), {{.*}} |
| 266 | +// DXCHECK: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 267 | +// SPVCHECK-NOT: icmp eq <2 x i32> {{.*}}, splat (i32 -1) |
| 268 | +// DXCHECK: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
| 269 | +// SPVCHECK-NOT: select i1 {{.*}}, <2 x i32> {{.*}}, <2 x i32> {{.*}} |
160 | 270 | uint2 test_firstbithigh_long2(int64_t2 p0) { |
161 | 271 | return firstbithigh(p0); |
162 | 272 | } |
163 | 273 |
|
164 | 274 | // CHECK-LABEL: test_firstbithigh_long3 |
165 | | -// CHECK: [[FBH:%.*]] = call <3 x i32> @llvm.[[TARGET]].firstbitshigh.v3i64 |
166 | | -// CHECK: sub <3 x i32> splat (i32 63), [[FBH]] |
| 275 | +// CHECK: call <3 x i32> @llvm.[[TARGET]].firstbitshigh.v3i64 |
| 276 | +// DXCHECK: sub <3 x i32> splat (i32 63), {{.*}} |
| 277 | +// SPVCHECK-NOT: sub <3 x i32> splat (i32 63), {{.*}} |
| 278 | +// DXCHECK: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 279 | +// SPVCHECK-NOT: icmp eq <3 x i32> {{.*}}, splat (i32 -1) |
| 280 | +// DXCHECK: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
| 281 | +// SPVCHECK-NOT: select i1 {{.*}}, <3 x i32> {{.*}}, <3 x i32> {{.*}} |
167 | 282 | uint3 test_firstbithigh_long3(int64_t3 p0) { |
168 | 283 | return firstbithigh(p0); |
169 | 284 | } |
170 | 285 |
|
171 | 286 | // CHECK-LABEL: test_firstbithigh_long4 |
172 | | -// CHECK: [[FBH:%.*]] = call <4 x i32> @llvm.[[TARGET]].firstbitshigh.v4i64 |
173 | | -// CHECK: sub <4 x i32> splat (i32 63), [[FBH]] |
| 287 | +// CHECK: call <4 x i32> @llvm.[[TARGET]].firstbitshigh.v4i64 |
| 288 | +// DXCHECK: sub <4 x i32> splat (i32 63), {{.*}} |
| 289 | +// SPVCHECK-NOT: sub <4 x i32> splat (i32 63), {{.*}} |
| 290 | +// DXCHECK: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 291 | +// SPVCHECK-NOT: icmp eq <4 x i32> {{.*}}, splat (i32 -1) |
| 292 | +// DXCHECK: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
| 293 | +// SPVCHECK-NOT: select i1 {{.*}}, <4 x i32> {{.*}}, <4 x i32> {{.*}} |
174 | 294 | uint4 test_firstbithigh_long4(int64_t4 p0) { |
175 | 295 | return firstbithigh(p0); |
176 | 296 | } |
177 | 297 |
|
178 | 298 | // CHECK-LABEL: test_firstbithigh_upcast |
179 | | -// CHECK: [[FBH:%.*]] = call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i32(<4 x i32> %{{.*}}) |
180 | | -// CHECK: [[SUB:%.*]] = sub <4 x i32> splat (i32 31), [[FBH]] |
181 | | -// CHECK: [[CONV:%.*]] = zext <4 x i32> [[SUB]] to <4 x i64> |
182 | | -// CHECK: ret <4 x i64> [[CONV]] |
| 299 | +// CHECK: call <4 x i32> @llvm.[[TARGET]].firstbituhigh.v4i32(<4 x i32> %{{.*}}) |
| 300 | +// DXCHECK: sub <4 x i32> splat (i32 31), {{.*}} |
| 301 | +// SPVCHECK-NOT: sub <4 x i32> splat (i32 31), {{.*}} |
| 302 | +// CHECK: zext <4 x i32> {{.*}} to <4 x i64> |
| 303 | +// CHECK: ret <4 x i64> {{.*}} |
183 | 304 | uint64_t4 test_firstbithigh_upcast(uint4 p0) { |
184 | 305 | return firstbithigh(p0); |
185 | 306 | } |
0 commit comments