[clang] [Clang] feat: Allow AVX/AVX2 permute operations in constexpr (PR #172149)

via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 13 14:30:25 PST 2025


================
@@ -5101,6 +5101,36 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
           unsigned SrcIdx = (ShuffleMask >> 6) & 0x1;
           return std::pair<unsigned, int>{SrcIdx, Offset};
         });
+  case X86::BI__builtin_ia32_vperm2f128_pd256:
+    return interp__builtin_ia32_shuffle_generic(
+        S, OpPC, Call, [](unsigned DstIdx, unsigned ShuffleMask) {
+          unsigned i = DstIdx >> 1;
+          unsigned k = ShuffleMask >> (i << 2);
----------------
AhmedYasser5 wrote:

I was using the same variable names as the comment. I'll change them to use meaningful names.

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


More information about the cfe-commits mailing list