llvm.org GIT mirror llvm / 467016e
Fix 256-bit PALIGNR comment decoding to understand that it works on independent 256-bit lanes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173674 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 7 years ago
2 changed file(s) with 26 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
6565 unsigned NumElts = VT.getVectorNumElements();
6666 unsigned Offset = Imm * (VT.getVectorElementType().getSizeInBits() / 8);
6767
68 for (unsigned i = 0; i != NumElts; ++i)
69 ShuffleMask.push_back((i + Offset) % (NumElts * 2));
68 unsigned NumLanes = VT.getSizeInBits() / 128;
69 unsigned NumLaneElts = NumElts / NumLanes;
70
71 for (unsigned l = 0; l != NumElts; l += NumLaneElts) {
72 for (unsigned i = 0; i != NumLaneElts; ++i) {
73 unsigned Base = i + Offset;
74 // if i+offset is out of this lane then we actually need the other source
75 if (Base >= NumLaneElts) Base += NumElts - NumLaneElts;
76 ShuffleMask.push_back(Base + l);
77 }
78 }
7079 }
7180
7281 /// DecodePSHUFMask - This decodes the shuffle masks for pshufd, and vpermilp*.
2828 # CHECK: xmm2 = xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
2929 vpalignr $0, (%rax), %xmm1, %xmm2
3030 # CHECK: xmm2 = mem[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
31
32 vpalignr $8, %ymm0, %ymm1, %ymm2
33 # CHECK: ymm2 = ymm0[8,9,10,11,12,13,14,15],ymm1[0,1,2,3,4,5,6,7],ymm0[24,25,26,27,28,29,30,31],ymm1[16,17,18,19,20,21,22,23]
34 vpalignr $8, (%rax), %ymm1, %ymm2
35 # CHECK: ymm2 = mem[8,9,10,11,12,13,14,15],ymm1[0,1,2,3,4,5,6,7],mem[24,25,26,27,28,29,30,31],ymm1[16,17,18,19,20,21,22,23]
36
37 vpalignr $16, %ymm0, %ymm1, %ymm2
38 # CHECK: ymm2 = ymm1[0,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]
39 vpalignr $16, (%rax), %ymm1, %ymm2
40 # CHECK: ymm2 = ymm1[0,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]
41
42 vpalignr $0, %ymm0, %ymm1, %ymm2
43 # CHECK: ymm2 = ymm0[0,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]
44 vpalignr $0, (%rax), %ymm1, %ymm2
45 # CHECK: ymm2 = mem[0,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]