#include "../simd.h"
#include <mochi_core/utils/array.h>
#include <mochi_core/utils/basic_utils.h>
#include <array>
#include <bit>
#include <cmath>
#include <cstring>
#include <type_traits>
#include <utility>
Go to the source code of this file.
|
template<class To, class FromT, int FromN>
requires (IsSimd<To> && Simd<FromT, FromN>::kIsSupported) |
| To | superdex::StaticCast (Simd< FromT, FromN > const &in) |
◆ MOCHI_SIMD_EMULATOR_HREDUCE_BOOL
| #define MOCHI_SIMD_EMULATOR_HREDUCE_BOOL |
( |
| Name, |
|
|
| Op ) |
Value:template <int M = kSize> \
static_assert(M >= 1 && M <= kSize, "Unsupported M"); \
auto eval = []<size_t... I>(Simd const& a, std::index_sequence<I...>) { \
return ((std::bit_cast<UIntT>(a.raw[I]) != UIntT{0}) Op...); \
}; \
return eval(a, std::make_index_sequence<M>{}); \
}
Definition at line 72 of file simd_arch_emulator_inl.h.
◆ MOCHI_SIMD_EMULATOR_OP_1
| #define MOCHI_SIMD_EMULATOR_OP_1 |
( |
| Op, |
|
|
| Expr ) |
Value:
auto eval = []<size_t... I>(Simd const& lhs, Simd const& rhs, std::index_sequence<I...>) { \
return Simd{(Expr)...}; \
}; \
return eval(*this, rhs, std::make_index_sequence<N>{}); \
}
Definition at line 54 of file simd_arch_emulator_inl.h.
◆ MOCHI_SIMD_EMULATOR_OP_2
| #define MOCHI_SIMD_EMULATOR_OP_2 |
( |
| Op | ) |
|
Value:
auto eval = []<size_t... I>(Simd const& lhs, Simd const& rhs, std::index_sequence<I...>) { \
return Simd( \
std::bit_cast<Scalar>(std::bit_cast<UIntT>(lhs.raw[I]) \
Op std::bit_cast<UIntT>(rhs.raw[I]))...); \
}; \
return eval(*this, rhs, std::make_index_sequence<N>{}); \
}
Definition at line 62 of file simd_arch_emulator_inl.h.