1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-apple-darwin10 | FileCheck %s --check-prefixes=X86,SDAG,SDAG-X86
3 ; RUN: llc < %s -mtriple=i686-apple-darwin10 -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefixes=X86,FASTISEL-X86
4 ; TODO: llc < %s -mtriple=i686-apple-darwin10 -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=X86,GISEL-X86
5 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s --check-prefixes=X64,SDAG,SDAG-X64
6 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefixes=X64,FASTISEL-X64
7 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=X64,GISEL-X64
9 define i8 @shl_i8(i8 %a, i8 %b) {
12 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
13 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
14 ; X86-NEXT: shlb %cl, %al
17 ; SDAG-X64-LABEL: shl_i8:
19 ; SDAG-X64-NEXT: movl %esi, %ecx
20 ; SDAG-X64-NEXT: movl %edi, %eax
21 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
22 ; SDAG-X64-NEXT: shlb %cl, %al
23 ; SDAG-X64-NEXT: ## kill: def $al killed $al killed $eax
26 ; FASTISEL-X64-LABEL: shl_i8:
27 ; FASTISEL-X64: ## %bb.0:
28 ; FASTISEL-X64-NEXT: movl %esi, %ecx
29 ; FASTISEL-X64-NEXT: movl %edi, %eax
30 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
31 ; FASTISEL-X64-NEXT: shlb %cl, %al
32 ; FASTISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
33 ; FASTISEL-X64-NEXT: retq
35 ; GISEL-X64-LABEL: shl_i8:
36 ; GISEL-X64: ## %bb.0:
37 ; GISEL-X64-NEXT: movl %edi, %eax
38 ; GISEL-X64-NEXT: movl %esi, %ecx
39 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
40 ; GISEL-X64-NEXT: shlb %cl, %al
41 ; GISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
42 ; GISEL-X64-NEXT: retq
47 define i16 @shl_i16(i16 %a, i16 %b) {
48 ; SDAG-X86-LABEL: shl_i16:
50 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
51 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
52 ; SDAG-X86-NEXT: shll %cl, %eax
53 ; SDAG-X86-NEXT: ## kill: def $ax killed $ax killed $eax
56 ; FASTISEL-X86-LABEL: shl_i16:
57 ; FASTISEL-X86: ## %bb.0:
58 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
59 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
60 ; FASTISEL-X86-NEXT: ## kill: def $cl killed $cx
61 ; FASTISEL-X86-NEXT: shlw %cl, %ax
62 ; FASTISEL-X86-NEXT: retl
64 ; SDAG-X64-LABEL: shl_i16:
66 ; SDAG-X64-NEXT: movl %esi, %ecx
67 ; SDAG-X64-NEXT: movl %edi, %eax
68 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
69 ; SDAG-X64-NEXT: shll %cl, %eax
70 ; SDAG-X64-NEXT: ## kill: def $ax killed $ax killed $eax
73 ; FASTISEL-X64-LABEL: shl_i16:
74 ; FASTISEL-X64: ## %bb.0:
75 ; FASTISEL-X64-NEXT: movl %esi, %ecx
76 ; FASTISEL-X64-NEXT: movl %edi, %eax
77 ; FASTISEL-X64-NEXT: ## kill: def $cx killed $cx killed $ecx
78 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $cx
79 ; FASTISEL-X64-NEXT: shlw %cl, %ax
80 ; FASTISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
81 ; FASTISEL-X64-NEXT: retq
83 ; GISEL-X64-LABEL: shl_i16:
84 ; GISEL-X64: ## %bb.0:
85 ; GISEL-X64-NEXT: movl %edi, %eax
86 ; GISEL-X64-NEXT: movl %esi, %ecx
87 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
88 ; GISEL-X64-NEXT: shlw %cl, %ax
89 ; GISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
90 ; GISEL-X64-NEXT: retq
95 define i32 @shl_i32(i32 %a, i32 %b) {
96 ; SDAG-X86-LABEL: shl_i32:
98 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
99 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
100 ; SDAG-X86-NEXT: shll %cl, %eax
101 ; SDAG-X86-NEXT: retl
103 ; FASTISEL-X86-LABEL: shl_i32:
104 ; FASTISEL-X86: ## %bb.0:
105 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
106 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
107 ; FASTISEL-X86-NEXT: ## kill: def $cl killed $ecx
108 ; FASTISEL-X86-NEXT: shll %cl, %eax
109 ; FASTISEL-X86-NEXT: retl
111 ; SDAG-X64-LABEL: shl_i32:
112 ; SDAG-X64: ## %bb.0:
113 ; SDAG-X64-NEXT: movl %esi, %ecx
114 ; SDAG-X64-NEXT: movl %edi, %eax
115 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
116 ; SDAG-X64-NEXT: shll %cl, %eax
117 ; SDAG-X64-NEXT: retq
119 ; FASTISEL-X64-LABEL: shl_i32:
120 ; FASTISEL-X64: ## %bb.0:
121 ; FASTISEL-X64-NEXT: movl %esi, %ecx
122 ; FASTISEL-X64-NEXT: movl %edi, %eax
123 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $ecx
124 ; FASTISEL-X64-NEXT: shll %cl, %eax
125 ; FASTISEL-X64-NEXT: retq
127 ; GISEL-X64-LABEL: shl_i32:
128 ; GISEL-X64: ## %bb.0:
129 ; GISEL-X64-NEXT: movl %edi, %eax
130 ; GISEL-X64-NEXT: movl %esi, %ecx
131 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
132 ; GISEL-X64-NEXT: shll %cl, %eax
133 ; GISEL-X64-NEXT: retq
138 define i64 @shl_i64(i64 %a, i64 %b) nounwind {
139 ; SDAG-X86-LABEL: shl_i64:
140 ; SDAG-X86: ## %bb.0:
141 ; SDAG-X86-NEXT: pushl %esi
142 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
143 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %esi
144 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
145 ; SDAG-X86-NEXT: movl %esi, %eax
146 ; SDAG-X86-NEXT: shll %cl, %eax
147 ; SDAG-X86-NEXT: shldl %cl, %esi, %edx
148 ; SDAG-X86-NEXT: testb $32, %cl
149 ; SDAG-X86-NEXT: je LBB3_2
150 ; SDAG-X86-NEXT: ## %bb.1:
151 ; SDAG-X86-NEXT: movl %eax, %edx
152 ; SDAG-X86-NEXT: xorl %eax, %eax
153 ; SDAG-X86-NEXT: LBB3_2:
154 ; SDAG-X86-NEXT: popl %esi
155 ; SDAG-X86-NEXT: retl
157 ; FASTISEL-X86-LABEL: shl_i64:
158 ; FASTISEL-X86: ## %bb.0:
159 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
160 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
161 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
162 ; FASTISEL-X86-NEXT: shldl %cl, %eax, %edx
163 ; FASTISEL-X86-NEXT: shll %cl, %eax
164 ; FASTISEL-X86-NEXT: testb $32, %cl
165 ; FASTISEL-X86-NEXT: je LBB3_2
166 ; FASTISEL-X86-NEXT: ## %bb.1:
167 ; FASTISEL-X86-NEXT: movl %eax, %edx
168 ; FASTISEL-X86-NEXT: xorl %eax, %eax
169 ; FASTISEL-X86-NEXT: LBB3_2:
170 ; FASTISEL-X86-NEXT: retl
172 ; SDAG-X64-LABEL: shl_i64:
173 ; SDAG-X64: ## %bb.0:
174 ; SDAG-X64-NEXT: movq %rsi, %rcx
175 ; SDAG-X64-NEXT: movq %rdi, %rax
176 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $rcx
177 ; SDAG-X64-NEXT: shlq %cl, %rax
178 ; SDAG-X64-NEXT: retq
180 ; FASTISEL-X64-LABEL: shl_i64:
181 ; FASTISEL-X64: ## %bb.0:
182 ; FASTISEL-X64-NEXT: movq %rsi, %rcx
183 ; FASTISEL-X64-NEXT: movq %rdi, %rax
184 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $rcx
185 ; FASTISEL-X64-NEXT: shlq %cl, %rax
186 ; FASTISEL-X64-NEXT: retq
188 ; GISEL-X64-LABEL: shl_i64:
189 ; GISEL-X64: ## %bb.0:
190 ; GISEL-X64-NEXT: movq %rdi, %rax
191 ; GISEL-X64-NEXT: movq %rsi, %rcx
192 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $rcx
193 ; GISEL-X64-NEXT: shlq %cl, %rax
194 ; GISEL-X64-NEXT: retq
199 define i8 @lshr_i8(i8 %a, i8 %b) {
200 ; X86-LABEL: lshr_i8:
202 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
203 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
204 ; X86-NEXT: shrb %cl, %al
207 ; SDAG-X64-LABEL: lshr_i8:
208 ; SDAG-X64: ## %bb.0:
209 ; SDAG-X64-NEXT: movl %esi, %ecx
210 ; SDAG-X64-NEXT: movl %edi, %eax
211 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
212 ; SDAG-X64-NEXT: shrb %cl, %al
213 ; SDAG-X64-NEXT: ## kill: def $al killed $al killed $eax
214 ; SDAG-X64-NEXT: retq
216 ; FASTISEL-X64-LABEL: lshr_i8:
217 ; FASTISEL-X64: ## %bb.0:
218 ; FASTISEL-X64-NEXT: movl %esi, %ecx
219 ; FASTISEL-X64-NEXT: movl %edi, %eax
220 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
221 ; FASTISEL-X64-NEXT: shrb %cl, %al
222 ; FASTISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
223 ; FASTISEL-X64-NEXT: retq
225 ; GISEL-X64-LABEL: lshr_i8:
226 ; GISEL-X64: ## %bb.0:
227 ; GISEL-X64-NEXT: movl %edi, %eax
228 ; GISEL-X64-NEXT: movl %esi, %ecx
229 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
230 ; GISEL-X64-NEXT: shrb %cl, %al
231 ; GISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
232 ; GISEL-X64-NEXT: retq
237 define i16 @lshr_i16(i16 %a, i16 %b) {
238 ; SDAG-X86-LABEL: lshr_i16:
239 ; SDAG-X86: ## %bb.0:
240 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
241 ; SDAG-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
242 ; SDAG-X86-NEXT: shrl %cl, %eax
243 ; SDAG-X86-NEXT: ## kill: def $ax killed $ax killed $eax
244 ; SDAG-X86-NEXT: retl
246 ; FASTISEL-X86-LABEL: lshr_i16:
247 ; FASTISEL-X86: ## %bb.0:
248 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
249 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
250 ; FASTISEL-X86-NEXT: ## kill: def $cl killed $cx
251 ; FASTISEL-X86-NEXT: shrw %cl, %ax
252 ; FASTISEL-X86-NEXT: retl
254 ; SDAG-X64-LABEL: lshr_i16:
255 ; SDAG-X64: ## %bb.0:
256 ; SDAG-X64-NEXT: movl %esi, %ecx
257 ; SDAG-X64-NEXT: movzwl %di, %eax
258 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
259 ; SDAG-X64-NEXT: shrl %cl, %eax
260 ; SDAG-X64-NEXT: ## kill: def $ax killed $ax killed $eax
261 ; SDAG-X64-NEXT: retq
263 ; FASTISEL-X64-LABEL: lshr_i16:
264 ; FASTISEL-X64: ## %bb.0:
265 ; FASTISEL-X64-NEXT: movl %esi, %ecx
266 ; FASTISEL-X64-NEXT: movl %edi, %eax
267 ; FASTISEL-X64-NEXT: ## kill: def $cx killed $cx killed $ecx
268 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $cx
269 ; FASTISEL-X64-NEXT: shrw %cl, %ax
270 ; FASTISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
271 ; FASTISEL-X64-NEXT: retq
273 ; GISEL-X64-LABEL: lshr_i16:
274 ; GISEL-X64: ## %bb.0:
275 ; GISEL-X64-NEXT: movl %edi, %eax
276 ; GISEL-X64-NEXT: movl %esi, %ecx
277 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
278 ; GISEL-X64-NEXT: shrw %cl, %ax
279 ; GISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
280 ; GISEL-X64-NEXT: retq
285 define i32 @lshr_i32(i32 %a, i32 %b) {
286 ; SDAG-X86-LABEL: lshr_i32:
287 ; SDAG-X86: ## %bb.0:
288 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
289 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
290 ; SDAG-X86-NEXT: shrl %cl, %eax
291 ; SDAG-X86-NEXT: retl
293 ; FASTISEL-X86-LABEL: lshr_i32:
294 ; FASTISEL-X86: ## %bb.0:
295 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
296 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
297 ; FASTISEL-X86-NEXT: ## kill: def $cl killed $ecx
298 ; FASTISEL-X86-NEXT: shrl %cl, %eax
299 ; FASTISEL-X86-NEXT: retl
301 ; SDAG-X64-LABEL: lshr_i32:
302 ; SDAG-X64: ## %bb.0:
303 ; SDAG-X64-NEXT: movl %esi, %ecx
304 ; SDAG-X64-NEXT: movl %edi, %eax
305 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
306 ; SDAG-X64-NEXT: shrl %cl, %eax
307 ; SDAG-X64-NEXT: retq
309 ; FASTISEL-X64-LABEL: lshr_i32:
310 ; FASTISEL-X64: ## %bb.0:
311 ; FASTISEL-X64-NEXT: movl %esi, %ecx
312 ; FASTISEL-X64-NEXT: movl %edi, %eax
313 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $ecx
314 ; FASTISEL-X64-NEXT: shrl %cl, %eax
315 ; FASTISEL-X64-NEXT: retq
317 ; GISEL-X64-LABEL: lshr_i32:
318 ; GISEL-X64: ## %bb.0:
319 ; GISEL-X64-NEXT: movl %edi, %eax
320 ; GISEL-X64-NEXT: movl %esi, %ecx
321 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
322 ; GISEL-X64-NEXT: shrl %cl, %eax
323 ; GISEL-X64-NEXT: retq
328 define i64 @lshr_i64(i64 %a, i64 %b) nounwind {
329 ; SDAG-X86-LABEL: lshr_i64:
330 ; SDAG-X86: ## %bb.0:
331 ; SDAG-X86-NEXT: pushl %esi
332 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
333 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
334 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %esi
335 ; SDAG-X86-NEXT: movl %esi, %edx
336 ; SDAG-X86-NEXT: shrl %cl, %edx
337 ; SDAG-X86-NEXT: shrdl %cl, %esi, %eax
338 ; SDAG-X86-NEXT: testb $32, %cl
339 ; SDAG-X86-NEXT: je LBB7_2
340 ; SDAG-X86-NEXT: ## %bb.1:
341 ; SDAG-X86-NEXT: movl %edx, %eax
342 ; SDAG-X86-NEXT: xorl %edx, %edx
343 ; SDAG-X86-NEXT: LBB7_2:
344 ; SDAG-X86-NEXT: popl %esi
345 ; SDAG-X86-NEXT: retl
347 ; FASTISEL-X86-LABEL: lshr_i64:
348 ; FASTISEL-X86: ## %bb.0:
349 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
350 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
351 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
352 ; FASTISEL-X86-NEXT: shrdl %cl, %edx, %eax
353 ; FASTISEL-X86-NEXT: shrl %cl, %edx
354 ; FASTISEL-X86-NEXT: testb $32, %cl
355 ; FASTISEL-X86-NEXT: je LBB7_2
356 ; FASTISEL-X86-NEXT: ## %bb.1:
357 ; FASTISEL-X86-NEXT: movl %edx, %eax
358 ; FASTISEL-X86-NEXT: xorl %edx, %edx
359 ; FASTISEL-X86-NEXT: LBB7_2:
360 ; FASTISEL-X86-NEXT: retl
362 ; SDAG-X64-LABEL: lshr_i64:
363 ; SDAG-X64: ## %bb.0:
364 ; SDAG-X64-NEXT: movq %rsi, %rcx
365 ; SDAG-X64-NEXT: movq %rdi, %rax
366 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $rcx
367 ; SDAG-X64-NEXT: shrq %cl, %rax
368 ; SDAG-X64-NEXT: retq
370 ; FASTISEL-X64-LABEL: lshr_i64:
371 ; FASTISEL-X64: ## %bb.0:
372 ; FASTISEL-X64-NEXT: movq %rsi, %rcx
373 ; FASTISEL-X64-NEXT: movq %rdi, %rax
374 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $rcx
375 ; FASTISEL-X64-NEXT: shrq %cl, %rax
376 ; FASTISEL-X64-NEXT: retq
378 ; GISEL-X64-LABEL: lshr_i64:
379 ; GISEL-X64: ## %bb.0:
380 ; GISEL-X64-NEXT: movq %rdi, %rax
381 ; GISEL-X64-NEXT: movq %rsi, %rcx
382 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $rcx
383 ; GISEL-X64-NEXT: shrq %cl, %rax
384 ; GISEL-X64-NEXT: retq
389 define i8 @ashr_i8(i8 %a, i8 %b) {
390 ; X86-LABEL: ashr_i8:
392 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
393 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
394 ; X86-NEXT: sarb %cl, %al
397 ; SDAG-X64-LABEL: ashr_i8:
398 ; SDAG-X64: ## %bb.0:
399 ; SDAG-X64-NEXT: movl %esi, %ecx
400 ; SDAG-X64-NEXT: movl %edi, %eax
401 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
402 ; SDAG-X64-NEXT: sarb %cl, %al
403 ; SDAG-X64-NEXT: ## kill: def $al killed $al killed $eax
404 ; SDAG-X64-NEXT: retq
406 ; FASTISEL-X64-LABEL: ashr_i8:
407 ; FASTISEL-X64: ## %bb.0:
408 ; FASTISEL-X64-NEXT: movl %esi, %ecx
409 ; FASTISEL-X64-NEXT: movl %edi, %eax
410 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
411 ; FASTISEL-X64-NEXT: sarb %cl, %al
412 ; FASTISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
413 ; FASTISEL-X64-NEXT: retq
415 ; GISEL-X64-LABEL: ashr_i8:
416 ; GISEL-X64: ## %bb.0:
417 ; GISEL-X64-NEXT: movl %edi, %eax
418 ; GISEL-X64-NEXT: movl %esi, %ecx
419 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
420 ; GISEL-X64-NEXT: sarb %cl, %al
421 ; GISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
422 ; GISEL-X64-NEXT: retq
427 define i16 @ashr_i16(i16 %a, i16 %b) {
428 ; SDAG-X86-LABEL: ashr_i16:
429 ; SDAG-X86: ## %bb.0:
430 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
431 ; SDAG-X86-NEXT: movswl {{[0-9]+}}(%esp), %eax
432 ; SDAG-X86-NEXT: sarl %cl, %eax
433 ; SDAG-X86-NEXT: ## kill: def $ax killed $ax killed $eax
434 ; SDAG-X86-NEXT: retl
436 ; FASTISEL-X86-LABEL: ashr_i16:
437 ; FASTISEL-X86: ## %bb.0:
438 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
439 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
440 ; FASTISEL-X86-NEXT: ## kill: def $cl killed $cx
441 ; FASTISEL-X86-NEXT: sarw %cl, %ax
442 ; FASTISEL-X86-NEXT: retl
444 ; SDAG-X64-LABEL: ashr_i16:
445 ; SDAG-X64: ## %bb.0:
446 ; SDAG-X64-NEXT: movl %esi, %ecx
447 ; SDAG-X64-NEXT: movswl %di, %eax
448 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
449 ; SDAG-X64-NEXT: sarl %cl, %eax
450 ; SDAG-X64-NEXT: ## kill: def $ax killed $ax killed $eax
451 ; SDAG-X64-NEXT: retq
453 ; FASTISEL-X64-LABEL: ashr_i16:
454 ; FASTISEL-X64: ## %bb.0:
455 ; FASTISEL-X64-NEXT: movl %esi, %ecx
456 ; FASTISEL-X64-NEXT: movl %edi, %eax
457 ; FASTISEL-X64-NEXT: ## kill: def $cx killed $cx killed $ecx
458 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $cx
459 ; FASTISEL-X64-NEXT: sarw %cl, %ax
460 ; FASTISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
461 ; FASTISEL-X64-NEXT: retq
463 ; GISEL-X64-LABEL: ashr_i16:
464 ; GISEL-X64: ## %bb.0:
465 ; GISEL-X64-NEXT: movl %edi, %eax
466 ; GISEL-X64-NEXT: movl %esi, %ecx
467 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
468 ; GISEL-X64-NEXT: sarw %cl, %ax
469 ; GISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
470 ; GISEL-X64-NEXT: retq
475 define i32 @ashr_i32(i32 %a, i32 %b) {
476 ; SDAG-X86-LABEL: ashr_i32:
477 ; SDAG-X86: ## %bb.0:
478 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
479 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
480 ; SDAG-X86-NEXT: sarl %cl, %eax
481 ; SDAG-X86-NEXT: retl
483 ; FASTISEL-X86-LABEL: ashr_i32:
484 ; FASTISEL-X86: ## %bb.0:
485 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
486 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
487 ; FASTISEL-X86-NEXT: ## kill: def $cl killed $ecx
488 ; FASTISEL-X86-NEXT: sarl %cl, %eax
489 ; FASTISEL-X86-NEXT: retl
491 ; SDAG-X64-LABEL: ashr_i32:
492 ; SDAG-X64: ## %bb.0:
493 ; SDAG-X64-NEXT: movl %esi, %ecx
494 ; SDAG-X64-NEXT: movl %edi, %eax
495 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
496 ; SDAG-X64-NEXT: sarl %cl, %eax
497 ; SDAG-X64-NEXT: retq
499 ; FASTISEL-X64-LABEL: ashr_i32:
500 ; FASTISEL-X64: ## %bb.0:
501 ; FASTISEL-X64-NEXT: movl %esi, %ecx
502 ; FASTISEL-X64-NEXT: movl %edi, %eax
503 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $ecx
504 ; FASTISEL-X64-NEXT: sarl %cl, %eax
505 ; FASTISEL-X64-NEXT: retq
507 ; GISEL-X64-LABEL: ashr_i32:
508 ; GISEL-X64: ## %bb.0:
509 ; GISEL-X64-NEXT: movl %edi, %eax
510 ; GISEL-X64-NEXT: movl %esi, %ecx
511 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $ecx
512 ; GISEL-X64-NEXT: sarl %cl, %eax
513 ; GISEL-X64-NEXT: retq
518 define i64 @ashr_i64(i64 %a, i64 %b) nounwind {
519 ; SDAG-X86-LABEL: ashr_i64:
520 ; SDAG-X86: ## %bb.0:
521 ; SDAG-X86-NEXT: pushl %esi
522 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
523 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
524 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %esi
525 ; SDAG-X86-NEXT: movl %esi, %edx
526 ; SDAG-X86-NEXT: sarl %cl, %edx
527 ; SDAG-X86-NEXT: shrdl %cl, %esi, %eax
528 ; SDAG-X86-NEXT: testb $32, %cl
529 ; SDAG-X86-NEXT: je LBB11_2
530 ; SDAG-X86-NEXT: ## %bb.1:
531 ; SDAG-X86-NEXT: sarl $31, %esi
532 ; SDAG-X86-NEXT: movl %edx, %eax
533 ; SDAG-X86-NEXT: movl %esi, %edx
534 ; SDAG-X86-NEXT: LBB11_2:
535 ; SDAG-X86-NEXT: popl %esi
536 ; SDAG-X86-NEXT: retl
538 ; FASTISEL-X86-LABEL: ashr_i64:
539 ; FASTISEL-X86: ## %bb.0:
540 ; FASTISEL-X86-NEXT: pushl %esi
541 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
542 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %esi
543 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
544 ; FASTISEL-X86-NEXT: shrdl %cl, %esi, %eax
545 ; FASTISEL-X86-NEXT: movl %esi, %edx
546 ; FASTISEL-X86-NEXT: sarl %cl, %edx
547 ; FASTISEL-X86-NEXT: testb $32, %cl
548 ; FASTISEL-X86-NEXT: je LBB11_2
549 ; FASTISEL-X86-NEXT: ## %bb.1:
550 ; FASTISEL-X86-NEXT: sarl $31, %esi
551 ; FASTISEL-X86-NEXT: movl %edx, %eax
552 ; FASTISEL-X86-NEXT: movl %esi, %edx
553 ; FASTISEL-X86-NEXT: LBB11_2:
554 ; FASTISEL-X86-NEXT: popl %esi
555 ; FASTISEL-X86-NEXT: retl
557 ; SDAG-X64-LABEL: ashr_i64:
558 ; SDAG-X64: ## %bb.0:
559 ; SDAG-X64-NEXT: movq %rsi, %rcx
560 ; SDAG-X64-NEXT: movq %rdi, %rax
561 ; SDAG-X64-NEXT: ## kill: def $cl killed $cl killed $rcx
562 ; SDAG-X64-NEXT: sarq %cl, %rax
563 ; SDAG-X64-NEXT: retq
565 ; FASTISEL-X64-LABEL: ashr_i64:
566 ; FASTISEL-X64: ## %bb.0:
567 ; FASTISEL-X64-NEXT: movq %rsi, %rcx
568 ; FASTISEL-X64-NEXT: movq %rdi, %rax
569 ; FASTISEL-X64-NEXT: ## kill: def $cl killed $rcx
570 ; FASTISEL-X64-NEXT: sarq %cl, %rax
571 ; FASTISEL-X64-NEXT: retq
573 ; GISEL-X64-LABEL: ashr_i64:
574 ; GISEL-X64: ## %bb.0:
575 ; GISEL-X64-NEXT: movq %rdi, %rax
576 ; GISEL-X64-NEXT: movq %rsi, %rcx
577 ; GISEL-X64-NEXT: ## kill: def $cl killed $cl killed $rcx
578 ; GISEL-X64-NEXT: sarq %cl, %rax
579 ; GISEL-X64-NEXT: retq
584 define i8 @shl_imm1_i8(i8 %a) {
585 ; SDAG-X86-LABEL: shl_imm1_i8:
586 ; SDAG-X86: ## %bb.0:
587 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
588 ; SDAG-X86-NEXT: addb %al, %al
589 ; SDAG-X86-NEXT: retl
591 ; FASTISEL-X86-LABEL: shl_imm1_i8:
592 ; FASTISEL-X86: ## %bb.0:
593 ; FASTISEL-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
594 ; FASTISEL-X86-NEXT: shlb %al
595 ; FASTISEL-X86-NEXT: retl
597 ; SDAG-X64-LABEL: shl_imm1_i8:
598 ; SDAG-X64: ## %bb.0:
599 ; SDAG-X64-NEXT: ## kill: def $edi killed $edi def $rdi
600 ; SDAG-X64-NEXT: leal (%rdi,%rdi), %eax
601 ; SDAG-X64-NEXT: ## kill: def $al killed $al killed $eax
602 ; SDAG-X64-NEXT: retq
604 ; FASTISEL-X64-LABEL: shl_imm1_i8:
605 ; FASTISEL-X64: ## %bb.0:
606 ; FASTISEL-X64-NEXT: ## kill: def $edi killed $edi def $rdi
607 ; FASTISEL-X64-NEXT: leal (,%rdi,2), %eax
608 ; FASTISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
609 ; FASTISEL-X64-NEXT: retq
611 ; GISEL-X64-LABEL: shl_imm1_i8:
612 ; GISEL-X64: ## %bb.0:
613 ; GISEL-X64-NEXT: ## kill: def $edi killed $edi def $rdi
614 ; GISEL-X64-NEXT: leal (%rdi,%rdi), %eax
615 ; GISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
616 ; GISEL-X64-NEXT: retq
621 define i16 @shl_imm1_i16(i16 %a) {
622 ; SDAG-X86-LABEL: shl_imm1_i16:
623 ; SDAG-X86: ## %bb.0:
624 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
625 ; SDAG-X86-NEXT: addl %eax, %eax
626 ; SDAG-X86-NEXT: ## kill: def $ax killed $ax killed $eax
627 ; SDAG-X86-NEXT: retl
629 ; FASTISEL-X86-LABEL: shl_imm1_i16:
630 ; FASTISEL-X86: ## %bb.0:
631 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
632 ; FASTISEL-X86-NEXT: shlw %ax
633 ; FASTISEL-X86-NEXT: retl
635 ; SDAG-X64-LABEL: shl_imm1_i16:
636 ; SDAG-X64: ## %bb.0:
637 ; SDAG-X64-NEXT: ## kill: def $edi killed $edi def $rdi
638 ; SDAG-X64-NEXT: leal (%rdi,%rdi), %eax
639 ; SDAG-X64-NEXT: ## kill: def $ax killed $ax killed $eax
640 ; SDAG-X64-NEXT: retq
642 ; FASTISEL-X64-LABEL: shl_imm1_i16:
643 ; FASTISEL-X64: ## %bb.0:
644 ; FASTISEL-X64-NEXT: ## kill: def $edi killed $edi def $rdi
645 ; FASTISEL-X64-NEXT: leal (,%rdi,2), %eax
646 ; FASTISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
647 ; FASTISEL-X64-NEXT: retq
649 ; GISEL-X64-LABEL: shl_imm1_i16:
650 ; GISEL-X64: ## %bb.0:
651 ; GISEL-X64-NEXT: ## kill: def $edi killed $edi def $rdi
652 ; GISEL-X64-NEXT: leal (%rdi,%rdi), %eax
653 ; GISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
654 ; GISEL-X64-NEXT: retq
659 define i32 @shl_imm1_i32(i32 %a) {
660 ; SDAG-X86-LABEL: shl_imm1_i32:
661 ; SDAG-X86: ## %bb.0:
662 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
663 ; SDAG-X86-NEXT: addl %eax, %eax
664 ; SDAG-X86-NEXT: retl
666 ; FASTISEL-X86-LABEL: shl_imm1_i32:
667 ; FASTISEL-X86: ## %bb.0:
668 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
669 ; FASTISEL-X86-NEXT: shll %eax
670 ; FASTISEL-X86-NEXT: retl
672 ; SDAG-X64-LABEL: shl_imm1_i32:
673 ; SDAG-X64: ## %bb.0:
674 ; SDAG-X64-NEXT: ## kill: def $edi killed $edi def $rdi
675 ; SDAG-X64-NEXT: leal (%rdi,%rdi), %eax
676 ; SDAG-X64-NEXT: retq
678 ; FASTISEL-X64-LABEL: shl_imm1_i32:
679 ; FASTISEL-X64: ## %bb.0:
680 ; FASTISEL-X64-NEXT: ## kill: def $edi killed $edi def $rdi
681 ; FASTISEL-X64-NEXT: leal (,%rdi,2), %eax
682 ; FASTISEL-X64-NEXT: retq
684 ; GISEL-X64-LABEL: shl_imm1_i32:
685 ; GISEL-X64: ## %bb.0:
686 ; GISEL-X64-NEXT: ## kill: def $edi killed $edi def $rdi
687 ; GISEL-X64-NEXT: leal (%rdi,%rdi), %eax
688 ; GISEL-X64-NEXT: retq
693 define i64 @shl_imm1_i64(i64 %a) {
694 ; SDAG-X86-LABEL: shl_imm1_i64:
695 ; SDAG-X86: ## %bb.0:
696 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
697 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
698 ; SDAG-X86-NEXT: shldl $1, %eax, %edx
699 ; SDAG-X86-NEXT: addl %eax, %eax
700 ; SDAG-X86-NEXT: retl
702 ; FASTISEL-X86-LABEL: shl_imm1_i64:
703 ; FASTISEL-X86: ## %bb.0:
704 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
705 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
706 ; FASTISEL-X86-NEXT: shldl $1, %eax, %edx
707 ; FASTISEL-X86-NEXT: addl %eax, %eax
708 ; FASTISEL-X86-NEXT: retl
710 ; SDAG-X64-LABEL: shl_imm1_i64:
711 ; SDAG-X64: ## %bb.0:
712 ; SDAG-X64-NEXT: leaq (%rdi,%rdi), %rax
713 ; SDAG-X64-NEXT: retq
715 ; FASTISEL-X64-LABEL: shl_imm1_i64:
716 ; FASTISEL-X64: ## %bb.0:
717 ; FASTISEL-X64-NEXT: leaq (,%rdi,2), %rax
718 ; FASTISEL-X64-NEXT: retq
720 ; GISEL-X64-LABEL: shl_imm1_i64:
721 ; GISEL-X64: ## %bb.0:
722 ; GISEL-X64-NEXT: leaq (%rdi,%rdi), %rax
723 ; GISEL-X64-NEXT: retq
728 define i8 @lshr_imm1_i8(i8 %a) {
729 ; X86-LABEL: lshr_imm1_i8:
731 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
735 ; X64-LABEL: lshr_imm1_i8:
737 ; X64-NEXT: movl %edi, %eax
739 ; X64-NEXT: ## kill: def $al killed $al killed $eax
745 define i16 @lshr_imm1_i16(i16 %a) {
746 ; SDAG-X86-LABEL: lshr_imm1_i16:
747 ; SDAG-X86: ## %bb.0:
748 ; SDAG-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
749 ; SDAG-X86-NEXT: shrl %eax
750 ; SDAG-X86-NEXT: ## kill: def $ax killed $ax killed $eax
751 ; SDAG-X86-NEXT: retl
753 ; FASTISEL-X86-LABEL: lshr_imm1_i16:
754 ; FASTISEL-X86: ## %bb.0:
755 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
756 ; FASTISEL-X86-NEXT: shrw %ax
757 ; FASTISEL-X86-NEXT: retl
759 ; SDAG-X64-LABEL: lshr_imm1_i16:
760 ; SDAG-X64: ## %bb.0:
761 ; SDAG-X64-NEXT: movzwl %di, %eax
762 ; SDAG-X64-NEXT: shrl %eax
763 ; SDAG-X64-NEXT: ## kill: def $ax killed $ax killed $eax
764 ; SDAG-X64-NEXT: retq
766 ; FASTISEL-X64-LABEL: lshr_imm1_i16:
767 ; FASTISEL-X64: ## %bb.0:
768 ; FASTISEL-X64-NEXT: movl %edi, %eax
769 ; FASTISEL-X64-NEXT: shrw %ax
770 ; FASTISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
771 ; FASTISEL-X64-NEXT: retq
773 ; GISEL-X64-LABEL: lshr_imm1_i16:
774 ; GISEL-X64: ## %bb.0:
775 ; GISEL-X64-NEXT: movl %edi, %eax
776 ; GISEL-X64-NEXT: shrw %ax
777 ; GISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
778 ; GISEL-X64-NEXT: retq
783 define i32 @lshr_imm1_i32(i32 %a) {
784 ; X86-LABEL: lshr_imm1_i32:
786 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
787 ; X86-NEXT: shrl %eax
790 ; X64-LABEL: lshr_imm1_i32:
792 ; X64-NEXT: movl %edi, %eax
793 ; X64-NEXT: shrl %eax
799 define i64 @lshr_imm1_i64(i64 %a) {
800 ; SDAG-X86-LABEL: lshr_imm1_i64:
801 ; SDAG-X86: ## %bb.0:
802 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
803 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
804 ; SDAG-X86-NEXT: shrdl $1, %edx, %eax
805 ; SDAG-X86-NEXT: shrl %edx
806 ; SDAG-X86-NEXT: retl
808 ; FASTISEL-X86-LABEL: lshr_imm1_i64:
809 ; FASTISEL-X86: ## %bb.0:
810 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
811 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
812 ; FASTISEL-X86-NEXT: shrdl $1, %edx, %eax
813 ; FASTISEL-X86-NEXT: shrl %edx
814 ; FASTISEL-X86-NEXT: retl
816 ; X64-LABEL: lshr_imm1_i64:
818 ; X64-NEXT: movq %rdi, %rax
819 ; X64-NEXT: shrq %rax
825 define i8 @ashr_imm1_i8(i8 %a) {
826 ; X86-LABEL: ashr_imm1_i8:
828 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
832 ; X64-LABEL: ashr_imm1_i8:
834 ; X64-NEXT: movl %edi, %eax
836 ; X64-NEXT: ## kill: def $al killed $al killed $eax
842 define i16 @ashr_imm1_i16(i16 %a) {
843 ; SDAG-X86-LABEL: ashr_imm1_i16:
844 ; SDAG-X86: ## %bb.0:
845 ; SDAG-X86-NEXT: movswl {{[0-9]+}}(%esp), %eax
846 ; SDAG-X86-NEXT: shrl %eax
847 ; SDAG-X86-NEXT: ## kill: def $ax killed $ax killed $eax
848 ; SDAG-X86-NEXT: retl
850 ; FASTISEL-X86-LABEL: ashr_imm1_i16:
851 ; FASTISEL-X86: ## %bb.0:
852 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
853 ; FASTISEL-X86-NEXT: sarw %ax
854 ; FASTISEL-X86-NEXT: retl
856 ; SDAG-X64-LABEL: ashr_imm1_i16:
857 ; SDAG-X64: ## %bb.0:
858 ; SDAG-X64-NEXT: movswl %di, %eax
859 ; SDAG-X64-NEXT: shrl %eax
860 ; SDAG-X64-NEXT: ## kill: def $ax killed $ax killed $eax
861 ; SDAG-X64-NEXT: retq
863 ; FASTISEL-X64-LABEL: ashr_imm1_i16:
864 ; FASTISEL-X64: ## %bb.0:
865 ; FASTISEL-X64-NEXT: movl %edi, %eax
866 ; FASTISEL-X64-NEXT: sarw %ax
867 ; FASTISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
868 ; FASTISEL-X64-NEXT: retq
870 ; GISEL-X64-LABEL: ashr_imm1_i16:
871 ; GISEL-X64: ## %bb.0:
872 ; GISEL-X64-NEXT: movl %edi, %eax
873 ; GISEL-X64-NEXT: sarw %ax
874 ; GISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
875 ; GISEL-X64-NEXT: retq
880 define i32 @ashr_imm1_i32(i32 %a) {
881 ; X86-LABEL: ashr_imm1_i32:
883 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
884 ; X86-NEXT: sarl %eax
887 ; X64-LABEL: ashr_imm1_i32:
889 ; X64-NEXT: movl %edi, %eax
890 ; X64-NEXT: sarl %eax
896 define i64 @ashr_imm1_i64(i64 %a) {
897 ; SDAG-X86-LABEL: ashr_imm1_i64:
898 ; SDAG-X86: ## %bb.0:
899 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
900 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
901 ; SDAG-X86-NEXT: shrdl $1, %edx, %eax
902 ; SDAG-X86-NEXT: sarl %edx
903 ; SDAG-X86-NEXT: retl
905 ; FASTISEL-X86-LABEL: ashr_imm1_i64:
906 ; FASTISEL-X86: ## %bb.0:
907 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
908 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
909 ; FASTISEL-X86-NEXT: shrdl $1, %edx, %eax
910 ; FASTISEL-X86-NEXT: sarl %edx
911 ; FASTISEL-X86-NEXT: retl
913 ; X64-LABEL: ashr_imm1_i64:
915 ; X64-NEXT: movq %rdi, %rax
916 ; X64-NEXT: sarq %rax
922 define i8 @shl_imm4_i8(i8 %a) {
923 ; X86-LABEL: shl_imm4_i8:
925 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
926 ; X86-NEXT: shlb $4, %al
929 ; X64-LABEL: shl_imm4_i8:
931 ; X64-NEXT: movl %edi, %eax
932 ; X64-NEXT: shlb $4, %al
933 ; X64-NEXT: ## kill: def $al killed $al killed $eax
939 define i16 @shl_imm4_i16(i16 %a) {
940 ; SDAG-X86-LABEL: shl_imm4_i16:
941 ; SDAG-X86: ## %bb.0:
942 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
943 ; SDAG-X86-NEXT: shll $4, %eax
944 ; SDAG-X86-NEXT: ## kill: def $ax killed $ax killed $eax
945 ; SDAG-X86-NEXT: retl
947 ; FASTISEL-X86-LABEL: shl_imm4_i16:
948 ; FASTISEL-X86: ## %bb.0:
949 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
950 ; FASTISEL-X86-NEXT: shlw $4, %ax
951 ; FASTISEL-X86-NEXT: retl
953 ; SDAG-X64-LABEL: shl_imm4_i16:
954 ; SDAG-X64: ## %bb.0:
955 ; SDAG-X64-NEXT: movl %edi, %eax
956 ; SDAG-X64-NEXT: shll $4, %eax
957 ; SDAG-X64-NEXT: ## kill: def $ax killed $ax killed $eax
958 ; SDAG-X64-NEXT: retq
960 ; FASTISEL-X64-LABEL: shl_imm4_i16:
961 ; FASTISEL-X64: ## %bb.0:
962 ; FASTISEL-X64-NEXT: movl %edi, %eax
963 ; FASTISEL-X64-NEXT: shlw $4, %ax
964 ; FASTISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
965 ; FASTISEL-X64-NEXT: retq
967 ; GISEL-X64-LABEL: shl_imm4_i16:
968 ; GISEL-X64: ## %bb.0:
969 ; GISEL-X64-NEXT: movl %edi, %eax
970 ; GISEL-X64-NEXT: shlw $4, %ax
971 ; GISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
972 ; GISEL-X64-NEXT: retq
977 define i32 @shl_imm4_i32(i32 %a) {
978 ; X86-LABEL: shl_imm4_i32:
980 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
981 ; X86-NEXT: shll $4, %eax
984 ; X64-LABEL: shl_imm4_i32:
986 ; X64-NEXT: movl %edi, %eax
987 ; X64-NEXT: shll $4, %eax
993 define i64 @shl_imm4_i64(i64 %a) {
994 ; SDAG-X86-LABEL: shl_imm4_i64:
995 ; SDAG-X86: ## %bb.0:
996 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
997 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
998 ; SDAG-X86-NEXT: shldl $4, %eax, %edx
999 ; SDAG-X86-NEXT: shll $4, %eax
1000 ; SDAG-X86-NEXT: retl
1002 ; FASTISEL-X86-LABEL: shl_imm4_i64:
1003 ; FASTISEL-X86: ## %bb.0:
1004 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
1005 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1006 ; FASTISEL-X86-NEXT: shldl $4, %eax, %edx
1007 ; FASTISEL-X86-NEXT: shll $4, %eax
1008 ; FASTISEL-X86-NEXT: retl
1010 ; X64-LABEL: shl_imm4_i64:
1012 ; X64-NEXT: movq %rdi, %rax
1013 ; X64-NEXT: shlq $4, %rax
1019 define i8 @lshr_imm4_i8(i8 %a) {
1020 ; X86-LABEL: lshr_imm4_i8:
1022 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
1023 ; X86-NEXT: shrb $4, %al
1026 ; X64-LABEL: lshr_imm4_i8:
1028 ; X64-NEXT: movl %edi, %eax
1029 ; X64-NEXT: shrb $4, %al
1030 ; X64-NEXT: ## kill: def $al killed $al killed $eax
1036 define i16 @lshr_imm4_i16(i16 %a) {
1037 ; SDAG-X86-LABEL: lshr_imm4_i16:
1038 ; SDAG-X86: ## %bb.0:
1039 ; SDAG-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
1040 ; SDAG-X86-NEXT: shrl $4, %eax
1041 ; SDAG-X86-NEXT: ## kill: def $ax killed $ax killed $eax
1042 ; SDAG-X86-NEXT: retl
1044 ; FASTISEL-X86-LABEL: lshr_imm4_i16:
1045 ; FASTISEL-X86: ## %bb.0:
1046 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
1047 ; FASTISEL-X86-NEXT: shrw $4, %ax
1048 ; FASTISEL-X86-NEXT: retl
1050 ; SDAG-X64-LABEL: lshr_imm4_i16:
1051 ; SDAG-X64: ## %bb.0:
1052 ; SDAG-X64-NEXT: movzwl %di, %eax
1053 ; SDAG-X64-NEXT: shrl $4, %eax
1054 ; SDAG-X64-NEXT: ## kill: def $ax killed $ax killed $eax
1055 ; SDAG-X64-NEXT: retq
1057 ; FASTISEL-X64-LABEL: lshr_imm4_i16:
1058 ; FASTISEL-X64: ## %bb.0:
1059 ; FASTISEL-X64-NEXT: movl %edi, %eax
1060 ; FASTISEL-X64-NEXT: shrw $4, %ax
1061 ; FASTISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
1062 ; FASTISEL-X64-NEXT: retq
1064 ; GISEL-X64-LABEL: lshr_imm4_i16:
1065 ; GISEL-X64: ## %bb.0:
1066 ; GISEL-X64-NEXT: movl %edi, %eax
1067 ; GISEL-X64-NEXT: shrw $4, %ax
1068 ; GISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
1069 ; GISEL-X64-NEXT: retq
1074 define i32 @lshr_imm4_i32(i32 %a) {
1075 ; X86-LABEL: lshr_imm4_i32:
1077 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1078 ; X86-NEXT: shrl $4, %eax
1081 ; X64-LABEL: lshr_imm4_i32:
1083 ; X64-NEXT: movl %edi, %eax
1084 ; X64-NEXT: shrl $4, %eax
1090 define i64 @lshr_imm4_i64(i64 %a) {
1091 ; SDAG-X86-LABEL: lshr_imm4_i64:
1092 ; SDAG-X86: ## %bb.0:
1093 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1094 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
1095 ; SDAG-X86-NEXT: shrdl $4, %edx, %eax
1096 ; SDAG-X86-NEXT: shrl $4, %edx
1097 ; SDAG-X86-NEXT: retl
1099 ; FASTISEL-X86-LABEL: lshr_imm4_i64:
1100 ; FASTISEL-X86: ## %bb.0:
1101 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
1102 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1103 ; FASTISEL-X86-NEXT: shrdl $4, %edx, %eax
1104 ; FASTISEL-X86-NEXT: shrl $4, %edx
1105 ; FASTISEL-X86-NEXT: retl
1107 ; X64-LABEL: lshr_imm4_i64:
1109 ; X64-NEXT: movq %rdi, %rax
1110 ; X64-NEXT: shrq $4, %rax
1116 define i8 @ashr_imm4_i8(i8 %a) {
1117 ; X86-LABEL: ashr_imm4_i8:
1119 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
1120 ; X86-NEXT: sarb $4, %al
1123 ; X64-LABEL: ashr_imm4_i8:
1125 ; X64-NEXT: movl %edi, %eax
1126 ; X64-NEXT: sarb $4, %al
1127 ; X64-NEXT: ## kill: def $al killed $al killed $eax
1133 define i16 @ashr_imm4_i16(i16 %a) {
1134 ; SDAG-X86-LABEL: ashr_imm4_i16:
1135 ; SDAG-X86: ## %bb.0:
1136 ; SDAG-X86-NEXT: movswl {{[0-9]+}}(%esp), %eax
1137 ; SDAG-X86-NEXT: shrl $4, %eax
1138 ; SDAG-X86-NEXT: ## kill: def $ax killed $ax killed $eax
1139 ; SDAG-X86-NEXT: retl
1141 ; FASTISEL-X86-LABEL: ashr_imm4_i16:
1142 ; FASTISEL-X86: ## %bb.0:
1143 ; FASTISEL-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
1144 ; FASTISEL-X86-NEXT: sarw $4, %ax
1145 ; FASTISEL-X86-NEXT: retl
1147 ; SDAG-X64-LABEL: ashr_imm4_i16:
1148 ; SDAG-X64: ## %bb.0:
1149 ; SDAG-X64-NEXT: movswl %di, %eax
1150 ; SDAG-X64-NEXT: shrl $4, %eax
1151 ; SDAG-X64-NEXT: ## kill: def $ax killed $ax killed $eax
1152 ; SDAG-X64-NEXT: retq
1154 ; FASTISEL-X64-LABEL: ashr_imm4_i16:
1155 ; FASTISEL-X64: ## %bb.0:
1156 ; FASTISEL-X64-NEXT: movl %edi, %eax
1157 ; FASTISEL-X64-NEXT: sarw $4, %ax
1158 ; FASTISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
1159 ; FASTISEL-X64-NEXT: retq
1161 ; GISEL-X64-LABEL: ashr_imm4_i16:
1162 ; GISEL-X64: ## %bb.0:
1163 ; GISEL-X64-NEXT: movl %edi, %eax
1164 ; GISEL-X64-NEXT: sarw $4, %ax
1165 ; GISEL-X64-NEXT: ## kill: def $ax killed $ax killed $eax
1166 ; GISEL-X64-NEXT: retq
1171 define i32 @ashr_imm4_i32(i32 %a) {
1172 ; X86-LABEL: ashr_imm4_i32:
1174 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1175 ; X86-NEXT: sarl $4, %eax
1178 ; X64-LABEL: ashr_imm4_i32:
1180 ; X64-NEXT: movl %edi, %eax
1181 ; X64-NEXT: sarl $4, %eax
1187 define i64 @ashr_imm4_i64(i64 %a) {
1188 ; SDAG-X86-LABEL: ashr_imm4_i64:
1189 ; SDAG-X86: ## %bb.0:
1190 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1191 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
1192 ; SDAG-X86-NEXT: shrdl $4, %edx, %eax
1193 ; SDAG-X86-NEXT: sarl $4, %edx
1194 ; SDAG-X86-NEXT: retl
1196 ; FASTISEL-X86-LABEL: ashr_imm4_i64:
1197 ; FASTISEL-X86: ## %bb.0:
1198 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
1199 ; FASTISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1200 ; FASTISEL-X86-NEXT: shrdl $4, %edx, %eax
1201 ; FASTISEL-X86-NEXT: sarl $4, %edx
1202 ; FASTISEL-X86-NEXT: retl
1204 ; X64-LABEL: ashr_imm4_i64:
1206 ; X64-NEXT: movq %rdi, %rax
1207 ; X64-NEXT: sarq $4, %rax
1213 define i8 @PR36731(i8 %a) {
1214 ; SDAG-LABEL: PR36731:
1216 ; SDAG-NEXT: ret{{[l|q]}}
1218 ; FASTISEL-X86-LABEL: PR36731:
1219 ; FASTISEL-X86: ## %bb.0:
1220 ; FASTISEL-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
1221 ; FASTISEL-X86-NEXT: movb $255, %cl
1222 ; FASTISEL-X86-NEXT: shlb %cl, %al
1223 ; FASTISEL-X86-NEXT: retl
1225 ; FASTISEL-X64-LABEL: PR36731:
1226 ; FASTISEL-X64: ## %bb.0:
1227 ; FASTISEL-X64-NEXT: movl %edi, %eax
1228 ; FASTISEL-X64-NEXT: movb $255, %cl
1229 ; FASTISEL-X64-NEXT: shlb %cl, %al
1230 ; FASTISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
1231 ; FASTISEL-X64-NEXT: retq
1233 ; GISEL-X64-LABEL: PR36731:
1234 ; GISEL-X64: ## %bb.0:
1235 ; GISEL-X64-NEXT: movl %edi, %eax
1236 ; GISEL-X64-NEXT: shlb $255, %al
1237 ; GISEL-X64-NEXT: ## kill: def $al killed $al killed $eax
1238 ; GISEL-X64-NEXT: retq