rust-lang / rust-lang/stdarch

aarch64: use portable SIMD intrinsics where possible

Open
#1,659 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
694
Forks
336
Avg merge
5d 14h
Merged PRs (30d)
9

Description

We have a number of portable SIMD intrinsics in core::intrinsics::simd. The advantage of using those is that they have to only be implemented once by non-LLVM backends (Miri, cranelift, gcc) and then they work consistently across all architectures. The x86 parts of stdarch thankfully make good use of them, which heavily reduces the number of intrinsics Miri and the other backends have to special-case by hand.

It would be good to do the same for aarch64. AFAIK aarch64 has completely standard float semantics including the behavior on subnormals, so there shouldn't be a reason to use architecture-specific intrinsics. (arm-32 is a different case since the neon intrinsics there flush subnormals to 0, which makes it technically not correct to use the portable intrinsics. But also at least LLVM doesn't implement the portable intrinsics properly on arm-32 so they actually do flush subnormals, except if optimizations kick in in which case we can get unsoundness.)

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 reviewing core::intrinsics::simd and the existing x86 implementations in stdarch, then compare how the aarch64 intrinsics are currently provided. Identify operations whose aarch64 floating-point semantics match the portable intrinsics, and consider the arm-32 subnormal behavior separately. Done means the applicable aarch64 operations consistently use portable SIMD intrinsics without changing their documented semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.