Skip to content

Commit

Permalink
x86 clmul simde_x_bitreverse_u64: add loongarch implementation (#1249)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinboson authored Dec 19, 2024
1 parent 4242de3 commit 866cc57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions simde/x86/clmul.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 866cc57

Please sign in to comment.