Data transfer

Data transfer instructions

template <class T1, class T2 = T1>
simd_return_type<T1, T2> xsimd::set_simd(const T1 &value)

Returns a batch with all values initialized to value.

Return
the batch wrapping the highest available instruction set.
Parameters
  • value: the scalar used to initialize the batch.

template <class T1, class T2 = T1>
simd_return_type<T1, T2> xsimd::load_aligned(const T1 *src)

Loads the memory array pointed to by src into a batch and returns it.

src is required to be aligned.

Return
the batch wrapping the highest available instruction set.
Parameters
  • src: the pointer to the memory array to load.

template <class T1, class T2 = T1>
void xsimd::load_aligned(const T1 *src, simd_type<T2> &dst)

Loads the memory array pointed to by src into the batch dst.

src is required to be aligned.

Parameters
  • src: the pointer to the memory array to load.
  • dst: the destination batch.

template <class T1, class T2>
simd_return_type<T1, T2> xsimd::load_aligned(const T1 *real_src, const T1 *imag_src)

Loads the memory arrays pointed to by real_src and imag_src into a batch of complex numbers and returns it.

real_src and imag_src are required to be aligned.

Return
the batch of complex wrapping the highest available instruction set.
Parameters
  • real_src: the pointer to the memory array containing the real part.
  • imag_src: the pointer to the memory array containing the imaginary part.

template <class T1, class T2>
void xsimd::load_aligned(const T1 *real_src, const T1 *imag_src, simd_type<T2> &dst)

Loads the memory arrays pointed to by real_src and imag_src into the batch dst.

real_src and imag_src are required to be aligned.

Parameters
  • real_src: the pointer to the memory array containing the real part.
  • imag_src: the pointer to the memory array containing the imaginary part.
  • dst: the destination batch.

template <class T1, class T2 = T1>
simd_return_type<T1, T2> xsimd::load_unaligned(const T1 *src)

Loads the memory array pointed to by src into a batch and returns it.

src is not required to be aligned.

Return
the batch wrapping the highest available instruction set.
Parameters
  • src: the pointer to the memory array to load.

template <class T1, class T2 = T1>
void xsimd::load_unaligned(const T1 *src, simd_type<T2> &dst)

Loads the memory array pointed to by src into the batch dst.

src is not required to be aligned.

Parameters
  • src: the pointer to the memory array to load.
  • dst: the destination batch.

template <class T1, class T2>
simd_return_type<T1, T2> xsimd::load_unaligned(const T1 *real_src, const T1 *imag_src)

Loads the memory arrays pointed to by real_src and imag_src into a batch of complex numbers and returns it.

real_src and imag_src are not required to be aligned.

Return
the batch of complex wrapping the highest available instruction set.
Parameters
  • real_src: the pointer to the memory array containing the real part.
  • imag_src: the pointer to the memory array containing the imaginary part.

template <class T1, class T2>
void xsimd::load_unaligned(const T1 *real_src, const T1 *imag_src, simd_type<T2> &dst)

Loads the memory arrays pointed to by real_src and imag_src into the batch dst.

real_src and imag_src are not required to be aligned.

Parameters
  • real_src: the pointer to the memory array containing the real part.
  • imag_src: the pointer to the memory array containing the imaginary part.
  • dst: the destination batch.

template <class T1, class T2 = T1>
void xsimd::store_aligned(T1 *dst, const simd_type<T2> &src)

Stores the batch src into the memory array pointed to by dst.

dst is required to be aligned.

Parameters
  • dst: the pointer to the memory array.
  • src: the batch to store.

template <class T1, class T2 = T1>
void xsimd::store_unaligned(T1 *dst, const simd_type<T2> &src)

Stores the batch src into the memory array pointed to by dst.

dst is not required to be aligned.

Parameters
  • dst: the pointer to the memory array.
  • src: the batch to store.

template <class T1, class T2>
void xsimd::store_aligned(T1 *real_dst, T1 *imag_dst, const simd_type<T2> &src)

Stores the batch of complex numbers src into the memory arrays pointed to by real_dst and imag_dst.

real_dst and imag_dst are required to be aligned.

Parameters
  • real_dst: the pointer to the memory array of the real part.
  • imag_dst: the pointer to the memory array of the imaginary part.
  • src: the batch to store.

template <class T1, class T2>
void xsimd::store_unaligned(T1 *real_dst, T1 *imag_dst, const simd_type<T2> &src)

Stores the batch of complex numbers src into the memory arrays pointed to by real_dst and imag_dst.

real_dst and imag_dst are not required to be aligned.

Parameters
  • real_dst: the pointer to the memory array of the real part.
  • imag_dst: the pointer to the memory array of the imaginary part.
  • src: the batch to store.

Generic load and store

template <class T1, class T2 = T1>
simd_return_type<T1, T2> xsimd::load_simd(const T1 *src, aligned_mode)

Loads the memory array pointed to by src into a batch and returns it.

src is required to be aligned.

Return
the batch wrapping the highest available instruction set.
Parameters
  • src: the pointer to the memory array to load.

template <class T1, class T2 = T1>
void xsimd::load_simd(const T1 *src, simd_type<T2> &dst, aligned_mode)

Loads the memory array pointed to by src into the batch dst.

src is required to be aligned.

Parameters
  • src: the pointer to the memory array to load.
  • dst: the destination batch.

template <class T1, class T2>
simd_return_type<T1, T2> xsimd::load_simd(const T1 *real_src, const T1 *imag_src, aligned_mode)

Loads the memory arrays pointed to by real_src and imag_src into a batch of complex numbers and returns it.

real_src and imag_src are required to be aligned.

Return
the batch of complex wrapping the highest available instruction set.
Parameters
  • real_src: the pointer to the memory array containing the real part.
  • imag_src: the pointer to the memory array containing the imaginary part.

template <class T1, class T2>
void xsimd::load_simd(const T1 *real_src, const T1 *imag_src, simd_type<T2> &dst, aligned_mode)

Loads the memory arrays pointed to by real_src and imag_src into the batch dst.

real_src and imag_src are required to be aligned.

Parameters
  • real_src: the pointer to the memory array containing the real part.
  • imag_src: the pointer to the memory array containing the imaginary part.
  • dst: the destination batch.

template <class T1, class T2 = T1>
simd_return_type<T1, T2> xsimd::load_simd(const T1 *src, unaligned_mode)

Loads the memory array pointed to by src into a batch and returns it.

src is not required to be aligned.

Return
the batch wrapping the highest available instruction set.
Parameters
  • src: the pointer to the memory array to load.

template <class T1, class T2 = T1>
void xsimd::load_simd(const T1 *src, simd_type<T2> &dst, unaligned_mode)

Loads the memory array pointed to by src into the batch dst.

src is not required to be aligned.

Parameters
  • src: the pointer to the memory array to load.
  • dst: the destination batch.

template <class T1, class T2>
simd_return_type<T1, T2> xsimd::load_simd(const T1 *real_src, const T1 *imag_src, unaligned_mode)

Loads the memory arrays pointed to by real_src and imag_src into a batch of complex numbers and returns it.

real_src and imag_src are not required to be aligned.

Return
the batch of complex wrapping the highest available instruction set.
Parameters
  • real_src: the pointer to the memory array containing the real part.
  • imag_src: the pointer to the memory array containing the imaginary part.

template <class T1, class T2>
void xsimd::load_simd(const T1 *real_src, const T1 *imag_src, simd_type<T2> &dst, unaligned_mode)

Loads the memory arrays pointed to by real_src and imag_src into the batch dst.

real_src and imag_src are not required to be aligned.

Parameters
  • real_src: the pointer to the memory array containing the real part.
  • imag_src: the pointer to the memory array containing the imaginary part.
  • dst: the destination batch.

template <class T1, class T2 = T1>
void xsimd::store_simd(T1 *dst, const simd_type<T2> &src, aligned_mode)

Stores the batch src into the memory array pointed to by dst.

dst is required to be aligned.

Parameters
  • dst: the pointer to the memory array.
  • src: the batch to store.

template <class T1, class T2 = T1>
void xsimd::store_simd(T1 *dst, const simd_type<T2> &src, unaligned_mode)

Stores the batch src into the memory array pointed to by dst.

dst is not required to be aligned.

Parameters
  • dst: the pointer to the memory array.
  • src: the batch to store.

template <class T1, class T2>
void xsimd::store_simd(T1 *real_dst, T1 *imag_dst, const simd_type<T2> &src, aligned_mode)

Stores the batch of complex numbers src into the memory arrays pointed to by real_dst and imag_dst.

real_dst and imag_dst are required to be aligned.

Parameters
  • real_dst: the pointer to the memory array of the real part.
  • imag_dst: the pointer to the memory array of the imaginary part.
  • src: the batch to store.

template <class T1, class T2>
void xsimd::store_simd(T1 *real_dst, T1 *imag_dst, const simd_type<T2> &src, unaligned_mode)

Stores the batch of complex numbers src into the memory arrays pointed to by real_dst and imag_dst.

real_dst and imag_dst are not required to be aligned.

Parameters
  • real_dst: the pointer to the memory array of the real part.
  • imag_dst: the pointer to the memory array of the imaginary part.
  • src: the batch to store.