Skip to content

Commit e83fad7

Browse files
authored
[X86] Allow PSHUFD/PSHUFLW/PSHUFW intrinsics in constexpr
1 parent cb30a32 commit e83fad7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/lib/AST/ExprConstant.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11630,7 +11630,9 @@ static bool evalPshufBuiltin(EvalInfo &Info, const CallExpr *Call,
1163011630
return false;
1163111631
unsigned NumElts = VT->getNumElements();
1163211632

11633-
unsigned LaneElts = 128u / ElemBits;
11633+
unsigned TotalBits = NumElts * ElemBits;
11634+
unsigned LaneBits = 128u;
11635+
unsigned LaneElts = LaneBits / ElemBits;
1163411636
if (!LaneElts || (NumElts % LaneElts) != 0)
1163511637
return false;
1163611638

0 commit comments

Comments
 (0)