The SIMD toolkit common interface is a work in progress. We’ve implemented many types and functions already, but many more remain to be done. Care to contribute?

For each function, we compare the return values of the vector functions against the return values of their scalar equivalents. Any runtime denormal handling should be on. You can run these tests yourself in the `vectest`

executable.

For integral functions, both sets of values shall match over the domain of the function.

For floating point functions, either: both values are not-a-number, or both values have the same sign and are either infinite or differ by at most 5 ulp. The domain shall be all numbers, except if the compiler finite math option is on, then it shall be all finite numbers.

Given the specification above, there are four stages of implementation:

- Unplanned grey. This function has not been planned, usually because it doesn’t make sense for the domain type.
- Planned red. This function has been planned but not yet implemented.
- Implemented yellow. This function has been implemented but is not yet at specification. It might still be useful for testing and in limited situations.
- At Specification green. This function has been implemented and empirically verified to conform to specifications. A clear run of the
`exhaustive`

test is sufficient.

These are the SIMD types implemented:

`vec <unsigned char, 16>`

— u8x16.`vec <signed char, 16>`

— i8x16.`vec <boolean <char>, 16>`

— b8x16.`vec <unsigned short, 8>`

— u16x8.`vec <short, 8>`

— i16x8.`vec <boolean <short>, 8>`

— b16x8.`vec <unsigned int, 4>`

— u32x4.`vec <int, 4>`

— i32x4.`vec <boolean <int>, 4>`

— b32x4.`vec <float, 4>`

— f32x4.`vec <boolean <float>, 4>`

(SSE/SSE2/SSE3 only) — f32bx4.`vec <unsigned long long, 2>`

(SSE/SSE2/SSE3 only) — u64x2.`vec <long long, 2>`

(SSE/SSE2/SSE3 only) — i64x2.`vec <signed char, 16>`

— b64x2.`vec <double, 2>`

(SSE/SSE2/SSE3 only) — f64x2.`vec <boolean <double>, 2>`

(SSE/SSE2/SSE3 only) — f64bx2.`vec <complex <float>, 2>`

(Altivec only) — c64x2.

These are the common interface functions implemented:

types | U8x16 | I8x16 | B8x16 | U16x8 | I16x8 | B16x8 | U32x4 | I32x4 | F32x4 | B32x4 | C64x2 | B64x2 |
---|---|---|---|---|---|---|---|---|---|---|---|---|

summarizers | ||||||||||||

sum | ||||||||||||

max | ||||||||||||

min | ||||||||||||

unary operators | ||||||||||||

operator- | ||||||||||||

operator~ | ||||||||||||

operator! | ||||||||||||

binary operators | ||||||||||||

operator* | ||||||||||||

operator/ | ||||||||||||

operator% | ||||||||||||

operator+ | ||||||||||||

operator- | ||||||||||||

operator& | ||||||||||||

operator| | ||||||||||||

operator^ | ||||||||||||

operator<< | ||||||||||||

operator>> | ||||||||||||

operator== | ||||||||||||

operator!= | ||||||||||||

operator< | ||||||||||||

operator> | ||||||||||||

operator<= | ||||||||||||

operator>= | ||||||||||||

operator&& | ||||||||||||

operator|| | ||||||||||||

transcendental functions | ||||||||||||

abs | ||||||||||||

acos | ||||||||||||

asin | ||||||||||||

atan | ||||||||||||

atan2 | ||||||||||||

cos | ||||||||||||

cosh | ||||||||||||

exp | ||||||||||||

log | ||||||||||||

max | ||||||||||||

min | ||||||||||||

pow | ||||||||||||

sin | ||||||||||||

sinh | ||||||||||||

sqrt | ||||||||||||

tan | ||||||||||||

tanh |

As you can see, Altivec has the most complete implementation. Only some float and complex transcendentals need to be filled in.

types | U8x16 | I8x16 | B8x16 | U16x8 | I16x8 | B16x8 | U32x4 | I32x4 | B32x4 | F32x4 | F32Bx4 | U64x2 | I64x2 | B64x2 | F64x2 | F64Bx2 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

summarizers | ||||||||||||||||

sum | ||||||||||||||||

max | ||||||||||||||||

min | ||||||||||||||||

unary operators | ||||||||||||||||

operator- | ||||||||||||||||

operator~ | ||||||||||||||||

operator! | ||||||||||||||||

binary operators | ||||||||||||||||

operator* | ||||||||||||||||

operator/ | ||||||||||||||||

operator% | ||||||||||||||||

operator+ | ||||||||||||||||

operator- | ||||||||||||||||

operator& | ||||||||||||||||

operator| | ||||||||||||||||

operator^ | ||||||||||||||||

operator<< | ||||||||||||||||

operator>> | ||||||||||||||||

operator== | ||||||||||||||||

operator!= | ||||||||||||||||

operator< | ||||||||||||||||

operator> | ||||||||||||||||

operator<= | ||||||||||||||||

operator>= | ||||||||||||||||

operator&& | ||||||||||||||||

operator|| | ||||||||||||||||

transcendental functions | ||||||||||||||||

abs | ||||||||||||||||

acos | ||||||||||||||||

asin | ||||||||||||||||

atan | ||||||||||||||||

atan2 | ||||||||||||||||

cos | ||||||||||||||||

cosh | ||||||||||||||||

exp | ||||||||||||||||

log | ||||||||||||||||

max | ||||||||||||||||

min | ||||||||||||||||

pow | ||||||||||||||||

sin | ||||||||||||||||

sinh | ||||||||||||||||

sqrt | ||||||||||||||||

tan | ||||||||||||||||

tanh |

SSE/SSE2/SSE3 has a workable but incomplete implementation. The summarizers, multiplicative and shift functions are largely unimplemented, as are long long, float and double functions.

» mach