1 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
4 ; CHECK-SPIRV: OpName %[[#r1:]] "r1"
5 ; CHECK-SPIRV: OpName %[[#r2:]] "r2"
6 ; CHECK-SPIRV: OpName %[[#r3:]] "r3"
7 ; CHECK-SPIRV: OpName %[[#r4:]] "r4"
8 ; CHECK-SPIRV: OpName %[[#r5:]] "r5"
9 ; CHECK-SPIRV: OpName %[[#r6:]] "r6"
10 ; CHECK-SPIRV: OpName %[[#r7:]] "r7"
11 ; CHECK-SPIRV: OpName %[[#r8:]] "r8"
12 ; CHECK-SPIRV: OpName %[[#r9:]] "r9"
13 ; CHECK-SPIRV: OpName %[[#r10:]] "r10"
14 ; CHECK-SPIRV: OpName %[[#r11:]] "r11"
15 ; CHECK-SPIRV: OpName %[[#r12:]] "r12"
16 ; CHECK-SPIRV: OpName %[[#r13:]] "r13"
17 ; CHECK-SPIRV: OpName %[[#r14:]] "r14"
18 ; CHECK-SPIRV: OpName %[[#r15:]] "r15"
19 ; CHECK-SPIRV: OpName %[[#r16:]] "r16"
20 ; CHECK-SPIRV: OpName %[[#r17:]] "r17"
21 ; CHECK-SPIRV: OpName %[[#r18:]] "r18"
22 ; CHECK-SPIRV: OpName %[[#r19:]] "r19"
23 ; CHECK-SPIRV: OpName %[[#r20:]] "r20"
24 ; CHECK-SPIRV: OpName %[[#r21:]] "r21"
25 ; CHECK-SPIRV: OpName %[[#r22:]] "r22"
26 ; CHECK-SPIRV: OpName %[[#r23:]] "r23"
27 ; CHECK-SPIRV: OpName %[[#r24:]] "r24"
28 ; CHECK-SPIRV: OpName %[[#r25:]] "r25"
29 ; CHECK-SPIRV: OpName %[[#r26:]] "r26"
30 ; CHECK-SPIRV: OpName %[[#r27:]] "r27"
31 ; CHECK-SPIRV: OpName %[[#r28:]] "r28"
32 ; CHECK-SPIRV: OpName %[[#r29:]] "r29"
33 ; CHECK-SPIRV: OpName %[[#r30:]] "r30"
34 ; CHECK-SPIRV: OpName %[[#r31:]] "r31"
35 ; CHECK-SPIRV: OpName %[[#r32:]] "r32"
36 ; CHECK-SPIRV: OpName %[[#r33:]] "r33"
37 ; CHECK-SPIRV: OpName %[[#r34:]] "r34"
38 ; CHECK-SPIRV: OpName %[[#r35:]] "r35"
39 ; CHECK-SPIRV: OpName %[[#r36:]] "r36"
40 ; CHECK-SPIRV: OpName %[[#r37:]] "r37"
41 ; CHECK-SPIRV: OpName %[[#r38:]] "r38"
42 ; CHECK-SPIRV: OpName %[[#r39:]] "r39"
43 ; CHECK-SPIRV: OpName %[[#r40:]] "r40"
44 ; CHECK-SPIRV: OpName %[[#r41:]] "r41"
45 ; CHECK-SPIRV: OpName %[[#r42:]] "r42"
46 ; CHECK-SPIRV: OpName %[[#r43:]] "r43"
47 ; CHECK-SPIRV: OpName %[[#r44:]] "r44"
48 ; CHECK-SPIRV: OpName %[[#r45:]] "r45"
49 ; CHECK-SPIRV: OpName %[[#r46:]] "r46"
50 ; CHECK-SPIRV: OpName %[[#r47:]] "r47"
51 ; CHECK-SPIRV: OpName %[[#r48:]] "r48"
52 ; CHECK-SPIRV: OpName %[[#r49:]] "r49"
53 ; CHECK-SPIRV: OpName %[[#r50:]] "r50"
54 ; CHECK-SPIRV: OpName %[[#r51:]] "r51"
55 ; CHECK-SPIRV: OpName %[[#r52:]] "r52"
56 ; CHECK-SPIRV: OpName %[[#r53:]] "r53"
57 ; CHECK-SPIRV: OpName %[[#r54:]] "r54"
58 ; CHECK-SPIRV: OpName %[[#r55:]] "r55"
59 ; CHECK-SPIRV: OpName %[[#r56:]] "r56"
60 ; CHECK-SPIRV: OpName %[[#r57:]] "r57"
61 ; CHECK-SPIRV: OpName %[[#r58:]] "r58"
62 ; CHECK-SPIRV: OpName %[[#r59:]] "r59"
63 ; CHECK-SPIRV: OpName %[[#r60:]] "r60"
64 ; CHECK-SPIRV: OpName %[[#r61:]] "r61"
65 ; CHECK-SPIRV: OpName %[[#r62:]] "r62"
66 ; CHECK-SPIRV: OpName %[[#r63:]] "r63"
67 ; CHECK-SPIRV: OpName %[[#r64:]] "r64"
68 ; CHECK-SPIRV: OpName %[[#r65:]] "r65"
69 ; CHECK-SPIRV: OpName %[[#r66:]] "r66"
70 ; CHECK-SPIRV: OpName %[[#r67:]] "r67"
71 ; CHECK-SPIRV: OpName %[[#r68:]] "r68"
72 ; CHECK-SPIRV: OpName %[[#r69:]] "r69"
73 ; CHECK-SPIRV: OpName %[[#r70:]] "r70"
74 ; CHECK-SPIRV: OpName %[[#r71:]] "r71"
75 ; CHECK-SPIRV: OpName %[[#r72:]] "r72"
76 ; CHECK-SPIRV: OpName %[[#r73:]] "r73"
77 ; CHECK-SPIRV: OpName %[[#r74:]] "r74"
78 ; CHECK-SPIRV: OpName %[[#r75:]] "r75"
79 ; CHECK-SPIRV: OpName %[[#r76:]] "r76"
80 ; CHECK-SPIRV: OpName %[[#r77:]] "r77"
81 ; CHECK-SPIRV: OpName %[[#r78:]] "r78"
82 ; CHECK-SPIRV: OpName %[[#r79:]] "r79"
83 ; CHECK-SPIRV: OpName %[[#r80:]] "r80"
84 ; CHECK-SPIRV: OpName %[[#r81:]] "r81"
85 ; CHECK-SPIRV: OpName %[[#r82:]] "r82"
86 ; CHECK-SPIRV: OpName %[[#r83:]] "r83"
87 ; CHECK-SPIRV: OpName %[[#r84:]] "r84"
88 ; CHECK-SPIRV: OpName %[[#r85:]] "r85"
89 ; CHECK-SPIRV: OpName %[[#r86:]] "r86"
90 ; CHECK-SPIRV: OpName %[[#r87:]] "r87"
91 ; CHECK-SPIRV: OpName %[[#r88:]] "r88"
92 ; CHECK-SPIRV: OpName %[[#r89:]] "r89"
93 ; CHECK-SPIRV: OpName %[[#r90:]] "r90"
94 ; CHECK-SPIRV-NOT: OpDecorate %{{.*}} FPFastMathMode
95 ; CHECK-SPIRV: %[[#bool:]] = OpTypeBool
96 ; CHECK-SPIRV: %[[#r1]] = OpFOrdEqual %[[#bool]]
97 ; CHECK-SPIRV: %[[#r2]] = OpFOrdEqual %[[#bool]]
98 ; CHECK-SPIRV: %[[#r3]] = OpFOrdEqual %[[#bool]]
99 ; CHECK-SPIRV: %[[#r4]] = OpFOrdEqual %[[#bool]]
100 ; CHECK-SPIRV: %[[#r5]] = OpFOrdEqual %[[#bool]]
101 ; CHECK-SPIRV: %[[#r6]] = OpFOrdEqual %[[#bool]]
102 ; CHECK-SPIRV: %[[#r7]] = OpFOrdEqual %[[#bool]]
103 ; CHECK-SPIRV: %[[#r8]] = OpFOrdNotEqual %[[#bool]]
104 ; CHECK-SPIRV: %[[#r9]] = OpFOrdNotEqual %[[#bool]]
105 ; CHECK-SPIRV: %[[#r10]] = OpFOrdNotEqual %[[#bool]]
106 ; CHECK-SPIRV: %[[#r11]] = OpFOrdNotEqual %[[#bool]]
107 ; CHECK-SPIRV: %[[#r12]] = OpFOrdNotEqual %[[#bool]]
108 ; CHECK-SPIRV: %[[#r13]] = OpFOrdNotEqual %[[#bool]]
109 ; CHECK-SPIRV: %[[#r14]] = OpFOrdNotEqual %[[#bool]]
110 ; CHECK-SPIRV: %[[#r15]] = OpFOrdLessThan %[[#bool]]
111 ; CHECK-SPIRV: %[[#r16]] = OpFOrdLessThan %[[#bool]]
112 ; CHECK-SPIRV: %[[#r17]] = OpFOrdLessThan %[[#bool]]
113 ; CHECK-SPIRV: %[[#r18]] = OpFOrdLessThan %[[#bool]]
114 ; CHECK-SPIRV: %[[#r19]] = OpFOrdLessThan %[[#bool]]
115 ; CHECK-SPIRV: %[[#r20]] = OpFOrdLessThan %[[#bool]]
116 ; CHECK-SPIRV: %[[#r21]] = OpFOrdLessThan %[[#bool]]
117 ; CHECK-SPIRV: %[[#r22]] = OpFOrdGreaterThan %[[#bool]]
118 ; CHECK-SPIRV: %[[#r23]] = OpFOrdGreaterThan %[[#bool]]
119 ; CHECK-SPIRV: %[[#r24]] = OpFOrdGreaterThan %[[#bool]]
120 ; CHECK-SPIRV: %[[#r25]] = OpFOrdGreaterThan %[[#bool]]
121 ; CHECK-SPIRV: %[[#r26]] = OpFOrdGreaterThan %[[#bool]]
122 ; CHECK-SPIRV: %[[#r27]] = OpFOrdGreaterThan %[[#bool]]
123 ; CHECK-SPIRV: %[[#r28]] = OpFOrdGreaterThan %[[#bool]]
124 ; CHECK-SPIRV: %[[#r29]] = OpFOrdLessThanEqual %[[#bool]]
125 ; CHECK-SPIRV: %[[#r30]] = OpFOrdLessThanEqual %[[#bool]]
126 ; CHECK-SPIRV: %[[#r31]] = OpFOrdLessThanEqual %[[#bool]]
127 ; CHECK-SPIRV: %[[#r32]] = OpFOrdLessThanEqual %[[#bool]]
128 ; CHECK-SPIRV: %[[#r33]] = OpFOrdLessThanEqual %[[#bool]]
129 ; CHECK-SPIRV: %[[#r34]] = OpFOrdLessThanEqual %[[#bool]]
130 ; CHECK-SPIRV: %[[#r35]] = OpFOrdLessThanEqual %[[#bool]]
131 ; CHECK-SPIRV: %[[#r36]] = OpFOrdGreaterThanEqual %[[#bool]]
132 ; CHECK-SPIRV: %[[#r37]] = OpFOrdGreaterThanEqual %[[#bool]]
133 ; CHECK-SPIRV: %[[#r38]] = OpFOrdGreaterThanEqual %[[#bool]]
134 ; CHECK-SPIRV: %[[#r39]] = OpFOrdGreaterThanEqual %[[#bool]]
135 ; CHECK-SPIRV: %[[#r40]] = OpFOrdGreaterThanEqual %[[#bool]]
136 ; CHECK-SPIRV: %[[#r41]] = OpFOrdGreaterThanEqual %[[#bool]]
137 ; CHECK-SPIRV: %[[#r42]] = OpFOrdGreaterThanEqual %[[#bool]]
138 ; CHECK-SPIRV: %[[#r43]] = OpOrdered %[[#bool]]
139 ; CHECK-SPIRV: %[[#r44]] = OpOrdered %[[#bool]]
140 ; CHECK-SPIRV: %[[#r45]] = OpOrdered %[[#bool]]
141 ; CHECK-SPIRV: %[[#r46]] = OpFUnordEqual %[[#bool]]
142 ; CHECK-SPIRV: %[[#r47]] = OpFUnordEqual %[[#bool]]
143 ; CHECK-SPIRV: %[[#r48]] = OpFUnordEqual %[[#bool]]
144 ; CHECK-SPIRV: %[[#r49]] = OpFUnordEqual %[[#bool]]
145 ; CHECK-SPIRV: %[[#r50]] = OpFUnordEqual %[[#bool]]
146 ; CHECK-SPIRV: %[[#r51]] = OpFUnordEqual %[[#bool]]
147 ; CHECK-SPIRV: %[[#r52]] = OpFUnordEqual %[[#bool]]
148 ; CHECK-SPIRV: %[[#r53]] = OpFUnordNotEqual %[[#bool]]
149 ; CHECK-SPIRV: %[[#r54]] = OpFUnordNotEqual %[[#bool]]
150 ; CHECK-SPIRV: %[[#r55]] = OpFUnordNotEqual %[[#bool]]
151 ; CHECK-SPIRV: %[[#r56]] = OpFUnordNotEqual %[[#bool]]
152 ; CHECK-SPIRV: %[[#r57]] = OpFUnordNotEqual %[[#bool]]
153 ; CHECK-SPIRV: %[[#r58]] = OpFUnordNotEqual %[[#bool]]
154 ; CHECK-SPIRV: %[[#r59]] = OpFUnordNotEqual %[[#bool]]
155 ; CHECK-SPIRV: %[[#r60]] = OpFUnordLessThan %[[#bool]]
156 ; CHECK-SPIRV: %[[#r61]] = OpFUnordLessThan %[[#bool]]
157 ; CHECK-SPIRV: %[[#r62]] = OpFUnordLessThan %[[#bool]]
158 ; CHECK-SPIRV: %[[#r63]] = OpFUnordLessThan %[[#bool]]
159 ; CHECK-SPIRV: %[[#r64]] = OpFUnordLessThan %[[#bool]]
160 ; CHECK-SPIRV: %[[#r65]] = OpFUnordLessThan %[[#bool]]
161 ; CHECK-SPIRV: %[[#r66]] = OpFUnordLessThan %[[#bool]]
162 ; CHECK-SPIRV: %[[#r67]] = OpFUnordGreaterThan %[[#bool]]
163 ; CHECK-SPIRV: %[[#r68]] = OpFUnordGreaterThan %[[#bool]]
164 ; CHECK-SPIRV: %[[#r69]] = OpFUnordGreaterThan %[[#bool]]
165 ; CHECK-SPIRV: %[[#r70]] = OpFUnordGreaterThan %[[#bool]]
166 ; CHECK-SPIRV: %[[#r71]] = OpFUnordGreaterThan %[[#bool]]
167 ; CHECK-SPIRV: %[[#r72]] = OpFUnordGreaterThan %[[#bool]]
168 ; CHECK-SPIRV: %[[#r73]] = OpFUnordGreaterThan %[[#bool]]
169 ; CHECK-SPIRV: %[[#r74]] = OpFUnordLessThanEqual %[[#bool]]
170 ; CHECK-SPIRV: %[[#r75]] = OpFUnordLessThanEqual %[[#bool]]
171 ; CHECK-SPIRV: %[[#r76]] = OpFUnordLessThanEqual %[[#bool]]
172 ; CHECK-SPIRV: %[[#r77]] = OpFUnordLessThanEqual %[[#bool]]
173 ; CHECK-SPIRV: %[[#r78]] = OpFUnordLessThanEqual %[[#bool]]
174 ; CHECK-SPIRV: %[[#r79]] = OpFUnordLessThanEqual %[[#bool]]
175 ; CHECK-SPIRV: %[[#r80]] = OpFUnordLessThanEqual %[[#bool]]
176 ; CHECK-SPIRV: %[[#r81]] = OpFUnordGreaterThanEqual %[[#bool]]
177 ; CHECK-SPIRV: %[[#r82]] = OpFUnordGreaterThanEqual %[[#bool]]
178 ; CHECK-SPIRV: %[[#r83]] = OpFUnordGreaterThanEqual %[[#bool]]
179 ; CHECK-SPIRV: %[[#r84]] = OpFUnordGreaterThanEqual %[[#bool]]
180 ; CHECK-SPIRV: %[[#r85]] = OpFUnordGreaterThanEqual %[[#bool]]
181 ; CHECK-SPIRV: %[[#r86]] = OpFUnordGreaterThanEqual %[[#bool]]
182 ; CHECK-SPIRV: %[[#r87]] = OpFUnordGreaterThanEqual %[[#bool]]
183 ; CHECK-SPIRV: %[[#r88]] = OpUnordered %[[#bool]]
184 ; CHECK-SPIRV: %[[#r89]] = OpUnordered %[[#bool]]
185 ; CHECK-SPIRV: %[[#r90]] = OpUnordered %[[#bool]]
187 define spir_kernel void @testFCmp(float %a, float %b) local_unnamed_addr {
189 %r1 = fcmp oeq float %a, %b
190 %r2 = fcmp nnan oeq float %a, %b
191 %r3 = fcmp ninf oeq float %a, %b
192 %r4 = fcmp nsz oeq float %a, %b
193 %r5 = fcmp arcp oeq float %a, %b
194 %r6 = fcmp fast oeq float %a, %b
195 %r7 = fcmp nnan ninf oeq float %a, %b
196 %r8 = fcmp one float %a, %b
197 %r9 = fcmp nnan one float %a, %b
198 %r10 = fcmp ninf one float %a, %b
199 %r11 = fcmp nsz one float %a, %b
200 %r12 = fcmp arcp one float %a, %b
201 %r13 = fcmp fast one float %a, %b
202 %r14 = fcmp nnan ninf one float %a, %b
203 %r15 = fcmp olt float %a, %b
204 %r16 = fcmp nnan olt float %a, %b
205 %r17 = fcmp ninf olt float %a, %b
206 %r18 = fcmp nsz olt float %a, %b
207 %r19 = fcmp arcp olt float %a, %b
208 %r20 = fcmp fast olt float %a, %b
209 %r21 = fcmp nnan ninf olt float %a, %b
210 %r22 = fcmp ogt float %a, %b
211 %r23 = fcmp nnan ogt float %a, %b
212 %r24 = fcmp ninf ogt float %a, %b
213 %r25 = fcmp nsz ogt float %a, %b
214 %r26 = fcmp arcp ogt float %a, %b
215 %r27 = fcmp fast ogt float %a, %b
216 %r28 = fcmp nnan ninf ogt float %a, %b
217 %r29 = fcmp ole float %a, %b
218 %r30 = fcmp nnan ole float %a, %b
219 %r31 = fcmp ninf ole float %a, %b
220 %r32 = fcmp nsz ole float %a, %b
221 %r33 = fcmp arcp ole float %a, %b
222 %r34 = fcmp fast ole float %a, %b
223 %r35 = fcmp nnan ninf ole float %a, %b
224 %r36 = fcmp oge float %a, %b
225 %r37 = fcmp nnan oge float %a, %b
226 %r38 = fcmp ninf oge float %a, %b
227 %r39 = fcmp nsz oge float %a, %b
228 %r40 = fcmp arcp oge float %a, %b
229 %r41 = fcmp fast oge float %a, %b
230 %r42 = fcmp nnan ninf oge float %a, %b
231 %r43 = fcmp ord float %a, %b
232 %r44 = fcmp ninf ord float %a, %b
233 %r45 = fcmp nsz ord float %a, %b
234 %r46 = fcmp ueq float %a, %b
235 %r47 = fcmp nnan ueq float %a, %b
236 %r48 = fcmp ninf ueq float %a, %b
237 %r49 = fcmp nsz ueq float %a, %b
238 %r50 = fcmp arcp ueq float %a, %b
239 %r51 = fcmp fast ueq float %a, %b
240 %r52 = fcmp nnan ninf ueq float %a, %b
241 %r53 = fcmp une float %a, %b
242 %r54 = fcmp nnan une float %a, %b
243 %r55 = fcmp ninf une float %a, %b
244 %r56 = fcmp nsz une float %a, %b
245 %r57 = fcmp arcp une float %a, %b
246 %r58 = fcmp fast une float %a, %b
247 %r59 = fcmp nnan ninf une float %a, %b
248 %r60 = fcmp ult float %a, %b
249 %r61 = fcmp nnan ult float %a, %b
250 %r62 = fcmp ninf ult float %a, %b
251 %r63 = fcmp nsz ult float %a, %b
252 %r64 = fcmp arcp ult float %a, %b
253 %r65 = fcmp fast ult float %a, %b
254 %r66 = fcmp nnan ninf ult float %a, %b
255 %r67 = fcmp ugt float %a, %b
256 %r68 = fcmp nnan ugt float %a, %b
257 %r69 = fcmp ninf ugt float %a, %b
258 %r70 = fcmp nsz ugt float %a, %b
259 %r71 = fcmp arcp ugt float %a, %b
260 %r72 = fcmp fast ugt float %a, %b
261 %r73 = fcmp nnan ninf ugt float %a, %b
262 %r74 = fcmp ule float %a, %b
263 %r75 = fcmp nnan ule float %a, %b
264 %r76 = fcmp ninf ule float %a, %b
265 %r77 = fcmp nsz ule float %a, %b
266 %r78 = fcmp arcp ule float %a, %b
267 %r79 = fcmp fast ule float %a, %b
268 %r80 = fcmp nnan ninf ule float %a, %b
269 %r81 = fcmp uge float %a, %b
270 %r82 = fcmp nnan uge float %a, %b
271 %r83 = fcmp ninf uge float %a, %b
272 %r84 = fcmp nsz uge float %a, %b
273 %r85 = fcmp arcp uge float %a, %b
274 %r86 = fcmp fast uge float %a, %b
275 %r87 = fcmp nnan ninf uge float %a, %b
276 %r88 = fcmp uno float %a, %b
277 %r89 = fcmp ninf uno float %a, %b
278 %r90 = fcmp nsz uno float %a, %b