The words in the
vocabulary are used to implement SIMD support. These words have three disadvantages compared to the higher-level
• They operate on raw byte arrays, with a separate “representation” parameter passed in to determine the type of the operands and result. • They are unsafe; passing values which are not byte arrays, or byte arrays with the wrong size, will dereference invalid memory and possibly crash Factor.
The compiler converts
into SIMD primitives automatically in cases where it is safe; this means that the input types are known to be SIMD vectors, and the CPU supports SIMD.
It is best to avoid calling SIMD primitives directly. To write efficient high-level code that compiles down to primitives and avoids memory allocation, see
Writing efficient SIMD code
There are two primitives which are used to implement accessing SIMD vector fields of
alien-vector ( c-ptr n rep -- value ) set-alien-vector ( value c-ptr n rep -- )
For the most part, the above primitives correspond directly to vector arithmetic words. They take a representation parameter, which is one of the singleton members of the
union in the
This documentation was generated offline from a
load-all image. If you want, you can also
browse the documentation from within the
UI developer tools. See
the Factor website
for more information.
Factor 0.99 x86.64 (2190, heads/master-855db86de1, Feb 3 2023 09:58:21)