llvm.org GIT mirror llvm / a009ec4
Merging r311258: ------------------------------------------------------------------------ r311258 | mstorsjo | 2017-08-19 12:47:48 -0700 (Sat, 19 Aug 2017) | 9 lines [ARM] Check the right order for halves of VZIP/VUZP if both parts are used This is the exact same fix as in SVN r247254. In that commit, the fix was applied only for isVTRNMask and isVTRN_v_undef_Mask, but the same issue is present for VZIP/VUZP as well. This fixes PR33921. Differential Revision: https://reviews.llvm.org/D36899 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@311369 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 2 years ago
2 changed file(s) with 35 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
59005900 return false;
59015901
59025902 for (unsigned i = 0; i < M.size(); i += NumElts) {
5903 WhichResult = M[i] == 0 ? 0 : 1;
5903 if (M.size() == NumElts * 2)
5904 WhichResult = i / NumElts;
5905 else
5906 WhichResult = M[i] == 0 ? 0 : 1;
59045907 for (unsigned j = 0; j < NumElts; ++j) {
59055908 if (M[i+j] >= 0 && (unsigned) M[i+j] != 2 * j + WhichResult)
59065909 return false;
59315934
59325935 unsigned Half = NumElts / 2;
59335936 for (unsigned i = 0; i < M.size(); i += NumElts) {
5934 WhichResult = M[i] == 0 ? 0 : 1;
5937 if (M.size() == NumElts * 2)
5938 WhichResult = i / NumElts;
5939 else
5940 WhichResult = M[i] == 0 ? 0 : 1;
59355941 for (unsigned j = 0; j < NumElts; j += Half) {
59365942 unsigned Idx = WhichResult;
59375943 for (unsigned k = 0; k < Half; ++k) {
59715977 return false;
59725978
59735979 for (unsigned i = 0; i < M.size(); i += NumElts) {
5974 WhichResult = M[i] == 0 ? 0 : 1;
5980 if (M.size() == NumElts * 2)
5981 WhichResult = i / NumElts;
5982 else
5983 WhichResult = M[i] == 0 ? 0 : 1;
59755984 unsigned Idx = WhichResult * NumElts / 2;
59765985 for (unsigned j = 0; j < NumElts; j += 2) {
59775986 if ((M[i+j] >= 0 && (unsigned) M[i+j] != Idx) ||
60046013 return false;
60056014
60066015 for (unsigned i = 0; i < M.size(); i += NumElts) {
6007 WhichResult = M[i] == 0 ? 0 : 1;
6016 if (M.size() == NumElts * 2)
6017 WhichResult = i / NumElts;
6018 else
6019 WhichResult = M[i] == 0 ? 0 : 1;
60086020 unsigned Idx = WhichResult * NumElts / 2;
60096021 for (unsigned j = 0; j < NumElts; j += 2) {
60106022 if ((M[i+j] >= 0 && (unsigned) M[i+j] != Idx) ||
278278 %tmp1 = load <4 x i16>, <4 x i16>* %A
279279 %tmp2 = load <4 x i16>, <4 x i16>* %B
280280 %0 = shufflevector <4 x i16> %tmp1, <4 x i16> %tmp2, <8 x i32>
281 ret <8 x i16> %0
282 }
283
284 ; NOTE: The mask here looks like something that could be done with a vzip,
285 ; but which the current handling of two-result vzip can't do - thus ending up
286 ; as a vtrn.
287 define <8 x i16> @vzip_lower_shufflemask_undef_rev(<4 x i16>* %A, <4 x i16>* %B) {
288 ; CHECK-LABEL: vzip_lower_shufflemask_undef_rev:
289 ; CHECK: @ BB#0: @ %entry
290 ; CHECK-NEXT: vldr d16, [r1]
291 ; CHECK-NEXT: vldr d19, [r0]
292 ; CHECK-NEXT: vtrn.16 d19, d16
293 ; CHECK-NEXT: vmov r0, r1, d18
294 ; CHECK-NEXT: vmov r2, r3, d19
295 ; CHECK-NEXT: mov pc, lr
296 entry:
297 %tmp1 = load <4 x i16>, <4 x i16>* %A
298 %tmp2 = load <4 x i16>, <4 x i16>* %B
299 %0 = shufflevector <4 x i16> %tmp1, <4 x i16> %tmp2, <8 x i32>
281300 ret <8 x i16> %0
282301 }
283302