vec_cast.ll
6.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-linux -mattr=+ssse3 | FileCheck %s --check-prefixes=CHECK,CHECK-LIN
; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+ssse3 | FileCheck %s --check-prefixes=CHECK,CHECK-WIN
define <8 x i32> @a(<8 x i16> %a) nounwind {
; CHECK-LIN-LABEL: a:
; CHECK-LIN: # %bb.0:
; CHECK-LIN-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
; CHECK-LIN-NEXT: psrad $16, %xmm2
; CHECK-LIN-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
; CHECK-LIN-NEXT: psrad $16, %xmm1
; CHECK-LIN-NEXT: movdqa %xmm2, %xmm0
; CHECK-LIN-NEXT: retq
;
; CHECK-WIN-LABEL: a:
; CHECK-WIN: # %bb.0:
; CHECK-WIN-NEXT: movdqa (%rcx), %xmm1
; CHECK-WIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
; CHECK-WIN-NEXT: psrad $16, %xmm0
; CHECK-WIN-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
; CHECK-WIN-NEXT: psrad $16, %xmm1
; CHECK-WIN-NEXT: retq
%c = sext <8 x i16> %a to <8 x i32>
ret <8 x i32> %c
}
define <3 x i32> @b(<3 x i16> %a) nounwind {
; CHECK-LIN-LABEL: b:
; CHECK-LIN: # %bb.0:
; CHECK-LIN-NEXT: pxor %xmm0, %xmm0
; CHECK-LIN-NEXT: pinsrw $1, %edi, %xmm0
; CHECK-LIN-NEXT: pinsrw $3, %esi, %xmm0
; CHECK-LIN-NEXT: pinsrw $5, %edx, %xmm0
; CHECK-LIN-NEXT: psrad $16, %xmm0
; CHECK-LIN-NEXT: retq
;
; CHECK-WIN-LABEL: b:
; CHECK-WIN: # %bb.0:
; CHECK-WIN-NEXT: # kill: def $r8w killed $r8w def $r8d
; CHECK-WIN-NEXT: # kill: def $dx killed $dx def $edx
; CHECK-WIN-NEXT: # kill: def $cx killed $cx def $ecx
; CHECK-WIN-NEXT: pxor %xmm0, %xmm0
; CHECK-WIN-NEXT: pinsrw $1, %ecx, %xmm0
; CHECK-WIN-NEXT: pinsrw $3, %edx, %xmm0
; CHECK-WIN-NEXT: pinsrw $5, %r8d, %xmm0
; CHECK-WIN-NEXT: psrad $16, %xmm0
; CHECK-WIN-NEXT: retq
%c = sext <3 x i16> %a to <3 x i32>
ret <3 x i32> %c
}
define <1 x i32> @c(<1 x i16> %a) nounwind {
; CHECK-LIN-LABEL: c:
; CHECK-LIN: # %bb.0:
; CHECK-LIN-NEXT: movswl %di, %eax
; CHECK-LIN-NEXT: retq
;
; CHECK-WIN-LABEL: c:
; CHECK-WIN: # %bb.0:
; CHECK-WIN-NEXT: movswl %cx, %eax
; CHECK-WIN-NEXT: retq
%c = sext <1 x i16> %a to <1 x i32>
ret <1 x i32> %c
}
define <8 x i32> @d(<8 x i16> %a) nounwind {
; CHECK-LIN-LABEL: d:
; CHECK-LIN: # %bb.0:
; CHECK-LIN-NEXT: movdqa %xmm0, %xmm1
; CHECK-LIN-NEXT: pxor %xmm2, %xmm2
; CHECK-LIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3]
; CHECK-LIN-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
; CHECK-LIN-NEXT: retq
;
; CHECK-WIN-LABEL: d:
; CHECK-WIN: # %bb.0:
; CHECK-WIN-NEXT: movdqa (%rcx), %xmm1
; CHECK-WIN-NEXT: pxor %xmm2, %xmm2
; CHECK-WIN-NEXT: movdqa %xmm1, %xmm0
; CHECK-WIN-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3]
; CHECK-WIN-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
; CHECK-WIN-NEXT: retq
%c = zext <8 x i16> %a to <8 x i32>
ret <8 x i32> %c
}
define <3 x i32> @e(<3 x i16> %a) nounwind {
; CHECK-LIN-LABEL: e:
; CHECK-LIN: # %bb.0:
; CHECK-LIN-NEXT: pxor %xmm0, %xmm0
; CHECK-LIN-NEXT: pinsrw $0, %edi, %xmm0
; CHECK-LIN-NEXT: pinsrw $2, %esi, %xmm0
; CHECK-LIN-NEXT: pinsrw $4, %edx, %xmm0
; CHECK-LIN-NEXT: retq
;
; CHECK-WIN-LABEL: e:
; CHECK-WIN: # %bb.0:
; CHECK-WIN-NEXT: # kill: def $r8w killed $r8w def $r8d
; CHECK-WIN-NEXT: # kill: def $dx killed $dx def $edx
; CHECK-WIN-NEXT: # kill: def $cx killed $cx def $ecx
; CHECK-WIN-NEXT: pxor %xmm0, %xmm0
; CHECK-WIN-NEXT: pinsrw $0, %ecx, %xmm0
; CHECK-WIN-NEXT: pinsrw $2, %edx, %xmm0
; CHECK-WIN-NEXT: pinsrw $4, %r8d, %xmm0
; CHECK-WIN-NEXT: retq
%c = zext <3 x i16> %a to <3 x i32>
ret <3 x i32> %c
}
define <1 x i32> @f(<1 x i16> %a) nounwind {
; CHECK-LIN-LABEL: f:
; CHECK-LIN: # %bb.0:
; CHECK-LIN-NEXT: movzwl %di, %eax
; CHECK-LIN-NEXT: retq
;
; CHECK-WIN-LABEL: f:
; CHECK-WIN: # %bb.0:
; CHECK-WIN-NEXT: movzwl %cx, %eax
; CHECK-WIN-NEXT: retq
%c = zext <1 x i16> %a to <1 x i32>
ret <1 x i32> %c
}
define <8 x i16> @g(<8 x i32> %a) nounwind {
; CHECK-LIN-LABEL: g:
; CHECK-LIN: # %bb.0:
; CHECK-LIN-NEXT: movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
; CHECK-LIN-NEXT: pshufb %xmm2, %xmm1
; CHECK-LIN-NEXT: pshufb %xmm2, %xmm0
; CHECK-LIN-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
; CHECK-LIN-NEXT: retq
;
; CHECK-WIN-LABEL: g:
; CHECK-WIN: # %bb.0:
; CHECK-WIN-NEXT: movdqa (%rcx), %xmm0
; CHECK-WIN-NEXT: movdqa (%rdx), %xmm1
; CHECK-WIN-NEXT: movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
; CHECK-WIN-NEXT: pshufb %xmm2, %xmm1
; CHECK-WIN-NEXT: pshufb %xmm2, %xmm0
; CHECK-WIN-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
; CHECK-WIN-NEXT: retq
%c = trunc <8 x i32> %a to <8 x i16>
ret <8 x i16> %c
}
define <3 x i16> @h(<3 x i32> %a) nounwind {
; CHECK-LIN-LABEL: h:
; CHECK-LIN: # %bb.0:
; CHECK-LIN-NEXT: movd %xmm0, %eax
; CHECK-LIN-NEXT: pextrw $2, %xmm0, %edx
; CHECK-LIN-NEXT: pextrw $4, %xmm0, %ecx
; CHECK-LIN-NEXT: # kill: def $ax killed $ax killed $eax
; CHECK-LIN-NEXT: # kill: def $dx killed $dx killed $edx
; CHECK-LIN-NEXT: # kill: def $cx killed $cx killed $ecx
; CHECK-LIN-NEXT: retq
;
; CHECK-WIN-LABEL: h:
; CHECK-WIN: # %bb.0:
; CHECK-WIN-NEXT: movdqa (%rcx), %xmm0
; CHECK-WIN-NEXT: movd %xmm0, %eax
; CHECK-WIN-NEXT: pextrw $2, %xmm0, %edx
; CHECK-WIN-NEXT: pextrw $4, %xmm0, %ecx
; CHECK-WIN-NEXT: # kill: def $ax killed $ax killed $eax
; CHECK-WIN-NEXT: # kill: def $dx killed $dx killed $edx
; CHECK-WIN-NEXT: # kill: def $cx killed $cx killed $ecx
; CHECK-WIN-NEXT: retq
%c = trunc <3 x i32> %a to <3 x i16>
ret <3 x i16> %c
}
define <1 x i16> @i(<1 x i32> %a) nounwind {
; CHECK-LIN-LABEL: i:
; CHECK-LIN: # %bb.0:
; CHECK-LIN-NEXT: movl %edi, %eax
; CHECK-LIN-NEXT: # kill: def $ax killed $ax killed $eax
; CHECK-LIN-NEXT: retq
;
; CHECK-WIN-LABEL: i:
; CHECK-WIN: # %bb.0:
; CHECK-WIN-NEXT: movl %ecx, %eax
; CHECK-WIN-NEXT: # kill: def $ax killed $ax killed $eax
; CHECK-WIN-NEXT: retq
%c = trunc <1 x i32> %a to <1 x i16>
ret <1 x i16> %c
}
; PR6438
define void @__OpenCL_math_kernel4_kernel() nounwind {
; CHECK-LABEL: __OpenCL_math_kernel4_kernel:
; CHECK: # %bb.0:
; CHECK-NEXT: retq
%tmp12.i = and <4 x i32> zeroinitializer, <i32 2139095040, i32 2139095040, i32 2139095040, i32 2139095040> ; <<4 x i32>> [#uses=1]
%cmp13.i = icmp eq <4 x i32> %tmp12.i, <i32 2139095040, i32 2139095040, i32 2139095040, i32 2139095040> ; <<4 x i1>> [#uses=2]
%cmp.ext14.i = sext <4 x i1> %cmp13.i to <4 x i32> ; <<4 x i32>> [#uses=0]
%tmp2110.i = and <4 x i1> %cmp13.i, zeroinitializer ; <<4 x i1>> [#uses=0]
ret void
}