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: shll $4, %eax
157 ; X64-NEXT: subl %edi, %eax
158 ; X64-NEXT: subl %edi, %eax
159 ; X64-NEXT: # kill: def $al killed $al killed $eax
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: # kill: def $edi killed $edi def $rdi
192 ; X64-NEXT: movl %edi, %eax
193 ; X64-NEXT: shll $4, %eax
194 ; X64-NEXT: addl %edi, %eax
195 ; X64-NEXT: # kill: def $al killed $al killed $eax
201 define i8 @test_mul_by_18(i8 %x) {
202 ; X64-LABEL: test_mul_by_18:
204 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
205 ; X64-NEXT: addl %edi, %edi
206 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
207 ; X64-NEXT: # kill: def $al killed $al killed $eax
213 define i8 @test_mul_by_19(i8 %x) {
214 ; X64-LABEL: test_mul_by_19:
216 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
217 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
218 ; X64-NEXT: leal (%rdi,%rax,2), %eax
219 ; X64-NEXT: # kill: def $al killed $al killed $eax
225 define i8 @test_mul_by_20(i8 %x) {
226 ; X64-LABEL: test_mul_by_20:
228 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
229 ; X64-NEXT: shll $2, %edi
230 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
231 ; X64-NEXT: # kill: def $al killed $al killed $eax
237 define i8 @test_mul_by_21(i8 %x) {
238 ; X64-LABEL: test_mul_by_21:
240 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
241 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
242 ; X64-NEXT: leal (%rdi,%rax,4), %eax
243 ; X64-NEXT: # kill: def $al killed $al killed $eax
249 define i8 @test_mul_by_22(i8 %x) {
250 ; X64-LABEL: test_mul_by_22:
252 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
253 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
254 ; X64-NEXT: leal (%rdi,%rax,4), %eax
255 ; X64-NEXT: addl %edi, %eax
256 ; X64-NEXT: # kill: def $al killed $al killed $eax
262 define i8 @test_mul_by_23(i8 %x) {
263 ; X64-LABEL: test_mul_by_23:
265 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
266 ; X64-NEXT: leal (%rdi,%rdi,2), %eax
267 ; X64-NEXT: shll $3, %eax
268 ; X64-NEXT: subl %edi, %eax
269 ; X64-NEXT: # kill: def $al killed $al killed $eax
275 define i8 @test_mul_by_24(i8 %x) {
276 ; X64-LABEL: test_mul_by_24:
278 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
279 ; X64-NEXT: shll $3, %edi
280 ; X64-NEXT: leal (%rdi,%rdi,2), %eax
281 ; X64-NEXT: # kill: def $al killed $al killed $eax
287 define i8 @test_mul_by_25(i8 %x) {
288 ; X64-LABEL: test_mul_by_25:
290 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
291 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
292 ; X64-NEXT: leal (%rax,%rax,4), %eax
293 ; X64-NEXT: # kill: def $al killed $al killed $eax
299 define i8 @test_mul_by_26(i8 %x) {
300 ; X64-LABEL: test_mul_by_26:
302 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
303 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
304 ; X64-NEXT: leal (%rax,%rax,4), %eax
305 ; X64-NEXT: addl %edi, %eax
306 ; X64-NEXT: # kill: def $al killed $al killed $eax
312 define i8 @test_mul_by_27(i8 %x) {
313 ; X64-LABEL: test_mul_by_27:
315 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
316 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
317 ; X64-NEXT: leal (%rax,%rax,2), %eax
318 ; X64-NEXT: # kill: def $al killed $al killed $eax
324 define i8 @test_mul_by_28(i8 %x) {
325 ; X64-LABEL: test_mul_by_28:
327 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
328 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
329 ; X64-NEXT: leal (%rax,%rax,2), %eax
330 ; X64-NEXT: addl %edi, %eax
331 ; X64-NEXT: # kill: def $al killed $al killed $eax
337 define i8 @test_mul_by_29(i8 %x) {
338 ; X64-LABEL: test_mul_by_29:
340 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
341 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
342 ; X64-NEXT: leal (%rax,%rax,2), %eax
343 ; X64-NEXT: addl %edi, %eax
344 ; X64-NEXT: addl %edi, %eax
345 ; X64-NEXT: # kill: def $al killed $al killed $eax
351 define i8 @test_mul_by_30(i8 %x) {
352 ; X64-LABEL: test_mul_by_30:
354 ; X64-NEXT: movl %edi, %eax
355 ; X64-NEXT: shll $5, %eax
356 ; X64-NEXT: subl %edi, %eax
357 ; X64-NEXT: subl %edi, %eax
358 ; X64-NEXT: # kill: def $al killed $al killed $eax
364 define i8 @test_mul_by_31(i8 %x) {
365 ; X64-LABEL: test_mul_by_31:
367 ; X64-NEXT: movl %edi, %eax
368 ; X64-NEXT: shll $5, %eax
369 ; X64-NEXT: subl %edi, %eax
370 ; X64-NEXT: # kill: def $al killed $al killed $eax
376 define i8 @test_mul_by_32(i8 %x) {
377 ; X64-LABEL: test_mul_by_32:
379 ; X64-NEXT: movl %edi, %eax
380 ; X64-NEXT: shlb $5, %al
381 ; X64-NEXT: # kill: def $al killed $al killed $eax
387 define i8 @test_mul_by_37(i8 %x) {
388 ; X64-LABEL: test_mul_by_37:
390 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
391 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
392 ; X64-NEXT: leal (%rdi,%rax,4), %eax
393 ; X64-NEXT: # kill: def $al killed $al killed $eax
399 define i8 @test_mul_by_41(i8 %x) {
400 ; X64-LABEL: test_mul_by_41:
402 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
403 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
404 ; X64-NEXT: leal (%rdi,%rax,8), %eax
405 ; X64-NEXT: # kill: def $al killed $al killed $eax
411 define i8 @test_mul_by_62(i8 %x) {
412 ; X64-LABEL: test_mul_by_62:
414 ; X64-NEXT: movl %edi, %eax
415 ; X64-NEXT: shll $6, %eax
416 ; X64-NEXT: subl %edi, %eax
417 ; X64-NEXT: subl %edi, %eax
418 ; X64-NEXT: # kill: def $al killed $al killed $eax
424 define i8 @test_mul_by_66(i8 %x) {
425 ; X64-LABEL: test_mul_by_66:
427 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
428 ; X64-NEXT: movl %edi, %eax
429 ; X64-NEXT: shll $6, %eax
430 ; X64-NEXT: leal (%rax,%rdi,2), %eax
431 ; X64-NEXT: # kill: def $al killed $al killed $eax
437 define i8 @test_mul_by_73(i8 %x) {
438 ; X64-LABEL: test_mul_by_73:
440 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
441 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
442 ; X64-NEXT: leal (%rdi,%rax,8), %eax
443 ; X64-NEXT: # kill: def $al killed $al killed $eax
449 define i8 @test_mul_by_520(i8 %x) {
450 ; X64-LABEL: test_mul_by_520:
452 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
453 ; X64-NEXT: leal (,%rdi,8), %eax
454 ; X64-NEXT: # kill: def $al killed $al killed $eax
460 define i8 @test_mul_by_neg10(i8 %x) {
461 ; X64-LABEL: test_mul_by_neg10:
463 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
464 ; X64-NEXT: addl %edi, %edi
465 ; X64-NEXT: leal (%rdi,%rdi,4), %eax
466 ; X64-NEXT: negl %eax
467 ; X64-NEXT: # kill: def $al killed $al killed $eax
473 define i8 @test_mul_by_neg36(i8 %x) {
474 ; X64-LABEL: test_mul_by_neg36:
476 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
477 ; X64-NEXT: shll $2, %edi
478 ; X64-NEXT: leal (%rdi,%rdi,8), %eax
479 ; X64-NEXT: negl %eax
480 ; X64-NEXT: # kill: def $al killed $al killed $eax