Unlike intrinsics, SIMD loads and stores are represented as flambda2-visible primitives.
-
string
,bytes
:caml_{string,bytes}_{getu128,setu128}{u}
map toMOVUPD
, an unaligned 128-bit vector load/store. The primitives can operate on all 128-bit vector types. The safe primitives raiseInvalid_argument
if any part of the vector is not within the array bounds; theu
suffix omits this check. Aligned load/store is not available because these values may be moved by the GC. -
bigstring
:caml_bigstring_{get,set}{u}128{u}
map toMOVAPD
orMOVUPD
. The primitives can operate on all 128-bit vector types. The prefixu
indicates an unaligned operation (MOVUPD
), and the suffixu
omits bounds checking. Aligned load/store is available because bigstrings are allocated bymalloc
. -
float array
,floatarray
,float# array
: the corresponding primitives take an index infloat
s and are required to operate onfloat64x2
s. The address is computed asarray + index * 8
; the safe primitives bounds-check against0, length - 1
. The primitives onfloat array
are only available when the float array optimization is enabled. Aligned load/store is not available because these values may be moved by the GC. -
nativeint# array
,int64# array
: the corresponding primitives take an index innativeint
s/int64
s and are required to operate onint64x2
s. The address is computed asarray + index * 8
; the safe primitives bounds-check against0, length - 1
. The primitives onnativeint# array
are only available in 64-bit mode. Aligned load/store is not available because these values may be moved by the GC. -
int32# array
: the corresponding primitives take an index inint32
s and are required to operate onint32x4
s. The address is computed asarray + index * 4
; the safe primitives bounds-check against0, length - 3
. Aligned load/store is not available because these values may be moved by the GC. -
%immediate64 array
: the corresponding primitives take an index in immediates, and are required to operate onint64x2
s. The primitives can operate on all('a : immediate64) array
s and are only available in 64-bit mode. The address is computed asarray + index * 8
; the safe primitives bounds-check against0, length - 1
. Aligned load/store is not available because these values may be moved by the GC. Load/store directly reads/writes two 64-bit tagged values. The "safe" primitives do not check for proper tagging, so are not to be exposed to users as "safe."