RISC-V: Add new option -march=help to print all supported extensions
The output of -march=help is like below:
```
All available -march extensions for RISC-V:
Name Version
i 2.0, 2.1
e 2.0
m 2.0
a 2.0, 2.1
f 2.0, 2.2
d 2.0, 2.2
...
```
Also support -print-supported-extensions and --print-supported-extensions for
clang compatibility.
gcc/ChangeLog:
PR target/109349
* common/config/riscv/riscv-common.cc (riscv_arch_help): New.
* config/riscv/riscv-protos.h (RISCV_MAJOR_VERSION_BASE): New.
(RISCV_MINOR_VERSION_BASE): Ditto.
(RISCV_REVISION_VERSION_BASE): Ditto.
* config/riscv/riscv-c.cc (riscv_ext_version_value): Use enum
rather than magic number.
* config/riscv/riscv.h (riscv_arch_help): New.
(EXTRA_SPEC_FUNCTIONS): Add riscv_arch_help.
(DRIVER_SELF_SPECS): Handle -march=help, -print-supported-extensions and
--print-supported-extensions.
* config/riscv/riscv.opt (march=help): New.
(print-supported-extensions): New.
(-print-supported-extensions): New.
* doc/invoke.texi (RISC-V Options): Document -march=help.
Reviewed-by:
Christoph Müllner <christoph.muellner@vrull.eu>
Showing
- gcc/common/config/riscv/riscv-common.cc 46 additions, 0 deletionsgcc/common/config/riscv/riscv-common.cc
- gcc/config/riscv/riscv-c.cc 1 addition, 1 deletiongcc/config/riscv/riscv-c.cc
- gcc/config/riscv/riscv-protos.h 7 additions, 0 deletionsgcc/config/riscv/riscv-protos.h
- gcc/config/riscv/riscv.h 6 additions, 1 deletiongcc/config/riscv/riscv.h
- gcc/config/riscv/riscv.opt 12 additions, 0 deletionsgcc/config/riscv/riscv.opt
- gcc/doc/invoke.texi 2 additions, 1 deletiongcc/doc/invoke.texi
Loading
Please register or sign in to comment