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.ushl.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: shrl %cl, %esi
19 ; X64-NEXT: cmpl %esi, %eax
20 ; X64-NEXT: movl $-1, %eax
21 ; X64-NEXT: cmovnel %eax, %edx
22 ; X64-NEXT: movd %edx, %xmm2
23 ; X64-NEXT: pshufd {{.*#+}} xmm3 = xmm0[2,3,2,3]
24 ; X64-NEXT: movd %xmm3, %edx
25 ; X64-NEXT: pshufd {{.*#+}} xmm3 = xmm1[2,3,2,3]
26 ; X64-NEXT: movd %xmm3, %ecx
27 ; X64-NEXT: movl %edx, %esi
28 ; X64-NEXT: shll %cl, %esi
29 ; X64-NEXT: movl %esi, %edi
30 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
31 ; X64-NEXT: shrl %cl, %edi
32 ; X64-NEXT: cmpl %edi, %edx
33 ; X64-NEXT: cmovnel %eax, %esi
34 ; X64-NEXT: movd %esi, %xmm3
35 ; X64-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
36 ; X64-NEXT: movd %xmm0, %edx
37 ; X64-NEXT: movd %xmm1, %ecx
38 ; X64-NEXT: movl %edx, %esi
39 ; X64-NEXT: shll %cl, %esi
40 ; X64-NEXT: movl %esi, %edi
41 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
42 ; X64-NEXT: shrl %cl, %edi
43 ; X64-NEXT: cmpl %edi, %edx
44 ; X64-NEXT: cmovnel %eax, %esi
45 ; X64-NEXT: movd %esi, %xmm2
46 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,1,1]
47 ; X64-NEXT: movd %xmm0, %edx
48 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,1,1]
49 ; X64-NEXT: movd %xmm0, %ecx
50 ; X64-NEXT: movl %edx, %esi
51 ; X64-NEXT: shll %cl, %esi
52 ; X64-NEXT: movl %esi, %edi
53 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
54 ; X64-NEXT: shrl %cl, %edi
55 ; X64-NEXT: cmpl %edi, %edx
56 ; X64-NEXT: cmovnel %eax, %esi
57 ; X64-NEXT: movd %esi, %xmm0
58 ; X64-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
59 ; X64-NEXT: punpcklqdq {{.*#+}} xmm2 = xmm2[0],xmm3[0]
60 ; X64-NEXT: movdqa %xmm2, %xmm0
65 ; X86-NEXT: pushl %ebp
66 ; X86-NEXT: pushl %ebx
67 ; X86-NEXT: pushl %edi
68 ; X86-NEXT: pushl %esi
69 ; X86-NEXT: movb {{[0-9]+}}(%esp), %ch
70 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %edx
71 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
72 ; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
73 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
74 ; X86-NEXT: movl %ebx, %esi
75 ; X86-NEXT: shll %cl, %esi
76 ; X86-NEXT: movl %esi, %ebp
77 ; X86-NEXT: shrl %cl, %ebp
78 ; X86-NEXT: cmpl %ebp, %ebx
79 ; X86-NEXT: movl $-1, %ebx
80 ; X86-NEXT: cmovnel %ebx, %esi
81 ; X86-NEXT: movl %edi, %eax
82 ; X86-NEXT: movb %dl, %cl
83 ; X86-NEXT: shll %cl, %eax
84 ; X86-NEXT: movl %eax, %ebp
85 ; X86-NEXT: shrl %cl, %ebp
86 ; X86-NEXT: cmpl %ebp, %edi
87 ; X86-NEXT: cmovnel %ebx, %eax
88 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
89 ; X86-NEXT: movl %ebp, %edx
90 ; X86-NEXT: movb %ch, %cl
91 ; X86-NEXT: shll %cl, %edx
92 ; X86-NEXT: movl %edx, %edi
93 ; X86-NEXT: shrl %cl, %edi
94 ; X86-NEXT: cmpl %edi, %ebp
95 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
96 ; X86-NEXT: cmovnel %ebx, %edx
97 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
98 ; X86-NEXT: shll %cl, %ebp
99 ; X86-NEXT: movl %ebp, %edi
100 ; X86-NEXT: shrl %cl, %edi
101 ; X86-NEXT: cmpl %edi, {{[0-9]+}}(%esp)
102 ; X86-NEXT: cmovnel %ebx, %ebp
103 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
104 ; X86-NEXT: movl %ebp, 12(%ecx)
105 ; X86-NEXT: movl %edx, 8(%ecx)
106 ; X86-NEXT: movl %eax, 4(%ecx)
107 ; X86-NEXT: movl %esi, (%ecx)
108 ; X86-NEXT: movl %ecx, %eax
109 ; X86-NEXT: popl %esi
110 ; X86-NEXT: popl %edi
111 ; X86-NEXT: popl %ebx
112 ; X86-NEXT: popl %ebp
114 %tmp = call <4 x i32> @llvm.ushl.sat.v4i32(<4 x i32> %x, <4 x i32> %y)