llvm.org GIT mirror llvm / c3648ce
Make blend tests more specific Following the lead set by r209324, I'm making these tests match the whole instruction, so we can be sure we're lowering them correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209947 91177308-0d34-0410-b5e6-96231b3b80d8 Filipe Cabecinhas 5 years ago
3 changed file(s) with 17 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
161161 ;; 4 tests for shufflevectors that optimize to blend + immediate
162162 ; CHECK-LABEL: @blend_shufflevector_4xfloat
163163 define <4 x float> @blend_shufflevector_4xfloat(<4 x float> %a, <4 x float> %b) {
164 ; CHECK: vblendps
164 ; Equivalent select mask is .
165 ; Big endian representation is 0101 = 5.
166 ; '1' means takes the first argument, '0' means takes the second argument.
167 ; This is the opposite of the intel syntax, thus we expect
168 ; Inverted mask: 1010 = 10.
169 ; According to the ABI:
170 ; a is in xmm0 => first argument is xmm0.
171 ; b is in xmm1 => second argument is xmm1.
172 ; Result is in xmm0 => destination argument.
173 ; CHECK: vblendps $10, %xmm1, %xmm0, %xmm0
165174 ; CHECK: ret
166175 %1 = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32>
167176 ret <4 x float> %1
169178
170179 ; CHECK-LABEL: @blend_shufflevector_8xfloat
171180 define <8 x float> @blend_shufflevector_8xfloat(<8 x float> %a, <8 x float> %b) {
172 ; CHECK: vblendps
181 ; CHECK: vblendps $190, %ymm1, %ymm0, %ymm0
173182 ; CHECK: ret
174183 %1 = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32>
175184 ret <8 x float> %1
177186
178187 ; CHECK-LABEL: @blend_shufflevector_4xdouble
179188 define <4 x double> @blend_shufflevector_4xdouble(<4 x double> %a, <4 x double> %b) {
180 ; CHECK: vblendpd
189 ; CHECK: vblendpd $2, %ymm1, %ymm0, %ymm0
181190 ; CHECK: ret
182191 %1 = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32>
183192 ret <4 x double> %1
185194
186195 ; CHECK-LABEL: @blend_shufflevector_4xi64
187196 define <4 x i64> @blend_shufflevector_4xi64(<4 x i64> %a, <4 x i64> %b) {
188 ; CHECK: vblendpd
197 ; CHECK: vblendpd $13, %ymm1, %ymm0, %ymm0
189198 ; CHECK: ret
190199 %1 = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32>
191200 ret <4 x i64> %1
6161
6262 ;; 2 tests for shufflevectors that optimize to blend + immediate
6363 ; CHECK-LABEL: @blend_test5
64 ; CHECK: vpblendd
64 ; CHECK: vpblendd $10, %xmm1, %xmm0, %xmm0
6565 ; CHECK: ret
6666 define <4 x i32> @blend_test5(<4 x i32> %a, <4 x i32> %b) {
6767 %1 = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32>
6969 }
7070
7171 ; CHECK-LABEL: @blend_test6
72 ; CHECK: vpblendw
72 ; CHECK: vpblendw $134, %ymm1, %ymm0, %ymm0
7373 ; CHECK: ret
7474 define <16 x i16> @blend_test6(<16 x i16> %a, <16 x i16> %b) {
7575 %1 = shufflevector <16 x i16> %a, <16 x i16> %b, <16 x i32>
123123
124124 ;; 2 tests for shufflevectors that optimize to blend + immediate
125125 ; CHECK-LABEL: @blend_shufflevector_4xfloat
126 ; CHECK: blendps
126 ; CHECK: blendps $6, %xmm1, %xmm0
127127 ; CHECK: ret
128128 define <4 x float> @blend_shufflevector_4xfloat(<4 x float> %a, <4 x float> %b) {
129129 %1 = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32>
131131 }
132132
133133 ; CHECK-LABEL: @blend_shufflevector_8xi16
134 ; CHECK: pblendw
134 ; CHECK: pblendw $134, %xmm1, %xmm0
135135 ; CHECK: ret
136136 define <8 x i16> @blend_shufflevector_8xi16(<8 x i16> %a, <8 x i16> %b) {
137137 %1 = shufflevector <8 x i16> %a, <8 x i16> %b, <8 x i32>