diff options
author | Andrew Pinski <apinski@marvell.com> | 2022-08-19 17:46:40 +0000 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2022-08-24 11:30:44 -0700 |
commit | e5e6983c3da53729e58a32af1d531ea74b3dbf5d (patch) | |
tree | 1de40f51a76673e5c4953b1a48e4a9e6bda3bd00 /libcpp | |
parent | cb2daf5acce003300ee948a89860c0d13ebcae79 (diff) | |
download | gcc-e5e6983c3da53729e58a32af1d531ea74b3dbf5d.zip gcc-e5e6983c3da53729e58a32af1d531ea74b3dbf5d.tar.gz gcc-e5e6983c3da53729e58a32af1d531ea74b3dbf5d.tar.bz2 |
Fix PR 106601: __builtin_bswap16 code gen could be improved with ZBB enabled
The default expansion for bswap16 is two extractions (shift/and)
followed by an insertation (ior) and then a zero extend. This can be improved
with ZBB enabled to just full byteswap followed by a (logical) shift right.
This patch adds a new pattern for this which does that.
OK? Built and tested on riscv32-linux-gnu and riscv64-linux-gnu.
gcc/ChangeLog:
PR target/106601
* config/riscv/bitmanip.md (bswaphi2): New pattern.
gcc/testsuite/ChangeLog:
PR target/106601
* gcc.target/riscv/zbb_32_bswap-2.c: New test.
* gcc.target/riscv/zbb_bswap-2.c: New test.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions