SuperDex Physics C++ API
Loading...
Searching...
No Matches
simd_specializations_inl.h File Reference
#include "../debug.h"
#include "../simd.h"
#include "simd_arch_emulator_inl.h"

Go to the source code of this file.

Namespaces

namespace  superdex

Macros

#define MOCHI_NATIVE_SIMD_IMPL_BOILERPLATE(T, N, NativeT)
#define MOCHI_REQUIRES_NON_BOOL_SCALAR(U, S)

Macro Definition Documentation

◆ MOCHI_NATIVE_SIMD_IMPL_BOILERPLATE

#define MOCHI_NATIVE_SIMD_IMPL_BOILERPLATE ( T,
N,
NativeT )
Value:
NativeT raw; \
static constexpr int kSize = N; \
static constexpr bool kIsSupported = true; \
static constexpr bool kIsComposite = false; \
static constexpr bool kIsEmulated = false; \
using NativeType = NativeT; \
using Scalar = T; \
MOCHI_FORCE_INLINE Simd() = default; \
MOCHI_FORCE_INLINE ~Simd() = default; \
MOCHI_FORCE_INLINE Simd(Simd const& rhs) = default; \
MOCHI_FORCE_INLINE Simd(Simd&& rhs) = default; \
MOCHI_FORCE_INLINE Simd(NativeType rhs) : raw(rhs) {}; \
MOCHI_FORCE_INLINE static constexpr size_t size() { \
return kSize; \
} \
MOCHI_FORCE_INLINE Simd& operator=(Simd const& rhs) = default; \
MOCHI_FORCE_INLINE Simd& operator=(Simd&& rhs) = default; \
template <class U, MOCHI_REQUIRES_NON_BOOL_SCALAR(U, Scalar)> \
MOCHI_FORCE_INLINE Simd& operator=(U rhs) { \
raw = Simd{rhs}.raw; \
return *this; \
} \
[[nodiscard]] MOCHI_FORCE_INLINE Scalar operator[](int i) const { \
return Get(*this, i); /* return by value */ \
}
#define MOCHI_FORCE_INLINE
T Get(Simd< T, N > v)
Definition simd_inl.h:300

Definition at line 36 of file simd_specializations_inl.h.

◆ MOCHI_REQUIRES_NON_BOOL_SCALAR

#define MOCHI_REQUIRES_NON_BOOL_SCALAR ( U,
S )
Value:
MOCHI_CONCEPT((std::is_convertible_v<U, S> && !std::is_same_v<U, bool>))
#define MOCHI_CONCEPT(a)

Definition at line 30 of file simd_specializations_inl.h.