[clang] [X86][Clang] allow CRC32 intrinsics to be used in constexp (PR #173908)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 30 08:44:24 PST 2025


================
@@ -717,6 +717,52 @@ static bool interp__builtin_popcount(InterpState &S, CodePtr OpPC,
   return true;
 }
 
+static bool interp__builtin_ia32_crc32(InterpState &S, CodePtr OpPC,
+                                       const InterpFrame *Frame,
+                                       const CallExpr *Call,
+                                       unsigned BuiltinID) {
+  APSInt Data = popToAPSInt(S, Call->getArg(1));
+  APSInt CRC = popToAPSInt(S, Call->getArg(0));
----------------
tbaederr wrote:

If you don't use `Data` and `CRC` anyway, you can also use `popToUInt64()`.

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


More information about the cfe-commits mailing list