[clang] [X86][Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - allow AVX512 mask predicate intrinsics to be used in constexpr (PR #165054)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 19 21:49:42 PST 2025
================
@@ -3362,6 +3362,28 @@ static bool interp__builtin_ia32_vpconflict(InterpState &S, CodePtr OpPC,
return true;
}
+static bool interp__builtin_ia32_cvt_vec2mask(InterpState &S, CodePtr OpPC,
+ const CallExpr *Call,
+ unsigned ID) {
+ assert(Call->getNumArgs() == 1);
+
+ const Pointer &Vec = S.Stk.pop<Pointer>();
+ unsigned RetWidth = S.getASTContext().getIntWidth(Call->getType());
+ APInt RetMask(RetWidth, 0);
+
+ unsigned VectorLen = Vec.getNumElems();
+ PrimType ElemT = Vec.getFieldDesc()->getPrimType();
+
+ for (unsigned ElemNum = 0; ElemNum < VectorLen; ++ElemNum) {
----------------
tbaederr wrote:
```suggestion
for (unsigned ElemNum = 0; ElemNum != VectorLen; ++ElemNum) {
```
https://github.com/llvm/llvm-project/pull/165054
More information about the cfe-commits
mailing list