chickadee » crunch-simd » define-vector-type

(define-vector-type TYPENAME CTYPE SIZE [CTOR])syntax

Defines a vector type of SIZE elements of type CTYPE. SIZE must be a positive integer, and CTYPE must be a symbol naming an integral or floating point numeric C type (like int, short, float, etc.).

Note that this "vector" type represents a fixed size SIMD number vector, not a Scheme vector.

If CTOR is given, it should be the name of a zero-argument constructor procedure that creates an uninitialized vector of the defined type.

TYPENAME should be a symbol and will map to a C SIMD vector type.

SIMD vectors are passed by value, not by reference, and can be stored in and loaded from SRFI-4 numerical vectors.

Every vector-type defined allows the use of the following operations, overloaded variants are created on demand. In the following, arguments X and Y designate vector or numeric arguments, at least one of them must be a vector. If both are vectors they must be of the same type.