rust-lang / rust-lang/libs-team

ACP: Add unchecked arithmetic methods for integer simd

Open
#662 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ACP-accepted api-change-proposal
Dominant language
Rust
Stars
178
Forks
28
Avg merge
15m
Merged PRs (30d)
1

Description

Proposal

Add unchecked arithmetic methods for integer simd

Problem statement

uncheked_(add, sub, mul, div, shl, shr, neg, exact_div) methods are added for integers but not for integer simd.

Motivating examples or use cases

These methods will be helpful in performant code.

Solution sketch

  1. Add unchecked intrinsics
  2. Add inherent unchecked methods

Alternatives

Links and related work

https://github.com/rust-lang/portable-simd/issues/14
https://github.com/rust-lang/portable-simd/issues/481

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

Start by comparing the existing unchecked integer methods with the integer SIMD API, then read the linked portable-simd issues for related context. Implement the unchecked intrinsics and corresponding inherent methods for add, sub, mul, div, shl, shr, neg, and exact_div; done means integer SIMD exposes the requested operations consistently with integer types.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.