Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.
/ SIMD Public archive

Wrapper library for more easily using SIMD functions

License

Notifications You must be signed in to change notification settings

AlexGarrity/SIMD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agSIMD

Small library for more easily performing vector maths, using AVX or SSE extensions. This library is archived as a compiler can optimise this far better than I can

Building

The easiest way to build is to just run:

cmake .
make -j4
make install

The extensions available to you should be detected automatically, and the library will build whichever one is going to perform best. Alternatively, you can use my preferred method for CMake projects...

mkdir build
cd build
cmake-gui -S .. -B .
make -j4
make install

This allows you to graphically tweak the CMake configuration, provided that you have cmake-gui installed. ccmake will also allow you to do this, but with a terminal-based UI.

Features

The library is built around the Quad<T> templated type, which behaves as a vector of 4 values. Currently the library has three of these defined as typedefs - BQuad, FQuad, and DQuad for BYTEs, floats, and doubles respectively. There are then a set of basic maths functions, Add, Sub, Div, and Mul which will take the Quad types and efficiently perform their respective operations on them. Additionally, there are also packed maths functions, which perform on types such as BQuad8 - this will allow you to operate on 32 BYTE types at once.

Future Additions

At some point in the future I'll likely add more Quad types for 16, 32, and 64 bit values. The library was originally extracted from my Pixel library, so only the necessary types for that are currently implemented. If I do end up doing that, I may well separate the Quad types out into their own files and implement the maths functions as operator overloads.

Releases

No releases published

Packages

No packages published