Skip to content
/ nimsimd Public
generated from treeform/nimtemplate

Pleasant Nim bindings for SIMD instruction sets.

License

Notifications You must be signed in to change notification settings

guzba/nimsimd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nimsimd

nimble install nimsimd

This repo provides pleasant Nim bindings for various SIMD instructions.

Each SIMD instruction set is in its own file for importing.

In addition to direct bindings to the SIMD instructions, there are also operator overloads to make for much more readable code (that is also easier to write!). See this basic example:

import nimsimd/sse2

# SIMD floating point multiplication
let
  a = m128(1.0) # Vector of 4 float32 each with value 1.0
  b = m128(2.0) # Vector of 4 float32 each with value 2.0
  c = a * b # SIMD vector multiplication operator

# Cast the vector to echo as separate float32 values
echo cast[array[4, float32]](c)

Status

This repo is under development. Check back here for the latest status.

Instruction Set Bindings
SSE
SSE2
SSE3
SSSE3
SSE4.1
SSE4.2
AVX
AVX2

Uses of nimsimd

  • Noisy uses SIMD to accelerate generating coherent noise.

Testing

nimble test