[0/3,RISCV] Improve bswap for ZBB

Message ID 1661015666-14659-1-git-send-email-apinski@marvell.com
Headers
Series Improve bswap for ZBB |

Message

Li, Pan2 via Gcc-patches Aug. 20, 2022, 5:14 p.m. UTC
  From: Andrew Pinski <apinski@marvell.com>

Just some improvements for bswap and ZBB including a testsuite change that will
allow more testing to happen.

Thanks,
Andrew Pinski


Andrew Pinski (3):
  Fix PR 106600: __builtin_bswap32 is not hooked up for ZBB for 32bit
  Fix PR 106601: __builtin_bswap16 code gen could be improved with ZBB
    enabled
  Fix PR 106690: enable effective_target_bswap for RISCV targets with
    ZBB enabled by default

 gcc/config/riscv/bitmanip.md                  | 26 ++++++++++++++++++-
 .../gcc.target/riscv/zbb_32_bswap-1.c         | 11 ++++++++
 .../gcc.target/riscv/zbb_32_bswap-2.c         | 12 +++++++++
 gcc/testsuite/gcc.target/riscv/zbb_bswap-1.c  | 11 ++++++++
 gcc/testsuite/gcc.target/riscv/zbb_bswap-2.c  | 12 +++++++++
 gcc/testsuite/lib/target-supports.exp         |  7 +++++
 6 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_32_bswap-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_32_bswap-2.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_bswap-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_bswap-2.c
  

Comments

Kito Cheng Aug. 22, 2022, 9:14 a.m. UTC | #1
Hi Andrew:

LGTM, Just checked what's clang gen, and saw LLVM already did the same
optimization, thanks for improving the code gen!


On Sun, Aug 21, 2022 at 1:15 AM apinski--- via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> From: Andrew Pinski <apinski@marvell.com>
>
> Just some improvements for bswap and ZBB including a testsuite change that will
> allow more testing to happen.
>
> Thanks,
> Andrew Pinski
>
>
> Andrew Pinski (3):
>   Fix PR 106600: __builtin_bswap32 is not hooked up for ZBB for 32bit
>   Fix PR 106601: __builtin_bswap16 code gen could be improved with ZBB
>     enabled
>   Fix PR 106690: enable effective_target_bswap for RISCV targets with
>     ZBB enabled by default
>
>  gcc/config/riscv/bitmanip.md                  | 26 ++++++++++++++++++-
>  .../gcc.target/riscv/zbb_32_bswap-1.c         | 11 ++++++++
>  .../gcc.target/riscv/zbb_32_bswap-2.c         | 12 +++++++++
>  gcc/testsuite/gcc.target/riscv/zbb_bswap-1.c  | 11 ++++++++
>  gcc/testsuite/gcc.target/riscv/zbb_bswap-2.c  | 12 +++++++++
>  gcc/testsuite/lib/target-supports.exp         |  7 +++++
>  6 files changed, 78 insertions(+), 1 deletion(-)
>  create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_32_bswap-1.c
>  create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_32_bswap-2.c
>  create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_bswap-1.c
>  create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_bswap-2.c
>
> --
> 2.17.1
>