rust-lang / rust-lang/rustc_codegen_cranelift

Please support non-2^N SIMD lane counts

Open
#1,136 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-core-arch C-enhancement
Dominant language
Rust
Stars
2.1k
Forks
157
Avg merge
1d 19h
Merged PRs (30d)
3

Description

The silicon that supports these more or less directly:
GPUs handle Vec3s (f32x3 typically) all the time already.
Arm SVE supports 384-bit width vector registers and is available Soon™.
RISCVV will eventually exist and support arbitrary-width vectors, somewhere, over the rainbow🌈 someday🎵...

LLVM's approach for handling these when only fixed width vector registers are available to compile to was, as far as I could tell, and as described by the author of the vek crate, an approach similar to the one GPUs use: use 128-bit registers just fine but politely ignore the unspecified lanes when the "Vec3" types are loaded and stored.

Also the https://github.com/WebAssembly/flexible-vectors/ proposal exists, though is currently in a fairly nascent state. Still, another point to this being a long-term desirable even if it's not immediately needed.

Contributor guide

No contributing guide indexed for this repository

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

The issue does not name a source file, test, or entry point. Start by reviewing the referenced LLVM approach and the linked vek discussion, then trace how rustc_codegen_cranelift represents and lowers SIMD types. Done would require an agreed design, implementation, and coverage for non-power-of-two lane counts.

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
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.