Mercurial > vec
comparison README @ 23:e26874655738
*: huge refactor, new major release (hahaha)
I keep finding things that are broken...
The problem NOW was that vec would unintentionally build some
functions with extended instruction sets, which is Bad and would
mean that for all intents and purposes the CPU detection was
completely broken.
Now vec is no longer header only either. Boohoo. However this gives
a lot more flexibility to vec since we no longer want or need to
care about C++ crap.
The NEON and Altivec implementations have not been updated which
means they won't compile hence why they're commented out in the
cmake build file.
author | Paper <paper@tflc.us> |
---|---|
date | Sun, 24 Nov 2024 02:52:40 -0500 |
parents | e05c257c6a23 |
children |
comparison
equal
deleted
inserted
replaced
22:fbcd3fa6f8fc | 23:e26874655738 |
---|---|
1 vec - a tiny SIMD vector header-only library written in C99 | 1 vec - a tiny SIMD vector library written in C99 |
2 | 2 |
3 it comes with an extremely basic API that is similar to other intrinsics | 3 it comes with an extremely basic API that is similar to other intrinsics |
4 libraries; each type is in the exact same format: | 4 libraries; each type is in the exact same format: |
5 | 5 |
6 v[sign][bits]x[size] | 6 v[sign][bits]x[size] |
9 and `size' is the how many integers are in the vector | 9 and `size' is the how many integers are in the vector |
10 | 10 |
11 vec provides types for 64-bit, 128-bit, 256-bit, and 512-bit SIMD intrinsics | 11 vec provides types for 64-bit, 128-bit, 256-bit, and 512-bit SIMD intrinsics |
12 on processors where vec has an implementation and falls back to array-based | 12 on processors where vec has an implementation and falls back to array-based |
13 implementations where they are not. | 13 implementations where they are not. |
14 | |
15 to initialize vec, you MUST call `vec_init()' when your program starts up. | |
16 | |
17 note that `vec_init()' is NOT thread-safe, and things can and will | |
18 blow up if you call it simultaneously from different threads (i.e. you | |
19 try to only initialize it when you need to... please just initialize | |
20 it on startup so you don't have to worry about that!!!) | |
14 | 21 |
15 all of these have many operations that are prefixed with the name of the | 22 all of these have many operations that are prefixed with the name of the |
16 type and an underscore, for example: | 23 type and an underscore, for example: |
17 | 24 |
18 vint8x16 vint8x16_splat(uint8_t x) | 25 vint8x16 vint8x16_splat(uint8_t x) |
104 v[u]intAxB cmpge(v[u]intAxB vec1, v[u]intAxB vec2) | 111 v[u]intAxB cmpge(v[u]intAxB vec1, v[u]intAxB vec2) |
105 turns on all bits of the corresponding value in | 112 turns on all bits of the corresponding value in |
106 the result vector if the value in `vec1' is greater | 113 the result vector if the value in `vec1' is greater |
107 than or equal to the corresponding value in `vec2', | 114 than or equal to the corresponding value in `vec2', |
108 else all of the bits are turned off. | 115 else all of the bits are turned off. |
109 | |
110 to initialize vec, you MUST call `vec_init()' when your programs starts up. | |
111 | |
112 note that `vec_init()' is NOT thread-safe, and things can and will | |
113 blow up if you call it simultaneously from different threads (i.e. you | |
114 try to only initialize it when you need to... please just initialize | |
115 it on startup so you don't have to worry about that!!!) |