template <typename T, typename U> \
typename enable_if< \
is_same<U, CLASS>::value && is_pod<T>::value, bool>::type \
operator OP(
const T &pod,
const CLASS &obj)
FL_NO_EXCEPT { \
return pod OP obj; \
} \
template <typename T> \
typename enable_if<is_pod<T>::value, bool>::type operator OP( \
return obj OP pod; \
}
1033#pragma once
1034
1037
1043
1044
1045
1047
1049
1050
1052
1057
1058
1059
1064 }
1065
1066
1068 return from_raw(simd::platforms::load_u32_4(
reinterpret_cast<const u32*
>(ptr)));
1069 }
1070
1071
1073 simd::platforms::store_u32_4(
reinterpret_cast<u32*
>(ptr),
raw);
1074 }
1075
1076
1078 return from_raw(simd::platforms::set1_u32_4(
static_cast<u32
>(
value.raw())));
1079 }
1080
1081
1082
1085 }
1086
1089 }
1090
1092
1094 }
1095
1097
1098 auto zero = simd::set1_u32_4(0);
1100 }
1101
1104 }
1105
1108 }
1109
1110
1111
1113
1114
1115
1118
1119 auto mask = simd::sra_i32_4(
raw, 31);
1120
1121 auto flipped = simd::xor_u32_4(
raw, mask);
1122 return from_raw(simd::sub_i32_4(flipped, mask));
1123 }
1124
1128 }
1129
1133 }
1134
1138 }
1139
1144 auto diff = b - (*this);
1145 return (*this) + (diff * t_vec);
1146 }
1147
1151
1152
1153 static constexpr i32 RAD_TO_24 = 2670177;
1154
1155
1156 auto angles_u32 = simd::mulhi_su32_4(
raw, simd::set1_u32_4(
static_cast<u32
>(RAD_TO_24)));
1157
1158
1160
1161
1162 out_sin =
from_raw(simd::sra_i32_4(sc.sin_vals, 15));
1163 out_cos =
from_raw(simd::sra_i32_4(sc.cos_vals, 15));
1164 }
1165
1168 s16x16x4 sin_out, cos_out;
1169 sincos(sin_out, cos_out);
1170 return sin_out;
1171 }
1172
1175 s16x16x4 sin_out, cos_out;
1176 sincos(sin_out, cos_out);
1177 return cos_out;
1178 }
1179};
1180
1181
1182
1184
1185}
Alignment macros and utilities for FastLED.
platforms::simd_u32x4 simd_u32x4
constexpr int type_rank< T >::value
expected< T, E > result
Alias for expected (Rust-style naming)
FASTLED_FORCE_INLINE SinCos32_simd sincos32_simd(simd::simd_u32x4 angles) FL_NO_EXCEPT
Process 4 angles simultaneously, returning vectorized sin/cos values SIMD-optimized: vectorized angle...
Base definition for an LED controller.
SIMD 4-wide s0x32 fixed-point vector type.
#define FASTLED_FORCE_INLINE
Umbrella header for SIMD subsystem.
Cross-type SIMD fixed-point operations (implemented after all types are defined)
Four-lane SIMD batch of fl::sincos32.
4-wide s0x32 vector (normalized values [-1, 1]) Backed by 128-bit SIMD register (4× i32 in Q31 format...
FASTLED_FORCE_INLINE s16x16x4 min(s16x16x4 b) const
Element-wise minimum.
FASTLED_FORCE_INLINE s16x16x4 clamp(s16x16x4 lo, s16x16x4 hi) const
Clamp to [lo, hi].
FASTLED_FORCE_INLINE s16x16x4 cos() const
Compute cosine of 4 angles (in radians)
FASTLED_FORCE_INLINE s16x16x4 operator-() const
FASTLED_FORCE_INLINE s16x16x4 operator*(s16x16x4 b) const
FASTLED_FORCE_INLINE void store(s16x16 *ptr) const
FASTLED_FORCE_INLINE void sincos(s16x16x4 &out_sin, s16x16x4 &out_cos) const
Compute sin and cos of 4 angles (in radians) Results written to out_sin and out_cos.
FASTLED_FORCE_INLINE s16x16x4 sin() const
Compute sine of 4 angles (in radians)
FASTLED_FORCE_INLINE s16x16x4 abs() const
Absolute value: branchless via mask and xor.
FASTLED_FORCE_INLINE s16x16x4 operator>>(int shift) const
static FASTLED_FORCE_INLINE s16x16x4 from_raw(simd::simd_u32x4 r)
FASTLED_FORCE_INLINE s16x16x4 operator<<(int shift) const
FASTLED_FORCE_INLINE s16x16x4 max(s16x16x4 b) const
Element-wise maximum.
static FASTLED_FORCE_INLINE s16x16x4 load(const s16x16 *ptr)
static FASTLED_FORCE_INLINE s16x16x4 set1(s16x16 value)
FASTLED_FORCE_INLINE s16x16x4 lerp(s16x16x4 b, s16x16 t) const
Linear interpolation: a + (b - a) * t (using Q16 multiply) t: s16x16 interpolation factor in [0,...
FASTLED_FORCE_INLINE s16x16x4 operator+(s16x16x4 b) const
4-wide s16x16 vector (general fixed-point) Backed by 128-bit SIMD register (4× i32 in Q16 format)