llvm.org GIT mirror llvm / c60a6db
[X86][SSE] Regenerate odd sized sext/zext tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326484 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 years ago
1 changed file(s) with 158 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=core2
1 ; RUN: llc < %s -mtriple=x86_64-win32 -mcpu=core2
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=core2 | FileCheck %s --check-prefixes=CHECK,CHECK-LIN
2 ; RUN: llc < %s -mtriple=x86_64-win32 -mcpu=core2 | FileCheck %s --check-prefixes=CHECK,CHECK-WIN
23
34 define <8 x i32> @a(<8 x i16> %a) nounwind {
5 ; CHECK-LIN-LABEL: a:
6 ; CHECK-LIN: # %bb.0:
7 ; CHECK-LIN-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
8 ; CHECK-LIN-NEXT: psrad $16, %xmm2
9 ; CHECK-LIN-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
10 ; CHECK-LIN-NEXT: psrad $16, %xmm1
11 ; CHECK-LIN-NEXT: movdqa %xmm2, %xmm0
12 ; CHECK-LIN-NEXT: retq
13 ;
14 ; CHECK-WIN-LABEL: a:
15 ; CHECK-WIN: # %bb.0:
16 ; CHECK-WIN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
17 ; CHECK-WIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
18 ; CHECK-WIN-NEXT: psrad $16, %xmm0
19 ; CHECK-WIN-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
20 ; CHECK-WIN-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3]
21 ; CHECK-WIN-NEXT: psrad $16, %xmm1
22 ; CHECK-WIN-NEXT: retq
423 %c = sext <8 x i16> %a to <8 x i32>
524 ret <8 x i32> %c
625 }
726
8 ;define <3 x i32> @b(<3 x i16> %a) nounwind {
9 ; %c = sext <3 x i16> %a to <3 x i32>
10 ; ret <3 x i32> %c
11 ;}
27 define <3 x i32> @b(<3 x i16> %a) nounwind {
28 ; CHECK-LIN-LABEL: b:
29 ; CHECK-LIN: # %bb.0:
30 ; CHECK-LIN-NEXT: movd %edi, %xmm0
31 ; CHECK-LIN-NEXT: pinsrw $1, %esi, %xmm0
32 ; CHECK-LIN-NEXT: pinsrw $2, %edx, %xmm0
33 ; CHECK-LIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
34 ; CHECK-LIN-NEXT: psrad $16, %xmm0
35 ; CHECK-LIN-NEXT: retq
36 ;
37 ; CHECK-WIN-LABEL: b:
38 ; CHECK-WIN: # %bb.0:
39 ; CHECK-WIN-NEXT: movd %ecx, %xmm0
40 ; CHECK-WIN-NEXT: pinsrw $1, %edx, %xmm0
41 ; CHECK-WIN-NEXT: pinsrw $2, %r8d, %xmm0
42 ; CHECK-WIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
43 ; CHECK-WIN-NEXT: psrad $16, %xmm0
44 ; CHECK-WIN-NEXT: retq
45 %c = sext <3 x i16> %a to <3 x i32>
46 ret <3 x i32> %c
47 }
1248
1349 define <1 x i32> @c(<1 x i16> %a) nounwind {
50 ; CHECK-LIN-LABEL: c:
51 ; CHECK-LIN: # %bb.0:
52 ; CHECK-LIN-NEXT: movd %edi, %xmm0
53 ; CHECK-LIN-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,1,4,5,6,7]
54 ; CHECK-LIN-NEXT: psrad $16, %xmm0
55 ; CHECK-LIN-NEXT: movd %xmm0, %eax
56 ; CHECK-LIN-NEXT: retq
57 ;
58 ; CHECK-WIN-LABEL: c:
59 ; CHECK-WIN: # %bb.0:
60 ; CHECK-WIN-NEXT: movd %ecx, %xmm0
61 ; CHECK-WIN-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,1,4,5,6,7]
62 ; CHECK-WIN-NEXT: psrad $16, %xmm0
63 ; CHECK-WIN-NEXT: movd %xmm0, %eax
64 ; CHECK-WIN-NEXT: retq
1465 %c = sext <1 x i16> %a to <1 x i32>
1566 ret <1 x i32> %c
1667 }
1768
1869 define <8 x i32> @d(<8 x i16> %a) nounwind {
70 ; CHECK-LIN-LABEL: d:
71 ; CHECK-LIN: # %bb.0:
72 ; CHECK-LIN-NEXT: movdqa %xmm0, %xmm1
73 ; CHECK-LIN-NEXT: pxor %xmm2, %xmm2
74 ; CHECK-LIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3]
75 ; CHECK-LIN-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
76 ; CHECK-LIN-NEXT: retq
77 ;
78 ; CHECK-WIN-LABEL: d:
79 ; CHECK-WIN: # %bb.0:
80 ; CHECK-WIN-NEXT: movdqa (%rcx), %xmm1
81 ; CHECK-WIN-NEXT: pxor %xmm2, %xmm2
82 ; CHECK-WIN-NEXT: movdqa %xmm1, %xmm0
83 ; CHECK-WIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3]
84 ; CHECK-WIN-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
85 ; CHECK-WIN-NEXT: retq
1986 %c = zext <8 x i16> %a to <8 x i32>
2087 ret <8 x i32> %c
2188 }
2289
23 ;define <3 x i32> @e(<3 x i16> %a) nounwind {
24 ; %c = zext <3 x i16> %a to <3 x i32>
25 ; ret <3 x i32> %c
26 ;}
90 define <3 x i32> @e(<3 x i16> %a) nounwind {
91 ; CHECK-LIN-LABEL: e:
92 ; CHECK-LIN: # %bb.0:
93 ; CHECK-LIN-NEXT: movd %edi, %xmm0
94 ; CHECK-LIN-NEXT: pinsrw $1, %esi, %xmm0
95 ; CHECK-LIN-NEXT: pinsrw $2, %edx, %xmm0
96 ; CHECK-LIN-NEXT: pxor %xmm1, %xmm1
97 ; CHECK-LIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
98 ; CHECK-LIN-NEXT: retq
99 ;
100 ; CHECK-WIN-LABEL: e:
101 ; CHECK-WIN: # %bb.0:
102 ; CHECK-WIN-NEXT: movd %ecx, %xmm0
103 ; CHECK-WIN-NEXT: pinsrw $1, %edx, %xmm0
104 ; CHECK-WIN-NEXT: pinsrw $2, %r8d, %xmm0
105 ; CHECK-WIN-NEXT: pxor %xmm1, %xmm1
106 ; CHECK-WIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
107 ; CHECK-WIN-NEXT: retq
108 %c = zext <3 x i16> %a to <3 x i32>
109 ret <3 x i32> %c
110 }
27111
28112 define <1 x i32> @f(<1 x i16> %a) nounwind {
113 ; CHECK-LIN-LABEL: f:
114 ; CHECK-LIN: # %bb.0:
115 ; CHECK-LIN-NEXT: movd %edi, %xmm0
116 ; CHECK-LIN-NEXT: pxor %xmm1, %xmm1
117 ; CHECK-LIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
118 ; CHECK-LIN-NEXT: movd %xmm0, %eax
119 ; CHECK-LIN-NEXT: retq
120 ;
121 ; CHECK-WIN-LABEL: f:
122 ; CHECK-WIN: # %bb.0:
123 ; CHECK-WIN-NEXT: movd %ecx, %xmm0
124 ; CHECK-WIN-NEXT: pxor %xmm1, %xmm1
125 ; CHECK-WIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
126 ; CHECK-WIN-NEXT: movd %xmm0, %eax
127 ; CHECK-WIN-NEXT: retq
29128 %c = zext <1 x i16> %a to <1 x i32>
30129 ret <1 x i32> %c
31130 }
32131
33132 define <8 x i16> @g(<8 x i32> %a) nounwind {
133 ; CHECK-LIN-LABEL: g:
134 ; CHECK-LIN: # %bb.0:
135 ; CHECK-LIN-NEXT: movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
136 ; CHECK-LIN-NEXT: pshufb %xmm2, %xmm1
137 ; CHECK-LIN-NEXT: pshufb %xmm2, %xmm0
138 ; CHECK-LIN-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
139 ; CHECK-LIN-NEXT: retq
140 ;
141 ; CHECK-WIN-LABEL: g:
142 ; CHECK-WIN: # %bb.0:
143 ; CHECK-WIN-NEXT: movdqa (%rcx), %xmm0
144 ; CHECK-WIN-NEXT: movdqa (%rdx), %xmm1
145 ; CHECK-WIN-NEXT: movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
146 ; CHECK-WIN-NEXT: pshufb %xmm2, %xmm1
147 ; CHECK-WIN-NEXT: pshufb %xmm2, %xmm0
148 ; CHECK-WIN-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
149 ; CHECK-WIN-NEXT: retq
34150 %c = trunc <8 x i32> %a to <8 x i16>
35151 ret <8 x i16> %c
36152 }
37153
38154 define <3 x i16> @h(<3 x i32> %a) nounwind {
155 ; CHECK-LIN-LABEL: h:
156 ; CHECK-LIN: # %bb.0:
157 ; CHECK-LIN-NEXT: movd %xmm0, %eax
158 ; CHECK-LIN-NEXT: pextrw $2, %xmm0, %edx
159 ; CHECK-LIN-NEXT: pextrw $4, %xmm0, %ecx
160 ; CHECK-LIN-NEXT: # kill: def $ax killed $ax killed $eax
161 ; CHECK-LIN-NEXT: # kill: def $dx killed $dx killed $edx
162 ; CHECK-LIN-NEXT: # kill: def $cx killed $cx killed $ecx
163 ; CHECK-LIN-NEXT: retq
164 ;
165 ; CHECK-WIN-LABEL: h:
166 ; CHECK-WIN: # %bb.0:
167 ; CHECK-WIN-NEXT: movdqa (%rcx), %xmm0
168 ; CHECK-WIN-NEXT: movd %xmm0, %eax
169 ; CHECK-WIN-NEXT: pextrw $2, %xmm0, %edx
170 ; CHECK-WIN-NEXT: pextrw $4, %xmm0, %ecx
171 ; CHECK-WIN-NEXT: # kill: def $ax killed $ax killed $eax
172 ; CHECK-WIN-NEXT: # kill: def $dx killed $dx killed $edx
173 ; CHECK-WIN-NEXT: # kill: def $cx killed $cx killed $ecx
174 ; CHECK-WIN-NEXT: retq
39175 %c = trunc <3 x i32> %a to <3 x i16>
40176 ret <3 x i16> %c
41177 }
42178
43179 define <1 x i16> @i(<1 x i32> %a) nounwind {
180 ; CHECK-LIN-LABEL: i:
181 ; CHECK-LIN: # %bb.0:
182 ; CHECK-LIN-NEXT: movl %edi, %eax
183 ; CHECK-LIN-NEXT: retq
184 ;
185 ; CHECK-WIN-LABEL: i:
186 ; CHECK-WIN: # %bb.0:
187 ; CHECK-WIN-NEXT: movl %ecx, %eax
188 ; CHECK-WIN-NEXT: retq
44189 %c = trunc <1 x i32> %a to <1 x i16>
45190 ret <1 x i16> %c
46191 }
47192
48193 ; PR6438
49194 define void @__OpenCL_math_kernel4_kernel() nounwind {
195 ; CHECK-LABEL: __OpenCL_math_kernel4_kernel:
196 ; CHECK: # %bb.0:
197 ; CHECK-NEXT: retq
50198 %tmp12.i = and <4 x i32> zeroinitializer, ; <<4 x i32>> [#uses=1]
51199 %cmp13.i = icmp eq <4 x i32> %tmp12.i, ; <<4 x i1>> [#uses=2]
52200 %cmp.ext14.i = sext <4 x i1> %cmp13.i to <4 x i32> ; <<4 x i32>> [#uses=0]