-
Notifications
You must be signed in to change notification settings - Fork 39
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 1 commit
09d84db
022ac7e
144289b
90bf1e7
6294b2a
468555c
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 |
---|---|---|
|
@@ -216,6 +216,41 @@ 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 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"` | ||
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. Missing "b" |
||
|
||
`profile-ratified-year-version ::= "20" | "22" | "23A" | "23B"` | ||
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. Aren't the profiles named rva23 and rvb23. There is no A or B after 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 | ||
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. This sentence is kind of awkward. |
||
(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 commentThe reason will be displayed to describe this comment to others. Learn more. ", the toolchain will check" should be the start of a new sentence. |
||
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 input in the `-march` option. | ||
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. "Profiles should input in the |
||
|
||
Examples: | ||
|
||
`-march=rvi20u64 -mabi=lp64` equals `-march=rv64i -mabi=lp64` | ||
|
||
`-march=rva22u32` equals `-march=rv64gcb_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zihpm_za64rs_zfhmin_zkt` | ||
kito-cheng marked this conversation as resolved.
Show resolved
Hide resolved
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. There is no rva22u32 profile. I think this should be rva22u64? 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. Thanks for your comments, fixed in new commit. |
||
|
||
== Conventions for vendor extensions | ||
|
||
Support for custom instruction set extensions are an important part of RISC-V, | ||
|
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.