Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ inline uint32_t bswap(uint32_t val) {
__asm__("rev %w[dst], %w[src]" : [dst]"=r"(val) : [src]"r"(val));
#elif defined(__ppc64__)||(__PPC64__)||(__powerpc64__)||(__loongarch64)
return __builtin_bswap32(val);
#elif #elif defined(__riscv) && __riscv_xlen == 32
return __builtin_bswap32(val);
#else
__asm__("bswap %0" : "=r" (val) : "0" (val));
#endif
Expand All @@ -112,6 +114,8 @@ inline uint64_t bswap64(uint64_t val) {
__asm__("rev %[dst], %[src]" : [dst]"=r"(val) : [src]"r"(val));
#elif defined(__ppc64__)||(__PPC64__)||(__powerpc64__)||(__loongarch64)
return __builtin_bswap64(val);
#elif #elif defined(__riscv) && __riscv_xlen == 64
return __builtin_bswap64(val);
#else
#ifdef __X64
__asm__("bswapq %0" : "=r" (val) : "0" (val));
Expand Down