dimforge / dimforge/simba

Subtract with overflow for integers

Open
#56 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
347
Forks
39
PR merge metrics
No merged PRs in 30d

Description

There is currently no support for [core::num::Wrapping()](https://doc.rust-lang.org/stable/std/num/struct.Wrapping.html). If numbers overflow with #[cfg = debug_assertions], the program panics. It would be nice, if this library supports all of it's arithmetics for `AutoSimd<[Wrapping]>` for all T=i8/i16/i32/i64/usize/isize/u8/u16/u32/u64 like for T itself. This seems to be the only overflow-mode in the proposal for [std::simd::Simd](https://doc.rust-lang.org/std/simd/struct.Simd.html). It would be very nice to have it in simba!
```rust
let x = AutoSimd([1, 2]);
println!("{}", x * x); // works
let x = AutoSimd([Wrapping(1), Wrapping(2)]);
println!("{}", x * x); // doesn't compile yet
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.