Crate guff_matrix[−][src]
Expand description
Fast SIMD matrix multiplication for finite fields
This crate implements two things:
-
Fast SIMD-based multiplication of vectors of finite field elements (GF(28) with the polynomial 0x11b)
-
A (cache-friendly) matrix multiplication routine based on achieving 100% utilisation of the above
This crate supports x86_64 and Arm (v7, v8) with NEON extensions.
The matrix multiplication routine is heavily geared towards use in implementing Reed-Solomon or Information Dispersal Algorithm error-correcting codes.
Building
For x86_64 and Armv8 (Aarch64), building should require no extra options:
cargo build
Optional Features
Currently available options are:
simulator
— Software simulation of “wrap-around read matrix” (“warm”) multiplyarm_dsp
— Armv6 (dsp) 4-way SIMD multiplyarm_long
— Armv7/Armv8 8-way NEON reimplementation of Armv6 codearm_vmull
— Armv7/Armv8 8-way NEON vmull/vtbl multiply
To enable building these, use the --features
option when
building, eg:
RUSTFLAGS="-C target-cpu=native" cargo build --features arm_vmull
Software Simulation Feature
I’ve implemented a pure Rust version of the matrix multiplication code. It uses the same basic idea as the optimised versions, although for clarity, it works a byte at a time instead of simulating SIMD multiplication on 8 or 16 bytes at a time.