1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefix=X64
3 ; RUN: llc < %s -mtriple=i686 -mattr=cmov | FileCheck %s --check-prefix=X86
5 declare <4 x i32> @llvm.sshl.sat.v4i32(<4 x i32>, <4 x i32>)
7 define <4 x i32> @vec(<4 x i32> %x, <4 x i32> %y) nounwind {
10 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm0[3,3,3,3]
11 ; X64-NEXT: movd %xmm2, %eax
12 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm1[3,3,3,3]
13 ; X64-NEXT: movd %xmm2, %ecx
14 ; X64-NEXT: movl %eax, %edx
15 ; X64-NEXT: shll %cl, %edx
16 ; X64-NEXT: movl %edx, %esi
17 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
18 ; X64-NEXT: sarl %cl, %esi
19 ; X64-NEXT: xorl %ecx, %ecx
20 ; X64-NEXT: testl %eax, %eax
22 ; X64-NEXT: addl $2147483647, %ecx # imm = 0x7FFFFFFF
23 ; X64-NEXT: cmpl %esi, %eax
24 ; X64-NEXT: cmovel %edx, %ecx
25 ; X64-NEXT: movd %ecx, %xmm2
26 ; X64-NEXT: pshufd {{.*#+}} xmm3 = xmm0[2,3,2,3]
27 ; X64-NEXT: movd %xmm3, %eax
28 ; X64-NEXT: pshufd {{.*#+}} xmm3 = xmm1[2,3,2,3]
29 ; X64-NEXT: movd %xmm3, %ecx
30 ; X64-NEXT: movl %eax, %edx
31 ; X64-NEXT: shll %cl, %edx
32 ; X64-NEXT: movl %edx, %esi
33 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
34 ; X64-NEXT: sarl %cl, %esi
35 ; X64-NEXT: xorl %ecx, %ecx
36 ; X64-NEXT: testl %eax, %eax
38 ; X64-NEXT: addl $2147483647, %ecx # imm = 0x7FFFFFFF
39 ; X64-NEXT: cmpl %esi, %eax
40 ; X64-NEXT: cmovel %edx, %ecx
41 ; X64-NEXT: movd %ecx, %xmm3
42 ; X64-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
43 ; X64-NEXT: movd %xmm0, %eax
44 ; X64-NEXT: movd %xmm1, %ecx
45 ; X64-NEXT: movl %eax, %edx
46 ; X64-NEXT: shll %cl, %edx
47 ; X64-NEXT: movl %edx, %esi
48 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
49 ; X64-NEXT: sarl %cl, %esi
50 ; X64-NEXT: xorl %ecx, %ecx
51 ; X64-NEXT: testl %eax, %eax
53 ; X64-NEXT: addl $2147483647, %ecx # imm = 0x7FFFFFFF
54 ; X64-NEXT: cmpl %esi, %eax
55 ; X64-NEXT: cmovel %edx, %ecx
56 ; X64-NEXT: movd %ecx, %xmm2
57 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,1,1]
58 ; X64-NEXT: movd %xmm0, %eax
59 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,1,1]
60 ; X64-NEXT: movd %xmm0, %ecx
61 ; X64-NEXT: movl %eax, %edx
62 ; X64-NEXT: shll %cl, %edx
63 ; X64-NEXT: movl %edx, %esi
64 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
65 ; X64-NEXT: sarl %cl, %esi
66 ; X64-NEXT: xorl %ecx, %ecx
67 ; X64-NEXT: testl %eax, %eax
69 ; X64-NEXT: addl $2147483647, %ecx # imm = 0x7FFFFFFF
70 ; X64-NEXT: cmpl %esi, %eax
71 ; X64-NEXT: cmovel %edx, %ecx
72 ; X64-NEXT: movd %ecx, %xmm0
73 ; X64-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
74 ; X64-NEXT: punpcklqdq {{.*#+}} xmm2 = xmm2[0],xmm3[0]
75 ; X64-NEXT: movdqa %xmm2, %xmm0
80 ; X86-NEXT: pushl %ebp
81 ; X86-NEXT: pushl %ebx
82 ; X86-NEXT: pushl %edi
83 ; X86-NEXT: pushl %esi
84 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
85 ; X86-NEXT: movb {{[0-9]+}}(%esp), %ch
86 ; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
87 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
88 ; X86-NEXT: movl %edx, %edi
89 ; X86-NEXT: shll %cl, %edi
90 ; X86-NEXT: movl %edi, %ebp
91 ; X86-NEXT: sarl %cl, %ebp
92 ; X86-NEXT: xorl %ebx, %ebx
93 ; X86-NEXT: testl %edx, %edx
95 ; X86-NEXT: addl $2147483647, %ebx # imm = 0x7FFFFFFF
96 ; X86-NEXT: cmpl %ebp, %edx
97 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
98 ; X86-NEXT: cmovel %edi, %ebx
99 ; X86-NEXT: movl %ebp, %edi
100 ; X86-NEXT: movb %ch, %cl
101 ; X86-NEXT: shll %cl, %edi
102 ; X86-NEXT: movl %edi, %eax
103 ; X86-NEXT: sarl %cl, %eax
104 ; X86-NEXT: xorl %edx, %edx
105 ; X86-NEXT: testl %ebp, %ebp
107 ; X86-NEXT: addl $2147483647, %edx # imm = 0x7FFFFFFF
108 ; X86-NEXT: cmpl %eax, %ebp
109 ; X86-NEXT: cmovel %edi, %edx
110 ; X86-NEXT: movl %esi, %edi
111 ; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
112 ; X86-NEXT: shll %cl, %edi
113 ; X86-NEXT: movl %edi, %ebp
114 ; X86-NEXT: sarl %cl, %ebp
115 ; X86-NEXT: xorl %eax, %eax
116 ; X86-NEXT: testl %esi, %esi
118 ; X86-NEXT: addl $2147483647, %eax # imm = 0x7FFFFFFF
119 ; X86-NEXT: cmpl %ebp, %esi
120 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
121 ; X86-NEXT: cmovel %edi, %eax
122 ; X86-NEXT: movl %esi, %edi
123 ; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
124 ; X86-NEXT: shll %cl, %edi
125 ; X86-NEXT: movl %edi, %ebp
126 ; X86-NEXT: sarl %cl, %ebp
127 ; X86-NEXT: xorl %ecx, %ecx
128 ; X86-NEXT: testl %esi, %esi
130 ; X86-NEXT: addl $2147483647, %ecx # imm = 0x7FFFFFFF
131 ; X86-NEXT: cmpl %ebp, %esi
132 ; X86-NEXT: cmovel %edi, %ecx
133 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
134 ; X86-NEXT: movl %ecx, 12(%esi)
135 ; X86-NEXT: movl %eax, 8(%esi)
136 ; X86-NEXT: movl %edx, 4(%esi)
137 ; X86-NEXT: movl %ebx, (%esi)
138 ; X86-NEXT: movl %esi, %eax
139 ; X86-NEXT: popl %esi
140 ; X86-NEXT: popl %edi
141 ; X86-NEXT: popl %ebx
142 ; X86-NEXT: popl %ebp
144 %tmp = call <4 x i32> @llvm.sshl.sat.v4i32(<4 x i32> %x, <4 x i32> %y)