1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefixes=CHECK,X86,X86-FAST
3 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+slow-shld | FileCheck %s --check-prefixes=CHECK,X86,X86-SLOW
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=CHECK,X64,X64-FAST
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+slow-shld | FileCheck %s --check-prefixes=CHECK,X64,X64-SLOW
7 declare i8 @llvm.fshl.i8(i8, i8, i8) nounwind readnone
8 declare i16 @llvm.fshl.i16(i16, i16, i16) nounwind readnone
9 declare i32 @llvm.fshl.i32(i32, i32, i32) nounwind readnone
10 declare i64 @llvm.fshl.i64(i64, i64, i64) nounwind readnone
13 ; Variable Funnel Shift
16 define i8 @var_shift_i8(i8 %x, i8 %y, i8 %z) nounwind {
17 ; X86-LABEL: var_shift_i8:
19 ; X86-NEXT: movb {{[0-9]+}}(%esp), %ah
20 ; X86-NEXT: movb {{[0-9]+}}(%esp), %al
21 ; X86-NEXT: movb {{[0-9]+}}(%esp), %dl
22 ; X86-NEXT: andb $7, %dl
23 ; X86-NEXT: movb %al, %ch
24 ; X86-NEXT: movb %dl, %cl
25 ; X86-NEXT: shlb %cl, %ch
26 ; X86-NEXT: movb $8, %cl
27 ; X86-NEXT: subb %dl, %cl
28 ; X86-NEXT: shrb %cl, %ah
29 ; X86-NEXT: testb %dl, %dl
30 ; X86-NEXT: je .LBB0_2
32 ; X86-NEXT: orb %ah, %ch
33 ; X86-NEXT: movb %ch, %al
37 ; X64-LABEL: var_shift_i8:
39 ; X64-NEXT: andb $7, %dl
40 ; X64-NEXT: movl %edi, %eax
41 ; X64-NEXT: movl %edx, %ecx
42 ; X64-NEXT: shlb %cl, %al
43 ; X64-NEXT: movb $8, %cl
44 ; X64-NEXT: subb %dl, %cl
45 ; X64-NEXT: shrb %cl, %sil
46 ; X64-NEXT: orb %al, %sil
47 ; X64-NEXT: movzbl %sil, %eax
48 ; X64-NEXT: testb %dl, %dl
49 ; X64-NEXT: cmovel %edi, %eax
50 ; X64-NEXT: # kill: def $al killed $al killed $eax
52 %tmp = tail call i8 @llvm.fshl.i8(i8 %x, i8 %y, i8 %z)
56 define i16 @var_shift_i16(i16 %x, i16 %y, i16 %z) nounwind {
57 ; X86-FAST-LABEL: var_shift_i16:
59 ; X86-FAST-NEXT: movzwl {{[0-9]+}}(%esp), %edx
60 ; X86-FAST-NEXT: movzwl {{[0-9]+}}(%esp), %eax
61 ; X86-FAST-NEXT: movb {{[0-9]+}}(%esp), %cl
62 ; X86-FAST-NEXT: andb $15, %cl
63 ; X86-FAST-NEXT: shldw %cl, %dx, %ax
66 ; X86-SLOW-LABEL: var_shift_i16:
68 ; X86-SLOW-NEXT: pushl %edi
69 ; X86-SLOW-NEXT: pushl %esi
70 ; X86-SLOW-NEXT: movzwl {{[0-9]+}}(%esp), %esi
71 ; X86-SLOW-NEXT: movb {{[0-9]+}}(%esp), %dl
72 ; X86-SLOW-NEXT: andb $15, %dl
73 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
74 ; X86-SLOW-NEXT: movl %eax, %edi
75 ; X86-SLOW-NEXT: movl %edx, %ecx
76 ; X86-SLOW-NEXT: shll %cl, %edi
77 ; X86-SLOW-NEXT: movb $16, %cl
78 ; X86-SLOW-NEXT: subb %dl, %cl
79 ; X86-SLOW-NEXT: shrl %cl, %esi
80 ; X86-SLOW-NEXT: testb %dl, %dl
81 ; X86-SLOW-NEXT: je .LBB1_2
82 ; X86-SLOW-NEXT: # %bb.1:
83 ; X86-SLOW-NEXT: orl %esi, %edi
84 ; X86-SLOW-NEXT: movl %edi, %eax
85 ; X86-SLOW-NEXT: .LBB1_2:
86 ; X86-SLOW-NEXT: # kill: def $ax killed $ax killed $eax
87 ; X86-SLOW-NEXT: popl %esi
88 ; X86-SLOW-NEXT: popl %edi
91 ; X64-FAST-LABEL: var_shift_i16:
93 ; X64-FAST-NEXT: movl %edx, %ecx
94 ; X64-FAST-NEXT: movl %edi, %eax
95 ; X64-FAST-NEXT: andb $15, %cl
96 ; X64-FAST-NEXT: # kill: def $cl killed $cl killed $ecx
97 ; X64-FAST-NEXT: shldw %cl, %si, %ax
98 ; X64-FAST-NEXT: # kill: def $ax killed $ax killed $eax
101 ; X64-SLOW-LABEL: var_shift_i16:
103 ; X64-SLOW-NEXT: movzwl %si, %eax
104 ; X64-SLOW-NEXT: andb $15, %dl
105 ; X64-SLOW-NEXT: movl %edi, %esi
106 ; X64-SLOW-NEXT: movl %edx, %ecx
107 ; X64-SLOW-NEXT: shll %cl, %esi
108 ; X64-SLOW-NEXT: movb $16, %cl
109 ; X64-SLOW-NEXT: subb %dl, %cl
110 ; X64-SLOW-NEXT: shrl %cl, %eax
111 ; X64-SLOW-NEXT: orl %esi, %eax
112 ; X64-SLOW-NEXT: testb %dl, %dl
113 ; X64-SLOW-NEXT: cmovel %edi, %eax
114 ; X64-SLOW-NEXT: # kill: def $ax killed $ax killed $eax
115 ; X64-SLOW-NEXT: retq
116 %tmp = tail call i16 @llvm.fshl.i16(i16 %x, i16 %y, i16 %z)
120 define i32 @var_shift_i32(i32 %x, i32 %y, i32 %z) nounwind {
121 ; X86-FAST-LABEL: var_shift_i32:
123 ; X86-FAST-NEXT: movb {{[0-9]+}}(%esp), %cl
124 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %edx
125 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
126 ; X86-FAST-NEXT: shldl %cl, %edx, %eax
127 ; X86-FAST-NEXT: retl
129 ; X86-SLOW-LABEL: var_shift_i32:
131 ; X86-SLOW-NEXT: pushl %edi
132 ; X86-SLOW-NEXT: pushl %esi
133 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %esi
134 ; X86-SLOW-NEXT: movb {{[0-9]+}}(%esp), %dl
135 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
136 ; X86-SLOW-NEXT: movl %eax, %edi
137 ; X86-SLOW-NEXT: movl %edx, %ecx
138 ; X86-SLOW-NEXT: shll %cl, %edi
139 ; X86-SLOW-NEXT: andb $31, %dl
140 ; X86-SLOW-NEXT: movl %edx, %ecx
141 ; X86-SLOW-NEXT: negb %cl
142 ; X86-SLOW-NEXT: shrl %cl, %esi
143 ; X86-SLOW-NEXT: testb %dl, %dl
144 ; X86-SLOW-NEXT: je .LBB2_2
145 ; X86-SLOW-NEXT: # %bb.1:
146 ; X86-SLOW-NEXT: orl %esi, %edi
147 ; X86-SLOW-NEXT: movl %edi, %eax
148 ; X86-SLOW-NEXT: .LBB2_2:
149 ; X86-SLOW-NEXT: popl %esi
150 ; X86-SLOW-NEXT: popl %edi
151 ; X86-SLOW-NEXT: retl
153 ; X64-FAST-LABEL: var_shift_i32:
155 ; X64-FAST-NEXT: movl %edx, %ecx
156 ; X64-FAST-NEXT: movl %edi, %eax
157 ; X64-FAST-NEXT: # kill: def $cl killed $cl killed $ecx
158 ; X64-FAST-NEXT: shldl %cl, %esi, %eax
159 ; X64-FAST-NEXT: retq
161 ; X64-SLOW-LABEL: var_shift_i32:
163 ; X64-SLOW-NEXT: movl %esi, %eax
164 ; X64-SLOW-NEXT: movl %edi, %esi
165 ; X64-SLOW-NEXT: movl %edx, %ecx
166 ; X64-SLOW-NEXT: shll %cl, %esi
167 ; X64-SLOW-NEXT: andb $31, %dl
168 ; X64-SLOW-NEXT: movl %edx, %ecx
169 ; X64-SLOW-NEXT: negb %cl
170 ; X64-SLOW-NEXT: shrl %cl, %eax
171 ; X64-SLOW-NEXT: orl %esi, %eax
172 ; X64-SLOW-NEXT: testb %dl, %dl
173 ; X64-SLOW-NEXT: cmovel %edi, %eax
174 ; X64-SLOW-NEXT: retq
175 %tmp = tail call i32 @llvm.fshl.i32(i32 %x, i32 %y, i32 %z)
179 define i32 @var_shift_i32_optsize(i32 %x, i32 %y, i32 %z) nounwind optsize {
180 ; X86-LABEL: var_shift_i32_optsize:
182 ; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
183 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
184 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
185 ; X86-NEXT: shldl %cl, %edx, %eax
188 ; X64-LABEL: var_shift_i32_optsize:
190 ; X64-NEXT: movl %edx, %ecx
191 ; X64-NEXT: movl %edi, %eax
192 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
193 ; X64-NEXT: shldl %cl, %esi, %eax
195 %tmp = tail call i32 @llvm.fshl.i32(i32 %x, i32 %y, i32 %z)
199 define i64 @var_shift_i64(i64 %x, i64 %y, i64 %z) nounwind {
200 ; X86-FAST-LABEL: var_shift_i64:
202 ; X86-FAST-NEXT: pushl %ebp
203 ; X86-FAST-NEXT: pushl %ebx
204 ; X86-FAST-NEXT: pushl %edi
205 ; X86-FAST-NEXT: pushl %esi
206 ; X86-FAST-NEXT: pushl %eax
207 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
208 ; X86-FAST-NEXT: movl %eax, (%esp) # 4-byte Spill
209 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %edx
210 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
211 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %ebp
212 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %ebx
213 ; X86-FAST-NEXT: andl $63, %ebx
214 ; X86-FAST-NEXT: movl %eax, %edi
215 ; X86-FAST-NEXT: movl %ebx, %ecx
216 ; X86-FAST-NEXT: shll %cl, %edi
217 ; X86-FAST-NEXT: shldl %cl, %eax, %ebp
218 ; X86-FAST-NEXT: testb $32, %bl
219 ; X86-FAST-NEXT: je .LBB4_2
220 ; X86-FAST-NEXT: # %bb.1:
221 ; X86-FAST-NEXT: movl %edi, %ebp
222 ; X86-FAST-NEXT: xorl %edi, %edi
223 ; X86-FAST-NEXT: .LBB4_2:
224 ; X86-FAST-NEXT: movb $64, %cl
225 ; X86-FAST-NEXT: subb %bl, %cl
226 ; X86-FAST-NEXT: movl %edx, %esi
227 ; X86-FAST-NEXT: shrl %cl, %esi
228 ; X86-FAST-NEXT: shrdl %cl, %edx, (%esp) # 4-byte Folded Spill
229 ; X86-FAST-NEXT: testb $32, %cl
230 ; X86-FAST-NEXT: jne .LBB4_3
231 ; X86-FAST-NEXT: # %bb.4:
232 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %edx
233 ; X86-FAST-NEXT: movl (%esp), %ecx # 4-byte Reload
234 ; X86-FAST-NEXT: testl %ebx, %ebx
235 ; X86-FAST-NEXT: jne .LBB4_6
236 ; X86-FAST-NEXT: jmp .LBB4_7
237 ; X86-FAST-NEXT: .LBB4_3:
238 ; X86-FAST-NEXT: movl %esi, %ecx
239 ; X86-FAST-NEXT: xorl %esi, %esi
240 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %edx
241 ; X86-FAST-NEXT: testl %ebx, %ebx
242 ; X86-FAST-NEXT: je .LBB4_7
243 ; X86-FAST-NEXT: .LBB4_6:
244 ; X86-FAST-NEXT: orl %esi, %ebp
245 ; X86-FAST-NEXT: orl %ecx, %edi
246 ; X86-FAST-NEXT: movl %edi, %eax
247 ; X86-FAST-NEXT: movl %ebp, %edx
248 ; X86-FAST-NEXT: .LBB4_7:
249 ; X86-FAST-NEXT: addl $4, %esp
250 ; X86-FAST-NEXT: popl %esi
251 ; X86-FAST-NEXT: popl %edi
252 ; X86-FAST-NEXT: popl %ebx
253 ; X86-FAST-NEXT: popl %ebp
254 ; X86-FAST-NEXT: retl
256 ; X86-SLOW-LABEL: var_shift_i64:
258 ; X86-SLOW-NEXT: pushl %ebp
259 ; X86-SLOW-NEXT: pushl %ebx
260 ; X86-SLOW-NEXT: pushl %edi
261 ; X86-SLOW-NEXT: pushl %esi
262 ; X86-SLOW-NEXT: subl $8, %esp
263 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %edi
264 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
265 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %esi
266 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ebx
267 ; X86-SLOW-NEXT: andl $63, %ebx
268 ; X86-SLOW-NEXT: movb $64, %dh
269 ; X86-SLOW-NEXT: subb %bl, %dh
270 ; X86-SLOW-NEXT: movl %eax, (%esp) # 4-byte Spill
271 ; X86-SLOW-NEXT: movb %dh, %cl
272 ; X86-SLOW-NEXT: shrl %cl, %eax
273 ; X86-SLOW-NEXT: movb %dh, %dl
274 ; X86-SLOW-NEXT: andb $31, %dl
275 ; X86-SLOW-NEXT: movl %edx, %ecx
276 ; X86-SLOW-NEXT: negb %cl
277 ; X86-SLOW-NEXT: movl %esi, %ebp
278 ; X86-SLOW-NEXT: shll %cl, %ebp
279 ; X86-SLOW-NEXT: testb %dl, %dl
280 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ecx
281 ; X86-SLOW-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
282 ; X86-SLOW-NEXT: je .LBB4_2
283 ; X86-SLOW-NEXT: # %bb.1:
284 ; X86-SLOW-NEXT: orl %eax, %ebp
285 ; X86-SLOW-NEXT: movl %ebp, (%esp) # 4-byte Spill
286 ; X86-SLOW-NEXT: .LBB4_2:
287 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ebp
288 ; X86-SLOW-NEXT: movl %ebp, %eax
289 ; X86-SLOW-NEXT: movl %ebx, %ecx
290 ; X86-SLOW-NEXT: shll %cl, %eax
291 ; X86-SLOW-NEXT: movb %bl, %ch
292 ; X86-SLOW-NEXT: andb $31, %ch
293 ; X86-SLOW-NEXT: movb %ch, %cl
294 ; X86-SLOW-NEXT: negb %cl
295 ; X86-SLOW-NEXT: shrl %cl, %edi
296 ; X86-SLOW-NEXT: testb %ch, %ch
297 ; X86-SLOW-NEXT: je .LBB4_4
298 ; X86-SLOW-NEXT: # %bb.3:
299 ; X86-SLOW-NEXT: orl %edi, %eax
300 ; X86-SLOW-NEXT: movl %eax, %ebp
301 ; X86-SLOW-NEXT: .LBB4_4:
302 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
303 ; X86-SLOW-NEXT: movl %eax, %edi
304 ; X86-SLOW-NEXT: movl %ebx, %ecx
305 ; X86-SLOW-NEXT: shll %cl, %edi
306 ; X86-SLOW-NEXT: testb $32, %bl
307 ; X86-SLOW-NEXT: je .LBB4_6
308 ; X86-SLOW-NEXT: # %bb.5:
309 ; X86-SLOW-NEXT: movl %edi, %ebp
310 ; X86-SLOW-NEXT: xorl %edi, %edi
311 ; X86-SLOW-NEXT: .LBB4_6:
312 ; X86-SLOW-NEXT: movb %dh, %cl
313 ; X86-SLOW-NEXT: shrl %cl, %esi
314 ; X86-SLOW-NEXT: testb $32, %dh
315 ; X86-SLOW-NEXT: jne .LBB4_7
316 ; X86-SLOW-NEXT: # %bb.8:
317 ; X86-SLOW-NEXT: movl (%esp), %ecx # 4-byte Reload
318 ; X86-SLOW-NEXT: testl %ebx, %ebx
319 ; X86-SLOW-NEXT: jne .LBB4_10
320 ; X86-SLOW-NEXT: jmp .LBB4_11
321 ; X86-SLOW-NEXT: .LBB4_7:
322 ; X86-SLOW-NEXT: movl %esi, %ecx
323 ; X86-SLOW-NEXT: xorl %esi, %esi
324 ; X86-SLOW-NEXT: testl %ebx, %ebx
325 ; X86-SLOW-NEXT: je .LBB4_11
326 ; X86-SLOW-NEXT: .LBB4_10:
327 ; X86-SLOW-NEXT: orl %esi, %ebp
328 ; X86-SLOW-NEXT: orl %ecx, %edi
329 ; X86-SLOW-NEXT: movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
330 ; X86-SLOW-NEXT: movl %edi, %eax
331 ; X86-SLOW-NEXT: .LBB4_11:
332 ; X86-SLOW-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
333 ; X86-SLOW-NEXT: addl $8, %esp
334 ; X86-SLOW-NEXT: popl %esi
335 ; X86-SLOW-NEXT: popl %edi
336 ; X86-SLOW-NEXT: popl %ebx
337 ; X86-SLOW-NEXT: popl %ebp
338 ; X86-SLOW-NEXT: retl
340 ; X64-FAST-LABEL: var_shift_i64:
342 ; X64-FAST-NEXT: movq %rdx, %rcx
343 ; X64-FAST-NEXT: movq %rdi, %rax
344 ; X64-FAST-NEXT: # kill: def $cl killed $cl killed $rcx
345 ; X64-FAST-NEXT: shldq %cl, %rsi, %rax
346 ; X64-FAST-NEXT: retq
348 ; X64-SLOW-LABEL: var_shift_i64:
350 ; X64-SLOW-NEXT: movq %rsi, %rax
351 ; X64-SLOW-NEXT: movq %rdi, %rsi
352 ; X64-SLOW-NEXT: movl %edx, %ecx
353 ; X64-SLOW-NEXT: shlq %cl, %rsi
354 ; X64-SLOW-NEXT: andb $63, %dl
355 ; X64-SLOW-NEXT: movl %edx, %ecx
356 ; X64-SLOW-NEXT: negb %cl
357 ; X64-SLOW-NEXT: shrq %cl, %rax
358 ; X64-SLOW-NEXT: orq %rsi, %rax
359 ; X64-SLOW-NEXT: testb %dl, %dl
360 ; X64-SLOW-NEXT: cmoveq %rdi, %rax
361 ; X64-SLOW-NEXT: retq
362 %tmp = tail call i64 @llvm.fshl.i64(i64 %x, i64 %y, i64 %z)
370 define i8 @const_shift_i8(i8 %x, i8 %y) nounwind {
371 ; X86-LABEL: const_shift_i8:
373 ; X86-NEXT: movb {{[0-9]+}}(%esp), %al
374 ; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
376 ; X86-NEXT: shlb $7, %al
377 ; X86-NEXT: orb %cl, %al
380 ; X64-LABEL: const_shift_i8:
382 ; X64-NEXT: # kill: def $esi killed $esi def $rsi
383 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
384 ; X64-NEXT: shrb %sil
385 ; X64-NEXT: shlb $7, %dil
386 ; X64-NEXT: leal (%rdi,%rsi), %eax
387 ; X64-NEXT: # kill: def $al killed $al killed $eax
389 %tmp = tail call i8 @llvm.fshl.i8(i8 %x, i8 %y, i8 7)
393 define i16 @const_shift_i16(i16 %x, i16 %y) nounwind {
394 ; X86-FAST-LABEL: const_shift_i16:
396 ; X86-FAST-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
397 ; X86-FAST-NEXT: movzwl {{[0-9]+}}(%esp), %eax
398 ; X86-FAST-NEXT: shldw $7, %cx, %ax
399 ; X86-FAST-NEXT: retl
401 ; X86-SLOW-LABEL: const_shift_i16:
403 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
404 ; X86-SLOW-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
405 ; X86-SLOW-NEXT: shrl $9, %ecx
406 ; X86-SLOW-NEXT: shll $7, %eax
407 ; X86-SLOW-NEXT: orl %ecx, %eax
408 ; X86-SLOW-NEXT: # kill: def $ax killed $ax killed $eax
409 ; X86-SLOW-NEXT: retl
411 ; X64-FAST-LABEL: const_shift_i16:
413 ; X64-FAST-NEXT: movl %edi, %eax
414 ; X64-FAST-NEXT: shldw $7, %si, %ax
415 ; X64-FAST-NEXT: # kill: def $ax killed $ax killed $eax
416 ; X64-FAST-NEXT: retq
418 ; X64-SLOW-LABEL: const_shift_i16:
420 ; X64-SLOW-NEXT: movzwl %si, %eax
421 ; X64-SLOW-NEXT: shll $7, %edi
422 ; X64-SLOW-NEXT: shrl $9, %eax
423 ; X64-SLOW-NEXT: orl %edi, %eax
424 ; X64-SLOW-NEXT: # kill: def $ax killed $ax killed $eax
425 ; X64-SLOW-NEXT: retq
426 %tmp = tail call i16 @llvm.fshl.i16(i16 %x, i16 %y, i16 7)
430 define i32 @const_shift_i32(i32 %x, i32 %y) nounwind {
431 ; X86-FAST-LABEL: const_shift_i32:
433 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %ecx
434 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
435 ; X86-FAST-NEXT: shldl $7, %ecx, %eax
436 ; X86-FAST-NEXT: retl
438 ; X86-SLOW-LABEL: const_shift_i32:
440 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
441 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ecx
442 ; X86-SLOW-NEXT: shrl $25, %ecx
443 ; X86-SLOW-NEXT: shll $7, %eax
444 ; X86-SLOW-NEXT: orl %ecx, %eax
445 ; X86-SLOW-NEXT: retl
447 ; X64-FAST-LABEL: const_shift_i32:
449 ; X64-FAST-NEXT: movl %edi, %eax
450 ; X64-FAST-NEXT: shldl $7, %esi, %eax
451 ; X64-FAST-NEXT: retq
453 ; X64-SLOW-LABEL: const_shift_i32:
455 ; X64-SLOW-NEXT: # kill: def $esi killed $esi def $rsi
456 ; X64-SLOW-NEXT: # kill: def $edi killed $edi def $rdi
457 ; X64-SLOW-NEXT: shrl $25, %esi
458 ; X64-SLOW-NEXT: shll $7, %edi
459 ; X64-SLOW-NEXT: leal (%rdi,%rsi), %eax
460 ; X64-SLOW-NEXT: retq
461 %tmp = tail call i32 @llvm.fshl.i32(i32 %x, i32 %y, i32 7)
465 define i64 @const_shift_i64(i64 %x, i64 %y) nounwind {
466 ; X86-FAST-LABEL: const_shift_i64:
468 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
469 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %ecx
470 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %edx
471 ; X86-FAST-NEXT: shrdl $25, %ecx, %eax
472 ; X86-FAST-NEXT: shldl $7, %ecx, %edx
473 ; X86-FAST-NEXT: retl
475 ; X86-SLOW-LABEL: const_shift_i64:
477 ; X86-SLOW-NEXT: pushl %esi
478 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ecx
479 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %edx
480 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %esi
481 ; X86-SLOW-NEXT: shrl $25, %esi
482 ; X86-SLOW-NEXT: movl %ecx, %eax
483 ; X86-SLOW-NEXT: shll $7, %eax
484 ; X86-SLOW-NEXT: orl %esi, %eax
485 ; X86-SLOW-NEXT: shrl $25, %ecx
486 ; X86-SLOW-NEXT: shll $7, %edx
487 ; X86-SLOW-NEXT: orl %ecx, %edx
488 ; X86-SLOW-NEXT: popl %esi
489 ; X86-SLOW-NEXT: retl
491 ; X64-FAST-LABEL: const_shift_i64:
493 ; X64-FAST-NEXT: movq %rdi, %rax
494 ; X64-FAST-NEXT: shldq $7, %rsi, %rax
495 ; X64-FAST-NEXT: retq
497 ; X64-SLOW-LABEL: const_shift_i64:
499 ; X64-SLOW-NEXT: shrq $57, %rsi
500 ; X64-SLOW-NEXT: shlq $7, %rdi
501 ; X64-SLOW-NEXT: leaq (%rdi,%rsi), %rax
502 ; X64-SLOW-NEXT: retq
503 %tmp = tail call i64 @llvm.fshl.i64(i64 %x, i64 %y, i64 7)