Nic
Nic
@rustbot assign @oli-obk It looks like oli-obk already fixed it. @rustbot release-assignment
We want to check if `exp` * `power_used` is less than `Self::BITS` or not. Using algebra, we know that in real life as long as `power_used` > 0: `exp` *...
> For signed types, note that `2.pow(BITS - 1)` is still an overflow, but `(-2).pow(BITS - 1)` is its `MIN`. Right. Since overflow on `BITS - 1` is dependent on...
As expected, `imulc` has abysmal performance. On Kaby Lake, `I256::overflowing_mul` benches 20 to 27 times slower than `wrapping_mul`. According to [uops.info](https://uops.info/table.html), on Ice Lake up, 128-bit / 64-bit DIV runs...
tl;dr: nlordell's idea of verifying the sign afterwards should work and his concern of wrapping problems is unfounded. There is a tiny caveat with `I256::MIN`. The advantage of two's complement...
This is how llvm does it. This function is called on Aarch64 for i128 mul. https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/builtins/int_mulo_impl.inc
I would like to point out that div_rem methods may have value even without intrinsic functions to implement them. * Most importantly, the methods might just help with convenience or...
On an only somewhat related note. It's worth considering totally getting rid of the llvm intrinsics for `shl` and `shr`. The native implementations use branching rather than `cmov`. Even after...
My last commit made it slower in some circumstances but faster in others. However, I think it its overall a bit better than the 64-bit rotation version.
You may notice that I included a compiler hint for in some of the divide by zero checks. e.g.: https://github.com/NCGThompson/ethnum-rs/blob/295dd6d0a0743026c3ca593e750b0268b65e4357/src/uint.rs#L372-L386 Inequality operators (e.g. ) are overloaded with the `cmp` method,...