[RFC,0/2] RISC-V: Make __builtin_riscv_pause 'Zihintpause' only

Message ID cover.1691634361.git.research_trasio@irq.a4lg.com
Headers
Series RISC-V: Make __builtin_riscv_pause 'Zihintpause' only |

Message

Tsukasa OI Aug. 10, 2023, 2:26 a.m. UTC
  **WARNING**

Following patch sets are exclusive:

1.  [RFC PATCH v2] RISC-V: __builtin_riscv_pause for all environment
2.  [RFC PATCH] RISC-V: Make __builtin_riscv_pause 'Zihintpause' only (this)

See <https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626748.html>
for the background of this patch set.


Changes: (all environment) v1 -> ('Zihintpause'-only) v1

*   Based on the feedback from Jeff Law, I made an alternative patch set
    which makes "__builtin_riscv_pause" 'Zihintpause'-only.


Comparison: Patch sets [1] and [2] (this)

*   [1] completely preserves the compatibility with GCC 13
    ([2] removes __builtin_riscv_pause if the 'Zihintpause' extension is
     absent, making a minor compatibility issue)
*   Because of the nature of the instrinsic, [2] is more natural
    ("pause" is defined in the 'Zihintpause' extension).


Please consider those patch sets and decide which to apply.

Sincerely,
Tsukasa




Tsukasa OI (2):
  RISC-V: Make __builtin_riscv_pause 'Zihintpause' only
  RISC-V: Fix documentation of __builtin_riscv_pause

 gcc/common/config/riscv/riscv-common.cc        |  2 ++
 gcc/config/riscv/riscv-builtins.cc             |  4 ++--
 gcc/config/riscv/riscv-opts.h                  |  2 ++
 gcc/config/riscv/riscv.md                      |  2 +-
 gcc/doc/extend.texi                            |  6 +++---
 gcc/testsuite/gcc.target/riscv/builtin_pause.c | 10 ----------
 gcc/testsuite/gcc.target/riscv/zihintpause-1.c | 11 +++++++++++
 gcc/testsuite/gcc.target/riscv/zihintpause-2.c | 11 +++++++++++
 8 files changed, 32 insertions(+), 16 deletions(-)
 delete mode 100644 gcc/testsuite/gcc.target/riscv/builtin_pause.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/zihintpause-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/zihintpause-2.c


base-commit: 9b099a83b45b8fcdfc07d518e05d36ea741b2227