[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / RISCV / rv64b-aliases-valid.s
blob97585d32079c0d0f135fd217cee181f5cd637488
1 # RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-b -riscv-no-aliases \
2 # RUN: | FileCheck -check-prefixes=CHECK-S-OBJ-NOALIAS %s
3 # RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-b \
4 # RUN: | FileCheck -check-prefixes=CHECK-S-OBJ %s
5 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+experimental-b < %s \
6 # RUN: | llvm-objdump -d -r -M no-aliases --mattr=+experimental-b - \
7 # RUN: | FileCheck -check-prefixes=CHECK-S-OBJ-NOALIAS %s
8 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+experimental-b < %s \
9 # RUN: | llvm-objdump -d -r --mattr=+experimental-b - \
10 # RUN: | FileCheck -check-prefixes=CHECK-S-OBJ %s
12 # The following check prefixes are used in this test:
13 # CHECK-S-OBJ Match both the .s and objdumped object output with
14 # aliases enabled
15 # CHECK-S-OBJ-NOALIAS Match both the .s and objdumped object output with
16 # aliases disabled
18 # CHECK-S-OBJ-NOALIAS: andi t0, t1, 255
19 # CHECK-S-OBJ: andi t0, t1, 255
20 zext.b x5, x6
22 # CHECK-S-OBJ-NOALIAS: zext.h t0, t1
23 # CHECK-S-OBJ: zext.h t0, t1
24 zext.h x5, x6
26 # CHECK-S-OBJ-NOALIAS: add.uw t0, t1, zero
27 # CHECK-S-OBJ: zext.w t0, t1
28 zext.w x5, x6
30 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 1
31 # CHECK-S-OBJ: rev.p t0, t1
32 rev.p x5, x6
34 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 2
35 # CHECK-S-OBJ: rev2.n t0, t1
36 rev2.n x5, x6
38 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 3
39 # CHECK-S-OBJ: rev.n t0, t1
40 rev.n x5, x6
42 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 4
43 # CHECK-S-OBJ: rev4.b t0, t1
44 rev4.b x5, x6
46 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 6
47 # CHECK-S-OBJ: rev2.b t0, t1
48 rev2.b x5, x6
50 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 7
51 # CHECK-S-OBJ: rev.b t0, t1
52 rev.b x5, x6
54 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 8
55 # CHECK-S-OBJ: rev8.h t0, t1
56 rev8.h x5, x6
58 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 12
59 # CHECK-S-OBJ: rev4.h t0, t1
60 rev4.h x5, x6
62 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 14
63 # CHECK-S-OBJ: rev2.h t0, t1
64 rev2.h x5, x6
66 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 15
67 # CHECK-S-OBJ: rev.h t0, t1
68 rev.h x5, x6
70 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 16
71 # CHECK-S-OBJ: rev16.w t0, t1
72 rev16.w x5, x6
74 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 24
75 # CHECK-S-OBJ: rev8.w t0, t1
76 rev8.w x5, x6
78 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 28
79 # CHECK-S-OBJ: rev4.w t0, t1
80 rev4.w x5, x6
82 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 30
83 # CHECK-S-OBJ: rev2.w t0, t1
84 rev2.w x5, x6
86 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 31
87 # CHECK-S-OBJ: rev.w t0, t1
88 rev.w x5, x6
90 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 32
91 # CHECK-S-OBJ: rev32 t0, t1
92 rev32 x5, x6
94 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 48
95 # CHECK-S-OBJ: rev16 t0, t1
96 rev16 x5, x6
98 # CHECK-S-OBJ-NOALIAS: rev8 t0, t1
99 # CHECK-S-OBJ: rev8 t0, t1
100 rev8 x5, x6
102 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 60
103 # CHECK-S-OBJ: rev4 t0, t1
104 rev4 x5, x6
106 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 62
107 # CHECK-S-OBJ: rev2 t0, t1
108 rev2 x5, x6
110 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 63
111 # CHECK-S-OBJ: rev t0, t1
112 rev x5, x6
114 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 1
115 # CHECK-S-OBJ: zip.n t0, t1
116 zip.n x5, x6
118 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 1
119 # CHECK-S-OBJ: unzip.n t0, t1
120 unzip.n x5, x6
122 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 2
123 # CHECK-S-OBJ: zip2.b t0, t1
124 zip2.b x5, x6
126 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 2
127 # CHECK-S-OBJ: unzip2.b t0, t1
128 unzip2.b x5, x6
130 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 3
131 # CHECK-S-OBJ: zip.b t0, t1
132 zip.b x5, x6
134 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 3
135 # CHECK-S-OBJ: unzip.b t0, t1
136 unzip.b x5, x6
138 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 4
139 # CHECK-S-OBJ: zip4.h t0, t1
140 zip4.h x5, x6
142 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 4
143 # CHECK-S-OBJ: unzip4.h t0, t1
144 unzip4.h x5, x6
146 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 6
147 # CHECK-S-OBJ: zip2.h t0, t1
148 zip2.h x5, x6
150 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 6
151 # CHECK-S-OBJ: unzip2.h t0, t1
152 unzip2.h x5, x6
154 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 7
155 # CHECK-S-OBJ: zip.h t0, t1
156 zip.h x5, x6
158 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 7
159 # CHECK-S-OBJ: unzip.h t0, t1
160 unzip.h x5, x6
162 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 8
163 # CHECK-S-OBJ: zip8.w t0, t1
164 zip8.w x5, x6
166 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 8
167 # CHECK-S-OBJ: unzip8.w t0, t1
168 unzip8.w x5, x6
170 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 12
171 # CHECK-S-OBJ: zip4.w t0, t1
172 zip4.w x5, x6
174 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 12
175 # CHECK-S-OBJ: unzip4.w t0, t1
176 unzip4.w x5, x6
178 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 14
179 # CHECK-S-OBJ: zip2.w t0, t1
180 zip2.w x5, x6
182 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 14
183 # CHECK-S-OBJ: unzip2.w t0, t1
184 unzip2.w x5, x6
186 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 15
187 # CHECK-S-OBJ: zip.w t0, t1
188 zip.w x5, x6
190 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 15
191 # CHECK-S-OBJ: unzip.w t0, t1
192 unzip.w x5, x6
194 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 16
195 # CHECK-S-OBJ: zip16 t0, t1
196 zip16 x5, x6
198 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 16
199 # CHECK-S-OBJ: unzip16 t0, t1
200 unzip16 x5, x6
202 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 24
203 # CHECK-S-OBJ: zip8 t0, t1
204 zip8 x5, x6
206 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 24
207 # CHECK-S-OBJ: unzip8 t0, t1
208 unzip8 x5, x6
210 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 28
211 # CHECK-S-OBJ: zip4 t0, t1
212 zip4 x5, x6
214 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 28
215 # CHECK-S-OBJ: unzip4 t0, t1
216 unzip4 x5, x6
218 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 30
219 # CHECK-S-OBJ: zip2 t0, t1
220 zip2 x5, x6
222 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 30
223 # CHECK-S-OBJ: unzip2 t0, t1
224 unzip2 x5, x6
226 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 31
227 # CHECK-S-OBJ: zip t0, t1
228 zip x5, x6
230 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 31
231 # CHECK-S-OBJ: unzip t0, t1
232 unzip x5, x6
234 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 1
235 # CHECK-S-OBJ: orc.p t0, t1
236 orc.p x5, x6
238 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 2
239 # CHECK-S-OBJ: orc2.n t0, t1
240 orc2.n x5, x6
242 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 3
243 # CHECK-S-OBJ: orc.n t0, t1
244 orc.n x5, x6
246 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 4
247 # CHECK-S-OBJ: orc4.b t0, t1
248 orc4.b x5, x6
250 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 6
251 # CHECK-S-OBJ: orc2.b t0, t1
252 orc2.b x5, x6
254 # CHECK-S-OBJ-NOALIAS: orc.b t0, t1
255 # CHECK-S-OBJ: orc.b t0, t1
256 orc.b x5, x6
258 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 8
259 # CHECK-S-OBJ: orc8.h t0, t1
260 orc8.h x5, x6
262 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 12
263 # CHECK-S-OBJ: orc4.h t0, t1
264 orc4.h x5, x6
266 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 14
267 # CHECK-S-OBJ: orc2.h t0, t1
268 orc2.h x5, x6
270 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 15
271 # CHECK-S-OBJ: orc.h t0, t1
272 orc.h x5, x6
274 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 16
275 # CHECK-S-OBJ: orc16.w t0, t1
276 orc16.w x5, x6
278 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 24
279 # CHECK-S-OBJ: orc8.w t0, t1
280 orc8.w x5, x6
282 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 28
283 # CHECK-S-OBJ: orc4.w t0, t1
284 orc4.w x5, x6
286 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 30
287 # CHECK-S-OBJ: orc2.w t0, t1
288 orc2.w x5, x6
290 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 31
291 # CHECK-S-OBJ: orc.w t0, t1
292 orc.w x5, x6
294 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 32
295 # CHECK-S-OBJ: orc32 t0, t1
296 orc32 x5, x6
298 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 48
299 # CHECK-S-OBJ: orc16 t0, t1
300 orc16 x5, x6
302 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 56
303 # CHECK-S-OBJ: orc8 t0, t1
304 orc8 x5, x6
306 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 60
307 # CHECK-S-OBJ: orc4 t0, t1
308 orc4 x5, x6
310 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 62
311 # CHECK-S-OBJ: orc2 t0, t1
312 orc2 x5, x6
314 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 63
315 # CHECK-S-OBJ: orc t0, t1
316 orc x5, x6
318 # CHECK-S-OBJ-NOALIAS: rori t0, t1, 8
319 # CHECK-S-OBJ: rori t0, t1, 8
320 ror x5, x6, 8
322 # CHECK-S-OBJ-NOALIAS: roriw t0, t1, 8
323 # CHECK-S-OBJ: roriw t0, t1, 8
324 rorw x5, x6, 8
326 # CHECK-S-OBJ-NOALIAS: bseti t0, t1, 8
327 # CHECK-S-OBJ: bseti t0, t1, 8
328 bset x5, x6, 8
330 # CHECK-S-OBJ-NOALIAS: bclri t0, t1, 8
331 # CHECK-S-OBJ: bclri t0, t1, 8
332 bclr x5, x6, 8
334 # CHECK-S-OBJ-NOALIAS: binvi t0, t1, 8
335 # CHECK-S-OBJ: binvi t0, t1, 8
336 binv x5, x6, 8
338 # CHECK-S-OBJ-NOALIAS: bexti t0, t1, 8
339 # CHECK-S-OBJ: bexti t0, t1, 8
340 bext x5, x6, 8
342 # CHECK-S-OBJ-NOALIAS: grevi t0, t1, 13
343 # CHECK-S-OBJ: grevi t0, t1, 13
344 grev x5, x6, 13
346 # CHECK-S-OBJ-NOALIAS: gorci t0, t1, 13
347 # CHECK-S-OBJ: gorci t0, t1, 13
348 gorc x5, x6, 13
350 # CHECK-S-OBJ-NOALIAS: shfli t0, t1, 13
351 # CHECK-S-OBJ: shfli t0, t1, 13
352 shfl x5, x6, 13
354 # CHECK-S-OBJ-NOALIAS: unshfli t0, t1, 13
355 # CHECK-S-OBJ: unshfli t0, t1, 13
356 unshfl x5, x6, 13
358 # CHECK-S-OBJ-NOALIAS: greviw t0, t1, 13
359 # CHECK-S-OBJ: greviw t0, t1, 13
360 grevw x5, x6, 13
362 # CHECK-S-OBJ-NOALIAS: gorciw t0, t1, 13
363 # CHECK-S-OBJ: gorciw t0, t1, 13
364 gorcw x5, x6, 13
366 # CHECK-S-OBJ-NOALIAS: addi t1, zero, -2
367 # CHECK-S-OBJ-NOALIAS-NEXT: add.uw t1, t1, zero
368 # CHECK-S-OBJ: addi t1, zero, -2
369 # CHECK-S-OBJ-NEXT: zext.w t1, t1
370 li x6, 0xfffffffe
372 # CHECK-S-OBJ-NOALIAS: lui t2, 699051
373 # CHECK-S-OBJ-NOALIAS-NEXT: addiw t2, t2, -1366
374 # CHECK-S-OBJ-NOALIAS-NEXT: add.uw t2, t2, zero
375 # CHECK-S-OBJ: lui t2, 699051
376 # CHECK-S-OBJ-NEXT: addiw t2, t2, -1366
377 # CHECK-S-OBJ-NEXT: zext.w t2, t2
378 li x7, 0xaaaaaaaa