|
Intel xvec
Experimental C++ simd class library
|
#include <core.hpp>
Public Types | |
| using | element_type = element_storage_t<_Tp> |
| using | element_container_type = container_for_type<_Tp> |
| using | register_type = decltype(detail::get_register_type<builtin_type>()) |
| The register to use for intrinsic operations on this vec (e.g., for vec<double, 3> it would be __m256d). Note that unininitialised elements may be inserted to grow the vector to a size which can be represented in a register. | |
Static Public Member Functions | |
| static constexpr register_type | to_register (builtin_type v) |
| static constexpr builtin_type | from_register (register_type r) |
| A named constructor for creating a builtin type from a register value. | |
Static Public Attributes | |
| static constexpr simd_size_type | _numDataElements = complex_number<_Tp> ? 2 * _Np : _Np |
| The number of underlying builtin data elements. | |
| static constexpr simd_size_type | _numStorageElements = isLlvm ? _numDataElements : std::bit_ceil((std::uint64_t)_numDataElements) |
| The number of storage elements. This could be bigger than the number of data elements. | |
Traits for standard builtin vector types.
| using xvec::simd::detail::vec_traits< _Vendor, _Tp, _Np >::element_type = element_storage_t<_Tp> |
The bare storage type used by the compiler for the elements. For arithmetic types this will typically be the same as the type itself, but for user-defined types or complex types it might be a container of raw bits instead.
|
inlinestaticconstexpr |
A named constructor for creating a builtin type from a register value.
| r | The register value from which to create the builtin value. |
|
inlinestaticconstexpr |
Convert the vector data into a native register value which can be passed directly into an intrinsic. Firstly the data is expanded to full a complete native register (e.g., 128-bit, 256-bit, etc) using uninitialised bits. Secondly, the register is converted into the most appropriate native register type which can be used directly by an intrinsic. For example, vec<int, 3> would become __m128i, vec<float, 5> would become __m256, and so on. This function must not be used on a vec which is too big to fit a native register (use simd::chunk to break it into register-sized pieces). Note that while many intrinsics accept a register which contains uninitialised data, this data might lead to incorrect operation. The caller is responsible for ensuring that the uninitialised bits are set to a safe value before calling an intrinsic which requires it.