xref: /llvm-project/mlir/test/Dialect/Arith/ops.mlir (revision 8827ff92b96d78ef455157574061d745df2909af)
1// RUN: mlir-opt %s | mlir-opt | FileCheck %s
2// RUN: mlir-opt %s --mlir-print-op-generic | mlir-opt | FileCheck %s
3
4// CHECK-LABEL: test_addi
5func.func @test_addi(%arg0 : i64, %arg1 : i64) -> i64 {
6  %0 = arith.addi %arg0, %arg1 : i64
7  return %0 : i64
8}
9
10// CHECK-LABEL: test_addi_tensor
11func.func @test_addi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
12  %0 = arith.addi %arg0, %arg1 : tensor<8x8xi64>
13  return %0 : tensor<8x8xi64>
14}
15
16// CHECK-LABEL: test_addi_vector
17func.func @test_addi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
18  %0 = arith.addi %arg0, %arg1 : vector<8xi64>
19  return %0 : vector<8xi64>
20}
21
22// CHECK-LABEL: test_addi_scalable_vector
23func.func @test_addi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
24  %0 = arith.addi %arg0, %arg1 : vector<[8]xi64>
25  return %0 : vector<[8]xi64>
26}
27
28// CHECK-LABEL: test_addui_extended
29func.func @test_addui_extended(%arg0 : i64, %arg1 : i64) -> i64 {
30  %sum, %overflow = arith.addui_extended %arg0, %arg1 : i64, i1
31  return %sum : i64
32}
33
34// CHECK-LABEL: test_addui_extended_tensor
35func.func @test_addui_extended_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
36  %sum, %overflow = arith.addui_extended %arg0, %arg1 : tensor<8x8xi64>, tensor<8x8xi1>
37  return %sum : tensor<8x8xi64>
38}
39
40// CHECK-LABEL: test_addui_extended_vector
41func.func @test_addui_extended_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
42  %0:2 = arith.addui_extended %arg0, %arg1 : vector<8xi64>, vector<8xi1>
43  return %0#0 : vector<8xi64>
44}
45
46// CHECK-LABEL: test_addui_extended_scalable_vector
47func.func @test_addui_extended_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
48  %0:2 = arith.addui_extended %arg0, %arg1 : vector<[8]xi64>, vector<[8]xi1>
49  return %0#0 : vector<[8]xi64>
50}
51
52// CHECK-LABEL: test_subi
53func.func @test_subi(%arg0 : i64, %arg1 : i64) -> i64 {
54  %0 = arith.subi %arg0, %arg1 : i64
55  return %0 : i64
56}
57
58// CHECK-LABEL: test_subi_tensor
59func.func @test_subi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
60  %0 = arith.subi %arg0, %arg1 : tensor<8x8xi64>
61  return %0 : tensor<8x8xi64>
62}
63
64// CHECK-LABEL: test_subi_vector
65func.func @test_subi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
66  %0 = arith.subi %arg0, %arg1 : vector<8xi64>
67  return %0 : vector<8xi64>
68}
69
70// CHECK-LABEL: test_subi_scalable_vector
71func.func @test_subi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
72  %0 = arith.subi %arg0, %arg1 : vector<[8]xi64>
73  return %0 : vector<[8]xi64>
74}
75
76// CHECK-LABEL: test_muli
77func.func @test_muli(%arg0 : i64, %arg1 : i64) -> i64 {
78  %0 = arith.muli %arg0, %arg1 : i64
79  return %0 : i64
80}
81
82// CHECK-LABEL: test_muli_tensor
83func.func @test_muli_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
84  %0 = arith.muli %arg0, %arg1 : tensor<8x8xi64>
85  return %0 : tensor<8x8xi64>
86}
87
88// CHECK-LABEL: test_muli_vector
89func.func @test_muli_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
90  %0 = arith.muli %arg0, %arg1 : vector<8xi64>
91  return %0 : vector<8xi64>
92}
93
94// CHECK-LABEL: test_muli_scalable_vector
95func.func @test_muli_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
96  %0 = arith.muli %arg0, %arg1 : vector<[8]xi64>
97  return %0 : vector<[8]xi64>
98}
99
100// CHECK-LABEL: test_mulsi_extended
101func.func @test_mulsi_extended(%arg0 : i32, %arg1 : i32) -> i32 {
102  %low, %high = arith.mulsi_extended %arg0, %arg1 : i32
103  return %high : i32
104}
105
106// CHECK-LABEL: test_mulsi_extended_tensor
107func.func @test_mulsi_extended_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
108  %low, %high = arith.mulsi_extended %arg0, %arg1 : tensor<8x8xi64>
109  return %high : tensor<8x8xi64>
110}
111
112// CHECK-LABEL: test_mulsi_extended_vector
113func.func @test_mulsi_extended_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
114  %0:2 = arith.mulsi_extended %arg0, %arg1 : vector<8xi64>
115  return %0#0 : vector<8xi64>
116}
117
118// CHECK-LABEL: test_mulsi_extended_scalable_vector
119func.func @test_mulsi_extended_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
120  %0:2 = arith.mulsi_extended %arg0, %arg1 : vector<[8]xi64>
121  return %0#1 : vector<[8]xi64>
122}
123
124// CHECK-LABEL: test_mului_extended
125func.func @test_mului_extended(%arg0 : i32, %arg1 : i32) -> i32 {
126  %low, %high = arith.mului_extended %arg0, %arg1 : i32
127  return %high : i32
128}
129
130// CHECK-LABEL: test_mului_extended_tensor
131func.func @test_mului_extended_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
132  %low, %high = arith.mului_extended %arg0, %arg1 : tensor<8x8xi64>
133  return %high : tensor<8x8xi64>
134}
135
136// CHECK-LABEL: test_mului_extended_vector
137func.func @test_mului_extended_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
138  %0:2 = arith.mului_extended %arg0, %arg1 : vector<8xi64>
139  return %0#0 : vector<8xi64>
140}
141
142// CHECK-LABEL: test_mului_extended_scalable_vector
143func.func @test_mului_extended_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
144  %0:2 = arith.mului_extended %arg0, %arg1 : vector<[8]xi64>
145  return %0#1 : vector<[8]xi64>
146}
147
148// CHECK-LABEL: test_divui
149func.func @test_divui(%arg0 : i64, %arg1 : i64) -> i64 {
150  %0 = arith.divui %arg0, %arg1 : i64
151  return %0 : i64
152}
153
154// CHECK-LABEL: test_divui_tensor
155func.func @test_divui_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
156  %0 = arith.divui %arg0, %arg1 : tensor<8x8xi64>
157  return %0 : tensor<8x8xi64>
158}
159
160// CHECK-LABEL: test_divui_vector
161func.func @test_divui_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
162  %0 = arith.divui %arg0, %arg1 : vector<8xi64>
163  return %0 : vector<8xi64>
164}
165
166// CHECK-LABEL: test_divui_scalable_vector
167func.func @test_divui_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
168  %0 = arith.divui %arg0, %arg1 : vector<[8]xi64>
169  return %0 : vector<[8]xi64>
170}
171
172// CHECK-LABEL: test_divsi
173func.func @test_divsi(%arg0 : i64, %arg1 : i64) -> i64 {
174  %0 = arith.divsi %arg0, %arg1 : i64
175  return %0 : i64
176}
177
178// CHECK-LABEL: test_divsi_tensor
179func.func @test_divsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
180  %0 = arith.divsi %arg0, %arg1 : tensor<8x8xi64>
181  return %0 : tensor<8x8xi64>
182}
183
184// CHECK-LABEL: test_divsi_vector
185func.func @test_divsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
186  %0 = arith.divsi %arg0, %arg1 : vector<8xi64>
187  return %0 : vector<8xi64>
188}
189
190// CHECK-LABEL: test_divsi_scalable_vector
191func.func @test_divsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
192  %0 = arith.divsi %arg0, %arg1 : vector<[8]xi64>
193  return %0 : vector<[8]xi64>
194}
195
196// CHECK-LABEL: test_remui
197func.func @test_remui(%arg0 : i64, %arg1 : i64) -> i64 {
198  %0 = arith.remui %arg0, %arg1 : i64
199  return %0 : i64
200}
201
202// CHECK-LABEL: test_remui_tensor
203func.func @test_remui_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
204  %0 = arith.remui %arg0, %arg1 : tensor<8x8xi64>
205  return %0 : tensor<8x8xi64>
206}
207
208// CHECK-LABEL: test_remui_vector
209func.func @test_remui_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
210  %0 = arith.remui %arg0, %arg1 : vector<8xi64>
211  return %0 : vector<8xi64>
212}
213
214// CHECK-LABEL: test_remui_scalable_vector
215func.func @test_remui_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
216  %0 = arith.remui %arg0, %arg1 : vector<[8]xi64>
217  return %0 : vector<[8]xi64>
218}
219
220// CHECK-LABEL: test_remsi
221func.func @test_remsi(%arg0 : i64, %arg1 : i64) -> i64 {
222  %0 = arith.remsi %arg0, %arg1 : i64
223  return %0 : i64
224}
225
226// CHECK-LABEL: test_remsi_tensor
227func.func @test_remsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
228  %0 = arith.remsi %arg0, %arg1 : tensor<8x8xi64>
229  return %0 : tensor<8x8xi64>
230}
231
232// CHECK-LABEL: test_remsi_vector
233func.func @test_remsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
234  %0 = arith.remsi %arg0, %arg1 : vector<8xi64>
235  return %0 : vector<8xi64>
236}
237
238// CHECK-LABEL: test_remsi_scalable_vector
239func.func @test_remsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
240  %0 = arith.remsi %arg0, %arg1 : vector<[8]xi64>
241  return %0 : vector<[8]xi64>
242}
243
244// CHECK-LABEL: test_andi
245func.func @test_andi(%arg0 : i64, %arg1 : i64) -> i64 {
246  %0 = arith.andi %arg0, %arg1 : i64
247  return %0 : i64
248}
249
250// CHECK-LABEL: test_andi_tensor
251func.func @test_andi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
252  %0 = arith.andi %arg0, %arg1 : tensor<8x8xi64>
253  return %0 : tensor<8x8xi64>
254}
255
256// CHECK-LABEL: test_andi_vector
257func.func @test_andi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
258  %0 = arith.andi %arg0, %arg1 : vector<8xi64>
259  return %0 : vector<8xi64>
260}
261
262// CHECK-LABEL: test_andi_scalable_vector
263func.func @test_andi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
264  %0 = arith.andi %arg0, %arg1 : vector<[8]xi64>
265  return %0 : vector<[8]xi64>
266}
267
268// CHECK-LABEL: test_ori
269func.func @test_ori(%arg0 : i64, %arg1 : i64) -> i64 {
270  %0 = arith.ori %arg0, %arg1 : i64
271  return %0 : i64
272}
273
274// CHECK-LABEL: test_ori_tensor
275func.func @test_ori_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
276  %0 = arith.ori %arg0, %arg1 : tensor<8x8xi64>
277  return %0 : tensor<8x8xi64>
278}
279
280// CHECK-LABEL: test_ori_vector
281func.func @test_ori_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
282  %0 = arith.ori %arg0, %arg1 : vector<8xi64>
283  return %0 : vector<8xi64>
284}
285
286// CHECK-LABEL: test_ori_scalable_vector
287func.func @test_ori_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
288  %0 = arith.ori %arg0, %arg1 : vector<[8]xi64>
289  return %0 : vector<[8]xi64>
290}
291
292// CHECK-LABEL: test_xori
293func.func @test_xori(%arg0 : i64, %arg1 : i64) -> i64 {
294  %0 = arith.xori %arg0, %arg1 : i64
295  return %0 : i64
296}
297
298// CHECK-LABEL: test_xori_tensor
299func.func @test_xori_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
300  %0 = arith.xori %arg0, %arg1 : tensor<8x8xi64>
301  return %0 : tensor<8x8xi64>
302}
303
304// CHECK-LABEL: test_xori_vector
305func.func @test_xori_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
306  %0 = arith.xori %arg0, %arg1 : vector<8xi64>
307  return %0 : vector<8xi64>
308}
309
310// CHECK-LABEL: test_xori_scalable_vector
311func.func @test_xori_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
312  %0 = arith.xori %arg0, %arg1 : vector<[8]xi64>
313  return %0 : vector<[8]xi64>
314}
315
316// CHECK-LABEL: test_ceildivsi
317func.func @test_ceildivsi(%arg0 : i64, %arg1 : i64) -> i64 {
318  %0 = arith.ceildivsi %arg0, %arg1 : i64
319  return %0 : i64
320}
321
322// CHECK-LABEL: test_ceildivsi_tensor
323func.func @test_ceildivsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
324  %0 = arith.ceildivsi %arg0, %arg1 : tensor<8x8xi64>
325  return %0 : tensor<8x8xi64>
326}
327
328// CHECK-LABEL: test_ceildivsi_vector
329func.func @test_ceildivsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
330  %0 = arith.ceildivsi %arg0, %arg1 : vector<8xi64>
331  return %0 : vector<8xi64>
332}
333
334// CHECK-LABEL: test_ceildivsi_scalable_vector
335func.func @test_ceildivsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
336  %0 = arith.ceildivsi %arg0, %arg1 : vector<[8]xi64>
337  return %0 : vector<[8]xi64>
338}
339
340// CHECK-LABEL: test_floordivsi
341func.func @test_floordivsi(%arg0 : i64, %arg1 : i64) -> i64 {
342  %0 = arith.floordivsi %arg0, %arg1 : i64
343  return %0 : i64
344}
345
346// CHECK-LABEL: test_floordivsi_tensor
347func.func @test_floordivsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
348  %0 = arith.floordivsi %arg0, %arg1 : tensor<8x8xi64>
349  return %0 : tensor<8x8xi64>
350}
351
352// CHECK-LABEL: test_floordivsi_vector
353func.func @test_floordivsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
354  %0 = arith.floordivsi %arg0, %arg1 : vector<8xi64>
355  return %0 : vector<8xi64>
356}
357
358// CHECK-LABEL: test_floordivsi_scalable_vector
359func.func @test_floordivsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
360  %0 = arith.floordivsi %arg0, %arg1 : vector<[8]xi64>
361  return %0 : vector<[8]xi64>
362}
363
364// CHECK-LABEL: test_shli
365func.func @test_shli(%arg0 : i64, %arg1 : i64) -> i64 {
366  %0 = arith.shli %arg0, %arg1 : i64
367  return %0 : i64
368}
369
370// CHECK-LABEL: test_shli_tensor
371func.func @test_shli_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
372  %0 = arith.shli %arg0, %arg1 : tensor<8x8xi64>
373  return %0 : tensor<8x8xi64>
374}
375
376// CHECK-LABEL: test_shli_vector
377func.func @test_shli_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
378  %0 = arith.shli %arg0, %arg1 : vector<8xi64>
379  return %0 : vector<8xi64>
380}
381
382// CHECK-LABEL: test_shli_scalable_vector
383func.func @test_shli_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
384  %0 = arith.shli %arg0, %arg1 : vector<[8]xi64>
385  return %0 : vector<[8]xi64>
386}
387
388// CHECK-LABEL: test_shrui
389func.func @test_shrui(%arg0 : i64, %arg1 : i64) -> i64 {
390  %0 = arith.shrui %arg0, %arg1 : i64
391  return %0 : i64
392}
393
394// CHECK-LABEL: test_shrui_tensor
395func.func @test_shrui_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
396  %0 = arith.shrui %arg0, %arg1 : tensor<8x8xi64>
397  return %0 : tensor<8x8xi64>
398}
399
400// CHECK-LABEL: test_shrui_vector
401func.func @test_shrui_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
402  %0 = arith.shrui %arg0, %arg1 : vector<8xi64>
403  return %0 : vector<8xi64>
404}
405
406// CHECK-LABEL: test_shrui_scalable_vector
407func.func @test_shrui_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
408  %0 = arith.shrui %arg0, %arg1 : vector<[8]xi64>
409  return %0 : vector<[8]xi64>
410}
411
412// CHECK-LABEL: test_shrsi
413func.func @test_shrsi(%arg0 : i64, %arg1 : i64) -> i64 {
414  %0 = arith.shrsi %arg0, %arg1 : i64
415  return %0 : i64
416}
417
418// CHECK-LABEL: test_shrsi_tensor
419func.func @test_shrsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
420  %0 = arith.shrsi %arg0, %arg1 : tensor<8x8xi64>
421  return %0 : tensor<8x8xi64>
422}
423
424// CHECK-LABEL: test_shrsi_vector
425func.func @test_shrsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
426  %0 = arith.shrsi %arg0, %arg1 : vector<8xi64>
427  return %0 : vector<8xi64>
428}
429
430// CHECK-LABEL: test_shrsi_scalable_vector
431func.func @test_shrsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
432  %0 = arith.shrsi %arg0, %arg1 : vector<[8]xi64>
433  return %0 : vector<[8]xi64>
434}
435
436// CHECK-LABEL: test_negf
437func.func @test_negf(%arg0 : f64) -> f64 {
438  %0 = arith.negf %arg0 : f64
439  return %0 : f64
440}
441
442// CHECK-LABEL: test_negf_tensor
443func.func @test_negf_tensor(%arg0 : tensor<8x8xf64>) -> tensor<8x8xf64> {
444  %0 = arith.negf %arg0 : tensor<8x8xf64>
445  return %0 : tensor<8x8xf64>
446}
447
448// CHECK-LABEL: test_negf_vector
449func.func @test_negf_vector(%arg0 : vector<8xf64>) -> vector<8xf64> {
450  %0 = arith.negf %arg0 : vector<8xf64>
451  return %0 : vector<8xf64>
452}
453
454// CHECK-LABEL: test_negf_scalable_vector
455func.func @test_negf_scalable_vector(%arg0 : vector<[8]xf64>) -> vector<[8]xf64> {
456  %0 = arith.negf %arg0 : vector<[8]xf64>
457  return %0 : vector<[8]xf64>
458}
459
460// CHECK-LABEL: test_addf
461func.func @test_addf(%arg0 : f64, %arg1 : f64) -> f64 {
462  %0 = arith.addf %arg0, %arg1 : f64
463  return %0 : f64
464}
465
466// CHECK-LABEL: test_addf_tensor
467func.func @test_addf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
468  %0 = arith.addf %arg0, %arg1 : tensor<8x8xf64>
469  return %0 : tensor<8x8xf64>
470}
471
472// CHECK-LABEL: test_addf_vector
473func.func @test_addf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
474  %0 = arith.addf %arg0, %arg1 : vector<8xf64>
475  return %0 : vector<8xf64>
476}
477
478// CHECK-LABEL: test_addf_scalable_vector
479func.func @test_addf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
480  %0 = arith.addf %arg0, %arg1 : vector<[8]xf64>
481  return %0 : vector<[8]xf64>
482}
483
484// CHECK-LABEL: test_subf
485func.func @test_subf(%arg0 : f64, %arg1 : f64) -> f64 {
486  %0 = arith.subf %arg0, %arg1 : f64
487  return %0 : f64
488}
489
490// CHECK-LABEL: test_subf_tensor
491func.func @test_subf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
492  %0 = arith.subf %arg0, %arg1 : tensor<8x8xf64>
493  return %0 : tensor<8x8xf64>
494}
495
496// CHECK-LABEL: test_subf_vector
497func.func @test_subf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
498  %0 = arith.subf %arg0, %arg1 : vector<8xf64>
499  return %0 : vector<8xf64>
500}
501
502// CHECK-LABEL: test_subf_scalable_vector
503func.func @test_subf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
504  %0 = arith.subf %arg0, %arg1 : vector<[8]xf64>
505  return %0 : vector<[8]xf64>
506}
507
508// CHECK-LABEL: test_mulf
509func.func @test_mulf(%arg0 : f64, %arg1 : f64) -> f64 {
510  %0 = arith.mulf %arg0, %arg1 : f64
511  return %0 : f64
512}
513
514// CHECK-LABEL: test_mulf_tensor
515func.func @test_mulf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
516  %0 = arith.mulf %arg0, %arg1 : tensor<8x8xf64>
517  return %0 : tensor<8x8xf64>
518}
519
520// CHECK-LABEL: test_mulf_vector
521func.func @test_mulf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
522  %0 = arith.mulf %arg0, %arg1 : vector<8xf64>
523  return %0 : vector<8xf64>
524}
525
526// CHECK-LABEL: test_mulf_scalable_vector
527func.func @test_mulf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
528  %0 = arith.mulf %arg0, %arg1 : vector<[8]xf64>
529  return %0 : vector<[8]xf64>
530}
531
532// CHECK-LABEL: test_divf
533func.func @test_divf(%arg0 : f64, %arg1 : f64) -> f64 {
534  %0 = arith.divf %arg0, %arg1 : f64
535  return %0 : f64
536}
537
538// CHECK-LABEL: test_divf_tensor
539func.func @test_divf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
540  %0 = arith.divf %arg0, %arg1 : tensor<8x8xf64>
541  return %0 : tensor<8x8xf64>
542}
543
544// CHECK-LABEL: test_divf_vector
545func.func @test_divf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
546  %0 = arith.divf %arg0, %arg1 : vector<8xf64>
547  return %0 : vector<8xf64>
548}
549
550// CHECK-LABEL: test_divf_scalable_vector
551func.func @test_divf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
552  %0 = arith.divf %arg0, %arg1 : vector<[8]xf64>
553  return %0 : vector<[8]xf64>
554}
555
556// CHECK-LABEL: test_remf
557func.func @test_remf(%arg0 : f64, %arg1 : f64) -> f64 {
558  %0 = arith.remf %arg0, %arg1 : f64
559  return %0 : f64
560}
561
562// CHECK-LABEL: test_remf_tensor
563func.func @test_remf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
564  %0 = arith.remf %arg0, %arg1 : tensor<8x8xf64>
565  return %0 : tensor<8x8xf64>
566}
567
568// CHECK-LABEL: test_remf_vector
569func.func @test_remf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
570  %0 = arith.remf %arg0, %arg1 : vector<8xf64>
571  return %0 : vector<8xf64>
572}
573
574// CHECK-LABEL: test_remf_scalable_vector
575func.func @test_remf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
576  %0 = arith.remf %arg0, %arg1 : vector<[8]xf64>
577  return %0 : vector<[8]xf64>
578}
579
580// CHECK-LABEL: test_extui
581func.func @test_extui(%arg0 : i32) -> i64 {
582  %0 = arith.extui %arg0 : i32 to i64
583  return %0 : i64
584}
585
586// CHECK-LABEL: test_extui_tensor
587func.func @test_extui_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xi64> {
588  %0 = arith.extui %arg0 : tensor<8x8xi32> to tensor<8x8xi64>
589  return %0 : tensor<8x8xi64>
590}
591
592// CHECK-LABEL: test_extui_vector
593func.func @test_extui_vector(%arg0 : vector<8xi32>) -> vector<8xi64> {
594  %0 = arith.extui %arg0 : vector<8xi32> to vector<8xi64>
595  return %0 : vector<8xi64>
596}
597
598// CHECK-LABEL: test_extui_scalable_vector
599func.func @test_extui_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xi64> {
600  %0 = arith.extui %arg0 : vector<[8]xi32> to vector<[8]xi64>
601  return %0 : vector<[8]xi64>
602}
603
604// CHECK-LABEL: test_extsi
605func.func @test_extsi(%arg0 : i32) -> i64 {
606  %0 = arith.extsi %arg0 : i32 to i64
607  return %0 : i64
608}
609
610// CHECK-LABEL: test_extsi_tensor
611func.func @test_extsi_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xi64> {
612  %0 = arith.extsi %arg0 : tensor<8x8xi32> to tensor<8x8xi64>
613  return %0 : tensor<8x8xi64>
614}
615
616// CHECK-LABEL: test_extsi_vector
617func.func @test_extsi_vector(%arg0 : vector<8xi32>) -> vector<8xi64> {
618  %0 = arith.extsi %arg0 : vector<8xi32> to vector<8xi64>
619  return %0 : vector<8xi64>
620}
621
622// CHECK-LABEL: test_extsi_scalable_vector
623func.func @test_extsi_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xi64> {
624  %0 = arith.extsi %arg0 : vector<[8]xi32> to vector<[8]xi64>
625  return %0 : vector<[8]xi64>
626}
627
628// CHECK-LABEL: test_extf
629func.func @test_extf(%arg0 : f32) -> f64 {
630  %0 = arith.extf %arg0 : f32 to f64
631  return %0 : f64
632}
633
634// CHECK-LABEL: test_extf_tensor
635func.func @test_extf_tensor(%arg0 : tensor<8x8xf32>) -> tensor<8x8xf64> {
636  %0 = arith.extf %arg0 : tensor<8x8xf32> to tensor<8x8xf64>
637  return %0 : tensor<8x8xf64>
638}
639
640// CHECK-LABEL: test_extf_tensor_encoding
641func.func @test_extf_tensor_encoding(%arg0 : tensor<8x8xf32, "foo">) -> tensor<8x8xf64, "foo"> {
642  %0 = arith.extf %arg0 : tensor<8x8xf32, "foo"> to tensor<8x8xf64, "foo">
643  return %0 : tensor<8x8xf64, "foo">
644}
645
646// CHECK-LABEL: test_extf_vector
647func.func @test_extf_vector(%arg0 : vector<8xf32>) -> vector<8xf64> {
648  %0 = arith.extf %arg0 : vector<8xf32> to vector<8xf64>
649  return %0 : vector<8xf64>
650}
651
652// CHECK-LABEL: test_extf_scalable_vector
653func.func @test_extf_scalable_vector(%arg0 : vector<[8]xf32>) -> vector<[8]xf64> {
654  %0 = arith.extf %arg0 : vector<[8]xf32> to vector<[8]xf64>
655  return %0 : vector<[8]xf64>
656}
657
658// CHECK-LABEL: test_trunci
659func.func @test_trunci(%arg0 : i32) -> i16 {
660  %0 = arith.trunci %arg0 : i32 to i16
661  return %0 : i16
662}
663
664// CHECK-LABEL: test_trunci_tensor
665func.func @test_trunci_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xi16> {
666  %0 = arith.trunci %arg0 : tensor<8x8xi32> to tensor<8x8xi16>
667  return %0 : tensor<8x8xi16>
668}
669
670// CHECK-LABEL: test_trunci_vector
671func.func @test_trunci_vector(%arg0 : vector<8xi32>) -> vector<8xi16> {
672  %0 = arith.trunci %arg0 : vector<8xi32> to vector<8xi16>
673  return %0 : vector<8xi16>
674}
675
676// CHECK-LABEL: test_trunci_scalable_vector
677func.func @test_trunci_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xi16> {
678  %0 = arith.trunci %arg0 : vector<[8]xi32> to vector<[8]xi16>
679  return %0 : vector<[8]xi16>
680}
681
682// CHECK-LABEL: test_truncf
683func.func @test_truncf(%arg0 : f32) -> bf16 {
684  %0 = arith.truncf %arg0 : f32 to bf16
685  return %0 : bf16
686}
687
688// CHECK-LABEL: test_truncf_tensor
689func.func @test_truncf_tensor(%arg0 : tensor<8x8xf32>) -> tensor<8x8xbf16> {
690  %0 = arith.truncf %arg0 : tensor<8x8xf32> to tensor<8x8xbf16>
691  return %0 : tensor<8x8xbf16>
692}
693
694// CHECK-LABEL: test_truncf_vector
695func.func @test_truncf_vector(%arg0 : vector<8xf32>) -> vector<8xbf16> {
696  %0 = arith.truncf %arg0 : vector<8xf32> to vector<8xbf16>
697  return %0 : vector<8xbf16>
698}
699
700// CHECK-LABEL: test_truncf_scalable_vector
701func.func @test_truncf_scalable_vector(%arg0 : vector<[8]xf32>) -> vector<[8]xbf16> {
702  %0 = arith.truncf %arg0 : vector<[8]xf32> to vector<[8]xbf16>
703  return %0 : vector<[8]xbf16>
704}
705
706// CHECK-LABEL: test_truncf_rounding_mode
707func.func @test_truncf_rounding_mode(%arg0 : f64) -> (f32, f32, f32, f32, f32) {
708  %0 = arith.truncf %arg0 to_nearest_even : f64 to f32
709  %1 = arith.truncf %arg0 downward : f64 to f32
710  %2 = arith.truncf %arg0 upward : f64 to f32
711  %3 = arith.truncf %arg0 toward_zero : f64 to f32
712  %4 = arith.truncf %arg0 to_nearest_away : f64 to f32
713  return %0, %1, %2, %3, %4 : f32, f32, f32, f32, f32
714}
715
716// CHECK-LABEL: test_uitofp
717func.func @test_uitofp(%arg0 : i32) -> f32 {
718  %0 = arith.uitofp %arg0 : i32 to f32
719 return %0 : f32
720}
721
722// CHECK-LABEL: test_uitofp_tensor
723func.func @test_uitofp_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xf32> {
724  %0 = arith.uitofp %arg0 : tensor<8x8xi32> to tensor<8x8xf32>
725  return %0 : tensor<8x8xf32>
726}
727
728// CHECK-LABEL: test_uitofp_vector
729func.func @test_uitofp_vector(%arg0 : vector<8xi32>) -> vector<8xf32> {
730  %0 = arith.uitofp %arg0 : vector<8xi32> to vector<8xf32>
731  return %0 : vector<8xf32>
732}
733
734// CHECK-LABEL: test_uitofp_scalable_vector
735func.func @test_uitofp_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xf32> {
736  %0 = arith.uitofp %arg0 : vector<[8]xi32> to vector<[8]xf32>
737  return %0 : vector<[8]xf32>
738}
739
740// CHECK-LABEL: test_sitofp
741func.func @test_sitofp(%arg0 : i16) -> f64 {
742  %0 = arith.sitofp %arg0 : i16 to f64
743  return %0 : f64
744}
745
746// CHECK-LABEL: test_sitofp_tensor
747func.func @test_sitofp_tensor(%arg0 : tensor<8x8xi16>) -> tensor<8x8xf64> {
748  %0 = arith.sitofp %arg0 : tensor<8x8xi16> to tensor<8x8xf64>
749  return %0 : tensor<8x8xf64>
750}
751
752// CHECK-LABEL: test_sitofp_vector
753func.func @test_sitofp_vector(%arg0 : vector<8xi16>) -> vector<8xf64> {
754  %0 = arith.sitofp %arg0 : vector<8xi16> to vector<8xf64>
755  return %0 : vector<8xf64>
756}
757
758// CHECK-LABEL: test_sitofp_scalable_vector
759func.func @test_sitofp_scalable_vector(%arg0 : vector<[8]xi16>) -> vector<[8]xf64> {
760  %0 = arith.sitofp %arg0 : vector<[8]xi16> to vector<[8]xf64>
761  return %0 : vector<[8]xf64>
762}
763
764// CHECK-LABEL: test_fptoui
765func.func @test_fptoui(%arg0 : bf16) -> i8 {
766  %0 = arith.fptoui %arg0 : bf16 to i8
767  return %0 : i8
768}
769
770// CHECK-LABEL: test_fptoui_tensor
771func.func @test_fptoui_tensor(%arg0 : tensor<8x8xbf16>) -> tensor<8x8xi8> {
772  %0 = arith.fptoui %arg0 : tensor<8x8xbf16> to tensor<8x8xi8>
773  return %0 : tensor<8x8xi8>
774}
775
776// CHECK-LABEL: test_fptoui_vector
777func.func @test_fptoui_vector(%arg0 : vector<8xbf16>) -> vector<8xi8> {
778  %0 = arith.fptoui %arg0 : vector<8xbf16> to vector<8xi8>
779 return %0 : vector<8xi8>
780}
781
782// CHECK-LABEL: test_fptoui_scalable_vector
783func.func @test_fptoui_scalable_vector(%arg0 : vector<[8]xbf16>) -> vector<[8]xi8> {
784  %0 = arith.fptoui %arg0 : vector<[8]xbf16> to vector<[8]xi8>
785  return %0 : vector<[8]xi8>
786}
787
788// CHECK-LABEL: test_fptosi
789func.func @test_fptosi(%arg0 : f64) -> i64 {
790  %0 = arith.fptosi %arg0 : f64 to i64
791  return %0 : i64
792}
793
794// CHECK-LABEL: test_fptosi_tensor
795func.func @test_fptosi_tensor(%arg0 : tensor<8x8xf64>) -> tensor<8x8xi64> {
796  %0 = arith.fptosi %arg0 : tensor<8x8xf64> to tensor<8x8xi64>
797  return %0 : tensor<8x8xi64>
798}
799
800// CHECK-LABEL: test_fptosi_vector
801func.func @test_fptosi_vector(%arg0 : vector<8xf64>) -> vector<8xi64> {
802  %0 = arith.fptosi %arg0 : vector<8xf64> to vector<8xi64>
803 return %0 : vector<8xi64>
804}
805
806// CHECK-LABEL: test_fptosi_scalable_vector
807func.func @test_fptosi_scalable_vector(%arg0 : vector<[8]xf64>) -> vector<[8]xi64> {
808  %0 = arith.fptosi %arg0 : vector<[8]xf64> to vector<[8]xi64>
809  return %0 : vector<[8]xi64>
810}
811
812// CHECK-LABEL: test_index_cast0
813func.func @test_index_cast0(%arg0 : i32) -> index {
814  %0 = arith.index_cast %arg0 : i32 to index
815  return %0 : index
816}
817
818// CHECK-LABEL: test_index_cast_tensor0
819func.func @test_index_cast_tensor0(%arg0 : tensor<8x8xi32>) -> tensor<8x8xindex> {
820  %0 = arith.index_cast %arg0 : tensor<8x8xi32> to tensor<8x8xindex>
821  return %0 : tensor<8x8xindex>
822}
823
824// CHECK-LABEL: test_index_cast_vector0
825func.func @test_index_cast_vector0(%arg0 : vector<8xi32>) -> vector<8xindex> {
826  %0 = arith.index_cast %arg0 : vector<8xi32> to vector<8xindex>
827  return %0 : vector<8xindex>
828}
829
830// CHECK-LABEL: test_index_cast_scalable_vector0
831func.func @test_index_cast_scalable_vector0(%arg0 : vector<[8]xi32>) -> vector<[8]xindex> {
832  %0 = arith.index_cast %arg0 : vector<[8]xi32> to vector<[8]xindex>
833  return %0 : vector<[8]xindex>
834}
835
836// CHECK-LABEL: test_index_cast1
837func.func @test_index_cast1(%arg0 : index) -> i64 {
838  %0 = arith.index_cast %arg0 : index to i64
839  return %0 : i64
840}
841
842// CHECK-LABEL: test_index_cast_tensor1
843func.func @test_index_cast_tensor1(%arg0 : tensor<8x8xindex>) -> tensor<8x8xi64> {
844  %0 = arith.index_cast %arg0 : tensor<8x8xindex> to tensor<8x8xi64>
845  return %0 : tensor<8x8xi64>
846}
847
848// CHECK-LABEL: test_index_cast_vector1
849func.func @test_index_cast_vector1(%arg0 : vector<8xindex>) -> vector<8xi64> {
850  %0 = arith.index_cast %arg0 : vector<8xindex> to vector<8xi64>
851  return %0 : vector<8xi64>
852}
853
854// CHECK-LABEL: test_index_cast_scalable_vector1
855func.func @test_index_cast_scalable_vector1(%arg0 : vector<[8]xindex>) -> vector<[8]xi64> {
856  %0 = arith.index_cast %arg0 : vector<[8]xindex> to vector<[8]xi64>
857  return %0 : vector<[8]xi64>
858}
859
860
861// CHECK-LABEL: test_index_castui0
862func.func @test_index_castui0(%arg0 : i32) -> index {
863  %0 = arith.index_castui %arg0 : i32 to index
864  return %0 : index
865}
866
867// CHECK-LABEL: test_index_castui_tensor0
868func.func @test_index_castui_tensor0(%arg0 : tensor<8x8xi32>) -> tensor<8x8xindex> {
869  %0 = arith.index_castui %arg0 : tensor<8x8xi32> to tensor<8x8xindex>
870  return %0 : tensor<8x8xindex>
871}
872
873// CHECK-LABEL: test_index_castui_vector0
874func.func @test_index_castui_vector0(%arg0 : vector<8xi32>) -> vector<8xindex> {
875  %0 = arith.index_castui %arg0 : vector<8xi32> to vector<8xindex>
876  return %0 : vector<8xindex>
877}
878
879// CHECK-LABEL: test_index_castui_scalable_vector0
880func.func @test_index_castui_scalable_vector0(%arg0 : vector<[8]xi32>) -> vector<[8]xindex> {
881  %0 = arith.index_castui %arg0 : vector<[8]xi32> to vector<[8]xindex>
882  return %0 : vector<[8]xindex>
883}
884
885// CHECK-LABEL: test_indexui_cast1
886func.func @test_indexui_cast1(%arg0 : index) -> i64 {
887  %0 = arith.index_castui %arg0 : index to i64
888  return %0 : i64
889}
890
891// CHECK-LABEL: test_index_castui_tensor1
892func.func @test_index_castui_tensor1(%arg0 : tensor<8x8xindex>) -> tensor<8x8xi64> {
893  %0 = arith.index_castui %arg0 : tensor<8x8xindex> to tensor<8x8xi64>
894  return %0 : tensor<8x8xi64>
895}
896
897// CHECK-LABEL: test_index_castui_vector1
898func.func @test_index_castui_vector1(%arg0 : vector<8xindex>) -> vector<8xi64> {
899  %0 = arith.index_castui %arg0 : vector<8xindex> to vector<8xi64>
900  return %0 : vector<8xi64>
901}
902
903// CHECK-LABEL: test_index_castui_scalable_vector1
904func.func @test_index_castui_scalable_vector1(%arg0 : vector<[8]xindex>) -> vector<[8]xi64> {
905  %0 = arith.index_castui %arg0 : vector<[8]xindex> to vector<[8]xi64>
906  return %0 : vector<[8]xi64>
907}
908
909// CHECK-LABEL: test_bitcast0
910func.func @test_bitcast0(%arg0 : i64) -> f64 {
911  %0 = arith.bitcast %arg0 : i64 to f64
912  return %0 : f64
913}
914
915// CHECK-LABEL: test_bitcast_tensor0
916func.func @test_bitcast_tensor0(%arg0 : tensor<8x8xi64>) -> tensor<8x8xf64> {
917  %0 = arith.bitcast %arg0 : tensor<8x8xi64> to tensor<8x8xf64>
918  return %0 : tensor<8x8xf64>
919}
920
921// CHECK-LABEL: test_bitcast_vector0
922func.func @test_bitcast_vector0(%arg0 : vector<8xi64>) -> vector<8xf64> {
923  %0 = arith.bitcast %arg0 : vector<8xi64> to vector<8xf64>
924  return %0 : vector<8xf64>
925}
926
927// CHECK-LABEL: test_bitcast_scalable_vector0
928func.func @test_bitcast_scalable_vector0(%arg0 : vector<[8]xi64>) -> vector<[8]xf64> {
929  %0 = arith.bitcast %arg0 : vector<[8]xi64> to vector<[8]xf64>
930  return %0 : vector<[8]xf64>
931}
932
933// CHECK-LABEL: test_bitcast1
934func.func @test_bitcast1(%arg0 : f32) -> i32 {
935  %0 = arith.bitcast %arg0 : f32 to i32
936  return %0 : i32
937}
938
939// CHECK-LABEL: test_bitcast_tensor1
940func.func @test_bitcast_tensor1(%arg0 : tensor<8x8xf32>) -> tensor<8x8xi32> {
941  %0 = arith.bitcast %arg0 : tensor<8x8xf32> to tensor<8x8xi32>
942  return %0 : tensor<8x8xi32>
943}
944
945// CHECK-LABEL: test_bitcast_vector1
946func.func @test_bitcast_vector1(%arg0 : vector<8xf32>) -> vector<8xi32> {
947  %0 = arith.bitcast %arg0 : vector<8xf32> to vector<8xi32>
948  return %0 : vector<8xi32>
949}
950
951// CHECK-LABEL: test_bitcast_scalable_vector1
952func.func @test_bitcast_scalable_vector1(%arg0 : vector<[8]xf32>) -> vector<[8]xi32> {
953  %0 = arith.bitcast %arg0 : vector<[8]xf32> to vector<[8]xi32>
954  return %0 : vector<[8]xi32>
955}
956
957// CHECK-LABEL: test_cmpi
958func.func @test_cmpi(%arg0 : i64, %arg1 : i64) -> i1 {
959  %0 = arith.cmpi ne, %arg0, %arg1 : i64
960  return %0 : i1
961}
962
963// CHECK-LABEL: test_cmpi_tensor
964func.func @test_cmpi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi1> {
965  %0 = arith.cmpi slt, %arg0, %arg1 : tensor<8x8xi64>
966  return %0 : tensor<8x8xi1>
967}
968
969// CHECK-LABEL: test_cmpi_tensor_encoding
970func.func @test_cmpi_tensor_encoding(%arg0 : tensor<8x8xi64, "foo">, %arg1 : tensor<8x8xi64, "foo">) -> tensor<8x8xi1, "foo"> {
971  %0 = arith.cmpi slt, %arg0, %arg1 : tensor<8x8xi64, "foo">
972  return %0 : tensor<8x8xi1, "foo">
973}
974
975// CHECK-LABEL: test_cmpi_vector
976func.func @test_cmpi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi1> {
977  %0 = arith.cmpi ult, %arg0, %arg1 : vector<8xi64>
978  return %0 : vector<8xi1>
979}
980
981// CHECK-LABEL: test_cmpi_scalable_vector
982func.func @test_cmpi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi1> {
983  %0 = arith.cmpi ult, %arg0, %arg1 : vector<[8]xi64>
984  return %0 : vector<[8]xi1>
985}
986
987// CHECK-LABEL: test_cmpi_vector_0d
988func.func @test_cmpi_vector_0d(%arg0 : vector<i64>, %arg1 : vector<i64>) -> vector<i1> {
989  %0 = arith.cmpi ult, %arg0, %arg1 : vector<i64>
990  return %0 : vector<i1>
991}
992
993// CHECK-LABEL: test_cmpf
994func.func @test_cmpf(%arg0 : f64, %arg1 : f64) -> i1 {
995  %0 = arith.cmpf oeq, %arg0, %arg1 : f64
996  return %0 : i1
997}
998
999// CHECK-LABEL: test_cmpf_tensor
1000func.func @test_cmpf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xi1> {
1001  %0 = arith.cmpf olt, %arg0, %arg1 : tensor<8x8xf64>
1002  return %0 : tensor<8x8xi1>
1003}
1004
1005// CHECK-LABEL: test_cmpf_vector
1006func.func @test_cmpf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xi1> {
1007  %0 = arith.cmpf ult, %arg0, %arg1 : vector<8xf64>
1008  return %0 : vector<8xi1>
1009}
1010
1011// CHECK-LABEL: test_cmpf_scalable_vector
1012func.func @test_cmpf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xi1> {
1013  %0 = arith.cmpf ult, %arg0, %arg1 : vector<[8]xf64>
1014  return %0 : vector<[8]xi1>
1015}
1016
1017// CHECK-LABEL: test_index_cast
1018func.func @test_index_cast(%arg0 : index) -> i64 {
1019  %0 = arith.index_cast %arg0 : index to i64
1020  return %0 : i64
1021}
1022
1023// CHECK-LABEL: test_index_cast_tensor
1024func.func @test_index_cast_tensor(%arg0 : tensor<index>) -> tensor<i64> {
1025  %0 = arith.index_cast %arg0 : tensor<index> to tensor<i64>
1026  return %0 : tensor<i64>
1027}
1028
1029// CHECK-LABEL: test_index_cast_tensor_reverse
1030func.func @test_index_cast_tensor_reverse(%arg0 : tensor<i64>) -> tensor<index> {
1031  %0 = arith.index_cast %arg0 : tensor<i64> to tensor<index>
1032  return %0 : tensor<index>
1033}
1034
1035// CHECK-LABEL: func @bitcast(
1036func.func @bitcast(%arg : f32) -> i32 {
1037  %res = arith.bitcast %arg : f32 to i32
1038  return %res : i32
1039}
1040
1041// CHECK-LABEL: test_constant
1042func.func @test_constant() -> () {
1043  // CHECK: %c42_i32 = arith.constant 42 : i32
1044  %0 = "arith.constant"(){value = 42 : i32} : () -> i32
1045
1046  // CHECK: %c42_i32_0 = arith.constant 42 : i32
1047  %1 = arith.constant 42 : i32
1048
1049  // CHECK: %c43 = arith.constant {crazy = "func.foo"} 43 : index
1050  %2 = arith.constant {crazy = "func.foo"} 43: index
1051
1052  // CHECK: %cst = arith.constant 4.300000e+01 : bf16
1053  %3 = arith.constant 43.0 : bf16
1054
1055  // CHECK: %cst_1 = arith.constant dense<0> : vector<4xi32>
1056  %4 = arith.constant dense<0> : vector<4 x i32>
1057
1058  // CHECK: %cst_2 = arith.constant dense<0> : tensor<42xi32>
1059  %5 = arith.constant dense<0> : tensor<42 x i32>
1060
1061  // CHECK: %cst_3 = arith.constant dense<0> : vector<42xi32>
1062  %6 = arith.constant dense<0> : vector<42 x i32>
1063
1064  // CHECK: %true = arith.constant true
1065  %7 = arith.constant true
1066
1067  // CHECK: %false = arith.constant false
1068  %8 = arith.constant false
1069
1070  // CHECK: %c-1_i128 = arith.constant -1 : i128
1071  %9 = arith.constant 340282366920938463463374607431768211455 : i128
1072
1073  // CHECK: %c85070591730234615865843651857942052864_i128 = arith.constant 85070591730234615865843651857942052864 : i128
1074  %10 = arith.constant 85070591730234615865843651857942052864 : i128
1075
1076  return
1077}
1078
1079// CHECK-LABEL: func @maximum
1080func.func @maximum(%v1: vector<4xf32>, %v2: vector<4xf32>,
1081               %sv1: vector<[4]xf32>, %sv2: vector<[4]xf32>,
1082               %f1: f32, %f2: f32,
1083               %i1: i32, %i2: i32) {
1084  %maximum_vector = arith.maximumf %v1, %v2 : vector<4xf32>
1085  %maximum_scalable_vector = arith.maximumf %sv1, %sv2 : vector<[4]xf32>
1086  %maximum_float = arith.maximumf %f1, %f2 : f32
1087  %maxnum_vector = arith.maxnumf %v1, %v2 : vector<4xf32>
1088  %maxnum_scalable_vector = arith.maxnumf %sv1, %sv2 : vector<[4]xf32>
1089  %maxnum_float = arith.maxnumf %f1, %f2 : f32
1090  %max_signed = arith.maxsi %i1, %i2 : i32
1091  %max_unsigned = arith.maxui %i1, %i2 : i32
1092  return
1093}
1094
1095// CHECK-LABEL: func @minimum
1096func.func @minimum(%v1: vector<4xf32>, %v2: vector<4xf32>,
1097               %sv1: vector<[4]xf32>, %sv2: vector<[4]xf32>,
1098               %f1: f32, %f2: f32,
1099               %i1: i32, %i2: i32) {
1100  %minimum_vector = arith.minimumf %v1, %v2 : vector<4xf32>
1101  %minimum_scalable_vector = arith.minimumf %sv1, %sv2 : vector<[4]xf32>
1102  %minimum_float = arith.minimumf %f1, %f2 : f32
1103  %minnum_vector = arith.minnumf %v1, %v2 : vector<4xf32>
1104  %minnum_scalable_vector = arith.minnumf %sv1, %sv2 : vector<[4]xf32>
1105  %minnum_float = arith.minnumf %f1, %f2 : f32
1106  %min_signed = arith.minsi %i1, %i2 : i32
1107  %min_unsigned = arith.minui %i1, %i2 : i32
1108  return
1109}
1110
1111// CHECK-LABEL: @fastmath
1112func.func @fastmath(%arg0: f32, %arg1: f32, %arg2: i32) {
1113// CHECK: {{.*}} = arith.addf %arg0, %arg1 fastmath<fast> : f32
1114// CHECK: {{.*}} = arith.subf %arg0, %arg1 fastmath<fast> : f32
1115// CHECK: {{.*}} = arith.mulf %arg0, %arg1 fastmath<fast> : f32
1116// CHECK: {{.*}} = arith.divf %arg0, %arg1 fastmath<fast> : f32
1117// CHECK: {{.*}} = arith.remf %arg0, %arg1 fastmath<fast> : f32
1118// CHECK: {{.*}} = arith.negf %arg0 fastmath<fast> : f32
1119  %0 = arith.addf %arg0, %arg1 fastmath<fast> : f32
1120  %1 = arith.subf %arg0, %arg1 fastmath<fast> : f32
1121  %2 = arith.mulf %arg0, %arg1 fastmath<fast> : f32
1122  %3 = arith.divf %arg0, %arg1 fastmath<fast> : f32
1123  %4 = arith.remf %arg0, %arg1 fastmath<fast> : f32
1124  %5 = arith.negf %arg0 fastmath<fast> : f32
1125// CHECK: {{.*}} = arith.addf %arg0, %arg1 : f32
1126  %6 = arith.addf %arg0, %arg1 fastmath<none> : f32
1127// CHECK: {{.*}} = arith.addf %arg0, %arg1 fastmath<nnan,ninf> : f32
1128  %7 = arith.addf %arg0, %arg1 fastmath<nnan,ninf> : f32
1129// CHECK: {{.*}} = arith.mulf %arg0, %arg1 fastmath<fast> : f32
1130  %8 = arith.mulf %arg0, %arg1 fastmath<reassoc,nnan,ninf,nsz,arcp,contract,afn> : f32
1131// CHECK: {{.*}} = arith.cmpf oeq, %arg0, %arg1 fastmath<fast> : f32
1132  %9 = arith.cmpf oeq, %arg0, %arg1 fastmath<fast> : f32
1133
1134  return
1135}
1136
1137// CHECK-LABEL: @select_tensor
1138func.func @select_tensor(%arg0 : tensor<8xi1>, %arg1 : tensor<8xi32>, %arg2 : tensor<8xi32>) -> tensor<8xi32> {
1139  // CHECK: = arith.select %{{.*}}, %{{.*}}, %{{.*}} : tensor<8xi1>, tensor<8xi32>
1140  %0 = arith.select %arg0, %arg1, %arg2 : tensor<8xi1>, tensor<8xi32>
1141  return %0 : tensor<8xi32>
1142}
1143
1144// CHECK-LABEL: @select_tensor_encoding
1145func.func @select_tensor_encoding(
1146  %arg0 : tensor<8xi1, "foo">, %arg1 : tensor<8xi32, "foo">, %arg2 : tensor<8xi32, "foo">) -> tensor<8xi32, "foo"> {
1147  // CHECK: = arith.select %{{.*}}, %{{.*}}, %{{.*}} : tensor<8xi1, "foo">, tensor<8xi32, "foo">
1148  %0 = arith.select %arg0, %arg1, %arg2 : tensor<8xi1, "foo">, tensor<8xi32, "foo">
1149  return %0 : tensor<8xi32, "foo">
1150}
1151
1152// CHECK-LABEL: @intflags_func
1153func.func @intflags_func(%arg0: i64, %arg1: i64) {
1154  // CHECK: %{{.*}} = arith.addi %{{.*}}, %{{.*}} overflow<nsw> : i64
1155  %0 = arith.addi %arg0, %arg1 overflow<nsw> : i64
1156  // CHECK: %{{.*}} = arith.subi %{{.*}}, %{{.*}} overflow<nuw> : i64
1157  %1 = arith.subi %arg0, %arg1 overflow<nuw> : i64
1158  // CHECK: %{{.*}} = arith.muli %{{.*}}, %{{.*}} overflow<nsw, nuw> : i64
1159  %2 = arith.muli %arg0, %arg1 overflow<nsw, nuw> : i64
1160  // CHECK: %{{.*}} = arith.shli %{{.*}}, %{{.*}} overflow<nsw, nuw> : i64
1161  %3 = arith.shli %arg0, %arg1 overflow<nsw, nuw> : i64
1162  return
1163}
1164