================
@@ -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));
+
+ uint64_t CRCVal = CRC.getZExtValue();
+ uint64_t DataVal = Data.getZExtValue();
+
+ // Determine the data width based on the builtin
+ unsigned DataBytes;
+ switch (BuiltinID) {
----------------
RKSimon wrote:
We can avoid this switch statement by passing in unsigned DataBytes as an
additional argument to interp__builtin_ia32_crc32
https://github.com/llvm/llvm-project/pull/173908
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits