[clang] [Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - Allow shufps/pd shuffles intrinsics to be used in constexpr (PR #164078)
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 21 07:06:52 PDT 2025
================
@@ -3128,6 +3128,52 @@ static bool interp__builtin_ia32_vpconflict(InterpState &S, CodePtr OpPC,
return true;
}
+static bool interp__builtin_ia32_shuf(InterpState &S, CodePtr OpPC,
+ const CallExpr *Call) {
+ assert(Call->getNumArgs() == 3);
+
+ unsigned ShuffleMask = popToAPSInt(S, Call->getArg(2)).getZExtValue();
+ QualType Arg0Type = Call->getArg(0)->getType();
+ const auto *VecT = Arg0Type->castAs<VectorType>();
+ PrimType ElemT = *S.getContext().classify(VecT->getElementType());
+ unsigned NumElems = VecT->getNumElements();
+ unsigned LaneWidth = S.getContext().getBitWidth(VecT->getElementType());
----------------
RKSimon wrote:
LaneWidth -> ElemWidth (Lanes in x86 mean 128-bit subvectors)
https://github.com/llvm/llvm-project/pull/164078
More information about the cfe-commits
mailing list