-
Notifications
You must be signed in to change notification settings - Fork 42
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
Function attribute for standard fixed-length vector calling convention variant #68
base: main
Are you sure you want to change the base?
Conversation
…n variant Fixed-length vector are passed via general purposed register or memory within current ABI design, we proposed a standard fixed-length vector calling convention variant for passing the fixed-length vector via vector register. This is the syntax part in the proposal, further detail for that calling convention variant see riscv-non-isa/riscv-elf-psabi-doc#418
Stylistically, since this is a well-defined RISC-V specific ABI attribute independent of any GNU extensions, I wonder if it should be I believe that this needs to be included in C++ function pointer mangling to support natural uses (although this doesn't work on aarch64). Do the rules for that need to be specified here? LGTM otherwise. |
@sorear thanks for remind that, I almost forgot |
Update:
|
The attribute can accept an optional unsigned integer argument within the value | ||
range of `[32, 65536]`, which must be a power of two. This argument specifies | ||
the `ABI_VLEN`. If not provided, the default value is set to 128. However, this | ||
default value can be changed via command-line options or pragma directives. |
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.
Where are the command line options or pragma defined?
// foo is declared to use the standard fixed-length vector calling convention variant | ||
// with ABI_VLEN=256. Compilation will succeed with -march=rv64gcv_zvl256b, as it | ||
// supports VLEN of 256. However, compiling with -march=rv64gcv will result in an error, | ||
// because rv64gcv's VLEN is 128, which is less than the specified ABI_VLEN of 256. |
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 disagrees with the preceding paragraph that says ABI_VLEN must be larger or equal than the minimval VLEN.
void bar __attribute__((riscv_vls_cc(256))); | ||
``` | ||
|
||
One constraint on `ABI_VLEN` is that it must be larger than or equal to the |
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.
"ABI_VLEN
must be less than or equal to`." No need for the "One constraint on".
|
||
The attribute can accept an optional unsigned integer argument within the value | ||
range of `[32, 65536]`, which must be a power of two. This argument specifies | ||
the `ABI_VLEN`. If not provided, the default value is set to 128. However, this |
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.
is set to
-> is
…n variant
Fixed-length vector are passed via general purposed register or memory within current ABI design, we proposed a standard fixed-length vector calling convention variant for passing the fixed-length vector via vector register.
This is the syntax part in the proposal, further detail for that calling convention variant see riscv-non-isa/riscv-elf-psabi-doc#418