]> gcc.gnu.org Git - gcc.git/commit
store-merging: Match bswap64 on 32-bit targets with bswapsi2 [PR114319]
authorJakub Jelinek <jakub@redhat.com>
Wed, 13 Mar 2024 14:34:59 +0000 (15:34 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 13 Mar 2024 14:35:41 +0000 (15:35 +0100)
commit74bca21db31e3f4ab6543b56c3f26b4dfe586fef
treedb99186fa3df22143126aabde13fb6698251e86d
parent5a44e14eb4ff47317b420de10fcc2512a6a6e0fb
store-merging: Match bswap64 on 32-bit targets with bswapsi2 [PR114319]

gimple-ssa-store-merging.cc tests bswap_optab in 3 different places,
in 2 of them it has special exception for double-word bswap using pair
of word-mode bswap optabs, but in the last one it doesn't.

The following patch changes even the last spot.
We don't handle 128-bit bswaps in the passes at all, because currently we
just use uint64_t to represent the byte reshuffling (we'd need to use
offset_int or something like that instead) and we don't have
__builtin_bswap128 nor type-generic __builtin_bswap, so there is nothing
for 64-bit targets there.

2024-03-13  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/114319
* gimple-ssa-store-merging.cc
(imm_store_chain_info::try_coalesce_bswap): For 32-bit targets
allow matching __builtin_bswap64 if there is bswapsi2 optab.

* gcc.target/i386/pr114319.c: New test.
gcc/gimple-ssa-store-merging.cc
gcc/testsuite/gcc.target/i386/pr114319.c [new file with mode: 0644]
This page took 0.070481 seconds and 5 git commands to generate.