MCPcopy Index your code
hub / github.com/Lokathor/wide

github.com/Lokathor/wide @v1.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.0 ↗ · + Follow
1,632 symbols 2,994 edges 42 files 11 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

License:Zlib Minimum Rust Version crates.io docs.rs

wide

A crate to help you go wide.

Specifically, this has portable "wide" data types that do their best to be SIMD when possible. It's a near drop-in replacement for std::simd.

On x86, x86_64, wasm32 and aarch64 neon this is implemented with explicit intrinsic usage (via safe_arch), and on other architectures this is done by carefully writing functions so that LLVM hopefully does the right thing. When Rust stabilizes more explicit intrinsics then they can go into safe_arch and then they can get used here.

Enabling SIMD instructions in your build

Aarch64 (64-bit ARM)

Aarch64 always enables the NEON extension, so wide can always take advantage of SIMD on this platform.

WASM

SIMD is an optional extension for WASM, but it is supported by all modern browsers.

To enable SIMD in your build you need to set RUSTFLAGS="-C target-feature=+simd128", e.g.:

RUSTFLAGS="-C target-feature=+simd128" cargo build --target wasm32-wasip1

x86

Rust i686 and x86_64 targets guarantee only the presence of basic operations on 128-bit vectors (SSE2). If you need anything else, you need to explicitly enable the relevant SIMD extensions at build time. For example, this will use all SIMD extensions available on your CPU:

RUSTFLAGS='-C target-cpu=native' cargo build --release

However, attempting to use an instruction that is not supported by the CPU will crash the program or lead to undefined behavior. Therefore distributing binaries built with SIMD extensions enabled is not recommended.

Note: wide only supports detecting the available SIMD extensions at build time. Runtime feature detection via is_x86_feature_detected! or crates like multiversion do not work with wide.

Rust Version Policy

  • The rust-version entry of the crate's Cargo.toml will be kept accurate to the required Rust compiler version.
  • A bump in rust-version will be released as a change in either the major or minor crate version number, but never as part of a patch release. This way, users stuck on an old toolchain can always get necessary patch updates for their major.minor version of the crate.
  • If your build uses Resolver 3 (or later) this will be fine. If you're using a Resolver earlier than 3 then you are responsible for pinning a maximum crate version when you're using an old Rust version.

Extension points exported contracts — how you extend this code

CmpEq (Interface)
(no doc) [28 implementers]
src/lib.rs
Random (Interface)
(no doc) [1 implementers]
tests/utils/random_iter.rs
CmpGt (Interface)
(no doc) [28 implementers]
src/lib.rs
CmpGe (Interface)
(no doc) [28 implementers]
src/lib.rs
CmpNe (Interface)
(no doc) [28 implementers]
src/lib.rs
CmpLt (Interface)
(no doc) [28 implementers]
src/lib.rs

Core symbols most depended-on inside this repo

blend
called by 100
src/f64x8_.rs
blend
called by 100
src/f64x2_.rs
blend
called by 100
src/f64x4_.rs
blend
called by 94
src/f32x16_.rs
blend
called by 94
src/f32x8_.rs
blend
called by 94
src/f32x4_.rs
mul_add
called by 56
src/f64x8_.rs
mul_add
called by 51
src/f64x2_.rs

Shape

Method 1,406
Function 218
Interface 8

Languages

Rust100%

Modules by API surface

src/f64x4_.rs97 symbols
src/f64x2_.rs97 symbols
src/f64x8_.rs96 symbols
src/f32x4_.rs96 symbols
src/f32x16_.rs96 symbols
src/f32x8_.rs95 symbols
tests/simd_float.rs66 symbols
tests/simd.rs64 symbols
src/i16x8_.rs46 symbols
src/i16x16_.rs43 symbols
src/i8x16_.rs42 symbols
src/i32x8_.rs41 symbols

For agents

$ claude mcp add wide \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact