#simd #byte-vector #eight #vector-operations #operation #portable-simd #swar

eight_bytes

SIMD-like (SWAR) operations on vectors of eight bytes without using native SIMD instructions

4 releases

Uses new Rust 2024

0.2.0 Aug 29, 2025
0.1.2 Aug 26, 2025
0.1.1 Aug 25, 2025
0.1.0 Aug 25, 2025

#1266 in Hardware support

Download history 223/week @ 2025-08-20 120/week @ 2025-08-27 11/week @ 2025-09-03 7/week @ 2025-10-01

125 downloads per month

MIT license

33KB
594 lines

Implements "SIMD-like" operations over vectors of eight u8 values represented internally as single u64 values, using bit-fidding tricks to perform the same operation on all eight bytes at once.

These techniques are sometimes described as SWAR (SIMD within a register). However, that term can also sometimes refer to the use of a CPU architecture's specialized SIMD instructions.

The API is designed to loosely follow the conventions of the Rust standard library's portable SIMD module, but only to a limited extent. There is no explicit interop between the two.

This library is no_std-compatible and intended for CPU architectures that can perform arithmetic operations efficiently on 64-bit values.


eight_bytes for Rust

This library implements types u8x8 and mask8x8 which both represent a vector of eight values packed into a u64, where the first is a vector of u8 and the second is a vector of bool.

The methods of these types can perform limited SIMD-like operations on those vectors without using native SIMD instructions, by using various bit manipulation tricks.

No runtime deps