https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106601
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 Last reconfirmed| |2022-08-12 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Waterman from comment #1) > (I don't know whether bswap32 has already been similarly optimized on RV64, > but it needs to use srai so that the 32-bit result is canonicalized > properly.) It is: t: rev8 a0,a0 srai a0,a0,32 ret For: unsigned int t(unsigned int a) { return __builtin_bswap32(a); }