| 
0
 | 
     1 vec - a tiny SIMD vector header-only library written in C99
 | 
| 
 | 
     2 
 | 
| 
 | 
     3 it comes with an extremely basic (and somewhat lacking) API,
 | 
| 
 | 
     4 where there are eight supported vector types, all 128-bit:
 | 
| 
 | 
     5 
 | 
| 
 | 
     6 	vint8x16  - 16 signed 8-bit integers
 | 
| 
 | 
     7 	vint16x8  - 8 signed 16-bit integers
 | 
| 
 | 
     8 	vint32x4  - 4 signed 32-bit integers
 | 
| 
 | 
     9 	vint64x2  - 2 signed 64-bit integers
 | 
| 
 | 
    10 	vuint8x16 - 16 unsigned 8-bit integers
 | 
| 
 | 
    11 	vuint16x8 - 8 unsigned 16-bit integers
 | 
| 
 | 
    12 	vuint32x4 - 4 unsigned 32-bit integers
 | 
| 
 | 
    13 	vuint32x4 - 2 unsigned 64-bit integers
 | 
| 
 | 
    14 
 | 
| 
 | 
    15 all of these have many operations that are prefixed with the
 | 
| 
 | 
    16 name of the type and an underscore, for example:
 | 
| 
 | 
    17 
 | 
| 
 | 
    18 	vint8x16 vint8x16_splat(uint8_t x)
 | 
| 
 | 
    19 	- creates a vint8x16 where all of the values are filled
 | 
| 
 | 
    20 	  with the value of `x'
 | 
| 
 | 
    21 
 | 
| 
 | 
    22 the current supported operations are:
 | 
| 
 | 
    23 
 | 
| 
 | 
    24 	v[u]intAxB splat([u]intA_t x)
 | 
| 
 | 
    25 		creates a vector with all of the values are filled with
 | 
| 
 | 
    26 		the value of `x'
 | 
| 
 | 
    27 
 | 
| 
 | 
    28 	v[u]intAxB load(const [u]intA_t x[B])
 | 
| 
 | 
    29 		copies the values from the memory address stored at `x';
 | 
| 
 | 
    30 		the address is NOT required to be aligned
 | 
| 
 | 
    31 
 | 
| 
 | 
    32 	void store(v[u]intAxB vec, [u]intA_t x[B])
 | 
| 
 | 
    33 		copies the values from the vector into the memory address
 | 
| 
 | 
    34 		stored at `x'
 | 
| 
 | 
    35 
 | 
| 
 | 
    36 		like with load(), this does not require address alignment
 | 
| 
 | 
    37 
 | 
| 
 | 
    38 	v[u]intAxB add(v[u]intAxB vec1, v[u]intAxB vec2)
 | 
| 
 | 
    39 		adds the value of `vec1' and `vec2' and returns it
 | 
| 
 | 
    40 
 | 
| 
 | 
    41 	v[u]intAxB sub(v[u]intAxB vec1, v[u]intAxB vec2)
 | 
| 
 | 
    42 		subtracts the value of `vec2' from `vec1' and returns it
 | 
| 
 | 
    43 
 | 
| 
 | 
    44 	v[u]intAxB mul(v[u]intAxB vec1, v[u]intAxB vec2)
 | 
| 
 | 
    45 		multiplies the values of `vec1' and `vec2' together and
 | 
| 
 | 
    46 		returns it
 |