arduano / simdeez

easy simd
MIT License
332 stars 25 forks source link

safe conversion between different wrappers over the same underlying simd type (e.g. __m256i) #23

Closed eoxcross closed 4 years ago

eoxcross commented 4 years ago

packed_simd exposes an into_bits() trait method that safely converts between types where it makes sense to do so based on the underlying bit-patterns. For example, one can convert between u32x4 and u64x2 safely.

Is there a way to do this in simdeez at the moment?

jackmott commented 4 years ago

No, you can use transmute, which is unsafe but so is simdeez. Simdeez doesn't attempt to be a safe wrapper over simd.