https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61559
--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 4 Sep 2014, ubizjak at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61559 > > --- Comment #7 from Uroš Bizjak <ubizjak at gmail dot com> --- > (In reply to Richard Biener from comment #6) > > > Seems to me we want > > > > (bit_xor (bswap32 @0) (bswap32 @1)) -> (bswap32 (bit_xor @0 @1)) > > > > in match-and-simplify speak. > > Please note that there are some more interesting transformations involving > immediates and bit_not, as shown in builtin-bswap-8.c. Added. /* PR61559. Transforms for gcc.dg/builtin-bswap-8.c */ (for bswap in BUILT_IN_BSWAP16 BUILT_IN_BSWAP32 BUILT_IN_BSWAP64 (simplify (bswap (bswap @0)) @0) (simplify (bswap (bit_not (bswap @0))) (bit_not @0)) (for bitop in bit_xor bit_ior bit_and (simplify (bitop (bswap @0) (bswap @1)) (bswap (bitop @0 @1))) (simplify (bswap (bitop (bswap @0) INTEGER_CST@1)) (bitop @0 (bswap @1)))))
