1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 | FileCheck %s
4 define i8 @shl_i8(i8 %a, i8 %b) {
7 ; CHECK-NEXT: movl %esi, %ecx
8 ; CHECK-NEXT: movl %edi, %eax
9 ; CHECK-NEXT: ## kill: def $cl killed $cl killed $ecx
10 ; CHECK-NEXT: shlb %cl, %al
11 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
17 define i16 @shl_i16(i16 %a, i16 %b) {
18 ; CHECK-LABEL: shl_i16:
20 ; CHECK-NEXT: movl %esi, %ecx
21 ; CHECK-NEXT: movl %edi, %eax
22 ; CHECK-NEXT: ## kill: def $cx killed $cx killed $ecx
23 ; CHECK-NEXT: ## kill: def $cl killed $cx
24 ; CHECK-NEXT: shlw %cl, %ax
25 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
31 define i32 @shl_i32(i32 %a, i32 %b) {
32 ; CHECK-LABEL: shl_i32:
34 ; CHECK-NEXT: movl %esi, %ecx
35 ; CHECK-NEXT: movl %edi, %eax
36 ; CHECK-NEXT: ## kill: def $cl killed $ecx
37 ; CHECK-NEXT: shll %cl, %eax
43 define i64 @shl_i64(i64 %a, i64 %b) {
44 ; CHECK-LABEL: shl_i64:
46 ; CHECK-NEXT: movq %rsi, %rcx
47 ; CHECK-NEXT: movq %rdi, %rax
48 ; CHECK-NEXT: ## kill: def $cl killed $rcx
49 ; CHECK-NEXT: shlq %cl, %rax
55 define i8 @lshr_i8(i8 %a, i8 %b) {
56 ; CHECK-LABEL: lshr_i8:
58 ; CHECK-NEXT: movl %esi, %ecx
59 ; CHECK-NEXT: movl %edi, %eax
60 ; CHECK-NEXT: ## kill: def $cl killed $cl killed $ecx
61 ; CHECK-NEXT: shrb %cl, %al
62 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
68 define i16 @lshr_i16(i16 %a, i16 %b) {
69 ; CHECK-LABEL: lshr_i16:
71 ; CHECK-NEXT: movl %esi, %ecx
72 ; CHECK-NEXT: movl %edi, %eax
73 ; CHECK-NEXT: ## kill: def $cx killed $cx killed $ecx
74 ; CHECK-NEXT: ## kill: def $cl killed $cx
75 ; CHECK-NEXT: shrw %cl, %ax
76 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
82 define i32 @lshr_i32(i32 %a, i32 %b) {
83 ; CHECK-LABEL: lshr_i32:
85 ; CHECK-NEXT: movl %esi, %ecx
86 ; CHECK-NEXT: movl %edi, %eax
87 ; CHECK-NEXT: ## kill: def $cl killed $ecx
88 ; CHECK-NEXT: shrl %cl, %eax
94 define i64 @lshr_i64(i64 %a, i64 %b) {
95 ; CHECK-LABEL: lshr_i64:
97 ; CHECK-NEXT: movq %rsi, %rcx
98 ; CHECK-NEXT: movq %rdi, %rax
99 ; CHECK-NEXT: ## kill: def $cl killed $rcx
100 ; CHECK-NEXT: shrq %cl, %rax
106 define i8 @ashr_i8(i8 %a, i8 %b) {
107 ; CHECK-LABEL: ashr_i8:
109 ; CHECK-NEXT: movl %esi, %ecx
110 ; CHECK-NEXT: movl %edi, %eax
111 ; CHECK-NEXT: ## kill: def $cl killed $cl killed $ecx
112 ; CHECK-NEXT: sarb %cl, %al
113 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
119 define i16 @ashr_i16(i16 %a, i16 %b) {
120 ; CHECK-LABEL: ashr_i16:
122 ; CHECK-NEXT: movl %esi, %ecx
123 ; CHECK-NEXT: movl %edi, %eax
124 ; CHECK-NEXT: ## kill: def $cx killed $cx killed $ecx
125 ; CHECK-NEXT: ## kill: def $cl killed $cx
126 ; CHECK-NEXT: sarw %cl, %ax
127 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
133 define i32 @ashr_i32(i32 %a, i32 %b) {
134 ; CHECK-LABEL: ashr_i32:
136 ; CHECK-NEXT: movl %esi, %ecx
137 ; CHECK-NEXT: movl %edi, %eax
138 ; CHECK-NEXT: ## kill: def $cl killed $ecx
139 ; CHECK-NEXT: sarl %cl, %eax
145 define i64 @ashr_i64(i64 %a, i64 %b) {
146 ; CHECK-LABEL: ashr_i64:
148 ; CHECK-NEXT: movq %rsi, %rcx
149 ; CHECK-NEXT: movq %rdi, %rax
150 ; CHECK-NEXT: ## kill: def $cl killed $rcx
151 ; CHECK-NEXT: sarq %cl, %rax
157 define i8 @shl_imm1_i8(i8 %a) {
158 ; CHECK-LABEL: shl_imm1_i8:
160 ; CHECK-NEXT: ## kill: def $edi killed $edi def $rdi
161 ; CHECK-NEXT: leal (,%rdi,2), %eax
162 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
168 define i16 @shl_imm1_i16(i16 %a) {
169 ; CHECK-LABEL: shl_imm1_i16:
171 ; CHECK-NEXT: ## kill: def $edi killed $edi def $rdi
172 ; CHECK-NEXT: leal (,%rdi,2), %eax
173 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
179 define i32 @shl_imm1_i32(i32 %a) {
180 ; CHECK-LABEL: shl_imm1_i32:
182 ; CHECK-NEXT: ## kill: def $edi killed $edi def $rdi
183 ; CHECK-NEXT: leal (,%rdi,2), %eax
189 define i64 @shl_imm1_i64(i64 %a) {
190 ; CHECK-LABEL: shl_imm1_i64:
192 ; CHECK-NEXT: leaq (,%rdi,2), %rax
198 define i8 @lshr_imm1_i8(i8 %a) {
199 ; CHECK-LABEL: lshr_imm1_i8:
201 ; CHECK-NEXT: movl %edi, %eax
202 ; CHECK-NEXT: shrb $1, %al
203 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
209 define i16 @lshr_imm1_i16(i16 %a) {
210 ; CHECK-LABEL: lshr_imm1_i16:
212 ; CHECK-NEXT: movl %edi, %eax
213 ; CHECK-NEXT: shrw $1, %ax
214 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
220 define i32 @lshr_imm1_i32(i32 %a) {
221 ; CHECK-LABEL: lshr_imm1_i32:
223 ; CHECK-NEXT: movl %edi, %eax
224 ; CHECK-NEXT: shrl $1, %eax
230 define i64 @lshr_imm1_i64(i64 %a) {
231 ; CHECK-LABEL: lshr_imm1_i64:
233 ; CHECK-NEXT: movq %rdi, %rax
234 ; CHECK-NEXT: shrq $1, %rax
240 define i8 @ashr_imm1_i8(i8 %a) {
241 ; CHECK-LABEL: ashr_imm1_i8:
243 ; CHECK-NEXT: movl %edi, %eax
244 ; CHECK-NEXT: sarb $1, %al
245 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
251 define i16 @ashr_imm1_i16(i16 %a) {
252 ; CHECK-LABEL: ashr_imm1_i16:
254 ; CHECK-NEXT: movl %edi, %eax
255 ; CHECK-NEXT: sarw $1, %ax
256 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
262 define i32 @ashr_imm1_i32(i32 %a) {
263 ; CHECK-LABEL: ashr_imm1_i32:
265 ; CHECK-NEXT: movl %edi, %eax
266 ; CHECK-NEXT: sarl $1, %eax
272 define i64 @ashr_imm1_i64(i64 %a) {
273 ; CHECK-LABEL: ashr_imm1_i64:
275 ; CHECK-NEXT: movq %rdi, %rax
276 ; CHECK-NEXT: sarq $1, %rax
282 define i8 @shl_imm4_i8(i8 %a) {
283 ; CHECK-LABEL: shl_imm4_i8:
285 ; CHECK-NEXT: movl %edi, %eax
286 ; CHECK-NEXT: shlb $4, %al
287 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
293 define i16 @shl_imm4_i16(i16 %a) {
294 ; CHECK-LABEL: shl_imm4_i16:
296 ; CHECK-NEXT: movl %edi, %eax
297 ; CHECK-NEXT: shlw $4, %ax
298 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
304 define i32 @shl_imm4_i32(i32 %a) {
305 ; CHECK-LABEL: shl_imm4_i32:
307 ; CHECK-NEXT: movl %edi, %eax
308 ; CHECK-NEXT: shll $4, %eax
314 define i64 @shl_imm4_i64(i64 %a) {
315 ; CHECK-LABEL: shl_imm4_i64:
317 ; CHECK-NEXT: movq %rdi, %rax
318 ; CHECK-NEXT: shlq $4, %rax
324 define i8 @lshr_imm4_i8(i8 %a) {
325 ; CHECK-LABEL: lshr_imm4_i8:
327 ; CHECK-NEXT: movl %edi, %eax
328 ; CHECK-NEXT: shrb $4, %al
329 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
335 define i16 @lshr_imm4_i16(i16 %a) {
336 ; CHECK-LABEL: lshr_imm4_i16:
338 ; CHECK-NEXT: movl %edi, %eax
339 ; CHECK-NEXT: shrw $4, %ax
340 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
346 define i32 @lshr_imm4_i32(i32 %a) {
347 ; CHECK-LABEL: lshr_imm4_i32:
349 ; CHECK-NEXT: movl %edi, %eax
350 ; CHECK-NEXT: shrl $4, %eax
356 define i64 @lshr_imm4_i64(i64 %a) {
357 ; CHECK-LABEL: lshr_imm4_i64:
359 ; CHECK-NEXT: movq %rdi, %rax
360 ; CHECK-NEXT: shrq $4, %rax
366 define i8 @ashr_imm4_i8(i8 %a) {
367 ; CHECK-LABEL: ashr_imm4_i8:
369 ; CHECK-NEXT: movl %edi, %eax
370 ; CHECK-NEXT: sarb $4, %al
371 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
377 define i16 @ashr_imm4_i16(i16 %a) {
378 ; CHECK-LABEL: ashr_imm4_i16:
380 ; CHECK-NEXT: movl %edi, %eax
381 ; CHECK-NEXT: sarw $4, %ax
382 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
388 define i32 @ashr_imm4_i32(i32 %a) {
389 ; CHECK-LABEL: ashr_imm4_i32:
391 ; CHECK-NEXT: movl %edi, %eax
392 ; CHECK-NEXT: sarl $4, %eax
398 define i64 @ashr_imm4_i64(i64 %a) {
399 ; CHECK-LABEL: ashr_imm4_i64:
401 ; CHECK-NEXT: movq %rdi, %rax
402 ; CHECK-NEXT: sarq $4, %rax
408 ; Make sure we don't crash on out of bounds i8 shifts.
409 define i8 @PR36731(i8 %a) {
410 ; CHECK-LABEL: PR36731:
412 ; CHECK-NEXT: movl %edi, %eax
413 ; CHECK-NEXT: movb $255, %cl
414 ; CHECK-NEXT: shlb %cl, %al
415 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax