1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s --check-prefix=X64
4 define i8 @test_mul_by_1(i8 %x) {
5 ; X64-LABEL: test_mul_by_1:
7 ; X64-NEXT: movl %edi, %eax
8 ; X64-NEXT: # kill: def $al killed $al killed $eax
14 define i8 @test_mul_by_2(i8 %x) {
15 ; X64-LABEL: test_mul_by_2:
17 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
18 ; X64-NEXT: leal (%rdi,%rdi), %eax
19 ; X64-NEXT: # kill: def $al killed $al killed $eax
25 define i8 @test_mul_by_3(i8 %x) {
26 ; X64-LABEL: test_mul_by_3:
28 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
29 ; X64-NEXT: leal (%rdi,%rdi,2), %eax
30 ; X64-NEXT: # kill: def $al killed $al killed $eax
36 define i8 @test_mul_by_4(i8 %x) {
37 ; X64-LABEL: test_mul_by_4:
39 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
40 ; X64-NEXT: leal (,%rdi,4), %eax
41 ; X64-NEXT: # kill: def $al killed $al killed $eax
47 define i8 @test_mul_by_5(i8 %x) {
48 ; X64-LABEL: test_mul_by_5:
50 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
51 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
52 ; X64-NEXT: # kill: def $al killed $al killed $eax
58 define i8 @test_mul_by_6(i8 %x) {
59 ; X64-LABEL: test_mul_by_6:
61 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
62 ; X64-NEXT: addl %edi, %edi
63 ; X64-NEXT: leal (%rdi,%rdi,2), %eax
64 ; X64-NEXT: # kill: def $al killed $al killed $eax
70 define i8 @test_mul_by_7(i8 %x) {
71 ; X64-LABEL: test_mul_by_7:
73 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
74 ; X64-NEXT: leal (,%rdi,8), %eax
75 ; X64-NEXT: subl %edi, %eax
76 ; X64-NEXT: # kill: def $al killed $al killed $eax
82 define i8 @test_mul_by_8(i8 %x) {
83 ; X64-LABEL: test_mul_by_8:
85 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
86 ; X64-NEXT: leal (,%rdi,8), %eax
87 ; X64-NEXT: # kill: def $al killed $al killed $eax
93 define i8 @test_mul_by_9(i8 %x) {
94 ; X64-LABEL: test_mul_by_9:
96 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
97 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
98 ; X64-NEXT: # kill: def $al killed $al killed $eax
104 define i8 @test_mul_by_10(i8 %x) {
105 ; X64-LABEL: test_mul_by_10:
107 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
108 ; X64-NEXT: addl %edi, %edi
109 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
110 ; X64-NEXT: # kill: def $al killed $al killed $eax
116 define i8 @test_mul_by_11(i8 %x) {
117 ; X64-LABEL: test_mul_by_11:
119 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
120 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
121 ; X64-NEXT: leal (%rdi,%rax,2), %eax
122 ; X64-NEXT: # kill: def $al killed $al killed $eax
128 define i8 @test_mul_by_12(i8 %x) {
129 ; X64-LABEL: test_mul_by_12:
131 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
132 ; X64-NEXT: shll $2, %edi
133 ; X64-NEXT: leal (%rdi,%rdi,2), %eax
134 ; X64-NEXT: # kill: def $al killed $al killed $eax
140 define i8 @test_mul_by_13(i8 %x) {
141 ; X64-LABEL: test_mul_by_13:
143 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
144 ; X64-NEXT: leal (%rdi,%rdi,2), %eax
145 ; X64-NEXT: leal (%rdi,%rax,4), %eax
146 ; X64-NEXT: # kill: def $al killed $al killed $eax
152 define i8 @test_mul_by_14(i8 %x) {
153 ; X64-LABEL: test_mul_by_14:
155 ; X64-NEXT: movl %edi, %eax
156 ; X64-NEXT: leal (%rax,%rax), %ecx
157 ; X64-NEXT: shll $4, %eax
158 ; X64-NEXT: subl %ecx, %eax
159 ; X64-NEXT: # kill: def $al killed $al killed $rax
165 define i8 @test_mul_by_15(i8 %x) {
166 ; X64-LABEL: test_mul_by_15:
168 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
169 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
170 ; X64-NEXT: leal (%rax,%rax,2), %eax
171 ; X64-NEXT: # kill: def $al killed $al killed $eax
177 define i8 @test_mul_by_16(i8 %x) {
178 ; X64-LABEL: test_mul_by_16:
180 ; X64-NEXT: movl %edi, %eax
181 ; X64-NEXT: shlb $4, %al
182 ; X64-NEXT: # kill: def $al killed $al killed $eax
188 define i8 @test_mul_by_17(i8 %x) {
189 ; X64-LABEL: test_mul_by_17:
191 ; X64-NEXT: movl %edi, %eax
192 ; X64-NEXT: shll $4, %eax
193 ; X64-NEXT: addl %edi, %eax
194 ; X64-NEXT: # kill: def $al killed $al killed $eax
200 define i8 @test_mul_by_18(i8 %x) {
201 ; X64-LABEL: test_mul_by_18:
203 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
204 ; X64-NEXT: addl %edi, %edi
205 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
206 ; X64-NEXT: # kill: def $al killed $al killed $eax
212 define i8 @test_mul_by_19(i8 %x) {
213 ; X64-LABEL: test_mul_by_19:
215 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
216 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
217 ; X64-NEXT: leal (%rdi,%rax,2), %eax
218 ; X64-NEXT: # kill: def $al killed $al killed $eax
224 define i8 @test_mul_by_20(i8 %x) {
225 ; X64-LABEL: test_mul_by_20:
227 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
228 ; X64-NEXT: shll $2, %edi
229 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
230 ; X64-NEXT: # kill: def $al killed $al killed $eax
236 define i8 @test_mul_by_21(i8 %x) {
237 ; X64-LABEL: test_mul_by_21:
239 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
240 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
241 ; X64-NEXT: leal (%rdi,%rax,4), %eax
242 ; X64-NEXT: # kill: def $al killed $al killed $eax
248 define i8 @test_mul_by_22(i8 %x) {
249 ; X64-LABEL: test_mul_by_22:
251 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
252 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
253 ; X64-NEXT: leal (%rdi,%rax,4), %eax
254 ; X64-NEXT: addl %edi, %eax
255 ; X64-NEXT: # kill: def $al killed $al killed $eax
261 define i8 @test_mul_by_23(i8 %x) {
262 ; X64-LABEL: test_mul_by_23:
264 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
265 ; X64-NEXT: leal (%rdi,%rdi,2), %eax
266 ; X64-NEXT: shll $3, %eax
267 ; X64-NEXT: subl %edi, %eax
268 ; X64-NEXT: # kill: def $al killed $al killed $eax
274 define i8 @test_mul_by_24(i8 %x) {
275 ; X64-LABEL: test_mul_by_24:
277 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
278 ; X64-NEXT: shll $3, %edi
279 ; X64-NEXT: leal (%rdi,%rdi,2), %eax
280 ; X64-NEXT: # kill: def $al killed $al killed $eax
286 define i8 @test_mul_by_25(i8 %x) {
287 ; X64-LABEL: test_mul_by_25:
289 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
290 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
291 ; X64-NEXT: leal (%rax,%rax,4), %eax
292 ; X64-NEXT: # kill: def $al killed $al killed $eax
298 define i8 @test_mul_by_26(i8 %x) {
299 ; X64-LABEL: test_mul_by_26:
301 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
302 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
303 ; X64-NEXT: leal (%rax,%rax,4), %eax
304 ; X64-NEXT: addl %edi, %eax
305 ; X64-NEXT: # kill: def $al killed $al killed $eax
311 define i8 @test_mul_by_27(i8 %x) {
312 ; X64-LABEL: test_mul_by_27:
314 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
315 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
316 ; X64-NEXT: leal (%rax,%rax,2), %eax
317 ; X64-NEXT: # kill: def $al killed $al killed $eax
323 define i8 @test_mul_by_28(i8 %x) {
324 ; X64-LABEL: test_mul_by_28:
326 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
327 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
328 ; X64-NEXT: leal (%rax,%rax,2), %eax
329 ; X64-NEXT: addl %edi, %eax
330 ; X64-NEXT: # kill: def $al killed $al killed $eax
336 define i8 @test_mul_by_29(i8 %x) {
337 ; X64-LABEL: test_mul_by_29:
339 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
340 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
341 ; X64-NEXT: leal (%rax,%rax,2), %eax
342 ; X64-NEXT: addl %edi, %eax
343 ; X64-NEXT: addl %edi, %eax
344 ; X64-NEXT: # kill: def $al killed $al killed $eax
350 define i8 @test_mul_by_30(i8 %x) {
351 ; X64-LABEL: test_mul_by_30:
353 ; X64-NEXT: movl %edi, %eax
354 ; X64-NEXT: leal (%rax,%rax), %ecx
355 ; X64-NEXT: shll $5, %eax
356 ; X64-NEXT: subl %ecx, %eax
357 ; X64-NEXT: # kill: def $al killed $al killed $rax
363 define i8 @test_mul_by_31(i8 %x) {
364 ; X64-LABEL: test_mul_by_31:
366 ; X64-NEXT: movl %edi, %eax
367 ; X64-NEXT: shll $5, %eax
368 ; X64-NEXT: subl %edi, %eax
369 ; X64-NEXT: # kill: def $al killed $al killed $eax
375 define i8 @test_mul_by_32(i8 %x) {
376 ; X64-LABEL: test_mul_by_32:
378 ; X64-NEXT: movl %edi, %eax
379 ; X64-NEXT: shlb $5, %al
380 ; X64-NEXT: # kill: def $al killed $al killed $eax
386 define i8 @test_mul_by_37(i8 %x) {
387 ; X64-LABEL: test_mul_by_37:
389 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
390 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
391 ; X64-NEXT: leal (%rdi,%rax,4), %eax
392 ; X64-NEXT: # kill: def $al killed $al killed $eax
398 define i8 @test_mul_by_41(i8 %x) {
399 ; X64-LABEL: test_mul_by_41:
401 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
402 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
403 ; X64-NEXT: leal (%rdi,%rax,8), %eax
404 ; X64-NEXT: # kill: def $al killed $al killed $eax
410 define i8 @test_mul_by_62(i8 %x) {
411 ; X64-LABEL: test_mul_by_62:
413 ; X64-NEXT: movl %edi, %eax
414 ; X64-NEXT: leal (%rax,%rax), %ecx
415 ; X64-NEXT: shll $6, %eax
416 ; X64-NEXT: subl %ecx, %eax
417 ; X64-NEXT: # kill: def $al killed $al killed $rax
423 define i8 @test_mul_by_66(i8 %x) {
424 ; X64-LABEL: test_mul_by_66:
426 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
427 ; X64-NEXT: movl %edi, %eax
428 ; X64-NEXT: shll $6, %eax
429 ; X64-NEXT: leal (%rax,%rdi,2), %eax
430 ; X64-NEXT: # kill: def $al killed $al killed $eax
436 define i8 @test_mul_by_73(i8 %x) {
437 ; X64-LABEL: test_mul_by_73:
439 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
440 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
441 ; X64-NEXT: leal (%rdi,%rax,8), %eax
442 ; X64-NEXT: # kill: def $al killed $al killed $eax
448 define i8 @test_mul_by_520(i8 %x) {
449 ; X64-LABEL: test_mul_by_520:
451 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
452 ; X64-NEXT: leal (,%rdi,8), %eax
453 ; X64-NEXT: # kill: def $al killed $al killed $eax
459 define i8 @test_mul_by_neg10(i8 %x) {
460 ; X64-LABEL: test_mul_by_neg10:
462 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
463 ; X64-NEXT: addl %edi, %edi
464 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
465 ; X64-NEXT: negl %eax
466 ; X64-NEXT: # kill: def $al killed $al killed $eax
472 define i8 @test_mul_by_neg36(i8 %x) {
473 ; X64-LABEL: test_mul_by_neg36:
475 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
476 ; X64-NEXT: shll $2, %edi
477 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
478 ; X64-NEXT: negl %eax
479 ; X64-NEXT: # kill: def $al killed $al killed $eax