[Bug target/109349] riscv: Add --print-supported-extensions

2024-02-16 Thread kito at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109349

Kito Cheng  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED

--- Comment #6 from Kito Cheng  ---
Implemented on trunk now :)

[Bug target/109349] riscv: Add --print-supported-extensions

2024-02-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109349

--- Comment #5 from GCC Commits  ---
The master branch has been updated by Kito Cheng :

https://gcc.gnu.org/g:7af0f1e107a480fbfe882cb985603960114aefb5

commit r14-9023-g7af0f1e107a480fbfe882cb985603960114aefb5
Author: Kito Cheng 
Date:   Fri Jan 19 10:29:10 2024 +0800

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:
NameVersion
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 

[Bug target/109349] riscv: Add --print-supported-extensions

2023-03-30 Thread kito at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109349

Kito Cheng  changed:

   What|Removed |Added

 CC||kito at gcc dot gnu.org

--- Comment #4 from Kito Cheng  ---
MaskRay:

I would prefer to adding -march=help rather than --print-supported-extensions
on GNU toolchain side, that should be satisfy the conventions in GCC and also
having consistent with clang, although I am personally prefer -march=? rather
than -march=help, but I know clang has rename -mcpu=? -mtune=? to -mcpu=help
and -mtune=help, anyway that's minor.

BTW, 4vtomat is our(SiFive) team member, so actually we've plan to add that on
GNU toolchain side but because it's stage 4 for GCC so I still hold there :P


Andrew Pinski:

Yeah, I plan to make up document stuffs and release notes at April...

[Bug target/109349] riscv: Add --print-supported-extensions

2023-03-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109349

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=106530

--- Comment #3 from Andrew Pinski  ---
Note I filed PR 106530 for the whole lack of documentation on what is allowed
for -march= for riscv even.  Other targets documentation is so much better in
documenting options.

[Bug target/109349] riscv: Add --print-supported-extensions

2023-03-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109349

--- Comment #2 from Andrew Pinski  ---
Also from reading the merge request, this really should just be in the gcc user
manual instead of just in the compiler.

Gcc's user manual should document what is supported.
It is how all other targets handle this.

[Bug target/109349] riscv: Add --print-supported-extensions

2023-03-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109349

--- Comment #1 from Andrew Pinski  ---
Target options always start with -m