1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=X64-NOBMI2
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+bmi2 | FileCheck %s --check-prefixes=X64-BMI2
4 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefixes=X86-NOBMI2
5 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+bmi2 | FileCheck %s --check-prefixes=X86-BMI2
7 define i64 @t0(i64 %val, i64 %shamt) nounwind {
8 ; X64-NOBMI2-LABEL: t0:
10 ; X64-NOBMI2-NEXT: movq %rdi, %rax
11 ; X64-NOBMI2-NEXT: leaq 32(%rsi), %rcx
12 ; X64-NOBMI2-NEXT: negq %rcx
13 ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx
14 ; X64-NOBMI2-NEXT: shlq %cl, %rax
15 ; X64-NOBMI2-NEXT: retq
19 ; X64-BMI2-NEXT: addq $32, %rsi
20 ; X64-BMI2-NEXT: negq %rsi
21 ; X64-BMI2-NEXT: shlxq %rsi, %rdi, %rax
24 ; X86-NOBMI2-LABEL: t0:
25 ; X86-NOBMI2: # %bb.0:
26 ; X86-NOBMI2-NEXT: pushl %esi
27 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
28 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
29 ; X86-NOBMI2-NEXT: movb $32, %cl
30 ; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
31 ; X86-NOBMI2-NEXT: movl %esi, %eax
32 ; X86-NOBMI2-NEXT: shll %cl, %eax
33 ; X86-NOBMI2-NEXT: shldl %cl, %esi, %edx
34 ; X86-NOBMI2-NEXT: testb $32, %cl
35 ; X86-NOBMI2-NEXT: je .LBB0_2
36 ; X86-NOBMI2-NEXT: # %bb.1:
37 ; X86-NOBMI2-NEXT: movl %eax, %edx
38 ; X86-NOBMI2-NEXT: xorl %eax, %eax
39 ; X86-NOBMI2-NEXT: .LBB0_2:
40 ; X86-NOBMI2-NEXT: popl %esi
41 ; X86-NOBMI2-NEXT: retl
45 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
46 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
47 ; X86-BMI2-NEXT: movb $32, %cl
48 ; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
49 ; X86-BMI2-NEXT: shldl %cl, %eax, %edx
50 ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
51 ; X86-BMI2-NEXT: testb $32, %cl
52 ; X86-BMI2-NEXT: je .LBB0_2
53 ; X86-BMI2-NEXT: # %bb.1:
54 ; X86-BMI2-NEXT: movl %eax, %edx
55 ; X86-BMI2-NEXT: xorl %eax, %eax
56 ; X86-BMI2-NEXT: .LBB0_2:
58 %negshamt = sub i64 32, %shamt
59 %shifted = shl i64 %val, %negshamt
63 ; The constant we are subtracting from should be a multiple of 32.
64 define i64 @n1(i64 %val, i64 %shamt) nounwind {
65 ; X64-NOBMI2-LABEL: n1:
66 ; X64-NOBMI2: # %bb.0:
67 ; X64-NOBMI2-NEXT: movq %rdi, %rax
68 ; X64-NOBMI2-NEXT: movb $33, %cl
69 ; X64-NOBMI2-NEXT: subb %sil, %cl
70 ; X64-NOBMI2-NEXT: shlq %cl, %rax
71 ; X64-NOBMI2-NEXT: retq
75 ; X64-BMI2-NEXT: movb $33, %al
76 ; X64-BMI2-NEXT: subb %sil, %al
77 ; X64-BMI2-NEXT: shlxq %rax, %rdi, %rax
80 ; X86-NOBMI2-LABEL: n1:
81 ; X86-NOBMI2: # %bb.0:
82 ; X86-NOBMI2-NEXT: pushl %esi
83 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
84 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
85 ; X86-NOBMI2-NEXT: movb $33, %cl
86 ; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
87 ; X86-NOBMI2-NEXT: movl %esi, %eax
88 ; X86-NOBMI2-NEXT: shll %cl, %eax
89 ; X86-NOBMI2-NEXT: shldl %cl, %esi, %edx
90 ; X86-NOBMI2-NEXT: testb $32, %cl
91 ; X86-NOBMI2-NEXT: je .LBB1_2
92 ; X86-NOBMI2-NEXT: # %bb.1:
93 ; X86-NOBMI2-NEXT: movl %eax, %edx
94 ; X86-NOBMI2-NEXT: xorl %eax, %eax
95 ; X86-NOBMI2-NEXT: .LBB1_2:
96 ; X86-NOBMI2-NEXT: popl %esi
97 ; X86-NOBMI2-NEXT: retl
101 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
102 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
103 ; X86-BMI2-NEXT: movb $33, %cl
104 ; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
105 ; X86-BMI2-NEXT: shldl %cl, %eax, %edx
106 ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
107 ; X86-BMI2-NEXT: testb $32, %cl
108 ; X86-BMI2-NEXT: je .LBB1_2
109 ; X86-BMI2-NEXT: # %bb.1:
110 ; X86-BMI2-NEXT: movl %eax, %edx
111 ; X86-BMI2-NEXT: xorl %eax, %eax
112 ; X86-BMI2-NEXT: .LBB1_2:
113 ; X86-BMI2-NEXT: retl
114 %negshamt = sub i64 33, %shamt
115 %shifted = shl i64 %val, %negshamt
118 define i64 @n2(i64 %val, i64 %shamt) nounwind {
119 ; X64-NOBMI2-LABEL: n2:
120 ; X64-NOBMI2: # %bb.0:
121 ; X64-NOBMI2-NEXT: movq %rdi, %rax
122 ; X64-NOBMI2-NEXT: movb $31, %cl
123 ; X64-NOBMI2-NEXT: subb %sil, %cl
124 ; X64-NOBMI2-NEXT: shlq %cl, %rax
125 ; X64-NOBMI2-NEXT: retq
127 ; X64-BMI2-LABEL: n2:
129 ; X64-BMI2-NEXT: movb $31, %al
130 ; X64-BMI2-NEXT: subb %sil, %al
131 ; X64-BMI2-NEXT: shlxq %rax, %rdi, %rax
132 ; X64-BMI2-NEXT: retq
134 ; X86-NOBMI2-LABEL: n2:
135 ; X86-NOBMI2: # %bb.0:
136 ; X86-NOBMI2-NEXT: pushl %esi
137 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
138 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
139 ; X86-NOBMI2-NEXT: movb $31, %cl
140 ; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
141 ; X86-NOBMI2-NEXT: movl %esi, %eax
142 ; X86-NOBMI2-NEXT: shll %cl, %eax
143 ; X86-NOBMI2-NEXT: shldl %cl, %esi, %edx
144 ; X86-NOBMI2-NEXT: testb $32, %cl
145 ; X86-NOBMI2-NEXT: je .LBB2_2
146 ; X86-NOBMI2-NEXT: # %bb.1:
147 ; X86-NOBMI2-NEXT: movl %eax, %edx
148 ; X86-NOBMI2-NEXT: xorl %eax, %eax
149 ; X86-NOBMI2-NEXT: .LBB2_2:
150 ; X86-NOBMI2-NEXT: popl %esi
151 ; X86-NOBMI2-NEXT: retl
153 ; X86-BMI2-LABEL: n2:
155 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
156 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
157 ; X86-BMI2-NEXT: movb $31, %cl
158 ; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
159 ; X86-BMI2-NEXT: shldl %cl, %eax, %edx
160 ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
161 ; X86-BMI2-NEXT: testb $32, %cl
162 ; X86-BMI2-NEXT: je .LBB2_2
163 ; X86-BMI2-NEXT: # %bb.1:
164 ; X86-BMI2-NEXT: movl %eax, %edx
165 ; X86-BMI2-NEXT: xorl %eax, %eax
166 ; X86-BMI2-NEXT: .LBB2_2:
167 ; X86-BMI2-NEXT: retl
168 %negshamt = sub i64 31, %shamt
169 %shifted = shl i64 %val, %negshamt
173 define i64 @t3(i64 %val, i64 %shamt) nounwind {
174 ; X64-NOBMI2-LABEL: t3:
175 ; X64-NOBMI2: # %bb.0:
176 ; X64-NOBMI2-NEXT: movq %rsi, %rcx
177 ; X64-NOBMI2-NEXT: movq %rdi, %rax
178 ; X64-NOBMI2-NEXT: negb %cl
179 ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx
180 ; X64-NOBMI2-NEXT: shlq %cl, %rax
181 ; X64-NOBMI2-NEXT: retq
183 ; X64-BMI2-LABEL: t3:
185 ; X64-BMI2-NEXT: negb %sil
186 ; X64-BMI2-NEXT: shlxq %rsi, %rdi, %rax
187 ; X64-BMI2-NEXT: retq
189 ; X86-NOBMI2-LABEL: t3:
190 ; X86-NOBMI2: # %bb.0:
191 ; X86-NOBMI2-NEXT: pushl %esi
192 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
193 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
194 ; X86-NOBMI2-NEXT: movb $64, %cl
195 ; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
196 ; X86-NOBMI2-NEXT: movl %esi, %eax
197 ; X86-NOBMI2-NEXT: shll %cl, %eax
198 ; X86-NOBMI2-NEXT: shldl %cl, %esi, %edx
199 ; X86-NOBMI2-NEXT: testb $32, %cl
200 ; X86-NOBMI2-NEXT: je .LBB3_2
201 ; X86-NOBMI2-NEXT: # %bb.1:
202 ; X86-NOBMI2-NEXT: movl %eax, %edx
203 ; X86-NOBMI2-NEXT: xorl %eax, %eax
204 ; X86-NOBMI2-NEXT: .LBB3_2:
205 ; X86-NOBMI2-NEXT: popl %esi
206 ; X86-NOBMI2-NEXT: retl
208 ; X86-BMI2-LABEL: t3:
210 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
211 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
212 ; X86-BMI2-NEXT: movb $64, %cl
213 ; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
214 ; X86-BMI2-NEXT: shldl %cl, %eax, %edx
215 ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
216 ; X86-BMI2-NEXT: testb $32, %cl
217 ; X86-BMI2-NEXT: je .LBB3_2
218 ; X86-BMI2-NEXT: # %bb.1:
219 ; X86-BMI2-NEXT: movl %eax, %edx
220 ; X86-BMI2-NEXT: xorl %eax, %eax
221 ; X86-BMI2-NEXT: .LBB3_2:
222 ; X86-BMI2-NEXT: retl
223 %negshamt = sub i64 64, %shamt
224 %shifted = shl i64 %val, %negshamt
228 define i64 @t4(i64 %val, i64 %shamt) nounwind {
229 ; X64-NOBMI2-LABEL: t4:
230 ; X64-NOBMI2: # %bb.0:
231 ; X64-NOBMI2-NEXT: movq %rdi, %rax
232 ; X64-NOBMI2-NEXT: leaq 96(%rsi), %rcx
233 ; X64-NOBMI2-NEXT: negq %rcx
234 ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx
235 ; X64-NOBMI2-NEXT: shlq %cl, %rax
236 ; X64-NOBMI2-NEXT: retq
238 ; X64-BMI2-LABEL: t4:
240 ; X64-BMI2-NEXT: addq $96, %rsi
241 ; X64-BMI2-NEXT: negq %rsi
242 ; X64-BMI2-NEXT: shlxq %rsi, %rdi, %rax
243 ; X64-BMI2-NEXT: retq
245 ; X86-NOBMI2-LABEL: t4:
246 ; X86-NOBMI2: # %bb.0:
247 ; X86-NOBMI2-NEXT: pushl %esi
248 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
249 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
250 ; X86-NOBMI2-NEXT: movb $96, %cl
251 ; X86-NOBMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
252 ; X86-NOBMI2-NEXT: movl %esi, %eax
253 ; X86-NOBMI2-NEXT: shll %cl, %eax
254 ; X86-NOBMI2-NEXT: shldl %cl, %esi, %edx
255 ; X86-NOBMI2-NEXT: testb $32, %cl
256 ; X86-NOBMI2-NEXT: je .LBB4_2
257 ; X86-NOBMI2-NEXT: # %bb.1:
258 ; X86-NOBMI2-NEXT: movl %eax, %edx
259 ; X86-NOBMI2-NEXT: xorl %eax, %eax
260 ; X86-NOBMI2-NEXT: .LBB4_2:
261 ; X86-NOBMI2-NEXT: popl %esi
262 ; X86-NOBMI2-NEXT: retl
264 ; X86-BMI2-LABEL: t4:
266 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
267 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
268 ; X86-BMI2-NEXT: movb $96, %cl
269 ; X86-BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
270 ; X86-BMI2-NEXT: shldl %cl, %eax, %edx
271 ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
272 ; X86-BMI2-NEXT: testb $32, %cl
273 ; X86-BMI2-NEXT: je .LBB4_2
274 ; X86-BMI2-NEXT: # %bb.1:
275 ; X86-BMI2-NEXT: movl %eax, %edx
276 ; X86-BMI2-NEXT: xorl %eax, %eax
277 ; X86-BMI2-NEXT: .LBB4_2:
278 ; X86-BMI2-NEXT: retl
279 %negshamt = sub i64 96, %shamt
280 %shifted = shl i64 %val, %negshamt
284 define i64 @t5_cse(i64 %val, i64 %shamt, ptr%dst) nounwind {
285 ; X64-NOBMI2-LABEL: t5_cse:
286 ; X64-NOBMI2: # %bb.0:
287 ; X64-NOBMI2-NEXT: movq %rdi, %rax
288 ; X64-NOBMI2-NEXT: leaq 32(%rsi), %rcx
289 ; X64-NOBMI2-NEXT: movq %rcx, (%rdx)
290 ; X64-NOBMI2-NEXT: negq %rcx
291 ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx
292 ; X64-NOBMI2-NEXT: shlq %cl, %rax
293 ; X64-NOBMI2-NEXT: retq
295 ; X64-BMI2-LABEL: t5_cse:
297 ; X64-BMI2-NEXT: addq $32, %rsi
298 ; X64-BMI2-NEXT: movq %rsi, (%rdx)
299 ; X64-BMI2-NEXT: negq %rsi
300 ; X64-BMI2-NEXT: shlxq %rsi, %rdi, %rax
301 ; X64-BMI2-NEXT: retq
303 ; X86-NOBMI2-LABEL: t5_cse:
304 ; X86-NOBMI2: # %bb.0:
305 ; X86-NOBMI2-NEXT: pushl %ebx
306 ; X86-NOBMI2-NEXT: pushl %edi
307 ; X86-NOBMI2-NEXT: pushl %esi
308 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
309 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
310 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
311 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
312 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edi
313 ; X86-NOBMI2-NEXT: movl %eax, %ebx
314 ; X86-NOBMI2-NEXT: addl $32, %ebx
315 ; X86-NOBMI2-NEXT: adcl $0, %edi
316 ; X86-NOBMI2-NEXT: movl %ebx, (%ecx)
317 ; X86-NOBMI2-NEXT: movl %edi, 4(%ecx)
318 ; X86-NOBMI2-NEXT: movb $32, %cl
319 ; X86-NOBMI2-NEXT: subb %al, %cl
320 ; X86-NOBMI2-NEXT: movl %esi, %eax
321 ; X86-NOBMI2-NEXT: shll %cl, %eax
322 ; X86-NOBMI2-NEXT: shldl %cl, %esi, %edx
323 ; X86-NOBMI2-NEXT: testb $32, %cl
324 ; X86-NOBMI2-NEXT: je .LBB5_2
325 ; X86-NOBMI2-NEXT: # %bb.1:
326 ; X86-NOBMI2-NEXT: movl %eax, %edx
327 ; X86-NOBMI2-NEXT: xorl %eax, %eax
328 ; X86-NOBMI2-NEXT: .LBB5_2:
329 ; X86-NOBMI2-NEXT: popl %esi
330 ; X86-NOBMI2-NEXT: popl %edi
331 ; X86-NOBMI2-NEXT: popl %ebx
332 ; X86-NOBMI2-NEXT: retl
334 ; X86-BMI2-LABEL: t5_cse:
336 ; X86-BMI2-NEXT: pushl %ebx
337 ; X86-BMI2-NEXT: pushl %edi
338 ; X86-BMI2-NEXT: pushl %esi
339 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
340 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
341 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
342 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %ebx
343 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
344 ; X86-BMI2-NEXT: movl %ebx, %edi
345 ; X86-BMI2-NEXT: addl $32, %edi
346 ; X86-BMI2-NEXT: adcl $0, %esi
347 ; X86-BMI2-NEXT: movl %edi, (%ecx)
348 ; X86-BMI2-NEXT: movl %esi, 4(%ecx)
349 ; X86-BMI2-NEXT: movb $32, %cl
350 ; X86-BMI2-NEXT: subb %bl, %cl
351 ; X86-BMI2-NEXT: shldl %cl, %eax, %edx
352 ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
353 ; X86-BMI2-NEXT: testb $32, %cl
354 ; X86-BMI2-NEXT: je .LBB5_2
355 ; X86-BMI2-NEXT: # %bb.1:
356 ; X86-BMI2-NEXT: movl %eax, %edx
357 ; X86-BMI2-NEXT: xorl %eax, %eax
358 ; X86-BMI2-NEXT: .LBB5_2:
359 ; X86-BMI2-NEXT: popl %esi
360 ; X86-BMI2-NEXT: popl %edi
361 ; X86-BMI2-NEXT: popl %ebx
362 ; X86-BMI2-NEXT: retl
363 %incshamt = add i64 %shamt, 32
364 store i64 %incshamt, ptr %dst
365 %negshamt = sub i64 32, %shamt
366 %shifted = shl i64 %val, %negshamt
370 define i64 @t6_cse2(i64 %val, i64 %shamt, ptr%dst) nounwind {
371 ; X64-NOBMI2-LABEL: t6_cse2:
372 ; X64-NOBMI2: # %bb.0:
373 ; X64-NOBMI2-NEXT: movq %rdi, %rax
374 ; X64-NOBMI2-NEXT: movl $32, %ecx
375 ; X64-NOBMI2-NEXT: subq %rsi, %rcx
376 ; X64-NOBMI2-NEXT: movq %rcx, (%rdx)
377 ; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx
378 ; X64-NOBMI2-NEXT: shlq %cl, %rax
379 ; X64-NOBMI2-NEXT: retq
381 ; X64-BMI2-LABEL: t6_cse2:
383 ; X64-BMI2-NEXT: movl $32, %eax
384 ; X64-BMI2-NEXT: subq %rsi, %rax
385 ; X64-BMI2-NEXT: movq %rax, (%rdx)
386 ; X64-BMI2-NEXT: shlxq %rax, %rdi, %rax
387 ; X64-BMI2-NEXT: retq
389 ; X86-NOBMI2-LABEL: t6_cse2:
390 ; X86-NOBMI2: # %bb.0:
391 ; X86-NOBMI2-NEXT: pushl %edi
392 ; X86-NOBMI2-NEXT: pushl %esi
393 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
394 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
395 ; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
396 ; X86-NOBMI2-NEXT: xorl %edi, %edi
397 ; X86-NOBMI2-NEXT: movl $32, %ecx
398 ; X86-NOBMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx
399 ; X86-NOBMI2-NEXT: sbbl {{[0-9]+}}(%esp), %edi
400 ; X86-NOBMI2-NEXT: movl %ecx, (%eax)
401 ; X86-NOBMI2-NEXT: movl %edi, 4(%eax)
402 ; X86-NOBMI2-NEXT: movl %esi, %eax
403 ; X86-NOBMI2-NEXT: shll %cl, %eax
404 ; X86-NOBMI2-NEXT: shldl %cl, %esi, %edx
405 ; X86-NOBMI2-NEXT: testb $32, %cl
406 ; X86-NOBMI2-NEXT: je .LBB6_2
407 ; X86-NOBMI2-NEXT: # %bb.1:
408 ; X86-NOBMI2-NEXT: movl %eax, %edx
409 ; X86-NOBMI2-NEXT: xorl %eax, %eax
410 ; X86-NOBMI2-NEXT: .LBB6_2:
411 ; X86-NOBMI2-NEXT: popl %esi
412 ; X86-NOBMI2-NEXT: popl %edi
413 ; X86-NOBMI2-NEXT: retl
415 ; X86-BMI2-LABEL: t6_cse2:
417 ; X86-BMI2-NEXT: pushl %edi
418 ; X86-BMI2-NEXT: pushl %esi
419 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
420 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
421 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
422 ; X86-BMI2-NEXT: xorl %edi, %edi
423 ; X86-BMI2-NEXT: movl $32, %ecx
424 ; X86-BMI2-NEXT: subl {{[0-9]+}}(%esp), %ecx
425 ; X86-BMI2-NEXT: sbbl {{[0-9]+}}(%esp), %edi
426 ; X86-BMI2-NEXT: movl %ecx, (%esi)
427 ; X86-BMI2-NEXT: movl %edi, 4(%esi)
428 ; X86-BMI2-NEXT: shldl %cl, %eax, %edx
429 ; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
430 ; X86-BMI2-NEXT: testb $32, %cl
431 ; X86-BMI2-NEXT: je .LBB6_2
432 ; X86-BMI2-NEXT: # %bb.1:
433 ; X86-BMI2-NEXT: movl %eax, %edx
434 ; X86-BMI2-NEXT: xorl %eax, %eax
435 ; X86-BMI2-NEXT: .LBB6_2:
436 ; X86-BMI2-NEXT: popl %esi
437 ; X86-BMI2-NEXT: popl %edi
438 ; X86-BMI2-NEXT: retl
439 %negshamt = sub i64 32, %shamt
440 store i64 %negshamt, ptr %dst
441 %shifted = shl i64 %val, %negshamt