LoongArch incorrect codegen for std::byte_swap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



using uint_least64_t = __UINT_LEAST64_TYPE__;

uint_least64_t testbswap(uint_least64_t a) noexcept
{
   return __builtin_bswap64(a);
}

clang:
https://godbolt.org/z/z8GTsazf4


_Z9testbswapm:
       revb.d  $a0, $a0
       ret


GCC:

https://godbolt.org/z/PabfxP9ve

_Z9testbswapm:
       revb.4h $r4,$r4
       revh.d  $r4,$r4
       jr      $r1

It should just use revb.d for bswap, not separate them into two.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux