Skip to main content

grad_dot_simd

Function grad_dot_simd 

Source
pub fn grad_dot_simd<const N: usize>(
    hashes: [usize; N],
    x: Simd<f32, N>,
    y: Simd<f32, N>,
    z: Simd<f32, N>,
) -> Simd<f32, N>
where Simd<f32, N>: Mul<Output = Simd<f32, N>> + Add<Output = Simd<f32, N>> + Sub<Output = Simd<f32, N>> + Neg<Output = Simd<f32, N>>,
Expand description

f32 N-lane gradient dot product.

AVX-512 builds evaluate Minecraft’s 16-entry GRADIENT table branchlessly from the hash bits. Baseline builds assemble component vectors from the table, which avoids expensive mask work on current non-AVX-512 targets.