diff options
author | Kito Cheng <kito.cheng@sifive.com> | 2024-01-19 10:29:10 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2024-02-16 14:41:14 +0800 |
commit | 7af0f1e107a480fbfe882cb985603960114aefb5 (patch) | |
tree | cf915098915dc011964bf6e3a65af823d809b0f9 /gcc/doc | |
parent | f436a2ab6ad15968275c9bbf3bd56647e5559e68 (diff) | |
download | gcc-7af0f1e107a480fbfe882cb985603960114aefb5.zip gcc-7af0f1e107a480fbfe882cb985603960114aefb5.tar.gz gcc-7af0f1e107a480fbfe882cb985603960114aefb5.tar.bz2 |
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>
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 511114c..d0e6772 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -30207,7 +30207,8 @@ with @option{--with-isa-spec=} specifying a different default version. @item -march=@var{ISA-string} Generate code for given RISC-V ISA (e.g.@: @samp{rv64im}). ISA strings must be lower-case. Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, and -@samp{rv32imaf}. +@samp{rv32imaf}. Additionally, a special value @option{help} +(@option{-march=help}) is accepted to list all supported extensions. The syntax of the ISA string is defined as follows: |