[clang] [X86][Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - allow element extraction/insertion intrinsics to be used in constexpr #159753 (PR #161302)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 1 00:15:10 PDT 2025
================
@@ -2878,6 +2878,60 @@ static bool interp__builtin_x86_insert_subvector(InterpState &S, CodePtr OpPC,
return true;
}
+static bool interp__builtin_vec_ext(InterpState &S, CodePtr OpPC,
+ const CallExpr *Call, unsigned ID) {
+ assert(Call->getNumArgs() == 2);
+
+ APSInt ImmAPS = popToAPSInt(S, Call->getArg(1));
+ const Pointer &Vec = S.Stk.pop<Pointer>();
+ if (!Vec.getFieldDesc()->isPrimitiveArray())
+ return false;
+
+ unsigned NumElts = Vec.getNumElems();
----------------
tbaederr wrote:
```suggestion
unsigned NumElems = Vec.getNumElems();
```
https://github.com/llvm/llvm-project/pull/161302
More information about the cfe-commits
mailing list