Skip to content

Commit dc67248

Browse files
authored
Simplify lane element calculation logic
Refactor lane element calculation for clarity.
1 parent ffa0287 commit dc67248

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,10 +2788,8 @@ static bool interp__builtin_ia32_pshuf(InterpState &S, CodePtr OpPC,
27882788
unsigned ElemBits = static_cast<unsigned>(primSize(ElemT) * 8);
27892789
if (ElemBits != 16 && ElemBits != 32)
27902790
return false;
2791-
2792-
unsigned TotalBits = NumElems * ElemBits;
2793-
unsigned LaneBits = (TotalBits == 64) ? 64u : 128u;
2794-
unsigned LaneElts = LaneBits / ElemBits;
2791+
2792+
unsigned LaneElts = 128u / ElemBits;
27952793
assert(LaneElts && (NumElems % LaneElts == 0));
27962794

27972795
uint8_t ctl = static_cast<uint8_t>(ControlImm.getZExtValue());

0 commit comments

Comments
 (0)