在 2024/12/15 23:50, Jeff Law 写道:


On 12/3/24 4:02 AM, Jiawei wrote:
This patch introduces support for RISC-V Profiles RV20 and RV22 [1],
enabling developers to utilize these profiles through the -march option.

[1] https://github.com/riscv/riscv-profiles/releases/tag/v1.0

gcc/ChangeLog:

    * common/config/riscv/riscv-common.cc (struct riscv_profiles): New struct.
    (riscv_subset_list::parse_profiles): New parser.
    (riscv_subset_list::parse_base_ext): Ditto.
    * config/riscv/riscv-subset.h: New def.

[ ... ]


+const char *
+riscv_subset_list::parse_profiles (const char *p)
+{
+  /* Checking if input string contains a Profiles.
+     There are two cases use Profiles in -march option:
+
+     1. Only use Profiles as -march input
+     2. Mixed Profiles with other extensions
+
+     Use '+' to split Profiles and other extension.  */
Does LLVM use this same convention (using '+' to split profiles from additional extensions)?  I don't see it in the spec so I think we really need to make sure LLVM and GCC are in sync on this.

I think we need some kind of documentation around the new option in invoke.texi.

I didn't check the precise set of options in the spec.  That should be double-checked in the expected update of this patchkit.


jeff

In fact, we do have a PR in https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/36 to discuss the format, but it was out of date, I will pick up it, and update the format doc first in

recent days.


BR,
Jiawei

Reply via email to