Mercurial > vec
comparison README @ 36:677c03c382b8
Backed out changeset e26874655738
| author | Paper <paper@tflc.us> |
|---|---|
| date | Fri, 25 Apr 2025 17:40:55 -0400 |
| parents | e26874655738 |
| children | fd42f9b1b95e |
comparison
equal
deleted
inserted
replaced
| 35:99e4539f922f | 36:677c03c382b8 |
|---|---|
| 1 vec - a tiny SIMD vector library written in C99 | 1 vec - a tiny SIMD vector header-only 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!!!) | |
| 21 | 14 |
| 22 all of these have many operations that are prefixed with the name of the | 15 all of these have many operations that are prefixed with the name of the |
| 23 type and an underscore, for example: | 16 type and an underscore, for example: |
| 24 | 17 |
| 25 vint8x16 vint8x16_splat(uint8_t x) | 18 vint8x16 vint8x16_splat(uint8_t x) |
| 111 v[u]intAxB cmpge(v[u]intAxB vec1, v[u]intAxB vec2) | 104 v[u]intAxB cmpge(v[u]intAxB vec1, v[u]intAxB vec2) |
| 112 turns on all bits of the corresponding value in | 105 turns on all bits of the corresponding value in |
| 113 the result vector if the value in `vec1' is greater | 106 the result vector if the value in `vec1' is greater |
| 114 than or equal to the corresponding value in `vec2', | 107 than or equal to the corresponding value in `vec2', |
| 115 else all of the bits are turned off. | 108 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!!!) |
