-
Notifications
You must be signed in to change notification settings - Fork 35
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?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,36 @@ specification (input is case sensitive, ...). | |
If the 'C' (compressed) instruction set extension is targeted, the compiler | ||
will generate compressed instructions where possible. | ||
|
||
### Profile-based format | ||
|
||
Profiles should be recognized and used in the `-march=` option. The benefit use | ||
`-march` option is easy for toolchain parsing the profiles string and expanding | ||
it into normal extensions combinations. | ||
|
||
Profiles format has the following form `-march=<profile-name>[+<option-ext>]+`. | ||
|
||
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 | ||
will check whether an input profile name is correct at first, then do the parse | ||
work. | ||
|
||
In order 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. | ||
|
||
e.g. `-march = RVA20U64` is a legal profile input, it will be expand into: | ||
kito-cheng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
`-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 not use uppercase letters. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this incorrect due to the spaces around the '=' character?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you are right, remove the incorrect spaces, thanks! |
||
|
||
### Issues for consideration | ||
* Whether `riscv32` and `riscv64` should be accepted as synonyms for `rv32` | ||
and `rv64`. | ||
|
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 would suggest define that in BNF.
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 the suggestions.