[clang] [X86][Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - allow SSE/AVX FP2INT conversion intrinsics to be used in constexpr (PR #214611)
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 14 02:29:38 PDT 2026
================
@@ -4668,6 +4668,57 @@ static bool interp__builtin_ia32_bmac(InterpState &S, CodePtr OpPC,
return true;
}
+static bool interp_builtin_ia32_cvt_scalar_to_int(InterpState &S, CodePtr OpPC,
+ const CallExpr *E) {
+ Pointer SrcVecPtr = S.Stk.pop<Pointer>();
+ Pointer Lane0Ptr = SrcVecPtr.atIndex(0);
+ const Floating &FloatElem = Lane0Ptr.deref<Floating>();
+ unsigned BitWidth = S.getASTContext().getIntWidth(E->getType());
+
+ llvm::APSInt IntResult(BitWidth, /*isUnsigned=*/false);
----------------
RKSimon wrote:
Can we use the call to determine signedness? AFAICT all builtin signatures are coorect - and it will make it easier to extend to the avx512 intrinsics in the future.
https://github.com/llvm/llvm-project/pull/214611
More information about the cfe-commits
mailing list