rust-lang / rust-lang/rust

How should we handle SPARC's vector ABI?

Open
#133,141 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ABI A-SIMD C-discussion E-needs-design O-SPARC T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

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 (https://github.com/llvm/llvm-project/issues/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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the discussion in Rust PR #132842, Rust issue #131800, and LLVM issue #45418, then compare the cited GCC SPARC calling-convention code. Determine the intended treatment of SPARC vector ABI handling and the lint's vlen(0) behavior. Done means reaching and recording a clear ABI decision, including whether implementation work is needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.