[clang] [X86][Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - Allow AVX/AVX512 IFMA madd52 intrinsics to be used in constexpr (PR #161056)

Hongyu Chen via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 2 07:45:01 PDT 2025


================
@@ -3523,6 +3523,24 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
           return F;
         });
 
+  case X86::BI__builtin_ia32_vpmadd52luq128:
+  case X86::BI__builtin_ia32_vpmadd52luq256:
+  case X86::BI__builtin_ia32_vpmadd52luq512:
+    return interp__builtin_elementwise_triop(
+        S, OpPC, Call, [](const APSInt &A, const APSInt &B, const APSInt &C) {
+          return APSInt(A + (B.trunc(52) * C.trunc(52)).trunc(52).zext(64),
+                        false);
----------------
XChy wrote:

```suggestion
          return A + (B.trunc(52) * C.trunc(52)).zext(64);
```
Not familiar with frontend. Is the outer APSInt constructor necessary?

https://github.com/llvm/llvm-project/pull/161056


More information about the cfe-commits mailing list