[clang] [clang][x86] Add constexpr support for MULX intrinsics (PR #110654)
Phoebe Wang via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 1 06:06:07 PDT 2024
================
@@ -86,5 +98,17 @@ char pext64_0[_pext_u64(0x0123456789ABCDEFULL, 0x0000000000000000ULL) == 0x00000
char pext64_1[_pext_u64(0x0123456789ABCDEFULL, 0x00000000000000F0ULL) == 0x000000000000000EULL ? 1 : -1];
char pext64_2[_pext_u64(0x0123456789ABCDEFULL, 0xF00000F0F00000F0ULL) == 0x000000000000068EULL ? 1 : -1];
char pext64_3[_pext_u64(0x0123456789ABCDEFULL, 0xFFFFFFFFFFFFFFFFULL) == 0x0123456789ABCDEFULL ? 1 : -1];
+
+constexpr unsigned __int128
+test_mulx_u64(unsigned long long X, unsigned long long Y)
+{
+ unsigned long long H{};
+ return _mulx_u64(X, Y, &H) | ((unsigned __int128) H << 64);
+}
+
+void mulxu64() {
+ constexpr unsigned long long X = 0x0123456789ABCDEFULL, Y = 0xfEDCBA9876543210ULL;
----------------
phoebewang wrote:
`0xFED....`
https://github.com/llvm/llvm-project/pull/110654
More information about the cfe-commits
mailing list