• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-- | FileCheck %s --check-prefixes=ALL,i686
3; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s --check-prefixes=ALL,x86_64
4
5;
6; Scalars
7;
8
9define void @test_lshr_i128(i128 %x, i128 %a, i128* nocapture %r) nounwind {
10; i686-LABEL: test_lshr_i128:
11; i686:       # %bb.0: # %entry
12; i686-NEXT:    pushl %ebp
13; i686-NEXT:    pushl %ebx
14; i686-NEXT:    pushl %edi
15; i686-NEXT:    pushl %esi
16; i686-NEXT:    subl $20, %esp
17; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
18; i686-NEXT:    movb {{[0-9]+}}(%esp), %al
19; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
20; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
21; i686-NEXT:    movl %ebp, %esi
22; i686-NEXT:    movl %eax, %ecx
23; i686-NEXT:    shrdl %cl, %edi, %esi
24; i686-NEXT:    shrl %cl, %edx
25; i686-NEXT:    shrl %cl, %edi
26; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
27; i686-NEXT:    testb $32, %al
28; i686-NEXT:    jne .LBB0_1
29; i686-NEXT:  # %bb.2: # %entry
30; i686-NEXT:    movl %edx, (%esp) # 4-byte Spill
31; i686-NEXT:    jmp .LBB0_3
32; i686-NEXT:  .LBB0_1:
33; i686-NEXT:    movl %edi, %esi
34; i686-NEXT:    movl $0, (%esp) # 4-byte Folded Spill
35; i686-NEXT:    xorl %edi, %edi
36; i686-NEXT:  .LBB0_3: # %entry
37; i686-NEXT:    movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
38; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
39; i686-NEXT:    movl %eax, %edx
40; i686-NEXT:    subb $64, %dl
41; i686-NEXT:    jb .LBB0_5
42; i686-NEXT:  # %bb.4: # %entry
43; i686-NEXT:    xorl %edi, %edi
44; i686-NEXT:  .LBB0_5: # %entry
45; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
46; i686-NEXT:    negb %dl
47; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
48; i686-NEXT:    movl %edx, %ecx
49; i686-NEXT:    shldl %cl, %ebp, %edi
50; i686-NEXT:    movl %ebp, %esi
51; i686-NEXT:    shll %cl, %esi
52; i686-NEXT:    testb $32, %dl
53; i686-NEXT:    movl %esi, %ebx
54; i686-NEXT:    jne .LBB0_7
55; i686-NEXT:  # %bb.6: # %entry
56; i686-NEXT:    movl %edi, %ebx
57; i686-NEXT:  .LBB0_7: # %entry
58; i686-NEXT:    movb %al, %ah
59; i686-NEXT:    addb $-64, %ah
60; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
61; i686-NEXT:    movb %ah, %cl
62; i686-NEXT:    shrl %cl, %edi
63; i686-NEXT:    testb $32, %ah
64; i686-NEXT:    movl $0, %ecx
65; i686-NEXT:    jne .LBB0_9
66; i686-NEXT:  # %bb.8: # %entry
67; i686-NEXT:    movl %edi, %ecx
68; i686-NEXT:  .LBB0_9: # %entry
69; i686-NEXT:    cmpb $64, %al
70; i686-NEXT:    jb .LBB0_10
71; i686-NEXT:  # %bb.11: # %entry
72; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
73; i686-NEXT:    jmp .LBB0_12
74; i686-NEXT:  .LBB0_10:
75; i686-NEXT:    movl (%esp), %ecx # 4-byte Reload
76; i686-NEXT:    orl %ebx, %ecx
77; i686-NEXT:  .LBB0_12: # %entry
78; i686-NEXT:    movl %ecx, (%esp) # 4-byte Spill
79; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
80; i686-NEXT:    testb $32, %dl
81; i686-NEXT:    jne .LBB0_14
82; i686-NEXT:  # %bb.13: # %entry
83; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
84; i686-NEXT:  .LBB0_14: # %entry
85; i686-NEXT:    movl %ebx, %edx
86; i686-NEXT:    movl %eax, %ecx
87; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
88; i686-NEXT:    shrdl %cl, %esi, %edx
89; i686-NEXT:    testb $32, %al
90; i686-NEXT:    jne .LBB0_16
91; i686-NEXT:  # %bb.15: # %entry
92; i686-NEXT:    movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
93; i686-NEXT:  .LBB0_16: # %entry
94; i686-NEXT:    movb %ah, %cl
95; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
96; i686-NEXT:    shrdl %cl, %edx, %ebp
97; i686-NEXT:    testb $32, %ah
98; i686-NEXT:    jne .LBB0_18
99; i686-NEXT:  # %bb.17: # %entry
100; i686-NEXT:    movl %ebp, %edi
101; i686-NEXT:  .LBB0_18: # %entry
102; i686-NEXT:    cmpb $64, %al
103; i686-NEXT:    jae .LBB0_20
104; i686-NEXT:  # %bb.19:
105; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Reload
106; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Folded Reload
107; i686-NEXT:  .LBB0_20: # %entry
108; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
109; i686-NEXT:    testb %al, %al
110; i686-NEXT:    je .LBB0_22
111; i686-NEXT:  # %bb.21: # %entry
112; i686-NEXT:    movl %edi, %ebx
113; i686-NEXT:    movl (%esp), %esi # 4-byte Reload
114; i686-NEXT:  .LBB0_22: # %entry
115; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
116; i686-NEXT:    movl %eax, 12(%ecx)
117; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
118; i686-NEXT:    movl %eax, 8(%ecx)
119; i686-NEXT:    movl %esi, 4(%ecx)
120; i686-NEXT:    movl %ebx, (%ecx)
121; i686-NEXT:    addl $20, %esp
122; i686-NEXT:    popl %esi
123; i686-NEXT:    popl %edi
124; i686-NEXT:    popl %ebx
125; i686-NEXT:    popl %ebp
126; i686-NEXT:    retl
127;
128; x86_64-LABEL: test_lshr_i128:
129; x86_64:       # %bb.0: # %entry
130; x86_64-NEXT:    movq %rdx, %rcx
131; x86_64-NEXT:    shrdq %cl, %rsi, %rdi
132; x86_64-NEXT:    shrq %cl, %rsi
133; x86_64-NEXT:    xorl %eax, %eax
134; x86_64-NEXT:    testb $64, %cl
135; x86_64-NEXT:    cmovneq %rsi, %rdi
136; x86_64-NEXT:    cmoveq %rsi, %rax
137; x86_64-NEXT:    movq %rax, 8(%r8)
138; x86_64-NEXT:    movq %rdi, (%r8)
139; x86_64-NEXT:    retq
140entry:
141	%0 = lshr i128 %x, %a
142	store i128 %0, i128* %r, align 16
143	ret void
144}
145
146define void @test_ashr_i128(i128 %x, i128 %a, i128* nocapture %r) nounwind {
147; i686-LABEL: test_ashr_i128:
148; i686:       # %bb.0: # %entry
149; i686-NEXT:    pushl %ebp
150; i686-NEXT:    pushl %ebx
151; i686-NEXT:    pushl %edi
152; i686-NEXT:    pushl %esi
153; i686-NEXT:    subl $24, %esp
154; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
155; i686-NEXT:    movb {{[0-9]+}}(%esp), %al
156; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
157; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
158; i686-NEXT:    movl %ebp, %esi
159; i686-NEXT:    movl %eax, %ecx
160; i686-NEXT:    shrdl %cl, %ebx, %esi
161; i686-NEXT:    shrl %cl, %edx
162; i686-NEXT:    movl %ebx, %edi
163; i686-NEXT:    sarl %cl, %edi
164; i686-NEXT:    sarl $31, %ebx
165; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
166; i686-NEXT:    testb $32, %al
167; i686-NEXT:    movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
168; i686-NEXT:    jne .LBB1_1
169; i686-NEXT:  # %bb.2: # %entry
170; i686-NEXT:    movl %edx, (%esp) # 4-byte Spill
171; i686-NEXT:    jmp .LBB1_3
172; i686-NEXT:  .LBB1_1:
173; i686-NEXT:    movl %edi, %esi
174; i686-NEXT:    movl $0, (%esp) # 4-byte Folded Spill
175; i686-NEXT:    movl %ebx, %edi
176; i686-NEXT:  .LBB1_3: # %entry
177; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
178; i686-NEXT:    movl %eax, %edx
179; i686-NEXT:    subb $64, %dl
180; i686-NEXT:    jb .LBB1_5
181; i686-NEXT:  # %bb.4: # %entry
182; i686-NEXT:    movl %ebx, %edi
183; i686-NEXT:  .LBB1_5: # %entry
184; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
185; i686-NEXT:    negb %dl
186; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
187; i686-NEXT:    movl %edx, %ecx
188; i686-NEXT:    shldl %cl, %ebp, %edi
189; i686-NEXT:    movl %ebp, %esi
190; i686-NEXT:    shll %cl, %esi
191; i686-NEXT:    testb $32, %dl
192; i686-NEXT:    movl %esi, %ecx
193; i686-NEXT:    jne .LBB1_7
194; i686-NEXT:  # %bb.6: # %entry
195; i686-NEXT:    movl %edi, %ecx
196; i686-NEXT:  .LBB1_7: # %entry
197; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
198; i686-NEXT:    movb %al, %ah
199; i686-NEXT:    addb $-64, %ah
200; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
201; i686-NEXT:    movb %ah, %cl
202; i686-NEXT:    sarl %cl, %edi
203; i686-NEXT:    testb $32, %ah
204; i686-NEXT:    movl %ebx, %ecx
205; i686-NEXT:    jne .LBB1_9
206; i686-NEXT:  # %bb.8: # %entry
207; i686-NEXT:    movl %edi, %ecx
208; i686-NEXT:  .LBB1_9: # %entry
209; i686-NEXT:    cmpb $64, %al
210; i686-NEXT:    jb .LBB1_10
211; i686-NEXT:  # %bb.11: # %entry
212; i686-NEXT:    movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
213; i686-NEXT:    jmp .LBB1_12
214; i686-NEXT:  .LBB1_10:
215; i686-NEXT:    movl (%esp), %ecx # 4-byte Reload
216; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Folded Reload
217; i686-NEXT:  .LBB1_12: # %entry
218; i686-NEXT:    movl %ecx, (%esp) # 4-byte Spill
219; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
220; i686-NEXT:    testb $32, %dl
221; i686-NEXT:    jne .LBB1_14
222; i686-NEXT:  # %bb.13: # %entry
223; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
224; i686-NEXT:  .LBB1_14: # %entry
225; i686-NEXT:    movl %ebx, %edx
226; i686-NEXT:    movl %eax, %ecx
227; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
228; i686-NEXT:    shrdl %cl, %esi, %edx
229; i686-NEXT:    testb $32, %al
230; i686-NEXT:    jne .LBB1_16
231; i686-NEXT:  # %bb.15: # %entry
232; i686-NEXT:    movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
233; i686-NEXT:  .LBB1_16: # %entry
234; i686-NEXT:    movb %ah, %cl
235; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
236; i686-NEXT:    shrdl %cl, %edx, %ebp
237; i686-NEXT:    testb $32, %ah
238; i686-NEXT:    jne .LBB1_18
239; i686-NEXT:  # %bb.17: # %entry
240; i686-NEXT:    movl %ebp, %edi
241; i686-NEXT:  .LBB1_18: # %entry
242; i686-NEXT:    cmpb $64, %al
243; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
244; i686-NEXT:    jae .LBB1_20
245; i686-NEXT:  # %bb.19:
246; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Folded Reload
247; i686-NEXT:    movl %ecx, %edi
248; i686-NEXT:  .LBB1_20: # %entry
249; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
250; i686-NEXT:    testb %al, %al
251; i686-NEXT:    je .LBB1_22
252; i686-NEXT:  # %bb.21: # %entry
253; i686-NEXT:    movl %edi, %ebx
254; i686-NEXT:    movl (%esp), %esi # 4-byte Reload
255; i686-NEXT:  .LBB1_22: # %entry
256; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
257; i686-NEXT:    movl %eax, 12(%ecx)
258; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
259; i686-NEXT:    movl %eax, 8(%ecx)
260; i686-NEXT:    movl %esi, 4(%ecx)
261; i686-NEXT:    movl %ebx, (%ecx)
262; i686-NEXT:    addl $24, %esp
263; i686-NEXT:    popl %esi
264; i686-NEXT:    popl %edi
265; i686-NEXT:    popl %ebx
266; i686-NEXT:    popl %ebp
267; i686-NEXT:    retl
268;
269; x86_64-LABEL: test_ashr_i128:
270; x86_64:       # %bb.0: # %entry
271; x86_64-NEXT:    movq %rdx, %rcx
272; x86_64-NEXT:    shrdq %cl, %rsi, %rdi
273; x86_64-NEXT:    movq %rsi, %rax
274; x86_64-NEXT:    sarq %cl, %rax
275; x86_64-NEXT:    sarq $63, %rsi
276; x86_64-NEXT:    testb $64, %cl
277; x86_64-NEXT:    cmovneq %rax, %rdi
278; x86_64-NEXT:    cmoveq %rax, %rsi
279; x86_64-NEXT:    movq %rsi, 8(%r8)
280; x86_64-NEXT:    movq %rdi, (%r8)
281; x86_64-NEXT:    retq
282entry:
283	%0 = ashr i128 %x, %a
284	store i128 %0, i128* %r, align 16
285	ret void
286}
287
288define void @test_shl_i128(i128 %x, i128 %a, i128* nocapture %r) nounwind {
289; i686-LABEL: test_shl_i128:
290; i686:       # %bb.0: # %entry
291; i686-NEXT:    pushl %ebp
292; i686-NEXT:    pushl %ebx
293; i686-NEXT:    pushl %edi
294; i686-NEXT:    pushl %esi
295; i686-NEXT:    subl $20, %esp
296; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
297; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
298; i686-NEXT:    movb {{[0-9]+}}(%esp), %al
299; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
300; i686-NEXT:    movl %eax, %ecx
301; i686-NEXT:    shll %cl, %ebx
302; i686-NEXT:    movl %ebp, %esi
303; i686-NEXT:    shll %cl, %esi
304; i686-NEXT:    movl %edi, %edx
305; i686-NEXT:    shldl %cl, %ebp, %edx
306; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
307; i686-NEXT:    testb $32, %al
308; i686-NEXT:    jne .LBB2_1
309; i686-NEXT:  # %bb.2: # %entry
310; i686-NEXT:    movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
311; i686-NEXT:    movl %ebx, (%esp) # 4-byte Spill
312; i686-NEXT:    jmp .LBB2_3
313; i686-NEXT:  .LBB2_1:
314; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
315; i686-NEXT:    movl $0, (%esp) # 4-byte Folded Spill
316; i686-NEXT:    xorl %esi, %esi
317; i686-NEXT:  .LBB2_3: # %entry
318; i686-NEXT:    movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
319; i686-NEXT:    movl %eax, %edx
320; i686-NEXT:    subb $64, %dl
321; i686-NEXT:    jb .LBB2_5
322; i686-NEXT:  # %bb.4: # %entry
323; i686-NEXT:    xorl %esi, %esi
324; i686-NEXT:  .LBB2_5: # %entry
325; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
326; i686-NEXT:    negb %dl
327; i686-NEXT:    movl %edi, %esi
328; i686-NEXT:    movl %edx, %ecx
329; i686-NEXT:    shrl %cl, %esi
330; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
331; i686-NEXT:    shrdl %cl, %edi, %ebx
332; i686-NEXT:    testb $32, %dl
333; i686-NEXT:    movl %esi, %ebp
334; i686-NEXT:    jne .LBB2_7
335; i686-NEXT:  # %bb.6: # %entry
336; i686-NEXT:    movl %ebx, %ebp
337; i686-NEXT:  .LBB2_7: # %entry
338; i686-NEXT:    movb %al, %ah
339; i686-NEXT:    addb $-64, %ah
340; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
341; i686-NEXT:    movb %ah, %cl
342; i686-NEXT:    shll %cl, %ebx
343; i686-NEXT:    testb $32, %ah
344; i686-NEXT:    movl $0, %ecx
345; i686-NEXT:    jne .LBB2_9
346; i686-NEXT:  # %bb.8: # %entry
347; i686-NEXT:    movl %ebx, %ecx
348; i686-NEXT:  .LBB2_9: # %entry
349; i686-NEXT:    cmpb $64, %al
350; i686-NEXT:    jb .LBB2_10
351; i686-NEXT:  # %bb.11: # %entry
352; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
353; i686-NEXT:    jmp .LBB2_12
354; i686-NEXT:  .LBB2_10:
355; i686-NEXT:    movl (%esp), %ecx # 4-byte Reload
356; i686-NEXT:    orl %ebp, %ecx
357; i686-NEXT:  .LBB2_12: # %entry
358; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
359; i686-NEXT:    movl %ecx, (%esp) # 4-byte Spill
360; i686-NEXT:    testb $32, %dl
361; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
362; i686-NEXT:    jne .LBB2_14
363; i686-NEXT:  # %bb.13: # %entry
364; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
365; i686-NEXT:  .LBB2_14: # %entry
366; i686-NEXT:    movl %edx, %esi
367; i686-NEXT:    movl %eax, %ecx
368; i686-NEXT:    shldl %cl, %ebp, %esi
369; i686-NEXT:    testb $32, %al
370; i686-NEXT:    jne .LBB2_16
371; i686-NEXT:  # %bb.15: # %entry
372; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
373; i686-NEXT:  .LBB2_16: # %entry
374; i686-NEXT:    movb %ah, %cl
375; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
376; i686-NEXT:    shldl %cl, %esi, %edi
377; i686-NEXT:    testb $32, %ah
378; i686-NEXT:    jne .LBB2_18
379; i686-NEXT:  # %bb.17: # %entry
380; i686-NEXT:    movl %edi, %ebx
381; i686-NEXT:  .LBB2_18: # %entry
382; i686-NEXT:    cmpb $64, %al
383; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
384; i686-NEXT:    jae .LBB2_20
385; i686-NEXT:  # %bb.19:
386; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Reload
387; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Folded Reload
388; i686-NEXT:  .LBB2_20: # %entry
389; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
390; i686-NEXT:    testb %al, %al
391; i686-NEXT:    je .LBB2_22
392; i686-NEXT:  # %bb.21: # %entry
393; i686-NEXT:    movl %ebx, %edx
394; i686-NEXT:    movl (%esp), %ebp # 4-byte Reload
395; i686-NEXT:  .LBB2_22: # %entry
396; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
397; i686-NEXT:    movl %eax, 4(%ecx)
398; i686-NEXT:    movl %esi, (%ecx)
399; i686-NEXT:    movl %edx, 12(%ecx)
400; i686-NEXT:    movl %ebp, 8(%ecx)
401; i686-NEXT:    addl $20, %esp
402; i686-NEXT:    popl %esi
403; i686-NEXT:    popl %edi
404; i686-NEXT:    popl %ebx
405; i686-NEXT:    popl %ebp
406; i686-NEXT:    retl
407;
408; x86_64-LABEL: test_shl_i128:
409; x86_64:       # %bb.0: # %entry
410; x86_64-NEXT:    movq %rdx, %rcx
411; x86_64-NEXT:    shldq %cl, %rdi, %rsi
412; x86_64-NEXT:    shlq %cl, %rdi
413; x86_64-NEXT:    xorl %eax, %eax
414; x86_64-NEXT:    testb $64, %cl
415; x86_64-NEXT:    cmovneq %rdi, %rsi
416; x86_64-NEXT:    cmoveq %rdi, %rax
417; x86_64-NEXT:    movq %rsi, 8(%r8)
418; x86_64-NEXT:    movq %rax, (%r8)
419; x86_64-NEXT:    retq
420entry:
421	%0 = shl i128 %x, %a
422	store i128 %0, i128* %r, align 16
423	ret void
424}
425
426define void @test_lshr_i128_outofrange(i128 %x, i128* nocapture %r) nounwind {
427; ALL-LABEL: test_lshr_i128_outofrange:
428; ALL:       # %bb.0: # %entry
429; ALL-NEXT:    ret{{[l|q]}}
430entry:
431	%0 = lshr i128 %x, -1
432	store i128 %0, i128* %r, align 16
433	ret void
434}
435
436define void @test_ashr_i128_outofrange(i128 %x, i128* nocapture %r) nounwind {
437; ALL-LABEL: test_ashr_i128_outofrange:
438; ALL:       # %bb.0: # %entry
439; ALL-NEXT:    ret{{[l|q]}}
440entry:
441	%0 = ashr i128 %x, -1
442	store i128 %0, i128* %r, align 16
443	ret void
444}
445
446define void @test_shl_i128_outofrange(i128 %x, i128* nocapture %r) nounwind {
447; ALL-LABEL: test_shl_i128_outofrange:
448; ALL:       # %bb.0: # %entry
449; ALL-NEXT:    ret{{[l|q]}}
450entry:
451	%0 = shl i128 %x, -1
452	store i128 %0, i128* %r, align 16
453	ret void
454}
455
456;
457; Vectors
458;
459
460define void @test_lshr_v2i128(<2 x i128> %x, <2 x i128> %a, <2 x i128>* nocapture %r) nounwind {
461; i686-LABEL: test_lshr_v2i128:
462; i686:       # %bb.0: # %entry
463; i686-NEXT:    pushl %ebp
464; i686-NEXT:    pushl %ebx
465; i686-NEXT:    pushl %edi
466; i686-NEXT:    pushl %esi
467; i686-NEXT:    subl $68, %esp
468; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
469; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
470; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
471; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
472; i686-NEXT:    movl %ebx, %edi
473; i686-NEXT:    movl %eax, %ecx
474; i686-NEXT:    shrl %cl, %edi
475; i686-NEXT:    movl %esi, %ebp
476; i686-NEXT:    shrl %cl, %ebp
477; i686-NEXT:    shrdl %cl, %esi, %edx
478; i686-NEXT:    testb $32, %al
479; i686-NEXT:    jne .LBB6_1
480; i686-NEXT:  # %bb.2: # %entry
481; i686-NEXT:    movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
482; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
483; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
484; i686-NEXT:    jmp .LBB6_3
485; i686-NEXT:  .LBB6_1:
486; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
487; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
488; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
489; i686-NEXT:  .LBB6_3: # %entry
490; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
491; i686-NEXT:    movl %eax, %ecx
492; i686-NEXT:    shrdl %cl, %ebx, %esi
493; i686-NEXT:    testb $32, %al
494; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
495; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
496; i686-NEXT:    jne .LBB6_5
497; i686-NEXT:  # %bb.4: # %entry
498; i686-NEXT:    movl %esi, %edi
499; i686-NEXT:  .LBB6_5: # %entry
500; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
501; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
502; i686-NEXT:    movl %edx, %ecx
503; i686-NEXT:    shrl %cl, %ebx
504; i686-NEXT:    shrl %cl, %ebp
505; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
506; i686-NEXT:    movl %edx, %ecx
507; i686-NEXT:    subl $64, %ecx
508; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
509; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
510; i686-NEXT:    sbbl $0, %ecx
511; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
512; i686-NEXT:    sbbl $0, %ecx
513; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
514; i686-NEXT:    sbbl $0, %ecx
515; i686-NEXT:    setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
516; i686-NEXT:    testb $32, %dl
517; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
518; i686-NEXT:    movl $0, %ecx
519; i686-NEXT:    jne .LBB6_7
520; i686-NEXT:  # %bb.6: # %entry
521; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
522; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
523; i686-NEXT:    movl %ebx, %ecx
524; i686-NEXT:  .LBB6_7: # %entry
525; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
526; i686-NEXT:    movl %edx, %ecx
527; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
528; i686-NEXT:    shrdl %cl, %ebp, %esi
529; i686-NEXT:    testb $32, %dl
530; i686-NEXT:    jne .LBB6_9
531; i686-NEXT:  # %bb.8: # %entry
532; i686-NEXT:    movl %esi, %ebx
533; i686-NEXT:  .LBB6_9: # %entry
534; i686-NEXT:    movl %edi, %esi
535; i686-NEXT:    movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
536; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
537; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
538; i686-NEXT:    shrl %cl, %ebp
539; i686-NEXT:    testb $32, %cl
540; i686-NEXT:    movl $0, %ecx
541; i686-NEXT:    jne .LBB6_11
542; i686-NEXT:  # %bb.10: # %entry
543; i686-NEXT:    movl %ebp, %ecx
544; i686-NEXT:  .LBB6_11: # %entry
545; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
546; i686-NEXT:    movb $64, %cl
547; i686-NEXT:    subb %dl, %cl
548; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
549; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
550; i686-NEXT:    shldl %cl, %ebx, %edi
551; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
552; i686-NEXT:    movl %ebx, %edi
553; i686-NEXT:    shll %cl, %edi
554; i686-NEXT:    testb $32, %cl
555; i686-NEXT:    movb $64, %bl
556; i686-NEXT:    jne .LBB6_12
557; i686-NEXT:  # %bb.13: # %entry
558; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
559; i686-NEXT:    jmp .LBB6_14
560; i686-NEXT:  .LBB6_12:
561; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
562; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
563; i686-NEXT:  .LBB6_14: # %entry
564; i686-NEXT:    movl %esi, %edi
565; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
566; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
567; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
568; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
569; i686-NEXT:    movl %edx, %ecx
570; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
571; i686-NEXT:    shrdl %cl, %ebp, %esi
572; i686-NEXT:    testb $32, %dl
573; i686-NEXT:    jne .LBB6_16
574; i686-NEXT:  # %bb.15: # %entry
575; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
576; i686-NEXT:  .LBB6_16: # %entry
577; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
578; i686-NEXT:    subb %al, %bl
579; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
580; i686-NEXT:    movl %ebx, %ecx
581; i686-NEXT:    shll %cl, %ebp
582; i686-NEXT:    testb $32, %bl
583; i686-NEXT:    movl $0, %ecx
584; i686-NEXT:    jne .LBB6_18
585; i686-NEXT:  # %bb.17: # %entry
586; i686-NEXT:    movl %ebp, %ecx
587; i686-NEXT:  .LBB6_18: # %entry
588; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
589; i686-NEXT:    movl %eax, %ecx
590; i686-NEXT:    subl $64, %ecx
591; i686-NEXT:    sbbl $0, %esi
592; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
593; i686-NEXT:    sbbl $0, %esi
594; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
595; i686-NEXT:    sbbl $0, %esi
596; i686-NEXT:    setae %bh
597; i686-NEXT:    jb .LBB6_20
598; i686-NEXT:  # %bb.19: # %entry
599; i686-NEXT:    xorl %edi, %edi
600; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
601; i686-NEXT:  .LBB6_20: # %entry
602; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
603; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
604; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
605; i686-NEXT:    shrdl %cl, %esi, %edi
606; i686-NEXT:    shrl %cl, %esi
607; i686-NEXT:    testb $32, %cl
608; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
609; i686-NEXT:    jne .LBB6_22
610; i686-NEXT:  # %bb.21: # %entry
611; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
612; i686-NEXT:  .LBB6_22: # %entry
613; i686-NEXT:    testb %bh, %bh
614; i686-NEXT:    jne .LBB6_24
615; i686-NEXT:  # %bb.23:
616; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Reload
617; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Folded Reload
618; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
619; i686-NEXT:  .LBB6_24: # %entry
620; i686-NEXT:    testb $32, %cl
621; i686-NEXT:    movl $0, %ecx
622; i686-NEXT:    jne .LBB6_26
623; i686-NEXT:  # %bb.25: # %entry
624; i686-NEXT:    movl %esi, %ecx
625; i686-NEXT:  .LBB6_26: # %entry
626; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
627; i686-NEXT:    movl %ebx, %ecx
628; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
629; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
630; i686-NEXT:    shldl %cl, %edi, %esi
631; i686-NEXT:    testb $32, %bl
632; i686-NEXT:    jne .LBB6_28
633; i686-NEXT:  # %bb.27: # %entry
634; i686-NEXT:    movl %esi, %ebp
635; i686-NEXT:  .LBB6_28: # %entry
636; i686-NEXT:    testb %bh, %bh
637; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
638; i686-NEXT:    jne .LBB6_30
639; i686-NEXT:  # %bb.29:
640; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
641; i686-NEXT:    orl %ebp, %ecx
642; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
643; i686-NEXT:  .LBB6_30: # %entry
644; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
645; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
646; i686-NEXT:    jne .LBB6_32
647; i686-NEXT:  # %bb.31: # %entry
648; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
649; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
650; i686-NEXT:  .LBB6_32: # %entry
651; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
652; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
653; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
654; i686-NEXT:    shrdl %cl, %ebp, %edi
655; i686-NEXT:    movl %edi, %ebp
656; i686-NEXT:    testb $32, %cl
657; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Reload
658; i686-NEXT:    je .LBB6_33
659; i686-NEXT:  # %bb.34: # %entry
660; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
661; i686-NEXT:    jne .LBB6_35
662; i686-NEXT:  .LBB6_36: # %entry
663; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
664; i686-NEXT:    je .LBB6_38
665; i686-NEXT:  .LBB6_37:
666; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
667; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Folded Reload
668; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
669; i686-NEXT:  .LBB6_38: # %entry
670; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
671; i686-NEXT:    orl {{[0-9]+}}(%esp), %ecx
672; i686-NEXT:    orl {{[0-9]+}}(%esp), %edx
673; i686-NEXT:    orl %ecx, %edx
674; i686-NEXT:    je .LBB6_40
675; i686-NEXT:  # %bb.39: # %entry
676; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
677; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Reload
678; i686-NEXT:  .LBB6_40: # %entry
679; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
680; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
681; i686-NEXT:    orl {{[0-9]+}}(%esp), %edx
682; i686-NEXT:    orl {{[0-9]+}}(%esp), %eax
683; i686-NEXT:    orl %edx, %eax
684; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
685; i686-NEXT:    je .LBB6_42
686; i686-NEXT:  # %bb.41: # %entry
687; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
688; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
689; i686-NEXT:  .LBB6_42: # %entry
690; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
691; i686-NEXT:    movl %edx, 28(%ecx)
692; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
693; i686-NEXT:    movl %edx, 24(%ecx)
694; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
695; i686-NEXT:    movl %edx, 12(%ecx)
696; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
697; i686-NEXT:    movl %edx, 8(%ecx)
698; i686-NEXT:    movl %esi, 20(%ecx)
699; i686-NEXT:    movl %eax, 16(%ecx)
700; i686-NEXT:    movl %ebx, 4(%ecx)
701; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
702; i686-NEXT:    movl %eax, (%ecx)
703; i686-NEXT:    addl $68, %esp
704; i686-NEXT:    popl %esi
705; i686-NEXT:    popl %edi
706; i686-NEXT:    popl %ebx
707; i686-NEXT:    popl %ebp
708; i686-NEXT:    retl
709; i686-NEXT:  .LBB6_33: # %entry
710; i686-NEXT:    movl %ebp, %edi
711; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
712; i686-NEXT:    je .LBB6_36
713; i686-NEXT:  .LBB6_35:
714; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
715; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Folded Reload
716; i686-NEXT:    movl %ecx, %edi
717; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
718; i686-NEXT:    jne .LBB6_37
719; i686-NEXT:    jmp .LBB6_38
720;
721; x86_64-LABEL: test_lshr_v2i128:
722; x86_64:       # %bb.0: # %entry
723; x86_64-NEXT:    movq %rcx, %rax
724; x86_64-NEXT:    movq {{[0-9]+}}(%rsp), %r10
725; x86_64-NEXT:    movb {{[0-9]+}}(%rsp), %r9b
726; x86_64-NEXT:    movl %r9d, %ecx
727; x86_64-NEXT:    shrdq %cl, %rax, %rdx
728; x86_64-NEXT:    movl %r8d, %ecx
729; x86_64-NEXT:    shrdq %cl, %rsi, %rdi
730; x86_64-NEXT:    shrq %cl, %rsi
731; x86_64-NEXT:    xorl %r11d, %r11d
732; x86_64-NEXT:    testb $64, %r8b
733; x86_64-NEXT:    cmovneq %rsi, %rdi
734; x86_64-NEXT:    cmovneq %r11, %rsi
735; x86_64-NEXT:    movl %r9d, %ecx
736; x86_64-NEXT:    shrq %cl, %rax
737; x86_64-NEXT:    testb $64, %r9b
738; x86_64-NEXT:    cmovneq %rax, %rdx
739; x86_64-NEXT:    cmovneq %r11, %rax
740; x86_64-NEXT:    movq %rax, 24(%r10)
741; x86_64-NEXT:    movq %rdx, 16(%r10)
742; x86_64-NEXT:    movq %rsi, 8(%r10)
743; x86_64-NEXT:    movq %rdi, (%r10)
744; x86_64-NEXT:    retq
745entry:
746	%0 = lshr <2 x i128> %x, %a
747	store <2 x i128> %0, <2 x i128>* %r, align 16
748	ret void
749}
750
751define void @test_ashr_v2i128(<2 x i128> %x, <2 x i128> %a, <2 x i128>* nocapture %r) nounwind {
752; i686-LABEL: test_ashr_v2i128:
753; i686:       # %bb.0: # %entry
754; i686-NEXT:    pushl %ebp
755; i686-NEXT:    pushl %ebx
756; i686-NEXT:    pushl %edi
757; i686-NEXT:    pushl %esi
758; i686-NEXT:    subl $80, %esp
759; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
760; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
761; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
762; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
763; i686-NEXT:    movl %ebp, %ebx
764; i686-NEXT:    movl %eax, %ecx
765; i686-NEXT:    sarl %cl, %ebx
766; i686-NEXT:    movl %esi, %edi
767; i686-NEXT:    shrl %cl, %edi
768; i686-NEXT:    shrdl %cl, %esi, %edx
769; i686-NEXT:    sarl $31, %ebp
770; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
771; i686-NEXT:    testb $32, %al
772; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
773; i686-NEXT:    jne .LBB7_1
774; i686-NEXT:  # %bb.2: # %entry
775; i686-NEXT:    movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
776; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
777; i686-NEXT:    movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
778; i686-NEXT:    jmp .LBB7_3
779; i686-NEXT:  .LBB7_1:
780; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
781; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
782; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
783; i686-NEXT:  .LBB7_3: # %entry
784; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
785; i686-NEXT:    movl %eax, %ecx
786; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
787; i686-NEXT:    shrdl %cl, %edx, %edi
788; i686-NEXT:    testb $32, %al
789; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
790; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
791; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
792; i686-NEXT:    jne .LBB7_5
793; i686-NEXT:  # %bb.4: # %entry
794; i686-NEXT:    movl %edi, %ebx
795; i686-NEXT:  .LBB7_5: # %entry
796; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
797; i686-NEXT:    movl %ebp, %edi
798; i686-NEXT:    movl %edx, %ecx
799; i686-NEXT:    sarl %cl, %edi
800; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
801; i686-NEXT:    shrl %cl, %esi
802; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
803; i686-NEXT:    sarl $31, %ebp
804; i686-NEXT:    movl %edx, %ecx
805; i686-NEXT:    subl $64, %ecx
806; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
807; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
808; i686-NEXT:    sbbl $0, %ecx
809; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
810; i686-NEXT:    sbbl $0, %ecx
811; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
812; i686-NEXT:    sbbl $0, %ecx
813; i686-NEXT:    setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
814; i686-NEXT:    testb $32, %dl
815; i686-NEXT:    movl $0, %esi
816; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
817; i686-NEXT:    movl %ebp, %ecx
818; i686-NEXT:    jne .LBB7_7
819; i686-NEXT:  # %bb.6: # %entry
820; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
821; i686-NEXT:    movl %edi, %ecx
822; i686-NEXT:  .LBB7_7: # %entry
823; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
824; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
825; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
826; i686-NEXT:    movl %edx, %ecx
827; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
828; i686-NEXT:    shrdl %cl, %ebp, %esi
829; i686-NEXT:    testb $32, %dl
830; i686-NEXT:    jne .LBB7_9
831; i686-NEXT:  # %bb.8: # %entry
832; i686-NEXT:    movl %esi, %edi
833; i686-NEXT:  .LBB7_9: # %entry
834; i686-NEXT:    movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
835; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
836; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
837; i686-NEXT:    sarl %cl, %esi
838; i686-NEXT:    testb $32, %cl
839; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
840; i686-NEXT:    jne .LBB7_11
841; i686-NEXT:  # %bb.10: # %entry
842; i686-NEXT:    movl %esi, %ecx
843; i686-NEXT:  .LBB7_11: # %entry
844; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
845; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
846; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
847; i686-NEXT:    movb $64, %cl
848; i686-NEXT:    subb %dl, %cl
849; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
850; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
851; i686-NEXT:    shldl %cl, %ebx, %ebp
852; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
853; i686-NEXT:    movl %ebx, %ebp
854; i686-NEXT:    shll %cl, %ebp
855; i686-NEXT:    testb $32, %cl
856; i686-NEXT:    movb $64, %bl
857; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
858; i686-NEXT:    je .LBB7_13
859; i686-NEXT:  # %bb.12:
860; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
861; i686-NEXT:    xorl %ebp, %ebp
862; i686-NEXT:  .LBB7_13: # %entry
863; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
864; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
865; i686-NEXT:    movl %edx, %ecx
866; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
867; i686-NEXT:    shrdl %cl, %edi, %esi
868; i686-NEXT:    testb $32, %dl
869; i686-NEXT:    jne .LBB7_15
870; i686-NEXT:  # %bb.14: # %entry
871; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
872; i686-NEXT:  .LBB7_15: # %entry
873; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
874; i686-NEXT:    subb %al, %bl
875; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
876; i686-NEXT:    movl %ebx, %ecx
877; i686-NEXT:    shll %cl, %ebp
878; i686-NEXT:    testb $32, %bl
879; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
880; i686-NEXT:    jne .LBB7_17
881; i686-NEXT:  # %bb.16: # %entry
882; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
883; i686-NEXT:  .LBB7_17: # %entry
884; i686-NEXT:    movl %eax, %ecx
885; i686-NEXT:    subl $64, %ecx
886; i686-NEXT:    sbbl $0, %esi
887; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
888; i686-NEXT:    sbbl $0, %esi
889; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
890; i686-NEXT:    sbbl $0, %esi
891; i686-NEXT:    setae %bh
892; i686-NEXT:    jb .LBB7_19
893; i686-NEXT:  # %bb.18: # %entry
894; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
895; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
896; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
897; i686-NEXT:  .LBB7_19: # %entry
898; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
899; i686-NEXT:    shrdl %cl, %edi, %esi
900; i686-NEXT:    sarl %cl, %edi
901; i686-NEXT:    testb $32, %cl
902; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
903; i686-NEXT:    je .LBB7_20
904; i686-NEXT:  # %bb.21: # %entry
905; i686-NEXT:    testb %bh, %bh
906; i686-NEXT:    je .LBB7_22
907; i686-NEXT:  .LBB7_23: # %entry
908; i686-NEXT:    testb $32, %cl
909; i686-NEXT:    jne .LBB7_25
910; i686-NEXT:  .LBB7_24: # %entry
911; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
912; i686-NEXT:  .LBB7_25: # %entry
913; i686-NEXT:    movl %ebx, %ecx
914; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
915; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
916; i686-NEXT:    shldl %cl, %esi, %edi
917; i686-NEXT:    testb $32, %bl
918; i686-NEXT:    jne .LBB7_27
919; i686-NEXT:  # %bb.26: # %entry
920; i686-NEXT:    movl %edi, %ebp
921; i686-NEXT:  .LBB7_27: # %entry
922; i686-NEXT:    testb %bh, %bh
923; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
924; i686-NEXT:    jne .LBB7_29
925; i686-NEXT:  # %bb.28:
926; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Reload
927; i686-NEXT:    orl %ebp, %ebx
928; i686-NEXT:    movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
929; i686-NEXT:  .LBB7_29: # %entry
930; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Reload
931; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
932; i686-NEXT:    jne .LBB7_31
933; i686-NEXT:  # %bb.30: # %entry
934; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
935; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
936; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
937; i686-NEXT:  .LBB7_31: # %entry
938; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
939; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
940; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
941; i686-NEXT:    shrdl %cl, %ebp, %ebx
942; i686-NEXT:    testb $32, %cl
943; i686-NEXT:    jne .LBB7_33
944; i686-NEXT:  # %bb.32: # %entry
945; i686-NEXT:    movl %ebx, %esi
946; i686-NEXT:  .LBB7_33: # %entry
947; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
948; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Reload
949; i686-NEXT:    je .LBB7_35
950; i686-NEXT:  # %bb.34:
951; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
952; i686-NEXT:    orl %ebx, %ecx
953; i686-NEXT:    movl %ecx, %esi
954; i686-NEXT:  .LBB7_35: # %entry
955; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
956; i686-NEXT:    je .LBB7_37
957; i686-NEXT:  # %bb.36:
958; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
959; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Folded Reload
960; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
961; i686-NEXT:  .LBB7_37: # %entry
962; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
963; i686-NEXT:    orl {{[0-9]+}}(%esp), %ecx
964; i686-NEXT:    orl {{[0-9]+}}(%esp), %edx
965; i686-NEXT:    orl %ecx, %edx
966; i686-NEXT:    je .LBB7_39
967; i686-NEXT:  # %bb.38: # %entry
968; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
969; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
970; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
971; i686-NEXT:  .LBB7_39: # %entry
972; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
973; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
974; i686-NEXT:    orl {{[0-9]+}}(%esp), %edx
975; i686-NEXT:    orl {{[0-9]+}}(%esp), %eax
976; i686-NEXT:    orl %edx, %eax
977; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
978; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
979; i686-NEXT:    je .LBB7_41
980; i686-NEXT:  # %bb.40: # %entry
981; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
982; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
983; i686-NEXT:  .LBB7_41: # %entry
984; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
985; i686-NEXT:    movl %edx, 28(%ecx)
986; i686-NEXT:    movl %edi, 24(%ecx)
987; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
988; i686-NEXT:    movl %edx, 12(%ecx)
989; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
990; i686-NEXT:    movl %edx, 8(%ecx)
991; i686-NEXT:    movl %esi, 20(%ecx)
992; i686-NEXT:    movl %eax, 16(%ecx)
993; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
994; i686-NEXT:    movl %eax, 4(%ecx)
995; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
996; i686-NEXT:    movl %eax, (%ecx)
997; i686-NEXT:    addl $80, %esp
998; i686-NEXT:    popl %esi
999; i686-NEXT:    popl %edi
1000; i686-NEXT:    popl %ebx
1001; i686-NEXT:    popl %ebp
1002; i686-NEXT:    retl
1003; i686-NEXT:  .LBB7_20: # %entry
1004; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1005; i686-NEXT:    testb %bh, %bh
1006; i686-NEXT:    jne .LBB7_23
1007; i686-NEXT:  .LBB7_22:
1008; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
1009; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Folded Reload
1010; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1011; i686-NEXT:    testb $32, %cl
1012; i686-NEXT:    je .LBB7_24
1013; i686-NEXT:    jmp .LBB7_25
1014;
1015; x86_64-LABEL: test_ashr_v2i128:
1016; x86_64:       # %bb.0: # %entry
1017; x86_64-NEXT:    movq %rcx, %r11
1018; x86_64-NEXT:    movq {{[0-9]+}}(%rsp), %r10
1019; x86_64-NEXT:    movb {{[0-9]+}}(%rsp), %r9b
1020; x86_64-NEXT:    movl %r9d, %ecx
1021; x86_64-NEXT:    shrdq %cl, %r11, %rdx
1022; x86_64-NEXT:    movl %r8d, %ecx
1023; x86_64-NEXT:    shrdq %cl, %rsi, %rdi
1024; x86_64-NEXT:    movq %rsi, %rax
1025; x86_64-NEXT:    sarq %cl, %rax
1026; x86_64-NEXT:    sarq $63, %rsi
1027; x86_64-NEXT:    testb $64, %r8b
1028; x86_64-NEXT:    cmovneq %rax, %rdi
1029; x86_64-NEXT:    cmoveq %rax, %rsi
1030; x86_64-NEXT:    movq %r11, %rax
1031; x86_64-NEXT:    movl %r9d, %ecx
1032; x86_64-NEXT:    sarq %cl, %rax
1033; x86_64-NEXT:    sarq $63, %r11
1034; x86_64-NEXT:    testb $64, %r9b
1035; x86_64-NEXT:    cmovneq %rax, %rdx
1036; x86_64-NEXT:    cmoveq %rax, %r11
1037; x86_64-NEXT:    movq %r11, 24(%r10)
1038; x86_64-NEXT:    movq %rdx, 16(%r10)
1039; x86_64-NEXT:    movq %rsi, 8(%r10)
1040; x86_64-NEXT:    movq %rdi, (%r10)
1041; x86_64-NEXT:    retq
1042entry:
1043	%0 = ashr <2 x i128> %x, %a
1044	store <2 x i128> %0, <2 x i128>* %r, align 16
1045	ret void
1046}
1047
1048define void @test_shl_v2i128(<2 x i128> %x, <2 x i128> %a, <2 x i128>* nocapture %r) nounwind {
1049; i686-LABEL: test_shl_v2i128:
1050; i686:       # %bb.0: # %entry
1051; i686-NEXT:    pushl %ebp
1052; i686-NEXT:    pushl %ebx
1053; i686-NEXT:    pushl %edi
1054; i686-NEXT:    pushl %esi
1055; i686-NEXT:    subl $72, %esp
1056; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
1057; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
1058; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
1059; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
1060; i686-NEXT:    movl %ebx, %ecx
1061; i686-NEXT:    shll %cl, %ebp
1062; i686-NEXT:    shll %cl, %esi
1063; i686-NEXT:    movl %edx, %eax
1064; i686-NEXT:    subl $64, %eax
1065; i686-NEXT:    movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1066; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1067; i686-NEXT:    sbbl $0, %eax
1068; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1069; i686-NEXT:    sbbl $0, %eax
1070; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1071; i686-NEXT:    sbbl $0, %eax
1072; i686-NEXT:    setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
1073; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
1074; i686-NEXT:    testb $32, %bl
1075; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1076; i686-NEXT:    movl $0, %eax
1077; i686-NEXT:    movl $0, %ecx
1078; i686-NEXT:    jne .LBB8_2
1079; i686-NEXT:  # %bb.1: # %entry
1080; i686-NEXT:    movl %esi, %eax
1081; i686-NEXT:    movl %ebp, %ecx
1082; i686-NEXT:  .LBB8_2: # %entry
1083; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1084; i686-NEXT:    movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1085; i686-NEXT:    movl %edi, %eax
1086; i686-NEXT:    movl %ebx, %ecx
1087; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1088; i686-NEXT:    shldl %cl, %edi, %eax
1089; i686-NEXT:    testb $32, %bl
1090; i686-NEXT:    jne .LBB8_4
1091; i686-NEXT:  # %bb.3: # %entry
1092; i686-NEXT:    movl %eax, %esi
1093; i686-NEXT:  .LBB8_4: # %entry
1094; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1095; i686-NEXT:    movb $64, %cl
1096; i686-NEXT:    subb %bl, %cl
1097; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1098; i686-NEXT:    movl %edi, %esi
1099; i686-NEXT:    shrl %cl, %esi
1100; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1101; i686-NEXT:    shrdl %cl, %edi, %eax
1102; i686-NEXT:    testb $32, %cl
1103; i686-NEXT:    jne .LBB8_5
1104; i686-NEXT:  # %bb.6: # %entry
1105; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1106; i686-NEXT:    jmp .LBB8_7
1107; i686-NEXT:  .LBB8_5:
1108; i686-NEXT:    movl %esi, %eax
1109; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
1110; i686-NEXT:  .LBB8_7: # %entry
1111; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1112; i686-NEXT:    movl %ebx, %ecx
1113; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
1114; i686-NEXT:    shldl %cl, %esi, %edi
1115; i686-NEXT:    testb $32, %bl
1116; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
1117; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1118; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
1119; i686-NEXT:    jne .LBB8_9
1120; i686-NEXT:  # %bb.8: # %entry
1121; i686-NEXT:    movl %edi, %ebp
1122; i686-NEXT:  .LBB8_9: # %entry
1123; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1124; i686-NEXT:    movl %ecx, %ebp
1125; i686-NEXT:    movl %edx, %ecx
1126; i686-NEXT:    shll %cl, %ebp
1127; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
1128; i686-NEXT:    shll %cl, %esi
1129; i686-NEXT:    testb $32, %dl
1130; i686-NEXT:    movl $0, %edi
1131; i686-NEXT:    movl $0, %ecx
1132; i686-NEXT:    jne .LBB8_11
1133; i686-NEXT:  # %bb.10: # %entry
1134; i686-NEXT:    movl %esi, %edi
1135; i686-NEXT:    movl %ebp, %ecx
1136; i686-NEXT:  .LBB8_11: # %entry
1137; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1138; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1139; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1140; i686-NEXT:    movl %edx, %ecx
1141; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
1142; i686-NEXT:    shldl %cl, %ebx, %edi
1143; i686-NEXT:    testb $32, %dl
1144; i686-NEXT:    jne .LBB8_13
1145; i686-NEXT:  # %bb.12: # %entry
1146; i686-NEXT:    movl %edi, %ebp
1147; i686-NEXT:  .LBB8_13: # %entry
1148; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1149; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1150; i686-NEXT:    movb $64, %cl
1151; i686-NEXT:    subb %dl, %cl
1152; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
1153; i686-NEXT:    shrl %cl, %ebx
1154; i686-NEXT:    movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1155; i686-NEXT:    movb %cl, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Spill
1156; i686-NEXT:    testb $32, %cl
1157; i686-NEXT:    movl $0, %ecx
1158; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
1159; i686-NEXT:    jne .LBB8_15
1160; i686-NEXT:  # %bb.14: # %entry
1161; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
1162; i686-NEXT:  .LBB8_15: # %entry
1163; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1164; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1165; i686-NEXT:    movl %edx, %ecx
1166; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
1167; i686-NEXT:    shldl %cl, %ebp, %edi
1168; i686-NEXT:    testb $32, %dl
1169; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
1170; i686-NEXT:    jne .LBB8_17
1171; i686-NEXT:  # %bb.16: # %entry
1172; i686-NEXT:    movl %edi, %esi
1173; i686-NEXT:  .LBB8_17: # %entry
1174; i686-NEXT:    orl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
1175; i686-NEXT:    movl %ebx, %eax
1176; i686-NEXT:    subl $64, %eax
1177; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
1178; i686-NEXT:    sbbl $0, %ecx
1179; i686-NEXT:    movl %ebp, %ecx
1180; i686-NEXT:    sbbl $0, %ecx
1181; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
1182; i686-NEXT:    sbbl $0, %ecx
1183; i686-NEXT:    setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
1184; i686-NEXT:    jb .LBB8_19
1185; i686-NEXT:  # %bb.18: # %entry
1186; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
1187; i686-NEXT:  .LBB8_19: # %entry
1188; i686-NEXT:    jb .LBB8_21
1189; i686-NEXT:  # %bb.20: # %entry
1190; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
1191; i686-NEXT:  .LBB8_21: # %entry
1192; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebp
1193; i686-NEXT:    movl %ebp, %ebx
1194; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
1195; i686-NEXT:    shll %cl, %ebx
1196; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1197; i686-NEXT:    shldl %cl, %ebp, %edi
1198; i686-NEXT:    testb $32, %cl
1199; i686-NEXT:    movl %ebx, %ecx
1200; i686-NEXT:    jne .LBB8_23
1201; i686-NEXT:  # %bb.22: # %entry
1202; i686-NEXT:    movl %edi, %ecx
1203; i686-NEXT:  .LBB8_23: # %entry
1204; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1205; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1206; i686-NEXT:    movl %eax, %ecx
1207; i686-NEXT:    shll %cl, %edi
1208; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1209; i686-NEXT:    testb $32, %al
1210; i686-NEXT:    movl $0, %edi
1211; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Reload
1212; i686-NEXT:    jne .LBB8_25
1213; i686-NEXT:  # %bb.24: # %entry
1214; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Reload
1215; i686-NEXT:  .LBB8_25: # %entry
1216; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1217; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
1218; i686-NEXT:    jne .LBB8_27
1219; i686-NEXT:  # %bb.26: # %entry
1220; i686-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1221; i686-NEXT:  .LBB8_27: # %entry
1222; i686-NEXT:    movl %eax, %ecx
1223; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1224; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
1225; i686-NEXT:    shldl %cl, %edi, %esi
1226; i686-NEXT:    testb $32, %al
1227; i686-NEXT:    jne .LBB8_29
1228; i686-NEXT:  # %bb.28: # %entry
1229; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1230; i686-NEXT:  .LBB8_29: # %entry
1231; i686-NEXT:    cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
1232; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi
1233; i686-NEXT:    movb {{[-0-9]+}}(%e{{[sb]}}p), %al # 1-byte Reload
1234; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
1235; i686-NEXT:    jne .LBB8_30
1236; i686-NEXT:  # %bb.31: # %entry
1237; i686-NEXT:    testb %al, %al
1238; i686-NEXT:    je .LBB8_32
1239; i686-NEXT:  .LBB8_33: # %entry
1240; i686-NEXT:    testb $32, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
1241; i686-NEXT:    jne .LBB8_35
1242; i686-NEXT:  .LBB8_34: # %entry
1243; i686-NEXT:    movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1244; i686-NEXT:  .LBB8_35: # %entry
1245; i686-NEXT:    movb {{[-0-9]+}}(%e{{[sb]}}p), %cl # 1-byte Reload
1246; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
1247; i686-NEXT:    shrdl %cl, %ebx, %esi
1248; i686-NEXT:    testb $32, %cl
1249; i686-NEXT:    jne .LBB8_37
1250; i686-NEXT:  # %bb.36: # %entry
1251; i686-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1252; i686-NEXT:  .LBB8_37: # %entry
1253; i686-NEXT:    testb %al, %al
1254; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
1255; i686-NEXT:    movl {{[0-9]+}}(%esp), %ebx
1256; i686-NEXT:    jne .LBB8_38
1257; i686-NEXT:  # %bb.39: # %entry
1258; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
1259; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Reload
1260; i686-NEXT:    testb %al, %al
1261; i686-NEXT:    jne .LBB8_41
1262; i686-NEXT:    jmp .LBB8_42
1263; i686-NEXT:  .LBB8_30:
1264; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
1265; i686-NEXT:    orl %ebp, %ecx
1266; i686-NEXT:    movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1267; i686-NEXT:    testb %al, %al
1268; i686-NEXT:    jne .LBB8_33
1269; i686-NEXT:  .LBB8_32: # %entry
1270; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
1271; i686-NEXT:    movl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
1272; i686-NEXT:    testb $32, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
1273; i686-NEXT:    je .LBB8_34
1274; i686-NEXT:    jmp .LBB8_35
1275; i686-NEXT:  .LBB8_38:
1276; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Reload
1277; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Folded Reload
1278; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
1279; i686-NEXT:    testb %al, %al
1280; i686-NEXT:    je .LBB8_42
1281; i686-NEXT:  .LBB8_41:
1282; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
1283; i686-NEXT:    orl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload
1284; i686-NEXT:    movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1285; i686-NEXT:  .LBB8_42: # %entry
1286; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1287; i686-NEXT:    orl {{[0-9]+}}(%esp), %eax
1288; i686-NEXT:    orl {{[0-9]+}}(%esp), %edx
1289; i686-NEXT:    orl %eax, %edx
1290; i686-NEXT:    je .LBB8_44
1291; i686-NEXT:  # %bb.43: # %entry
1292; i686-NEXT:    movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1293; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
1294; i686-NEXT:    movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
1295; i686-NEXT:  .LBB8_44: # %entry
1296; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1297; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
1298; i686-NEXT:    orl {{[0-9]+}}(%esp), %edx
1299; i686-NEXT:    orl {{[0-9]+}}(%esp), %ebx
1300; i686-NEXT:    orl %edx, %ebx
1301; i686-NEXT:    je .LBB8_46
1302; i686-NEXT:  # %bb.45: # %entry
1303; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
1304; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Reload
1305; i686-NEXT:  .LBB8_46: # %entry
1306; i686-NEXT:    movl %esi, 20(%eax)
1307; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
1308; i686-NEXT:    movl %edx, 16(%eax)
1309; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
1310; i686-NEXT:    movl %edx, 4(%eax)
1311; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
1312; i686-NEXT:    movl %edx, (%eax)
1313; i686-NEXT:    movl %edi, 28(%eax)
1314; i686-NEXT:    movl %ecx, 24(%eax)
1315; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
1316; i686-NEXT:    movl %ecx, 12(%eax)
1317; i686-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
1318; i686-NEXT:    movl %ecx, 8(%eax)
1319; i686-NEXT:    addl $72, %esp
1320; i686-NEXT:    popl %esi
1321; i686-NEXT:    popl %edi
1322; i686-NEXT:    popl %ebx
1323; i686-NEXT:    popl %ebp
1324; i686-NEXT:    retl
1325;
1326; x86_64-LABEL: test_shl_v2i128:
1327; x86_64:       # %bb.0: # %entry
1328; x86_64-NEXT:    movq %rcx, %rax
1329; x86_64-NEXT:    movq {{[0-9]+}}(%rsp), %r10
1330; x86_64-NEXT:    movb {{[0-9]+}}(%rsp), %r9b
1331; x86_64-NEXT:    movl %r9d, %ecx
1332; x86_64-NEXT:    shldq %cl, %rdx, %rax
1333; x86_64-NEXT:    movl %r8d, %ecx
1334; x86_64-NEXT:    shldq %cl, %rdi, %rsi
1335; x86_64-NEXT:    shlq %cl, %rdi
1336; x86_64-NEXT:    xorl %r11d, %r11d
1337; x86_64-NEXT:    testb $64, %r8b
1338; x86_64-NEXT:    cmovneq %rdi, %rsi
1339; x86_64-NEXT:    cmovneq %r11, %rdi
1340; x86_64-NEXT:    movl %r9d, %ecx
1341; x86_64-NEXT:    shlq %cl, %rdx
1342; x86_64-NEXT:    testb $64, %r9b
1343; x86_64-NEXT:    cmovneq %rdx, %rax
1344; x86_64-NEXT:    cmovneq %r11, %rdx
1345; x86_64-NEXT:    movq %rax, 24(%r10)
1346; x86_64-NEXT:    movq %rdx, 16(%r10)
1347; x86_64-NEXT:    movq %rsi, 8(%r10)
1348; x86_64-NEXT:    movq %rdi, (%r10)
1349; x86_64-NEXT:    retq
1350entry:
1351	%0 = shl <2 x i128> %x, %a
1352	store <2 x i128> %0, <2 x i128>* %r, align 16
1353	ret void
1354}
1355
1356define void @test_lshr_v2i128_outofrange(<2 x i128> %x, <2 x i128>* nocapture %r) nounwind {
1357; ALL-LABEL: test_lshr_v2i128_outofrange:
1358; ALL:       # %bb.0: # %entry
1359; ALL-NEXT:    ret{{[l|q]}}
1360entry:
1361	%0 = lshr <2 x i128> %x, <i128 -1, i128 -1>
1362	store <2 x i128> %0, <2 x i128>* %r, align 16
1363	ret void
1364}
1365
1366define void @test_ashr_v2i128_outofrange(<2 x i128> %x, <2 x i128>* nocapture %r) nounwind {
1367; ALL-LABEL: test_ashr_v2i128_outofrange:
1368; ALL:       # %bb.0: # %entry
1369; ALL-NEXT:    ret{{[l|q]}}
1370entry:
1371	%0 = ashr <2 x i128> %x, <i128 -1, i128 -1>
1372	store <2 x i128> %0, <2 x i128>* %r, align 16
1373	ret void
1374}
1375
1376define void @test_shl_v2i128_outofrange(<2 x i128> %x, <2 x i128>* nocapture %r) nounwind {
1377; ALL-LABEL: test_shl_v2i128_outofrange:
1378; ALL:       # %bb.0: # %entry
1379; ALL-NEXT:    ret{{[l|q]}}
1380entry:
1381	%0 = shl <2 x i128> %x, <i128 -1, i128 -1>
1382	store <2 x i128> %0, <2 x i128>* %r, align 16
1383	ret void
1384}
1385
1386define void @test_lshr_v2i128_outofrange_sum(<2 x i128> %x, <2 x i128>* nocapture %r) nounwind {
1387; i686-LABEL: test_lshr_v2i128_outofrange_sum:
1388; i686:       # %bb.0: # %entry
1389; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1390; i686-NEXT:    movl $0, 28(%eax)
1391; i686-NEXT:    movl $0, 24(%eax)
1392; i686-NEXT:    movl $0, 20(%eax)
1393; i686-NEXT:    movl $0, 16(%eax)
1394; i686-NEXT:    movl $0, 12(%eax)
1395; i686-NEXT:    movl $0, 8(%eax)
1396; i686-NEXT:    movl $0, 4(%eax)
1397; i686-NEXT:    movl $0, (%eax)
1398; i686-NEXT:    retl
1399;
1400; x86_64-LABEL: test_lshr_v2i128_outofrange_sum:
1401; x86_64:       # %bb.0: # %entry
1402; x86_64-NEXT:    xorps %xmm0, %xmm0
1403; x86_64-NEXT:    movaps %xmm0, 16(%r8)
1404; x86_64-NEXT:    movaps %xmm0, (%r8)
1405; x86_64-NEXT:    retq
1406entry:
1407	%0 = lshr <2 x i128> %x, <i128 -1, i128 -1>
1408	%1 = lshr <2 x i128> %0, <i128  1, i128  1>
1409	store <2 x i128> %1, <2 x i128>* %r, align 16
1410	ret void
1411}
1412
1413define void @test_ashr_v2i128_outofrange_sum(<2 x i128> %x, <2 x i128>* nocapture %r) nounwind {
1414; i686-LABEL: test_ashr_v2i128_outofrange_sum:
1415; i686:       # %bb.0: # %entry
1416; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1417; i686-NEXT:    movl $0, 28(%eax)
1418; i686-NEXT:    movl $0, 24(%eax)
1419; i686-NEXT:    movl $0, 20(%eax)
1420; i686-NEXT:    movl $0, 16(%eax)
1421; i686-NEXT:    movl $0, 12(%eax)
1422; i686-NEXT:    movl $0, 8(%eax)
1423; i686-NEXT:    movl $0, 4(%eax)
1424; i686-NEXT:    movl $0, (%eax)
1425; i686-NEXT:    retl
1426;
1427; x86_64-LABEL: test_ashr_v2i128_outofrange_sum:
1428; x86_64:       # %bb.0: # %entry
1429; x86_64-NEXT:    xorps %xmm0, %xmm0
1430; x86_64-NEXT:    movaps %xmm0, 16(%r8)
1431; x86_64-NEXT:    movaps %xmm0, (%r8)
1432; x86_64-NEXT:    retq
1433entry:
1434	%0 = ashr <2 x i128> %x, <i128 -1, i128 -1>
1435	%1 = ashr <2 x i128> %0, <i128  1, i128  1>
1436	store <2 x i128> %1, <2 x i128>* %r, align 16
1437	ret void
1438}
1439
1440define void @test_shl_v2i128_outofrange_sum(<2 x i128> %x, <2 x i128>* nocapture %r) nounwind {
1441; i686-LABEL: test_shl_v2i128_outofrange_sum:
1442; i686:       # %bb.0: # %entry
1443; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1444; i686-NEXT:    movl $0, 28(%eax)
1445; i686-NEXT:    movl $0, 24(%eax)
1446; i686-NEXT:    movl $0, 20(%eax)
1447; i686-NEXT:    movl $0, 16(%eax)
1448; i686-NEXT:    movl $0, 12(%eax)
1449; i686-NEXT:    movl $0, 8(%eax)
1450; i686-NEXT:    movl $0, 4(%eax)
1451; i686-NEXT:    movl $0, (%eax)
1452; i686-NEXT:    retl
1453;
1454; x86_64-LABEL: test_shl_v2i128_outofrange_sum:
1455; x86_64:       # %bb.0: # %entry
1456; x86_64-NEXT:    xorps %xmm0, %xmm0
1457; x86_64-NEXT:    movaps %xmm0, 16(%r8)
1458; x86_64-NEXT:    movaps %xmm0, (%r8)
1459; x86_64-NEXT:    retq
1460entry:
1461	%0 = shl <2 x i128> %x, <i128 -1, i128 -1>
1462	%1 = shl <2 x i128> %0, <i128  1, i128  1>
1463	store <2 x i128> %1, <2 x i128>* %r, align 16
1464	ret void
1465}
1466
1467;
1468; Combines
1469;
1470
1471define <2 x i256> @shl_sext_shl_outofrange(<2 x i128> %a0) {
1472; i686-LABEL: shl_sext_shl_outofrange:
1473; i686:       # %bb.0:
1474; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1475; i686-NEXT:    movl $0, 60(%eax)
1476; i686-NEXT:    movl $0, 56(%eax)
1477; i686-NEXT:    movl $0, 52(%eax)
1478; i686-NEXT:    movl $0, 48(%eax)
1479; i686-NEXT:    movl $0, 44(%eax)
1480; i686-NEXT:    movl $0, 40(%eax)
1481; i686-NEXT:    movl $0, 36(%eax)
1482; i686-NEXT:    movl $0, 32(%eax)
1483; i686-NEXT:    movl $0, 28(%eax)
1484; i686-NEXT:    movl $0, 24(%eax)
1485; i686-NEXT:    movl $0, 20(%eax)
1486; i686-NEXT:    movl $0, 16(%eax)
1487; i686-NEXT:    movl $0, 12(%eax)
1488; i686-NEXT:    movl $0, 8(%eax)
1489; i686-NEXT:    movl $0, 4(%eax)
1490; i686-NEXT:    movl $0, (%eax)
1491; i686-NEXT:    retl $4
1492;
1493; x86_64-LABEL: shl_sext_shl_outofrange:
1494; x86_64:       # %bb.0:
1495; x86_64-NEXT:    movq %rdi, %rax
1496; x86_64-NEXT:    xorps %xmm0, %xmm0
1497; x86_64-NEXT:    movaps %xmm0, 48(%rdi)
1498; x86_64-NEXT:    movaps %xmm0, 32(%rdi)
1499; x86_64-NEXT:    movaps %xmm0, 16(%rdi)
1500; x86_64-NEXT:    movaps %xmm0, (%rdi)
1501; x86_64-NEXT:    retq
1502  %1 = shl <2 x i128> %a0, <i128 -1, i128 -1>
1503  %2 = sext <2 x i128> %1 to <2 x i256>
1504  %3 = shl <2 x i256> %2, <i256 128, i256 128>
1505  ret <2 x i256> %3
1506}
1507
1508define <2 x i256> @shl_zext_shl_outofrange(<2 x i128> %a0) {
1509; i686-LABEL: shl_zext_shl_outofrange:
1510; i686:       # %bb.0:
1511; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1512; i686-NEXT:    movl $0, 60(%eax)
1513; i686-NEXT:    movl $0, 56(%eax)
1514; i686-NEXT:    movl $0, 52(%eax)
1515; i686-NEXT:    movl $0, 48(%eax)
1516; i686-NEXT:    movl $0, 44(%eax)
1517; i686-NEXT:    movl $0, 40(%eax)
1518; i686-NEXT:    movl $0, 36(%eax)
1519; i686-NEXT:    movl $0, 32(%eax)
1520; i686-NEXT:    movl $0, 28(%eax)
1521; i686-NEXT:    movl $0, 24(%eax)
1522; i686-NEXT:    movl $0, 20(%eax)
1523; i686-NEXT:    movl $0, 16(%eax)
1524; i686-NEXT:    movl $0, 12(%eax)
1525; i686-NEXT:    movl $0, 8(%eax)
1526; i686-NEXT:    movl $0, 4(%eax)
1527; i686-NEXT:    movl $0, (%eax)
1528; i686-NEXT:    retl $4
1529;
1530; x86_64-LABEL: shl_zext_shl_outofrange:
1531; x86_64:       # %bb.0:
1532; x86_64-NEXT:    movq %rdi, %rax
1533; x86_64-NEXT:    xorps %xmm0, %xmm0
1534; x86_64-NEXT:    movaps %xmm0, 48(%rdi)
1535; x86_64-NEXT:    movaps %xmm0, 32(%rdi)
1536; x86_64-NEXT:    movaps %xmm0, 16(%rdi)
1537; x86_64-NEXT:    movaps %xmm0, (%rdi)
1538; x86_64-NEXT:    retq
1539  %1 = shl <2 x i128> %a0, <i128 -1, i128 -1>
1540  %2 = zext <2 x i128> %1 to <2 x i256>
1541  %3 = shl <2 x i256> %2, <i256 128, i256 128>
1542  ret <2 x i256> %3
1543}
1544
1545define <2 x i256> @shl_zext_lshr_outofrange(<2 x i128> %a0) {
1546; i686-LABEL: shl_zext_lshr_outofrange:
1547; i686:       # %bb.0:
1548; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1549; i686-NEXT:    movl $0, 60(%eax)
1550; i686-NEXT:    movl $0, 56(%eax)
1551; i686-NEXT:    movl $0, 52(%eax)
1552; i686-NEXT:    movl $0, 48(%eax)
1553; i686-NEXT:    movl $0, 44(%eax)
1554; i686-NEXT:    movl $0, 40(%eax)
1555; i686-NEXT:    movl $0, 36(%eax)
1556; i686-NEXT:    movl $0, 32(%eax)
1557; i686-NEXT:    movl $0, 28(%eax)
1558; i686-NEXT:    movl $0, 24(%eax)
1559; i686-NEXT:    movl $0, 20(%eax)
1560; i686-NEXT:    movl $0, 16(%eax)
1561; i686-NEXT:    movl $0, 12(%eax)
1562; i686-NEXT:    movl $0, 8(%eax)
1563; i686-NEXT:    movl $0, 4(%eax)
1564; i686-NEXT:    movl $0, (%eax)
1565; i686-NEXT:    retl $4
1566;
1567; x86_64-LABEL: shl_zext_lshr_outofrange:
1568; x86_64:       # %bb.0:
1569; x86_64-NEXT:    movq %rdi, %rax
1570; x86_64-NEXT:    xorps %xmm0, %xmm0
1571; x86_64-NEXT:    movaps %xmm0, 48(%rdi)
1572; x86_64-NEXT:    movaps %xmm0, 32(%rdi)
1573; x86_64-NEXT:    movaps %xmm0, 16(%rdi)
1574; x86_64-NEXT:    movaps %xmm0, (%rdi)
1575; x86_64-NEXT:    retq
1576  %1 = lshr <2 x i128> %a0, <i128 -1, i128 -1>
1577  %2 = zext <2 x i128> %1 to <2 x i256>
1578  %3 = shl <2 x i256> %2, <i256 128, i256 128>
1579  ret <2 x i256> %3
1580}
1581
1582define i128 @lshr_shl_mask(i128 %a0) {
1583; i686-LABEL: lshr_shl_mask:
1584; i686:       # %bb.0:
1585; i686-NEXT:    pushl %edi
1586; i686-NEXT:    .cfi_def_cfa_offset 8
1587; i686-NEXT:    pushl %esi
1588; i686-NEXT:    .cfi_def_cfa_offset 12
1589; i686-NEXT:    .cfi_offset %esi, -12
1590; i686-NEXT:    .cfi_offset %edi, -8
1591; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
1592; i686-NEXT:    movl {{[0-9]+}}(%esp), %ecx
1593; i686-NEXT:    movl {{[0-9]+}}(%esp), %edx
1594; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi
1595; i686-NEXT:    movl $2147483647, %edi # imm = 0x7FFFFFFF
1596; i686-NEXT:    andl {{[0-9]+}}(%esp), %edi
1597; i686-NEXT:    movl %edi, 12(%eax)
1598; i686-NEXT:    movl %esi, 8(%eax)
1599; i686-NEXT:    movl %edx, 4(%eax)
1600; i686-NEXT:    movl %ecx, (%eax)
1601; i686-NEXT:    popl %esi
1602; i686-NEXT:    .cfi_def_cfa_offset 8
1603; i686-NEXT:    popl %edi
1604; i686-NEXT:    .cfi_def_cfa_offset 4
1605; i686-NEXT:    retl $4
1606;
1607; x86_64-LABEL: lshr_shl_mask:
1608; x86_64:       # %bb.0:
1609; x86_64-NEXT:    movq %rdi, %rax
1610; x86_64-NEXT:    movabsq $9223372036854775807, %rdx # imm = 0x7FFFFFFFFFFFFFFF
1611; x86_64-NEXT:    andq %rsi, %rdx
1612; x86_64-NEXT:    retq
1613  %1 = shl i128 %a0, 1
1614  %2 = lshr i128 %1, 1
1615  ret i128 %2
1616}
1617