Feature | Status |
---|---|
P1928R15 std::simd — merge data-parallel types from the Parallelism TS 2 | in progress |
P3430R3 simd issues: explicit, unsequenced, identity-element position, and members of disabled simd | done |
P3441R2 Rename simd_split to simd_chunk | done |
P3287R3 Exploration of namespaces for std::simd | not started |
P2933R4 Extend ⟨bit⟩ header function with overloads for std::simd | not started |
P2663R7 Interleaved complex values support in std::simd | not started |
This implementation is not intended for use yet. Nevertheless, it should be
usable for experimenting. There is no build system support for installation. But
you should be able to point your compiler's include path to this repository and
simply #include <simd>
.
To build the tests there are multiple targets available. make help
will list
all of them.
The default setting makes simd::vec
and simd::mask
read-only random-access
ranges. That's not part of P1928, so you can turn it off. However, that breaks
simd::iota_v
.
std::array{1, 2, 3} | std::ranges::to<simd::basic_vec>()
works without this,
and constructs a vec<int, 3>
. However, ranges without static extent and
non-contiguous ranges are not supported without this feature.
Enables any_rg | std::ranges::to<simd::basic_vec>()
. Precondition:
std::ranges::size(any_rg)
is equal to the width of the simd::vec
.
This implementation will render you program ill-formed if it can detect a potential precondition violation. This is not conforming, but maybe it should be?
The default on precondition violation otherwise is hard UB, which you can
detect reliably with UBsan. You can change that to a 'trap' if
_GLIBCXX_HARDEN
is >= 3
, or to a more verbose assertion failure by defining
_GLIBCXX_ASSERTIONS
.
Per default the simd
namespace is nested into the cpp26
namespace. With
this flag it's std::simd
instead.
Adds a subscript operator to basic_vec
with integral basic_vec
argument.
The operator provides a permute/gather operation.