Loading...
Searching...
No Matches
Go to the documentation of this file.
30#define MOCHI_REQUIRES_NON_BOOL_SCALAR(U, S) \
31 MOCHI_CONCEPT((std::is_convertible_v<U, S> && !std::is_same_v<U, bool>))
36#define MOCHI_NATIVE_SIMD_IMPL_BOILERPLATE(T, N, NativeT) \
38 static constexpr int kSize = N; \
39 static constexpr bool kIsSupported = true; \
40 static constexpr bool kIsComposite = false; \
41 static constexpr bool kIsEmulated = false; \
42 using NativeType = NativeT; \
44 MOCHI_FORCE_INLINE Simd() = default; \
45 MOCHI_FORCE_INLINE ~Simd() = default; \
46 MOCHI_FORCE_INLINE Simd(Simd const& rhs) = default; \
47 MOCHI_FORCE_INLINE Simd(Simd&& rhs) = default; \
48 MOCHI_FORCE_INLINE Simd(NativeType rhs) : raw(rhs) {}; \
49 MOCHI_FORCE_INLINE static constexpr size_t size() { \
52 MOCHI_FORCE_INLINE Simd& operator=(Simd const& rhs) = default; \
53 MOCHI_FORCE_INLINE Simd& operator=(Simd&& rhs) = default; \
54 template <class U, MOCHI_REQUIRES_NON_BOOL_SCALAR(U, Scalar)> \
55 MOCHI_FORCE_INLINE Simd& operator=(U rhs) { \
56 raw = Simd{rhs}.raw; \
59 [[nodiscard]] MOCHI_FORCE_INLINE Scalar operator[](int i) const { \
60 return Get(*this, i); \
74#error No supported SIMD architecture was detected. MOCHI_USE_SIMD should be zero.