aboutsummaryrefslogtreecommitdiff
path: root/contrib/unused_functions.py
diff options
context:
space:
mode:
authorTsukasa OI <research_trasio@irq.a4lg.com>2023-08-28 15:04:13 -0600
committerJeff Law <jlaw@ventanamicro.com>2023-08-28 15:08:53 -0600
commitc2d04dd659c499d8df19f68d0602ad4c7d7065c2 (patch)
tree2dc5dfefe48c9d650ef448142432acc230ebb985 /contrib/unused_functions.py
parentb7f9ee7fb89fc9c48f03970e8e6581c7bae58f5a (diff)
downloadgcc-c2d04dd659c499d8df19f68d0602ad4c7d7065c2.zip
gcc-c2d04dd659c499d8df19f68d0602ad4c7d7065c2.tar.gz
gcc-c2d04dd659c499d8df19f68d0602ad4c7d7065c2.tar.bz2
RISC-V: __builtin_riscv_pause for all environment
The "pause" RISC-V hint instruction requires the 'Zihintpause' extension (in the assembler). However, GCC emits "pause" unconditionally, making an assembler error while compiling code with __builtin_riscv_pause while the 'Zihintpause' extension disabled. However, the "pause" instruction code (0x0100000f) is a HINT and emitting its instruction code is safe in any environment. This commit implements handling for the 'Zihintpause' extension and emits ".insn 0x0100000f" instead of "pause" only if the extension is disabled (making the diagnostics better). gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_ext_version_table): Implement the 'Zihintpause' extension, version 2.0. (riscv_ext_flag_table) Add 'Zihintpause' handling. * config/riscv/riscv-builtins.cc: Remove availability predicate "always" and add "hint_pause". (riscv_builtins) : Add "pause" extension. * config/riscv/riscv-opts.h (MASK_ZIHINTPAUSE, TARGET_ZIHINTPAUSE): New. * config/riscv/riscv.md (riscv_pause): Adjust output based on TARGET_ZIHINTPAUSE. gcc/testsuite/ChangeLog: * gcc.target/riscv/builtin_pause.c: Removed. * gcc.target/riscv/zihintpause-1.c: New test when the 'Zihintpause' extension is enabled. * gcc.target/riscv/zihintpause-2.c: Likewise. * gcc.target/riscv/zihintpause-noarch.c: New test when the 'Zihintpause' extension is disabled.
Diffstat (limited to 'contrib/unused_functions.py')
0 files changed, 0 insertions, 0 deletions