]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RISCV] Add %~ to print w if TARGET_64BIT and use it
authorAndrew Pinski <apinski@marvell.com>
Fri, 12 Aug 2022 17:46:16 +0000 (17:46 +0000)
committerAndrew Pinski <apinski@marvell.com>
Wed, 24 Aug 2022 19:15:31 +0000 (12:15 -0700)
commit473d7aad848fe6ec151e7445e06c6e06ee4bd576
tree51c2c6aca7aadd80ab21308a6526b1cc4ed546a4
parent380b8fd96e10c45ce8470b906037cf487ac3f91f
[RISCV] Add %~ to print w if TARGET_64BIT and use it

To make things easier and more maintainable, we need to
add support printing out w if TARGET_64BIT so this patch
adds %~ to do that, similar how the x86 backend uses %~
to print out i/f for TARGET_AVX2. We could have chosen any
punctuation symbol but ~ looks the closest to w.

OK? Build and tested for riscv64-linux-gnu and riscv32-linux-gnu with no regressions.

Thanks,
Andrew Pinski

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_print_operand):
Handle '~'.
(riscv_print_operand_punct_valid_p): New function
(TARGET_PRINT_OPERAND_PUNCT_VALID_P): Define.
* config/riscv/bitmanip.md (<bitmanip_optab>si2/clz_ctz_pcnt):
Use %~ instead of conditional the pattern on TARGET_64BIT.
(rotrsi3): Likewise.
(rotlsi3): Likewise.
* config/riscv/riscv.md: Add ~ to the list of modifiers.
(addsi3): Use %~ instead of conditional the pattern on TARGET_64BIT.
(subsi3): Likewise.
(negsi2): Likewise.
(mulsi3): Likewise.
(optab>si3/any_div): Likewise.
(*add<mode>hi3): Likewise.
(<optab>si3/any_shift): Likewise.
gcc/config/riscv/bitmanip.md
gcc/config/riscv/riscv.cc
gcc/config/riscv/riscv.md