Skip to content
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

How should we handle SPARC's vector ABI? #133141

Open
workingjubilee opened this issue Nov 17, 2024 · 1 comment
Open

How should we handle SPARC's vector ABI? #133141

workingjubilee opened this issue Nov 17, 2024 · 1 comment
Labels
A-ABI Area: Concerning the application binary interface (ABI) A-SIMD Area: SIMD (Single Instruction Multiple Data) E-needs-design This issue needs exploration and design to see how and if we can fix/implement it O-SPARC Target: SPARC processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@workingjubilee
Copy link
Member

This concerns SPARC and its vis AKA Visual Instruction Set. Quoting from @taiki-e

AFAIK it's at least 64-bit.

SPARC FP registers (f[0-63]) are 32-bit long, and two/four of these are combined to process f64/f128. 64-bit VIS vectors also use two FP registers, as does f64.

128-bit/258-bit vectors are also passed or returned using four/eight FP registers.
https://github.com/gcc-mirror/gcc/blob/730f28b081bea4a749f9b82902446731ec8faa93/gcc/config/sparc/sparc.cc#L7388

In any case, LLVM doesn't currently support Vector ABI (llvm/llvm-project#45418), so it seems that using vlen(0) in the lint is correct for now.

SPARC's Vector ABI is defined based on the existing float and aggregate calling convention, not the VIS ISA [^1], and changing it without a new ABI would also break other non-vector arguments due to the nature of using FP registers. So, I don't believe it can be changed without a new ABI. (This is very different from the x86_64, which extended the ISA in the form of increasing the size of the vector registers.)

See also:

@workingjubilee workingjubilee added A-ABI Area: Concerning the application binary interface (ABI) A-SIMD Area: SIMD (Single Instruction Multiple Data) O-SPARC Target: SPARC processors labels Nov 17, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 17, 2024
@workingjubilee workingjubilee added E-needs-design This issue needs exploration and design to see how and if we can fix/implement it and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 17, 2024
@workingjubilee
Copy link
Member Author

workingjubilee commented Nov 17, 2024

Thanks to @taiki-e's description it seems we understand as much as there is to understand and all that is left here is mostly integrating that information and making decisions, perhaps after consulting any SPARC ISA experts working on LLVM.

@jieyouxu jieyouxu added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ABI Area: Concerning the application binary interface (ABI) A-SIMD Area: SIMD (Single Instruction Multiple Data) E-needs-design This issue needs exploration and design to see how and if we can fix/implement it O-SPARC Target: SPARC processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants