4 ms·
SIMD requires unsafe for some reason. Not sure exactly why. I don't see why they used unsafe in `add_assign` - an assert!(octets.len() == other.len()) would li
by staticassertion 8y ago
SIMD requires unsafe for some reason. Not sure exactly why.
I don't see why they used unsafe in `add_assign` - an assert!(octets.len() == other.len()) would likely have elided the bounds checks.
- MaulingMonkey 8y agohttps://users.rust-lang.org/t/how-to-zip-two-slices-efficiently/2048/3 https://users.rust-lang.org/t/how-to-zip-two-slices-efficien... explores eliding the bounds checks even without an assert! (though by using the smaller length as the bounds, which might not be the desired behavior)
- raphlinus 8y agoI talk a little about why in my "fearless SIMD" blog post (also introducing a prototype that wraps the unsafety but at the moment is very limited in exactly what SIMD operations are exposed). https://raphlinus.github.io/rust/simd/2018/10/19/fearless-simd.html https://raphlinus.github.io/rust/simd/2018/10/19/fearless-si...