Skip to main content

Module simd

Module simd 

Source
Expand description

SIMD-friendly batch math operations.

When the simd feature is enabled, these functions structure computations to encourage auto-vectorization by the compiler. On wasm32 with -C target-feature=+simd128, LLVM will use SIMD instructions.

Functionsยง

batch_cross
Batch cross products: compute cross(a[i], b[i]) for parallel arrays.
batch_distance_sq
Batch squared distances between corresponding point pairs.
batch_dot
Batch dot products: compute dot(a[i], b[i]) for parallel arrays.
batch_normalize
Batch normalize: normalize an array of vectors.
batch_transform_points
Batch transform: apply a Mat4 to an array of points.