diff --git a/simde/x86/clmul.h b/simde/x86/clmul.h index e2d8b4cf8..7d51b5b3f 100644 --- a/simde/x86/clmul.h +++ b/simde/x86/clmul.h @@ -101,6 +101,10 @@ simde_x_bitreverse_u64(uint64_t v) { return HEDLEY_STATIC_CAST(uint64_t, _mm_cvtsi128_si64(vec)); #elif HEDLEY_HAS_BUILTIN(__builtin_bitreverse64) return __builtin_bitreverse64(v); + #elif defined(__loongarch64) + uint64_t r; + __asm__ __volatile__ ("bitrev.d %0, %1" :"=&r"(r):"r"(v):); + return r; #else v = ((v >> 1) & UINT64_C(0x5555555555555555)) | ((v & UINT64_C(0x5555555555555555)) << 1); v = ((v >> 2) & UINT64_C(0x3333333333333333)) | ((v & UINT64_C(0x3333333333333333)) << 2);