llvm.org GIT mirror llvm / 6f0ee4d
[CostModel][X86] Add SSE2 two-src shuffle costs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310654 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 years ago
3 changed file(s) with 14 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
972972 { TTI::SK_PermuteTwoSrc, MVT::v2f64, 1 }, // shufpd
973973 { TTI::SK_PermuteTwoSrc, MVT::v2i64, 1 }, // shufpd
974974 { TTI::SK_PermuteTwoSrc, MVT::v4i32, 2 }, // 2*{unpck,movsd,pshufd}
975 { TTI::SK_PermuteTwoSrc, MVT::v8i16, 8 }, // blend+permute
976 { TTI::SK_PermuteTwoSrc, MVT::v16i8, 13 }, // blend+permute
975977 };
976978
977979 if (ST->hasSSE2())
158158 ; AVX512VBMI: cost of 1 {{.*}} %V128 = shufflevector
159159 %V128 = shufflevector <8 x i16> %src128, <8 x i16> undef, <8 x i32>
160160
161 ; SSE2: cost of 32 {{.*}} %V256 = shufflevector
161 ; SSE2: cost of 16 {{.*}} %V256 = shufflevector
162162 ; SSSE3: cost of 6 {{.*}} %V256 = shufflevector
163163 ; SSE42: cost of 6 {{.*}} %V256 = shufflevector
164164 ; AVX1: cost of 8 {{.*}} %V256 = shufflevector
168168 ; AVX512VBMI cost of 1 {{.*}} %V256 = shufflevector
169169 %V256 = shufflevector <16 x i16> %src256, <16 x i16> undef, <16 x i32>
170170
171 ; SSE2: cost of 192 {{.*}} %V512 = shufflevector
171 ; SSE2: cost of 96 {{.*}} %V512 = shufflevector
172172 ; SSSE3: cost of 36 {{.*}} %V512 = shufflevector
173173 ; SSE42: cost of 36 {{.*}} %V512 = shufflevector
174174 ; AVX1: cost of 30 {{.*}} %V512 = shufflevector
178178 ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
179179 %V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32>
180180
181 ; SSE2: cost of 896 {{.*}} %V1024 = shufflevector
181 ; SSE2: cost of 448 {{.*}} %V1024 = shufflevector
182182 ; SSSE3: cost of 168 {{.*}} %V1024 = shufflevector
183183 ; SSE42: cost of 168 {{.*}} %V1024 = shufflevector
184184 ; AVX1: cost of 180 {{.*}} %V1024 = shufflevector
200200 ; AVX512: cost of 1 {{.*}} %V128 = shufflevector
201201 %V128 = shufflevector <16 x i8> %src128, <16 x i8> undef, <16 x i32>
202202
203 ; SSE2: cost of 64 {{.*}} %V256 = shufflevector
203 ; SSE2: cost of 26 {{.*}} %V256 = shufflevector
204204 ; SSSE3: cost of 6 {{.*}} %V256 = shufflevector
205205 ; SSE42: cost of 6 {{.*}} %V256 = shufflevector
206206 ; AVX1: cost of 8 {{.*}} %V256 = shufflevector
210210 ; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector
211211 %V256 = shufflevector <32 x i8> %src256, <32 x i8> undef, <32 x i32>
212212
213 ; SSE2: cost of 384 {{.*}} %V512 = shufflevector
213 ; SSE2: cost of 156 {{.*}} %V512 = shufflevector
214214 ; SSSE3: cost of 36 {{.*}} %V512 = shufflevector
215215 ; SSE42: cost of 36 {{.*}} %V512 = shufflevector
216216 ; AVX1: cost of 30 {{.*}} %V512 = shufflevector
165165 ; CHECK-LABEL: 'test_vXi16'
166166 define void @test_vXi16(<8 x i16> %src128, <16 x i16> %src256, <32 x i16> %src512, <64 x i16> %src1024, <8 x i16> %src128_1, <16 x i16> %src256_1, <32 x i16> %src512_1, <64 x i16> %src1024_1) {
167167
168 ; SSE2: cost of 16 {{.*}} %V128 = shufflevector
168 ; SSE2: cost of 8 {{.*}} %V128 = shufflevector
169169 ; SSSE3: cost of 3 {{.*}} %V128 = shufflevector
170170 ; SSE42: cost of 3 {{.*}} %V128 = shufflevector
171171 ; AVX1: cost of 3 {{.*}} %V128 = shufflevector
175175 ; AVX512VBMI: cost of 1 {{.*}} %V128 = shufflevector
176176 %V128 = shufflevector <8 x i16> %src128, <8 x i16> %src128_1, <8 x i32>
177177
178 ; SSE2: cost of 32 {{.*}} %V256 = shufflevector
178 ; SSE2: cost of 48 {{.*}} %V256 = shufflevector
179179 ; SSSE3: cost of 18 {{.*}} %V256 = shufflevector
180180 ; SSE42: cost of 18 {{.*}} %V256 = shufflevector
181181 ; AVX1: cost of 15 {{.*}} %V256 = shufflevector
185185 ; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector
186186 %V256 = shufflevector <16 x i16> %src256, <16 x i16> %src256_1, <16 x i32>
187187
188 ; SSE2: cost of 64 {{.*}} %V512 = shufflevector
188 ; SSE2: cost of 224 {{.*}} %V512 = shufflevector
189189 ; SSSE3: cost of 84 {{.*}} %V512 = shufflevector
190190 ; SSE42: cost of 84 {{.*}} %V512 = shufflevector
191191 ; AVX1: cost of 90 {{.*}} %V512 = shufflevector
195195 ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
196196 %V512 = shufflevector <32 x i16> %src512, <32 x i16> %src512_1, <32 x i32>
197197
198 ; SSE2: cost of 128 {{.*}} %V1024 = shufflevector
198 ; SSE2: cost of 960 {{.*}} %V1024 = shufflevector
199199 ; SSSE3: cost of 360 {{.*}} %V1024 = shufflevector
200200 ; SSE42: cost of 360 {{.*}} %V1024 = shufflevector
201201 ; AVX1: cost of 420 {{.*}} %V1024 = shufflevector
211211 ; CHECK-LABEL: 'test_vXi8'
212212 define void @test_vXi8(<16 x i8> %src128, <32 x i8> %src256, <64 x i8> %src512, <16 x i8> %src128_1, <32 x i8> %src256_1, <64 x i8> %src512_1) {
213213
214 ; SSE2: cost of 32 {{.*}} %V128 = shufflevector
214 ; SSE2: cost of 13 {{.*}} %V128 = shufflevector
215215 ; SSSE3: cost of 3 {{.*}} %V128 = shufflevector
216216 ; SSE42: cost of 3 {{.*}} %V128 = shufflevector
217217 ; AVX1: cost of 3 {{.*}} %V128 = shufflevector
221221 ; AVX512VBMI: cost of 1 {{.*}} %V128 = shufflevector
222222 %V128 = shufflevector <16 x i8> %src128, <16 x i8> %src128_1, <16 x i32>
223223
224 ; SSE2: cost of 64 {{.*}} %V256 = shufflevector
224 ; SSE2: cost of 78 {{.*}} %V256 = shufflevector
225225 ; SSSE3: cost of 18 {{.*}} %V256 = shufflevector
226226 ; SSE42: cost of 18 {{.*}} %V256 = shufflevector
227227 ; AVX1: cost of 15 {{.*}} %V256 = shufflevector
231231 ; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector
232232 %V256 = shufflevector <32 x i8> %src256, <32 x i8> %src256_1, <32 x i32>
233233
234 ; SSE2: cost of 128 {{.*}} %V512 = shufflevector
234 ; SSE2: cost of 364 {{.*}} %V512 = shufflevector
235235 ; SSSE3: cost of 84 {{.*}} %V512 = shufflevector
236236 ; SSE42: cost of 84 {{.*}} %V512 = shufflevector
237237 ; AVX1: cost of 90 {{.*}} %V512 = shufflevector