Open
Description
Is there reason behind float SIMD not implementing bitwise operations?
I could not find much on this topic other than this comment.
This is severely annoying when it comes to porting algorithms that rely on bit manipulation of float values, like XOR for signs, or AND for masking off bits.
Is it because Simd<f32, N>
is modelling the f32
primitive? Even then, I feel like this should be reconsidered. The workaround is messy (from_bits(lhs.to_bits() op rhs.to_bits())
) and writing generic code that uses bitwise operators is not feasible since you can't implement operators for external crates.