]> gcc.gnu.org Git - gcc.git/commit
RISC-V: Add new option -march=help to print all supported extensions
authorKito Cheng <kito.cheng@sifive.com>
Fri, 19 Jan 2024 02:29:10 +0000 (10:29 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Fri, 16 Feb 2024 06:41:14 +0000 (14:41 +0800)
commit7af0f1e107a480fbfe882cb985603960114aefb5
treecf915098915dc011964bf6e3a65af823d809b0f9
parentf436a2ab6ad15968275c9bbf3bd56647e5559e68
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>
gcc/common/config/riscv/riscv-common.cc
gcc/config/riscv/riscv-c.cc
gcc/config/riscv/riscv-protos.h
gcc/config/riscv/riscv.h
gcc/config/riscv/riscv.opt
gcc/doc/invoke.texi
This page took 0.066129 seconds and 6 git commands to generate.