Intel xvec
Experimental C++ simd class library
Loading...
Searching...
No Matches
C++26: Loads and stores

Transfer vector elements to and from contiguous memory ranges. More...

Functions

template<typename _Vp = std::nullptr_t, detail::contiguous_sized_range _Range, typename... _Flags>
constexpr detail::load_return_type_range< _Vp, _Range > xvec::simd::partial_load (_Range &&r, flags< _Flags... > f={})
 Load the basic_vec elements from a contiguous sized range, performing a suitable conversion if necessary. Two variants are provided (unmasked and masked) and these provide the entry points for all the calls to the underlying target-specific load implementations. Note that loading from extents with known sizes are converted into special cases that handle those more efficiently than a general partial load (e.g., by removing unnecessary checks).
template<typename _Vp = std::nullptr_t, detail::contiguous_sized_range _Range, typename... _Flags>
constexpr detail::load_return_type_range< _Vp, _Range > xvec::simd::partial_load (_Range &&r, const detail::load_mask_type_range< _Vp, _Range > &m, flags< _Flags... > f={})
 Load selected vector elements from a contiguous sized range.
template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, typename... _Flags>
constexpr detail::load_return_type_iter< _Vp, _It > xvec::simd::partial_load (_It first, std::iter_difference_t< _It > n, flags< _Flags... > f={})
 Partial load from a contiguous iterator and element count.
template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, typename... _Flags>
constexpr detail::load_return_type_iter< _Vp, _It > xvec::simd::partial_load (_It first, std::iter_difference_t< _It > n, const detail::load_mask_type_iter< _Vp, _It > &m, flags< _Flags... > f={})
 Masked partial load from an iterator and element count.
template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
constexpr detail::load_return_type_iter< _Vp, _It > xvec::simd::partial_load (_It first, _Sent last, flags< _Flags... > f={})
 Partial load from an iterator and sized sentinel.
template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
constexpr detail::load_return_type_iter< _Vp, _It > xvec::simd::partial_load (_It first, _Sent last, const detail::load_mask_type_iter< _Vp, _It > &m, flags< _Flags... > f={})
 Masked partial load from an iterator and sized sentinel.
template<typename _Vp = std::nullptr_t, detail::contiguous_sized_range _Range, typename... _Flags>
constexpr detail::load_return_type_range< _Vp, _Range > xvec::simd::unchecked_load (_Range &&r, flags< _Flags... > f={})
 Unchecked load from a contiguous sized range.
template<typename _Vp = std::nullptr_t, detail::contiguous_sized_range _Range, typename... _Flags>
constexpr detail::load_return_type_range< _Vp, _Range > xvec::simd::unchecked_load (_Range &&r, const detail::load_mask_type_range< _Vp, _Range > &m, flags< _Flags... > f={})
 Masked unchecked load from a contiguous sized range.
template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, typename... _Flags>
constexpr detail::load_return_type_iter< _Vp, _It > xvec::simd::unchecked_load (_It first, std::iter_difference_t< _It > n, flags< _Flags... > f={})
 Unchecked load from an iterator and element count.
template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, typename... _Flags>
constexpr detail::load_return_type_iter< _Vp, _It > xvec::simd::unchecked_load (_It first, std::iter_difference_t< _It > n, const detail::load_mask_type_iter< _Vp, _It > &m, flags< _Flags... > f={})
 Masked unchecked load from an iterator and element count.
template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
constexpr detail::load_return_type_iter< _Vp, _It > xvec::simd::unchecked_load (_It first, _Sent last, flags< _Flags... > f={})
 Unchecked load from an iterator and sized sentinel.
template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
constexpr detail::load_return_type_iter< _Vp, _It > xvec::simd::unchecked_load (_It first, _Sent last, const detail::load_mask_type_iter< _Vp, _It > &m, flags< _Flags... > f={})
 Masked unchecked load from an iterator and sized sentinel.
template<typename _Tp, typename _Abi, detail::contiguous_sized_range _Range, typename... _Flags>
requires std::indirectly_writable<std::ranges::iterator_t<_Range>, _Tp>
constexpr void xvec::simd::partial_store (const basic_vec< _Tp, _Abi > &value, _Range &&r, flags< _Flags... > f={})
 Store the elements from a basic_vec value into a contiguous range, performing a suitable conversion if necessary. Both unmasked and masked variants are provided. Range checking is provided to ensure that the destination is not exceeded. These functions serve as the entry point for all overloaded variants of vec store, including masked/unmasked, iterator+iterator, iterator+count and all unchecked equivalents.
template<typename _Tp, typename _Abi, detail::contiguous_sized_range _Range, typename... _Flags>
requires std::indirectly_writable<std::ranges::iterator_t<_Range>, _Tp>
constexpr void xvec::simd::partial_store (const basic_vec< _Tp, _Abi > &value, _Range &&r, const typename basic_vec< _Tp, _Abi >::mask_type &m, flags< _Flags... > f={})
 Store selected vector elements into a contiguous sized range.
template<typename _Tp, typename _Abi, std::contiguous_iterator _It, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
constexpr void xvec::simd::partial_store (const basic_vec< _Tp, _Abi > &value, _It first, std::iter_difference_t< _It > n, flags< _Flags... > f={})
 Partial store using a contiguous iterator and element count.
template<typename _Tp, typename _Abi, std::contiguous_iterator _It, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
constexpr void xvec::simd::partial_store (const basic_vec< _Tp, _Abi > &value, _It first, std::iter_difference_t< _It > n, const typename basic_vec< _Tp, _Abi >::mask_type &m, flags< _Flags... > f={})
 Masked partial store using an iterator and element count.
template<typename _Tp, typename _Abi, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
constexpr void xvec::simd::partial_store (const basic_vec< _Tp, _Abi > &value, _It first, _Sent last, flags< _Flags... > f={})
 Partial store using an iterator and sized sentinel.
template<typename _Tp, typename _Abi, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
constexpr void xvec::simd::partial_store (const basic_vec< _Tp, _Abi > &value, _It first, _Sent last, const typename basic_vec< _Tp, _Abi >::mask_type &m, flags< _Flags... > f={})
 Masked partial store using an iterator and sized sentinel.
template<typename _Tp, typename _Abi, detail::contiguous_sized_range _Range, typename... _Flags>
requires std::indirectly_writable<std::ranges::iterator_t<_Range>, _Tp>
constexpr void xvec::simd::unchecked_store (const basic_vec< _Tp, _Abi > &value, _Range &&r, flags< _Flags... > f={})
 Unchecked store into a contiguous sized range.
template<typename _Tp, typename _Abi, detail::contiguous_sized_range _Range, typename... _Flags>
requires std::indirectly_writable<std::ranges::iterator_t<_Range>, _Tp>
constexpr void xvec::simd::unchecked_store (const basic_vec< _Tp, _Abi > &value, _Range &&r, const typename basic_vec< _Tp, _Abi >::mask_type &m, flags< _Flags... > f={})
 Masked unchecked store into a contiguous sized range.
template<typename _Tp, typename _Abi, std::contiguous_iterator _It, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
constexpr void xvec::simd::unchecked_store (const basic_vec< _Tp, _Abi > &value, _It first, std::iter_difference_t< _It > n, flags< _Flags... > f={})
 Unchecked store using an iterator and element count.
template<typename _Tp, typename _Abi, std::contiguous_iterator _It, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
constexpr void xvec::simd::unchecked_store (const basic_vec< _Tp, _Abi > &value, _It first, std::iter_difference_t< _It > n, const typename basic_vec< _Tp, _Abi >::mask_type &m, flags< _Flags... > f={})
 Masked unchecked store using an iterator and element count.
template<typename _Tp, typename _Abi, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
constexpr void xvec::simd::unchecked_store (const basic_vec< _Tp, _Abi > &value, _It first, _Sent last, flags< _Flags... > f={})
 Unchecked store using an iterator and sized sentinel.
template<typename _Tp, typename _Abi, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
constexpr void xvec::simd::unchecked_store (const basic_vec< _Tp, _Abi > &value, _It first, _Sent last, const typename basic_vec< _Tp, _Abi >::mask_type &m, flags< _Flags... > f={})
 Masked unchecked store using an iterator and sized sentinel.

Detailed Description

Transfer vector elements to and from contiguous memory ranges.

Includes partial and unchecked operations, with and without masks, using ranges, iterator/count pairs, or iterator/sentinel pairs.

See also
https://eel.is/c++draft/simd.load.store

Function Documentation

◆ partial_load() [1/6]

template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
detail::load_return_type_iter< _Vp, _It > xvec::simd::partial_load ( _It first,
_Sent last,
const detail::load_mask_type_iter< _Vp, _It > & m,
flags< _Flags... > f = {} )
constexpr

Masked partial load from an iterator and sized sentinel.

Parameters
firstThe beginning of the source range.
lastThe end of the source range.
mThe mask selecting elements to load.
fMemory-operation flags.

◆ partial_load() [2/6]

template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
detail::load_return_type_iter< _Vp, _It > xvec::simd::partial_load ( _It first,
_Sent last,
flags< _Flags... > f = {} )
constexpr

Partial load from an iterator and sized sentinel.

Parameters
firstThe beginning of the source range.
lastThe end of the source range.
fMemory-operation flags.

◆ partial_load() [3/6]

template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, typename... _Flags>
detail::load_return_type_iter< _Vp, _It > xvec::simd::partial_load ( _It first,
std::iter_difference_t< _It > n,
const detail::load_mask_type_iter< _Vp, _It > & m,
flags< _Flags... > f = {} )
constexpr

Masked partial load from an iterator and element count.

Parameters
firstThe beginning of the source range.
nThe source element count.
mThe mask selecting elements to load.
fMemory-operation flags.

◆ partial_load() [4/6]

template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, typename... _Flags>
detail::load_return_type_iter< _Vp, _It > xvec::simd::partial_load ( _It first,
std::iter_difference_t< _It > n,
flags< _Flags... > f = {} )
constexpr

Partial load from a contiguous iterator and element count.

Parameters
firstThe beginning of the source range.
nThe source element count.
fMemory-operation flags.

◆ partial_load() [5/6]

template<typename _Vp = std::nullptr_t, detail::contiguous_sized_range _Range, typename... _Flags>
detail::load_return_type_range< _Vp, _Range > xvec::simd::partial_load ( _Range && r,
const detail::load_mask_type_range< _Vp, _Range > & m,
flags< _Flags... > f = {} )
constexpr

Load selected vector elements from a contiguous sized range.

Parameters
rThe range from which to copy.
mThe mask selecting elements to load.
fThe flags to apply to the copy.

◆ partial_load() [6/6]

template<typename _Vp = std::nullptr_t, detail::contiguous_sized_range _Range, typename... _Flags>
detail::load_return_type_range< _Vp, _Range > xvec::simd::partial_load ( _Range && r,
flags< _Flags... > f = {} )
constexpr

Load the basic_vec elements from a contiguous sized range, performing a suitable conversion if necessary. Two variants are provided (unmasked and masked) and these provide the entry points for all the calls to the underlying target-specific load implementations. Note that loading from extents with known sizes are converted into special cases that handle those more efficiently than a general partial load (e.g., by removing unnecessary checks).

Template Parameters
_VpThe vec vector to return from the load. This specifies the number and type of elements. If not provided it will be deduced from the range.
_FlagsA parameter pack of types identifying properties to apply to this operation.
_RangeThe contiguous range from which to load the basic_vec values. If the range has a different value type to the basic_vec then the elements will be converted.
Parameters
rThe range from which to copy.
fThe flags to apply to the copy.

◆ partial_store() [1/6]

template<typename _Tp, typename _Abi, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
void xvec::simd::partial_store ( const basic_vec< _Tp, _Abi > & value,
_It first,
_Sent last,
const typename basic_vec< _Tp, _Abi >::mask_type & m,
flags< _Flags... > f = {} )
constexpr

Masked partial store using an iterator and sized sentinel.

Parameters
valueThe source vector.
firstThe beginning of the destination range.
lastThe end of the destination range.
mThe mask selecting elements to store.
fMemory-operation flags.

◆ partial_store() [2/6]

template<typename _Tp, typename _Abi, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
void xvec::simd::partial_store ( const basic_vec< _Tp, _Abi > & value,
_It first,
_Sent last,
flags< _Flags... > f = {} )
constexpr

Partial store using an iterator and sized sentinel.

Parameters
valueThe source vector.
firstThe beginning of the destination range.
lastThe end of the destination range.
fMemory-operation flags.

◆ partial_store() [3/6]

template<typename _Tp, typename _Abi, std::contiguous_iterator _It, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
void xvec::simd::partial_store ( const basic_vec< _Tp, _Abi > & value,
_It first,
std::iter_difference_t< _It > n,
const typename basic_vec< _Tp, _Abi >::mask_type & m,
flags< _Flags... > f = {} )
constexpr

Masked partial store using an iterator and element count.

Parameters
valueThe source vector.
firstThe beginning of the destination range.
nThe destination element count.
mThe mask selecting elements to store.
fMemory-operation flags.

◆ partial_store() [4/6]

template<typename _Tp, typename _Abi, std::contiguous_iterator _It, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
void xvec::simd::partial_store ( const basic_vec< _Tp, _Abi > & value,
_It first,
std::iter_difference_t< _It > n,
flags< _Flags... > f = {} )
constexpr

Partial store using a contiguous iterator and element count.

Parameters
valueThe source vector.
firstThe beginning of the destination range.
nThe destination element count.
fMemory-operation flags.

◆ partial_store() [5/6]

template<typename _Tp, typename _Abi, detail::contiguous_sized_range _Range, typename... _Flags>
requires std::indirectly_writable<std::ranges::iterator_t<_Range>, _Tp>
void xvec::simd::partial_store ( const basic_vec< _Tp, _Abi > & value,
_Range && r,
const typename basic_vec< _Tp, _Abi >::mask_type & m,
flags< _Flags... > f = {} )
constexpr

Store selected vector elements into a contiguous sized range.

Parameters
valueThe source vector.
rThe destination range.
mThe mask selecting elements to store.
fMemory-operation flags.

◆ partial_store() [6/6]

template<typename _Tp, typename _Abi, detail::contiguous_sized_range _Range, typename... _Flags>
requires std::indirectly_writable<std::ranges::iterator_t<_Range>, _Tp>
void xvec::simd::partial_store ( const basic_vec< _Tp, _Abi > & value,
_Range && r,
flags< _Flags... > f = {} )
constexpr

Store the elements from a basic_vec value into a contiguous range, performing a suitable conversion if necessary. Both unmasked and masked variants are provided. Range checking is provided to ensure that the destination is not exceeded. These functions serve as the entry point for all overloaded variants of vec store, including masked/unmasked, iterator+iterator, iterator+count and all unchecked equivalents.

Template Parameters
_FlagsMemory-operation flag types.
_TpThe type of the element in the original source.
_Abithe Abi of the original vec source.
_RangeThe output range into which to store the elements. If the range has a different element type then each value will be converted.
Parameters
valueThe simd::vec value to store into the range.
rthe range into which to store the simd::vec values.
fFlags controlling the memory operation.

◆ unchecked_load() [1/6]

template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
detail::load_return_type_iter< _Vp, _It > xvec::simd::unchecked_load ( _It first,
_Sent last,
const detail::load_mask_type_iter< _Vp, _It > & m,
flags< _Flags... > f = {} )
constexpr

Masked unchecked load from an iterator and sized sentinel.

Parameters
firstThe beginning of the source range.
lastThe end of the source range.
mThe mask selecting elements to load.
fMemory-operation flags.

◆ unchecked_load() [2/6]

template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
detail::load_return_type_iter< _Vp, _It > xvec::simd::unchecked_load ( _It first,
_Sent last,
flags< _Flags... > f = {} )
constexpr

Unchecked load from an iterator and sized sentinel.

Parameters
firstThe beginning of the source range.
lastThe end of the source range.
fMemory-operation flags.

◆ unchecked_load() [3/6]

template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, typename... _Flags>
detail::load_return_type_iter< _Vp, _It > xvec::simd::unchecked_load ( _It first,
std::iter_difference_t< _It > n,
const detail::load_mask_type_iter< _Vp, _It > & m,
flags< _Flags... > f = {} )
constexpr

Masked unchecked load from an iterator and element count.

Parameters
firstThe beginning of the source range.
nThe source element count.
mThe mask selecting elements to load.
fMemory-operation flags.

◆ unchecked_load() [4/6]

template<typename _Vp = std::nullptr_t, std::contiguous_iterator _It, typename... _Flags>
detail::load_return_type_iter< _Vp, _It > xvec::simd::unchecked_load ( _It first,
std::iter_difference_t< _It > n,
flags< _Flags... > f = {} )
constexpr

Unchecked load from an iterator and element count.

Parameters
firstThe beginning of the source range.
nThe source element count.
fMemory-operation flags.

◆ unchecked_load() [5/6]

template<typename _Vp = std::nullptr_t, detail::contiguous_sized_range _Range, typename... _Flags>
detail::load_return_type_range< _Vp, _Range > xvec::simd::unchecked_load ( _Range && r,
const detail::load_mask_type_range< _Vp, _Range > & m,
flags< _Flags... > f = {} )
constexpr

Masked unchecked load from a contiguous sized range.

Parameters
rThe source range.
mThe mask selecting elements to load.
fMemory-operation flags.

◆ unchecked_load() [6/6]

template<typename _Vp = std::nullptr_t, detail::contiguous_sized_range _Range, typename... _Flags>
detail::load_return_type_range< _Vp, _Range > xvec::simd::unchecked_load ( _Range && r,
flags< _Flags... > f = {} )
constexpr

Unchecked load from a contiguous sized range.

Parameters
rThe source range.
fMemory-operation flags.

◆ unchecked_store() [1/6]

template<typename _Tp, typename _Abi, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
void xvec::simd::unchecked_store ( const basic_vec< _Tp, _Abi > & value,
_It first,
_Sent last,
const typename basic_vec< _Tp, _Abi >::mask_type & m,
flags< _Flags... > f = {} )
constexpr

Masked unchecked store using an iterator and sized sentinel.

Parameters
valueThe source vector.
firstThe beginning of the destination range.
lastThe end of the destination range.
mThe mask selecting elements to store.
fMemory-operation flags.

◆ unchecked_store() [2/6]

template<typename _Tp, typename _Abi, std::contiguous_iterator _It, std::sized_sentinel_for< _It > _Sent, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
void xvec::simd::unchecked_store ( const basic_vec< _Tp, _Abi > & value,
_It first,
_Sent last,
flags< _Flags... > f = {} )
constexpr

Unchecked store using an iterator and sized sentinel.

Parameters
valueThe source vector.
firstThe beginning of the destination range.
lastThe end of the destination range.
fMemory-operation flags.

◆ unchecked_store() [3/6]

template<typename _Tp, typename _Abi, std::contiguous_iterator _It, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
void xvec::simd::unchecked_store ( const basic_vec< _Tp, _Abi > & value,
_It first,
std::iter_difference_t< _It > n,
const typename basic_vec< _Tp, _Abi >::mask_type & m,
flags< _Flags... > f = {} )
constexpr

Masked unchecked store using an iterator and element count.

Parameters
valueThe source vector.
firstThe beginning of the destination range.
nThe destination element count.
mThe mask selecting elements to store.
fMemory-operation flags.

◆ unchecked_store() [4/6]

template<typename _Tp, typename _Abi, std::contiguous_iterator _It, typename... _Flags>
requires std::indirectly_writable<_It, _Tp>
void xvec::simd::unchecked_store ( const basic_vec< _Tp, _Abi > & value,
_It first,
std::iter_difference_t< _It > n,
flags< _Flags... > f = {} )
constexpr

Unchecked store using an iterator and element count.

Parameters
valueThe source vector.
firstThe beginning of the destination range.
nThe destination element count.
fMemory-operation flags.

◆ unchecked_store() [5/6]

template<typename _Tp, typename _Abi, detail::contiguous_sized_range _Range, typename... _Flags>
requires std::indirectly_writable<std::ranges::iterator_t<_Range>, _Tp>
void xvec::simd::unchecked_store ( const basic_vec< _Tp, _Abi > & value,
_Range && r,
const typename basic_vec< _Tp, _Abi >::mask_type & m,
flags< _Flags... > f = {} )
constexpr

Masked unchecked store into a contiguous sized range.

Parameters
valueThe source vector.
rThe destination range.
mThe mask selecting elements to store.
fMemory-operation flags.

◆ unchecked_store() [6/6]

template<typename _Tp, typename _Abi, detail::contiguous_sized_range _Range, typename... _Flags>
requires std::indirectly_writable<std::ranges::iterator_t<_Range>, _Tp>
void xvec::simd::unchecked_store ( const basic_vec< _Tp, _Abi > & value,
_Range && r,
flags< _Flags... > f = {} )
constexpr

Unchecked store into a contiguous sized range.

Parameters
valueThe source vector.
rThe destination range.
fMemory-operation flags.