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.fshr.i8(i8, i8, i8) nounwind readnone
8 declare i16 @llvm.fshr.i16(i16, i16, i16) nounwind readnone
9 declare i32 @llvm.fshr.i32(i32, i32, i32) nounwind readnone
10 declare i64 @llvm.fshr.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: shrb %cl, %ch
26 ; X86-NEXT: movb $8, %cl
27 ; X86-NEXT: subb %dl, %cl
28 ; X86-NEXT: shlb %cl, %ah
29 ; X86-NEXT: testb %dl, %dl
30 ; X86-NEXT: je .LBB0_2
32 ; X86-NEXT: orb %ch, %ah
33 ; X86-NEXT: movb %ah, %al
37 ; X64-LABEL: var_shift_i8:
39 ; X64-NEXT: andb $7, %dl
40 ; X64-NEXT: movl %esi, %eax
41 ; X64-NEXT: movl %edx, %ecx
42 ; X64-NEXT: shrb %cl, %al
43 ; X64-NEXT: movb $8, %cl
44 ; X64-NEXT: subb %dl, %cl
45 ; X64-NEXT: shlb %cl, %dil
46 ; X64-NEXT: orb %al, %dil
47 ; X64-NEXT: movzbl %dil, %eax
48 ; X64-NEXT: testb %dl, %dl
49 ; X64-NEXT: cmovel %esi, %eax
50 ; X64-NEXT: # kill: def $al killed $al killed $eax
52 %tmp = tail call i8 @llvm.fshr.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: shrdw %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: movl {{[0-9]+}}(%esp), %esi
71 ; X86-SLOW-NEXT: movb {{[0-9]+}}(%esp), %dl
72 ; X86-SLOW-NEXT: andb $15, %dl
73 ; X86-SLOW-NEXT: movzwl {{[0-9]+}}(%esp), %eax
74 ; X86-SLOW-NEXT: movl %eax, %edi
75 ; X86-SLOW-NEXT: movl %edx, %ecx
76 ; X86-SLOW-NEXT: shrl %cl, %edi
77 ; X86-SLOW-NEXT: movb $16, %cl
78 ; X86-SLOW-NEXT: subb %dl, %cl
79 ; X86-SLOW-NEXT: shll %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 %edi, %esi
84 ; X86-SLOW-NEXT: movl %esi, %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 %esi, %eax
95 ; X64-FAST-NEXT: andb $15, %cl
96 ; X64-FAST-NEXT: # kill: def $cl killed $cl killed $ecx
97 ; X64-FAST-NEXT: shrdw %cl, %di, %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 %edx, %ecx
106 ; X64-SLOW-NEXT: shrl %cl, %eax
107 ; X64-SLOW-NEXT: movb $16, %cl
108 ; X64-SLOW-NEXT: subb %dl, %cl
109 ; X64-SLOW-NEXT: shll %cl, %edi
110 ; X64-SLOW-NEXT: orl %edi, %eax
111 ; X64-SLOW-NEXT: testb %dl, %dl
112 ; X64-SLOW-NEXT: cmovel %esi, %eax
113 ; X64-SLOW-NEXT: # kill: def $ax killed $ax killed $eax
114 ; X64-SLOW-NEXT: retq
115 %tmp = tail call i16 @llvm.fshr.i16(i16 %x, i16 %y, i16 %z)
119 define i32 @var_shift_i32(i32 %x, i32 %y, i32 %z) nounwind {
120 ; X86-FAST-LABEL: var_shift_i32:
122 ; X86-FAST-NEXT: movb {{[0-9]+}}(%esp), %cl
123 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %edx
124 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
125 ; X86-FAST-NEXT: shrdl %cl, %edx, %eax
126 ; X86-FAST-NEXT: retl
128 ; X86-SLOW-LABEL: var_shift_i32:
130 ; X86-SLOW-NEXT: pushl %edi
131 ; X86-SLOW-NEXT: pushl %esi
132 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %esi
133 ; X86-SLOW-NEXT: movb {{[0-9]+}}(%esp), %dl
134 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
135 ; X86-SLOW-NEXT: movl %eax, %edi
136 ; X86-SLOW-NEXT: movl %edx, %ecx
137 ; X86-SLOW-NEXT: shrl %cl, %edi
138 ; X86-SLOW-NEXT: andb $31, %dl
139 ; X86-SLOW-NEXT: movl %edx, %ecx
140 ; X86-SLOW-NEXT: negb %cl
141 ; X86-SLOW-NEXT: shll %cl, %esi
142 ; X86-SLOW-NEXT: testb %dl, %dl
143 ; X86-SLOW-NEXT: je .LBB2_2
144 ; X86-SLOW-NEXT: # %bb.1:
145 ; X86-SLOW-NEXT: orl %edi, %esi
146 ; X86-SLOW-NEXT: movl %esi, %eax
147 ; X86-SLOW-NEXT: .LBB2_2:
148 ; X86-SLOW-NEXT: popl %esi
149 ; X86-SLOW-NEXT: popl %edi
150 ; X86-SLOW-NEXT: retl
152 ; X64-FAST-LABEL: var_shift_i32:
154 ; X64-FAST-NEXT: movl %edx, %ecx
155 ; X64-FAST-NEXT: movl %esi, %eax
156 ; X64-FAST-NEXT: # kill: def $cl killed $cl killed $ecx
157 ; X64-FAST-NEXT: shrdl %cl, %edi, %eax
158 ; X64-FAST-NEXT: retq
160 ; X64-SLOW-LABEL: var_shift_i32:
162 ; X64-SLOW-NEXT: movl %edi, %eax
163 ; X64-SLOW-NEXT: movl %esi, %edi
164 ; X64-SLOW-NEXT: movl %edx, %ecx
165 ; X64-SLOW-NEXT: shrl %cl, %edi
166 ; X64-SLOW-NEXT: andb $31, %dl
167 ; X64-SLOW-NEXT: movl %edx, %ecx
168 ; X64-SLOW-NEXT: negb %cl
169 ; X64-SLOW-NEXT: shll %cl, %eax
170 ; X64-SLOW-NEXT: orl %edi, %eax
171 ; X64-SLOW-NEXT: testb %dl, %dl
172 ; X64-SLOW-NEXT: cmovel %esi, %eax
173 ; X64-SLOW-NEXT: retq
174 %tmp = tail call i32 @llvm.fshr.i32(i32 %x, i32 %y, i32 %z)
178 define i32 @var_shift_i32_optsize(i32 %x, i32 %y, i32 %z) nounwind optsize {
179 ; X86-LABEL: var_shift_i32_optsize:
181 ; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
182 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
183 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
184 ; X86-NEXT: shrdl %cl, %edx, %eax
187 ; X64-LABEL: var_shift_i32_optsize:
189 ; X64-NEXT: movl %edx, %ecx
190 ; X64-NEXT: movl %esi, %eax
191 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
192 ; X64-NEXT: shrdl %cl, %edi, %eax
194 %tmp = tail call i32 @llvm.fshr.i32(i32 %x, i32 %y, i32 %z)
198 define i64 @var_shift_i64(i64 %x, i64 %y, i64 %z) nounwind {
199 ; X86-FAST-LABEL: var_shift_i64:
201 ; X86-FAST-NEXT: pushl %ebp
202 ; X86-FAST-NEXT: pushl %ebx
203 ; X86-FAST-NEXT: pushl %edi
204 ; X86-FAST-NEXT: pushl %esi
205 ; X86-FAST-NEXT: pushl %eax
206 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
207 ; X86-FAST-NEXT: movl %eax, (%esp) # 4-byte Spill
208 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %edx
209 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
210 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %esi
211 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %ebx
212 ; X86-FAST-NEXT: andl $63, %ebx
213 ; X86-FAST-NEXT: movb $64, %cl
214 ; X86-FAST-NEXT: subb %bl, %cl
215 ; X86-FAST-NEXT: movl %eax, %edi
216 ; X86-FAST-NEXT: shll %cl, %edi
217 ; X86-FAST-NEXT: shldl %cl, %eax, %esi
218 ; X86-FAST-NEXT: testb $32, %cl
219 ; X86-FAST-NEXT: je .LBB4_2
220 ; X86-FAST-NEXT: # %bb.1:
221 ; X86-FAST-NEXT: movl %edi, %esi
222 ; X86-FAST-NEXT: xorl %edi, %edi
223 ; X86-FAST-NEXT: .LBB4_2:
224 ; X86-FAST-NEXT: movl %edx, %ebp
225 ; X86-FAST-NEXT: movl %ebx, %ecx
226 ; X86-FAST-NEXT: shrl %cl, %ebp
227 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
228 ; X86-FAST-NEXT: shrdl %cl, %edx, %eax
229 ; X86-FAST-NEXT: testb $32, %bl
230 ; X86-FAST-NEXT: je .LBB4_4
231 ; X86-FAST-NEXT: # %bb.3:
232 ; X86-FAST-NEXT: movl %ebp, %eax
233 ; X86-FAST-NEXT: xorl %ebp, %ebp
234 ; X86-FAST-NEXT: .LBB4_4:
235 ; X86-FAST-NEXT: testl %ebx, %ebx
236 ; X86-FAST-NEXT: je .LBB4_6
237 ; X86-FAST-NEXT: # %bb.5:
238 ; X86-FAST-NEXT: orl %ebp, %esi
239 ; X86-FAST-NEXT: orl %eax, %edi
240 ; X86-FAST-NEXT: movl %edi, (%esp) # 4-byte Spill
241 ; X86-FAST-NEXT: movl %esi, %edx
242 ; X86-FAST-NEXT: .LBB4_6:
243 ; X86-FAST-NEXT: movl (%esp), %eax # 4-byte Reload
244 ; X86-FAST-NEXT: addl $4, %esp
245 ; X86-FAST-NEXT: popl %esi
246 ; X86-FAST-NEXT: popl %edi
247 ; X86-FAST-NEXT: popl %ebx
248 ; X86-FAST-NEXT: popl %ebp
249 ; X86-FAST-NEXT: retl
251 ; X86-SLOW-LABEL: var_shift_i64:
253 ; X86-SLOW-NEXT: pushl %ebp
254 ; X86-SLOW-NEXT: pushl %ebx
255 ; X86-SLOW-NEXT: pushl %edi
256 ; X86-SLOW-NEXT: pushl %esi
257 ; X86-SLOW-NEXT: subl $8, %esp
258 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
259 ; X86-SLOW-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
260 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %esi
261 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %edx
262 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ebx
263 ; X86-SLOW-NEXT: andl $63, %ebx
264 ; X86-SLOW-NEXT: movb $64, %al
265 ; X86-SLOW-NEXT: subb %bl, %al
266 ; X86-SLOW-NEXT: movl %edx, (%esp) # 4-byte Spill
267 ; X86-SLOW-NEXT: movl %eax, %ecx
268 ; X86-SLOW-NEXT: shll %cl, %edx
269 ; X86-SLOW-NEXT: movb %al, %ch
270 ; X86-SLOW-NEXT: andb $31, %ch
271 ; X86-SLOW-NEXT: movb %ch, %cl
272 ; X86-SLOW-NEXT: negb %cl
273 ; X86-SLOW-NEXT: movl %esi, %edi
274 ; X86-SLOW-NEXT: shrl %cl, %edi
275 ; X86-SLOW-NEXT: testb %ch, %ch
276 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ebp
277 ; X86-SLOW-NEXT: je .LBB4_2
278 ; X86-SLOW-NEXT: # %bb.1:
279 ; X86-SLOW-NEXT: orl %edi, %edx
280 ; X86-SLOW-NEXT: movl %edx, (%esp) # 4-byte Spill
281 ; X86-SLOW-NEXT: .LBB4_2:
282 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ecx
283 ; X86-SLOW-NEXT: movl %ecx, %edx
284 ; X86-SLOW-NEXT: movl %ebx, %ecx
285 ; X86-SLOW-NEXT: shrl %cl, %edx
286 ; X86-SLOW-NEXT: movb %bl, %ah
287 ; X86-SLOW-NEXT: andb $31, %ah
288 ; X86-SLOW-NEXT: movb %ah, %cl
289 ; X86-SLOW-NEXT: negb %cl
290 ; X86-SLOW-NEXT: movl %ebp, %edi
291 ; X86-SLOW-NEXT: shll %cl, %edi
292 ; X86-SLOW-NEXT: testb %ah, %ah
293 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ebp
294 ; X86-SLOW-NEXT: je .LBB4_4
295 ; X86-SLOW-NEXT: # %bb.3:
296 ; X86-SLOW-NEXT: orl %edx, %edi
297 ; X86-SLOW-NEXT: movl %edi, %ebp
298 ; X86-SLOW-NEXT: .LBB4_4:
299 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %edi
300 ; X86-SLOW-NEXT: movl %ebx, %ecx
301 ; X86-SLOW-NEXT: shrl %cl, %edi
302 ; X86-SLOW-NEXT: testb $32, %bl
303 ; X86-SLOW-NEXT: je .LBB4_6
304 ; X86-SLOW-NEXT: # %bb.5:
305 ; X86-SLOW-NEXT: movl %edi, %ebp
306 ; X86-SLOW-NEXT: xorl %edi, %edi
307 ; X86-SLOW-NEXT: .LBB4_6:
308 ; X86-SLOW-NEXT: movl %eax, %ecx
309 ; X86-SLOW-NEXT: shll %cl, %esi
310 ; X86-SLOW-NEXT: testb $32, %al
311 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %edx
312 ; X86-SLOW-NEXT: jne .LBB4_7
313 ; X86-SLOW-NEXT: # %bb.8:
314 ; X86-SLOW-NEXT: movl (%esp), %eax # 4-byte Reload
315 ; X86-SLOW-NEXT: testl %ebx, %ebx
316 ; X86-SLOW-NEXT: jne .LBB4_10
317 ; X86-SLOW-NEXT: jmp .LBB4_11
318 ; X86-SLOW-NEXT: .LBB4_7:
319 ; X86-SLOW-NEXT: movl %esi, %eax
320 ; X86-SLOW-NEXT: xorl %esi, %esi
321 ; X86-SLOW-NEXT: testl %ebx, %ebx
322 ; X86-SLOW-NEXT: je .LBB4_11
323 ; X86-SLOW-NEXT: .LBB4_10:
324 ; X86-SLOW-NEXT: orl %ebp, %esi
325 ; X86-SLOW-NEXT: orl %edi, %eax
326 ; X86-SLOW-NEXT: movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
327 ; X86-SLOW-NEXT: movl %eax, %edx
328 ; X86-SLOW-NEXT: .LBB4_11:
329 ; X86-SLOW-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
330 ; X86-SLOW-NEXT: addl $8, %esp
331 ; X86-SLOW-NEXT: popl %esi
332 ; X86-SLOW-NEXT: popl %edi
333 ; X86-SLOW-NEXT: popl %ebx
334 ; X86-SLOW-NEXT: popl %ebp
335 ; X86-SLOW-NEXT: retl
337 ; X64-FAST-LABEL: var_shift_i64:
339 ; X64-FAST-NEXT: movq %rdx, %rcx
340 ; X64-FAST-NEXT: movq %rsi, %rax
341 ; X64-FAST-NEXT: # kill: def $cl killed $cl killed $rcx
342 ; X64-FAST-NEXT: shrdq %cl, %rdi, %rax
343 ; X64-FAST-NEXT: retq
345 ; X64-SLOW-LABEL: var_shift_i64:
347 ; X64-SLOW-NEXT: movq %rdi, %rax
348 ; X64-SLOW-NEXT: movq %rsi, %rdi
349 ; X64-SLOW-NEXT: movl %edx, %ecx
350 ; X64-SLOW-NEXT: shrq %cl, %rdi
351 ; X64-SLOW-NEXT: andb $63, %dl
352 ; X64-SLOW-NEXT: movl %edx, %ecx
353 ; X64-SLOW-NEXT: negb %cl
354 ; X64-SLOW-NEXT: shlq %cl, %rax
355 ; X64-SLOW-NEXT: orq %rdi, %rax
356 ; X64-SLOW-NEXT: testb %dl, %dl
357 ; X64-SLOW-NEXT: cmoveq %rsi, %rax
358 ; X64-SLOW-NEXT: retq
359 %tmp = tail call i64 @llvm.fshr.i64(i64 %x, i64 %y, i64 %z)
367 define i8 @const_shift_i8(i8 %x, i8 %y) nounwind {
368 ; X86-LABEL: const_shift_i8:
370 ; X86-NEXT: movb {{[0-9]+}}(%esp), %al
371 ; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
372 ; X86-NEXT: shrb $7, %cl
373 ; X86-NEXT: addb %al, %al
374 ; X86-NEXT: orb %cl, %al
377 ; X64-LABEL: const_shift_i8:
379 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
380 ; X64-NEXT: shrb $7, %sil
381 ; X64-NEXT: leal (%rdi,%rdi), %eax
382 ; X64-NEXT: orb %sil, %al
383 ; X64-NEXT: # kill: def $al killed $al killed $eax
385 %tmp = tail call i8 @llvm.fshr.i8(i8 %x, i8 %y, i8 7)
389 define i16 @const_shift_i16(i16 %x, i16 %y) nounwind {
390 ; X86-FAST-LABEL: const_shift_i16:
392 ; X86-FAST-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
393 ; X86-FAST-NEXT: movzwl {{[0-9]+}}(%esp), %eax
394 ; X86-FAST-NEXT: shrdw $7, %cx, %ax
395 ; X86-FAST-NEXT: retl
397 ; X86-SLOW-LABEL: const_shift_i16:
399 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
400 ; X86-SLOW-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
401 ; X86-SLOW-NEXT: shrl $7, %ecx
402 ; X86-SLOW-NEXT: shll $9, %eax
403 ; X86-SLOW-NEXT: orl %ecx, %eax
404 ; X86-SLOW-NEXT: # kill: def $ax killed $ax killed $eax
405 ; X86-SLOW-NEXT: retl
407 ; X64-FAST-LABEL: const_shift_i16:
409 ; X64-FAST-NEXT: movl %esi, %eax
410 ; X64-FAST-NEXT: shrdw $7, %di, %ax
411 ; X64-FAST-NEXT: # kill: def $ax killed $ax killed $eax
412 ; X64-FAST-NEXT: retq
414 ; X64-SLOW-LABEL: const_shift_i16:
416 ; X64-SLOW-NEXT: movzwl %si, %eax
417 ; X64-SLOW-NEXT: shll $9, %edi
418 ; X64-SLOW-NEXT: shrl $7, %eax
419 ; X64-SLOW-NEXT: orl %edi, %eax
420 ; X64-SLOW-NEXT: # kill: def $ax killed $ax killed $eax
421 ; X64-SLOW-NEXT: retq
422 %tmp = tail call i16 @llvm.fshr.i16(i16 %x, i16 %y, i16 7)
426 define i32 @const_shift_i32(i32 %x, i32 %y) nounwind {
427 ; X86-FAST-LABEL: const_shift_i32:
429 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %ecx
430 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
431 ; X86-FAST-NEXT: shrdl $7, %ecx, %eax
432 ; X86-FAST-NEXT: retl
434 ; X86-SLOW-LABEL: const_shift_i32:
436 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
437 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ecx
438 ; X86-SLOW-NEXT: shrl $7, %ecx
439 ; X86-SLOW-NEXT: shll $25, %eax
440 ; X86-SLOW-NEXT: orl %ecx, %eax
441 ; X86-SLOW-NEXT: retl
443 ; X64-FAST-LABEL: const_shift_i32:
445 ; X64-FAST-NEXT: movl %edi, %eax
446 ; X64-FAST-NEXT: shldl $25, %esi, %eax
447 ; X64-FAST-NEXT: retq
449 ; X64-SLOW-LABEL: const_shift_i32:
451 ; X64-SLOW-NEXT: # kill: def $esi killed $esi def $rsi
452 ; X64-SLOW-NEXT: # kill: def $edi killed $edi def $rdi
453 ; X64-SLOW-NEXT: shrl $7, %esi
454 ; X64-SLOW-NEXT: shll $25, %edi
455 ; X64-SLOW-NEXT: leal (%rdi,%rsi), %eax
456 ; X64-SLOW-NEXT: retq
457 %tmp = tail call i32 @llvm.fshr.i32(i32 %x, i32 %y, i32 7)
461 define i64 @const_shift_i64(i64 %x, i64 %y) nounwind {
462 ; X86-FAST-LABEL: const_shift_i64:
464 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %eax
465 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %ecx
466 ; X86-FAST-NEXT: movl {{[0-9]+}}(%esp), %edx
467 ; X86-FAST-NEXT: shldl $25, %ecx, %edx
468 ; X86-FAST-NEXT: shrdl $7, %ecx, %eax
469 ; X86-FAST-NEXT: retl
471 ; X86-SLOW-LABEL: const_shift_i64:
473 ; X86-SLOW-NEXT: pushl %esi
474 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %edx
475 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %eax
476 ; X86-SLOW-NEXT: movl {{[0-9]+}}(%esp), %ecx
477 ; X86-SLOW-NEXT: movl %ecx, %esi
478 ; X86-SLOW-NEXT: shll $25, %esi
479 ; X86-SLOW-NEXT: shrl $7, %eax
480 ; X86-SLOW-NEXT: orl %esi, %eax
481 ; X86-SLOW-NEXT: shrl $7, %ecx
482 ; X86-SLOW-NEXT: shll $25, %edx
483 ; X86-SLOW-NEXT: orl %ecx, %edx
484 ; X86-SLOW-NEXT: popl %esi
485 ; X86-SLOW-NEXT: retl
487 ; X64-FAST-LABEL: const_shift_i64:
489 ; X64-FAST-NEXT: movq %rdi, %rax
490 ; X64-FAST-NEXT: shldq $57, %rsi, %rax
491 ; X64-FAST-NEXT: retq
493 ; X64-SLOW-LABEL: const_shift_i64:
495 ; X64-SLOW-NEXT: shrq $7, %rsi
496 ; X64-SLOW-NEXT: shlq $57, %rdi
497 ; X64-SLOW-NEXT: leaq (%rdi,%rsi), %rax
498 ; X64-SLOW-NEXT: retq
499 %tmp = tail call i64 @llvm.fshr.i64(i64 %x, i64 %y, i64 7)