-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RISC-V Profiles format #36
base: main
Are you sure you want to change the base?
Conversation
README.mkd
Outdated
### Profile-based format | ||
|
||
Profiles should be recognized and used in the `-march=` option. | ||
The benefit is that it is easy for toolchain parsing the profiles string and expanding it into normal extensions combinations. It’s also easy to combine a profile with any extensions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is the right place to be advocating for why profiles make sense.
Regarding "It's also easy to combine a profile with any extensions" - this patch should give an example of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in new version, remove this descriptions, give an example behind.
This got briefly brought up during the SIG toolchain meeting today, but got rapidly derailed into a process discussion. Since the root point seems important, I am repeating it here. In addition to defining the syntax for the -march string for profiles, there is a separate set of task items required to define and implement support for each of the new extensions which were defined in the ratified profile document. From the perspective of LLVM, my current intent is to make the support for all the various extensions a blocker for merging the -march profile parsing support. This may evolve, and I'm open to the arguments on why we should adopt a different posture, but that argument will need to be explicitly made. |
You are right, Christoph added a comment here riscv-admin/dev-partners#16 (comment). In fact, we need to nothing until those new extensions are actually ratified(more details are needed in extenisons specification to approach). So I think maybe is a good idea that only implements the new extensions' names in toolchain Profiles support. |
README.mkd
Outdated
|
||
`-march = rv64imafdc_zicsr_ziccif_ziccrse_ziccamoa_zicclsm_za128rs_zba_zbb_zbc_zbs` | ||
|
||
and `-march = rva20u64` is an illegal profile input, it not use uppercase letters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"it not use" -> "it does not use"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks for your checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this incorrect due to the spaces around the '=' character?
-march = rv64imafdc_zicsr_ziccif_ziccrse_ziccamoa_zicclsm_za128rs_zba_zbb_zbc_zbs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right, remove the incorrect spaces, thanks!
README.mkd
Outdated
To distinguish between ordinary extension input and input with profiles, | ||
profiles are assumed to be entered `at the beginning of the -march option`, and | ||
then input other extensions. Profiles `should use uppercase letters` in the `-march` | ||
option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect placement of code (backtick) markup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to emphasize here the rules for using, do you have any good solutions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To distinguish between ordinary extension input and input with profiles, | |
profiles are assumed to be entered `at the beginning of the -march option`, and | |
then input other extensions. Profiles `should use uppercase letters` in the `-march` | |
option. | |
To distinguish between ordinary extension input and input with profiles, | |
profiles are assumed to be entered `at the beginning of the -march option`, and | |
then input other extensions. Profiles *should use uppercase letters* in the `-march` | |
option. |
README.mkd
Outdated
e.g. `-march = RVA20U64` is a legal profile input, it will be expanded into: | ||
|
||
`-march = rv64imafdc_zicsr_ziccif_ziccrse_ziccamoa_zicclsm_za128rs`, | ||
which include all the mandatory extensions required by this profile. | ||
|
||
`-march = RVA20U64+zba_zbb_zbc_zbs` is also a legal profile input, it will add | ||
four new extensions after expanded profile strings: | ||
|
||
`-march = rv64imafdc_zicsr_ziccif_ziccrse_ziccamoa_zicclsm_za128rs_zba_zbb_zbc_zbs` | ||
|
||
and `-march = rva20u64` is an illegal profile input, it does not use uppercase letters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces around '=' character are incorrect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, thank you!
The status of the profiles support was briefly discussed in today's SIG toolchain call:
|
An initial patch was sent to the GCC mailing list today: https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637490.html |
Uppercase strings being required in things like -march is very unusual; I would be much more in favour of keeping things lowercase |
The architecture review committee has sent out the following text about how profiles support in toolchains should look like:
|
Draft LLVM implementation: llvm/llvm-project#76357. |
This PR implements the draft riscv-non-isa/riscv-toolchain-conventions#36. Currently, we replace specified profile in `-march` with standard arch string. We may need to pass it to backend so that we can emit an ELF attr proposed by riscv-non-isa/riscv-elf-psabi-doc#409.
Reverse ping. Is there any progress? |
The GCC implementation is tracked here: riscv-admin/dev-partners#16. There was a request to wait on the GCC patch regarding the adoption of profiles in toolchain components: https://gcc.gnu.org/pipermail/gcc-patches/2023-December/641025.html. So, at this point, we have clear guidelines from RVI regarding the adoption. We have this PR, and we have patches for GCC and LLVM. This can all move forward if upstream maintainers are fine with it. Given the relatively low impact on toolchains, I'm fine with waiting until the GCC 15 branch opens up. |
This PR implements the draft riscv-non-isa/riscv-toolchain-conventions#36. Currently, we replace specified profile in `-march` with standard arch string.
This PR implements the draft riscv-non-isa/riscv-toolchain-conventions#36. Currently, we replace specified profile in `-march` with standard arch string.
This PR implements the draft riscv-non-isa/riscv-toolchain-conventions#36. Currently, we replace specified profile in `-march` with standard arch string.
This PR implements the draft riscv-non-isa/riscv-toolchain-conventions#36. Currently, we replace specified profile in `-march` with standard arch string.
This PR implements the draft riscv-non-isa/riscv-toolchain-conventions#36. Currently, we replace specified profile in `-march` with standard arch string.
This PR implements the draft riscv-non-isa/riscv-toolchain-conventions#36. Currently, we replace specified profile in `-march` with standard arch string. This is recommitted as 66f88de was reverted because of failures caused by lacking `--target` option.
This PR implements the draft riscv-non-isa/riscv-toolchain-conventions#36. Currently, we replace specified profile in `-march` with standard arch string.
This PR implements the draft riscv-non-isa/riscv-toolchain-conventions#36. Currently, we replace specified profile in `-march` with standard arch string. This is recommitted as 66f88de was reverted because of failures caused by lacking `--target` option.
LLVM support landed upstream a few days ago (see also llvm/llvm-project#76357). |
The text in this PR currently differs from the ARC decision mentioned in #36 (comment) and the implementation in LLVM in llvm/llvm-project#76357 in two significant ways:
I worry that this inconsistency might cause compatibility issues. |
@pz9115 Hi Jiawei, can you please update the RFC according to the comment?
|
Sync Profiles descrption with LLVM implement. Signed-off-by: Jiawei <[email protected]>
Hi PengCheng, I update the description in Profiles to sync with LLVM implement, please check it. |
Sync the format with LLVM implement, using lowercase and |
src/toolchain-conventions.adoc
Outdated
|
||
Profiles format has the following BNF form `"-march="<profile-name>"_"[option-ext]*`. | ||
|
||
`profile-name ::= "RV"<profile-family-name><profile-ratified-year><privilege-mode><ISA-XLEN>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming convention of profiles may not be like this any more if I read what the sig-profiles (https://lists.riscv.org/g/sig-profiles/message/83) is doing rightly. The proposed profile naming is here (I don't know if every one can read it): https://docs.google.com/document/d/19xXIMnk1MNRZIp9fnW0yzBvnRnqko0LJT0XUjUvDVZ4/
So, I think, here we can just say that profile-name
will be a valid list of released profiles. As for the format, we should refer to the document of profiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok,it sounds great, will update it in new version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we don't need these eBNFs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
Update Profiles name description and add new example. Signed-off-by: Jiawei <[email protected]>
src/toolchain-conventions.adoc
Outdated
`option-ext ::= 'a legal RISC-V extension name'` | ||
|
||
As the spec defines, to use the profiles it should follow profile naming convention | ||
(See [3.4 form spec doc](https://github.com/riscv/riscv-profiles)), the toolchain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
", the toolchain will check" should be the start of a new sentence.
src/toolchain-conventions.adoc
Outdated
|
||
`option-ext ::= 'a legal RISC-V extension name'` | ||
|
||
As the spec defines, to use the profiles it should follow profile naming convention |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence is kind of awkward.
src/toolchain-conventions.adoc
Outdated
@@ -216,6 +216,43 @@ As of November 2021 the additional tail-call entry points are only | |||
implemented in compiler-rt, and calls will only be generated by LLVM | |||
when the option `-mllvm -save-restore-tailcall` is specified. | |||
|
|||
== Profile-based format | |||
|
|||
Profiles name will be a valid list of released profiles, it should be recognized and used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Profiles name" -> "Profile names" if we are talking about a list of names of multiple profiles.
src/toolchain-conventions.adoc
Outdated
|
||
`profile-family-name ::= "i" | "m" | "a"` | ||
|
||
`profile-ratified-year-version ::= "20" | "22" | "23A" | "23B"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't the profiles named rva23 and rvb23. There is no A or B after 23.
src/toolchain-conventions.adoc
Outdated
|
||
`profile-name ::= "RV"<profile-family-name><profile-ratified-year><privilege-mode><ISA-XLEN>` | ||
|
||
`profile-family-name ::= "i" | "m" | "a"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing "b"
src/toolchain-conventions.adoc
Outdated
|
||
To distinguish between ordinary extension input and input with profiles, | ||
profiles are assumed to be entered *at the beginning of the -march option*, and | ||
then input other extensions. Profiles should input in the `-march` option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Profiles should input in the -march
option." seems redundant with the previous sentece.
src/toolchain-conventions.adoc
Outdated
|
||
`-march=rvi20u64_zbkb_zkne -mabi=lp64` equals `-march=rv64i_zbkb_zkne -mabi=lp64` | ||
|
||
`-march=rva22u32` equals `-march=rv64gcb_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zihpm_za64rs_zfhmin_zkt` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no rva22u32 profile. I think this should be rva22u64?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your comments, fixed in new commit.
Fix Profiles description problems. Signed-off-by: Jiawei <[email protected]>
Add missing symbols. Signed-off-by: Jiawei <[email protected]>
Apply suggestions from code review Co-authored-by: Laine Taffin Altman <[email protected]> Signed-off-by: Jiawei <[email protected]>
This is a subset work form #26.
Add RISC-V Profiles format only. The doc record in:
https://docs.google.com/document/d/1TZXRIgVfQHWQ6xrZflHXUCSav6xNmliojrW2bEsvPno/edit.