[clang] [X86][Clang] allow CRC32 intrinsics to be used in constexp (PR #173908)
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 14 07:27:08 PST 2026
================
@@ -138,3 +138,13 @@ unsigned long long test_mm_crc32_u64(unsigned long long CRC, unsigned long long
return _mm_crc32_u64(CRC, V);
}
#endif
+
+#ifdef __cplusplus
+TEST_CONSTEXPR(_mm_crc32_u8(0, 42) == 0x4b5fa6e6);
+TEST_CONSTEXPR(_mm_crc32_u8(0x12345678, 42) == 0xb00c9e72);
+TEST_CONSTEXPR(_mm_crc32_u16(0, 42) == 0xc5da1054);
+TEST_CONSTEXPR(_mm_crc32_u32(0, 42) == 0x9e0654ec);
+#ifdef __x86_64__
+TEST_CONSTEXPR(_mm_crc32_u64(0, 42) == 0xdd439b0d);
----------------
RKSimon wrote:
still missing a range of random value tests as I suggested
https://github.com/llvm/llvm-project/pull/173908
More information about the cfe-commits
mailing list