simba
simba copied to clipboard
lanes associated const for SimdValue
is possible we can have associated const LANES for wide types? Or for example in SimdValue:
trait SimdValue {
const LANES: usize;
}
This will be very useful in generic context and working with arrays.
For example:
if we have:
type WIDE = simba::simd::WideF32x4;
type WIDET = f32;
for slice in data.chunks(WIDE::LANES) {
let arr: [WIDET; WIDE::LANES] = slice.try_into().unwrap();
let wide = WIDE::from(arr);
}
we can now easily switch the wide type, put in generics, or change wide amount to experiment for performance. today simba::simd::WideF32x4::lanes()
is trait fn, and cannot be const.
if yes, i will attempt to make PR, thank you