add avx2 = -2147483648
thread 'main' panicked at 'attempt to add with overflow', /home/ophir/.cargo/registry/src/github.com-1ecc6299db9ec823/simdeez-1.0.0/src/overloads/add.rs:17:15
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This is because the simd variant implements wrapping addition (which is expected), but the scalar variant uses the default rust + semantics for i32: it panics on overflow unless compiled in release mode.
I think the semantics of the arithmetic operators should be the same for all variants, preferably wrapping addition.
The following code :
gives the following output :
This is because the simd variant implements wrapping addition (which is expected), but the scalar variant uses the default rust
+
semantics fori32
: it panics on overflow unless compiled in release mode.I think the semantics of the arithmetic operators should be the same for all variants, preferably wrapping addition.