-
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
Open
pz9115
wants to merge
5
commits into
riscv-non-isa:main
Choose a base branch
from
pz9115:master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,48 @@ 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 of using | ||
the `-march` option is easy for toolchain parsing the profiles string and expanding | ||
it into normal extensions combinations. | ||
|
||
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>` | ||
|
||
`profile-family-name ::= "I" | "M" | "A"` | ||
|
||
`profile-ratified-year ::= "20" | "22" | "23"` | ||
|
||
`privilege-mode ::= "U" | "S" | "M"` | ||
|
||
`ISA-XLEN ::= "64" | "32"` | ||
|
||
`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 | ||
will check whether an input profile name is correct at first, then do the parse | ||
work. | ||
|
||
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 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Removed, thank you! |
||
|
||
### Issues for consideration | ||
* Whether `riscv32` and `riscv64` should be accepted as synonyms for `rv32` | ||
and `rv64`. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.