FastLED 3.9.15
Loading...
Searching...
No Matches
fl::fl Namespace Reference

Namespaces

namespace  detail
 
namespace  int_cast_detail
 
namespace  make_unsigned_detail
 
namespace  simd
 

Classes

struct  add_pointer
 
struct  add_pointer< T & >
 
struct  add_pointer< T && >
 
struct  add_rvalue_reference
 
struct  add_rvalue_reference< T & >
 
class  aligned_ptr
 
struct  alignment_of
 
struct  callable_traits
 
struct  callable_traits< R(*)(Args...)>
 
struct  callable_traits< R(Args...)>
 
struct  callable_traits< R(C::*)(Args...) const >
 
struct  callable_traits< R(C::*)(Args...)>
 
struct  callable_traits< T, typename enable_if< is_member_function_pointer< decltype(&T::operator())>::value >::type >
 
struct  choose_by_rank
 
struct  choose_by_signedness
 
struct  choose_by_size
 
struct  common_type
 
struct  common_type_impl
 
struct  common_type_impl< double, float >
 
struct  common_type_impl< double, long double >
 
struct  common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >
 
struct  common_type_impl< float, double >
 
struct  common_type_impl< float, long double >
 
struct  common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >
 
struct  common_type_impl< i8, u8, void >
 
struct  common_type_impl< long double, double >
 
struct  common_type_impl< long double, float >
 
struct  common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >
 
struct  common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >
 
struct  common_type_impl< T, T >
 
struct  common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >
 
struct  common_type_impl< u8, i8, void >
 
struct  conditional
 
struct  conditional< false, T, F >
 
struct  contains_type
 
struct  contains_type< T >
 
struct  contains_type< T, U, Rest... >
 
struct  decay
 
struct  enable_if
 
struct  enable_if< true, T >
 
struct  has_member_swap
 
struct  identity
 
struct  index_sequence
 
struct  integer_promotion_impl
 
struct  integral_constant
 
struct  is_arithmetic
 
struct  is_arithmetic< const T >
 
struct  is_arithmetic< T & >
 
struct  is_arithmetic< volatile T >
 
struct  is_array
 
struct  is_array< T[]>
 
struct  is_array< T[N]>
 
struct  is_base_of
 
struct  is_base_of_v_helper
 
struct  is_char_type
 
struct  is_char_type< char >
 
struct  is_char_type< const T >
 
struct  is_char_type< signed char >
 
struct  is_char_type< T & >
 
struct  is_char_type< unsigned char >
 
struct  is_char_type< volatile T >
 
struct  is_const
 
struct  is_const< const T >
 
struct  is_enum
 
struct  is_fixed_point
 
struct  is_floating_point
 
struct  is_floating_point< const T >
 
struct  is_floating_point< double >
 
struct  is_floating_point< float >
 
struct  is_floating_point< long double >
 
struct  is_floating_point< T & >
 
struct  is_floating_point< volatile T >
 
struct  is_function
 
struct  is_function< Ret(Args...) const >
 
struct  is_function< Ret(Args...) const volatile >
 
struct  is_function< Ret(Args...) volatile >
 
struct  is_function< Ret(Args...)>
 
struct  is_integral
 
struct  is_integral< bool >
 
struct  is_integral< char >
 
struct  is_integral< const T >
 
struct  is_integral< int >
 
struct  is_integral< long >
 
struct  is_integral< long long >
 
struct  is_integral< short >
 
struct  is_integral< signed char >
 
struct  is_integral< T & >
 
struct  is_integral< unsigned char >
 
struct  is_integral< unsigned int >
 
struct  is_integral< unsigned long >
 
struct  is_integral< unsigned long long >
 
struct  is_integral< unsigned short >
 
struct  is_integral< volatile T >
 
struct  is_lvalue_reference
 
struct  is_lvalue_reference< T & >
 
struct  is_member_function_pointer
 
struct  is_member_function_pointer< Ret(C::*)(A...) const >
 
struct  is_member_function_pointer< Ret(C::*)(A...)>
 
struct  is_multi_byte_integer
 
struct  is_pod
 
struct  is_pod< bool >
 
struct  is_pod< char >
 
struct  is_pod< double >
 
struct  is_pod< float >
 
struct  is_pod< int >
 
struct  is_pod< long >
 
struct  is_pod< long double >
 
struct  is_pod< long long >
 
struct  is_pod< short >
 
struct  is_pod< signed char >
 
struct  is_pod< unsigned char >
 
struct  is_pod< unsigned int >
 
struct  is_pod< unsigned long >
 
struct  is_pod< unsigned long long >
 
struct  is_pod< unsigned short >
 
struct  is_pod_v_helper
 
struct  is_pointer
 
struct  is_pointer< T * >
 
struct  is_pointer< T *const >
 
struct  is_pointer< T *const volatile >
 
struct  is_pointer< T *volatile >
 
struct  is_reference
 
struct  is_rvalue_reference
 
struct  is_rvalue_reference< T && >
 
struct  is_same
 
struct  is_same< T, T >
 
struct  is_same_v_helper
 
struct  is_signed
 
struct  is_signed< char >
 
struct  is_signed< const T >
 
struct  is_signed< const volatile T >
 
struct  is_signed< double >
 
struct  is_signed< float >
 
struct  is_signed< int >
 
struct  is_signed< long >
 
struct  is_signed< long double >
 
struct  is_signed< long long >
 
struct  is_signed< short >
 
struct  is_signed< signed char >
 
struct  is_signed< volatile T >
 
struct  is_trivially_copyable
 
struct  is_trivially_copyable_v_helper
 
struct  is_void
 
struct  is_void< void >
 
struct  make_index_sequence_impl
 
struct  make_index_sequence_impl< 0, Is... >
 
struct  make_unsigned
 
struct  make_unsigned< T, typename enable_if< is_integral< T >::value &&!is_same< typename remove_cv< T >::type, bool >::value >::type >
 
struct  max_align
 
struct  max_align< T, Rest... >
 
struct  max_align<>
 
struct  max_align_selector
 
struct  max_align_selector< false >
 
struct  max_size
 
struct  max_size< T, Rest... >
 
struct  max_size<>
 
struct  remove_const
 
struct  remove_const< const T >
 
struct  remove_cv
 
struct  remove_cv< const T >
 
struct  remove_cv< const volatile T >
 
struct  remove_cv< volatile T >
 
struct  remove_extent
 
struct  remove_extent< T[]>
 
struct  remove_extent< T[N]>
 
struct  remove_pointer
 
struct  remove_pointer< T * >
 
struct  remove_pointer< T *const >
 
struct  remove_pointer< T *const volatile >
 
struct  remove_pointer< T *volatile >
 
struct  remove_reference
 
struct  remove_reference< T & >
 
struct  remove_reference< T && >
 
class  s0x32
 
struct  s0x32x4
 4-wide s0x32 vector (normalized values [-1, 1]) Backed by 128-bit SIMD register (4× i32 in Q31 format) More...
 
struct  static_assert_failure
 
struct  static_assert_failure< true >
 
struct  swap_impl
 
struct  swap_impl< T, false >
 
struct  swap_impl< T, true >
 
struct  type_rank
 
struct  type_rank< bool >
 
struct  type_rank< char >
 
struct  type_rank< double >
 
struct  type_rank< float >
 
struct  type_rank< int >
 
struct  type_rank< long >
 
struct  type_rank< long double >
 
struct  type_rank< long long >
 
struct  type_rank< short >
 
struct  type_rank< signed char >
 
struct  type_rank< unsigned char >
 
struct  type_rank< unsigned int >
 
struct  type_rank< unsigned long >
 
struct  type_rank< unsigned long long >
 
struct  type_rank< unsigned short >
 
struct  underlying_type
 

Typedefs

typedef u16 accum124
 no direct ANSI counterpart. 12 bits int, 4 bits fraction
 
typedef u32 accum1616
 ANSI: signed _Accum. 16 bits int, 16 bits fraction.
 
typedef u16 accum88
 ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction.
 
template<typename T>
using add_pointer_t = typename add_pointer<T>::type
 
template<bool B>
using bool_constant = integral_constant<bool, B>
 
template<typename T, typename U>
using common_type_t = typename common_type<T, U>::type
 
template<bool B, typename T, typename F>
using conditional_t = typename conditional<B, T, F>::type
 
template<typename T>
using decay_t = typename decay<T>::type
 
template<bool Condition, typename T = void>
using enable_if_t = typename enable_if<Condition, T>::type
 
using false_type = integral_constant<bool, false>
 
typedef u16 fract16
 ANSI: unsigned _Fract.
 
typedef u32 fract32
 ANSI: unsigned long _Fract. 32 bits int, 32 bits fraction.
 
typedef u8 fract8
 Fixed-Point Fractional Types.
 
typedef signed char i8
 
template<typename Base, typename Derived>
using is_derived = enable_if_t<is_base_of<Base, Derived>::value>
 
template<fl::size N>
using make_index_sequence = typename make_index_sequence_impl<N>::type
 
typedef max_align_selector<(sizeof(longdouble)>sizeof(double))>::type max_align_t
 
typedef decltype(nullptr) nullptr_t
 
typedef long ptrdiff_t
 
template<typename T>
using remove_cv_t = typename remove_cv<T>::type
 
template<typename T>
using remove_pointer_t = typename remove_pointer<T>::type
 
template<typename T>
using remove_reference_t = typename remove_reference<T>::type
 
typedef i32 saccum114
 no direct ANSI counterpart. 1 bit int, 14 bits fraction
 
typedef i32 saccum1516
 ANSI: signed _Accum. 15 bits int, 16 bits fraction.
 
typedef i16 saccum78
 ANSI: signed short _Accum. 7 bits int, 8 bits fraction.
 
typedef i16 sfract15
 ANSI: signed _Fract.
 
typedef i32 sfract31
 ANSI: signed long _Fract. 31 bits int, 1 bit fraction.
 
typedef i8 sfract7
 ANSI: signed short _Fract.
 
typedef __SIZE_TYPE__ size_t
 
using true_type = integral_constant<bool, true>
 
typedef unsigned char u8
 
typedef unsigned int uint
 
template<typename T>
using underlying_type_t = typename underlying_type<T>::type
 

Functions

template<fl::size_t N, typename T>
const T * assume_aligned (const T *ptr) FL_NOEXCEPT
 
template<fl::size_t N, typename T>
T * assume_aligned (T *ptr) FL_NOEXCEPT
 
template<typename T>
add_rvalue_reference< T >::type declval () FL_NOEXCEPT
 
template<typename T>
constexpr T && forward (typename remove_reference< T >::type &&t) FL_NOEXCEPT
 
template<typename T>
constexpr T && forward (typename remove_reference< T >::type &t) FL_NOEXCEPT
 
template<typename T>
constexpr remove_reference< T >::type && move (T &&t) FL_NOEXCEPT
 
template<typename T>
void swap (T &a, T &b) FL_NOEXCEPT
 
template<typename T>
void swap_by_copy (T &a, T &b) FL_NOEXCEPT
 
Class Members
typedef T * type T *

◆ fl::fl::add_pointer< T & >

struct fl::fl::add_pointer< T & >
+ Inheritance diagram for fl::fl::add_pointer< T & >:
+ Collaboration diagram for fl::fl::add_pointer< T & >:
Class Members
typedef T * type
typedef T * type T *

◆ fl::fl::add_pointer< T && >

struct fl::fl::add_pointer< T && >
+ Inheritance diagram for fl::fl::add_pointer< T && >:
+ Collaboration diagram for fl::fl::add_pointer< T && >:
Class Members
typedef T * type
typedef T * type T *

◆ fl::fl::add_rvalue_reference

struct fl::fl::add_rvalue_reference
+ Inheritance diagram for fl::fl::add_rvalue_reference< T >:
Class Members
typedef T && type T&&

◆ fl::fl::add_rvalue_reference< T & >

struct fl::fl::add_rvalue_reference< T & >
+ Inheritance diagram for fl::fl::add_rvalue_reference< T & >:
+ Collaboration diagram for fl::fl::add_rvalue_reference< T & >:
Class Members
typedef T && type
typedef T & type T&

◆ fl::fl::callable_traits

struct fl::fl::callable_traits
+ Inheritance diagram for fl::fl::callable_traits< T, typename >:

◆ fl::fl::choose_by_rank

struct fl::fl::choose_by_rank
Class Members
typedef typename value > value), T, typename value > value), U, void >::type >::type type

◆ fl::fl::choose_by_size

struct fl::fl::choose_by_size
Class Members
typedef typename conditional<(sizeof(T) > sizeof(U)), T, typename conditional<(sizeof(U) > sizeof(T)), U, void >::type >::type type

◆ fl::fl::common_type

struct fl::fl::common_type
Class Members
typedef typename type type typename common_type_impl<T, U>::type

◆ fl::fl::common_type_impl

struct fl::fl::common_type_impl
+ Inheritance diagram for fl::fl::common_type_impl< T, U, typename >:
Class Members
typedef T type T

◆ fl::fl::common_type_impl< double, float >

struct fl::fl::common_type_impl< double, float >
+ Inheritance diagram for fl::fl::common_type_impl< double, float >:
+ Collaboration diagram for fl::fl::common_type_impl< double, float >:
Class Members
typedef double type
typedef double type double

◆ fl::fl::common_type_impl< double, long double >

struct fl::fl::common_type_impl< double, long double >
+ Inheritance diagram for fl::fl::common_type_impl< double, long double >:
+ Collaboration diagram for fl::fl::common_type_impl< double, long double >:
Class Members
typedef double type
typedef long double type long double

◆ fl::fl::common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >

struct fl::fl::common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >
+ Inheritance diagram for fl::fl::common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >:
+ Collaboration diagram for fl::fl::common_type_impl< double, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >:
Class Members
typedef double type
typedef double type double

◆ fl::fl::common_type_impl< float, double >

struct fl::fl::common_type_impl< float, double >
+ Inheritance diagram for fl::fl::common_type_impl< float, double >:
+ Collaboration diagram for fl::fl::common_type_impl< float, double >:
Class Members
typedef float type
typedef double type double

◆ fl::fl::common_type_impl< float, long double >

struct fl::fl::common_type_impl< float, long double >
+ Inheritance diagram for fl::fl::common_type_impl< float, long double >:
+ Collaboration diagram for fl::fl::common_type_impl< float, long double >:
Class Members
typedef float type
typedef long double type long double

◆ fl::fl::common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >

struct fl::fl::common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >
+ Inheritance diagram for fl::fl::common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >:
+ Collaboration diagram for fl::fl::common_type_impl< float, T, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >:
Class Members
typedef float type
typedef float type float

◆ fl::fl::common_type_impl< i8, u8, void >

struct fl::fl::common_type_impl< i8, u8, void >
+ Inheritance diagram for fl::fl::common_type_impl< i8, u8, void >:
+ Collaboration diagram for fl::fl::common_type_impl< i8, u8, void >:
Class Members
typedef i8 type

◆ fl::fl::common_type_impl< long double, double >

struct fl::fl::common_type_impl< long double, double >
+ Inheritance diagram for fl::fl::common_type_impl< long double, double >:
+ Collaboration diagram for fl::fl::common_type_impl< long double, double >:
Class Members
typedef long double type
typedef long double type long double

◆ fl::fl::common_type_impl< long double, float >

struct fl::fl::common_type_impl< long double, float >
+ Inheritance diagram for fl::fl::common_type_impl< long double, float >:
+ Collaboration diagram for fl::fl::common_type_impl< long double, float >:
Class Members
typedef long double type
typedef long double type long double

◆ fl::fl::common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >

struct fl::fl::common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >
+ Inheritance diagram for fl::fl::common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >:
+ Collaboration diagram for fl::fl::common_type_impl< T, double, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, double >::value >::type >:
Class Members
typedef T type
typedef double type double

◆ fl::fl::common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >

struct fl::fl::common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >
+ Inheritance diagram for fl::fl::common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >:
+ Collaboration diagram for fl::fl::common_type_impl< T, float, typename enable_if<(is_integral< T >::value||is_floating_point< T >::value) &&!is_same< T, float >::value >::type >:
Class Members
typedef T type
typedef float type float

◆ fl::fl::common_type_impl< T, T >

struct fl::fl::common_type_impl< T, T >
+ Inheritance diagram for fl::fl::common_type_impl< T, T >:
+ Collaboration diagram for fl::fl::common_type_impl< T, T >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >

struct fl::fl::common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >
+ Inheritance diagram for fl::fl::common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >:
+ Collaboration diagram for fl::fl::common_type_impl< T, U, typename enable_if< is_integral< T >::value &&is_integral< U >::value &&!is_same< T, U >::value &&!((is_same< T, i8 >::value &&is_same< U, u8 >::value)||(is_same< T, u8 >::value &&is_same< U, i8 >::value))>::type >:
Class Members
typedef T type
typedef typename type type typename integer_promotion_impl<T, U>::type

◆ fl::fl::common_type_impl< u8, i8, void >

struct fl::fl::common_type_impl< u8, i8, void >
+ Inheritance diagram for fl::fl::common_type_impl< u8, i8, void >:
+ Collaboration diagram for fl::fl::common_type_impl< u8, i8, void >:
Class Members
typedef u8 type

◆ fl::fl::conditional

struct fl::fl::conditional
+ Inheritance diagram for fl::fl::conditional< B, T, F >:
Class Members
typedef T type T

◆ fl::fl::conditional< false, T, F >

struct fl::fl::conditional< false, T, F >
+ Inheritance diagram for fl::fl::conditional< false, T, F >:
+ Collaboration diagram for fl::fl::conditional< false, T, F >:
Class Members
typedef T type
typedef F type F

◆ fl::fl::contains_type

struct fl::fl::contains_type
+ Inheritance diagram for fl::fl::contains_type< T, Types >:

◆ fl::fl::enable_if

struct fl::fl::enable_if
+ Inheritance diagram for fl::fl::enable_if< Condition, T >:

◆ fl::fl::enable_if< true, T >

struct fl::fl::enable_if< true, T >
+ Inheritance diagram for fl::fl::enable_if< true, T >:
+ Collaboration diagram for fl::fl::enable_if< true, T >:
Class Members
typedef T type T

◆ fl::fl::identity

struct fl::fl::identity
Class Members
typedef T type T

◆ fl::fl::make_index_sequence_impl

struct fl::fl::make_index_sequence_impl
+ Inheritance diagram for fl::fl::make_index_sequence_impl< N, Is >:

◆ fl::fl::make_index_sequence_impl< 0, Is... >

struct fl::fl::make_index_sequence_impl< 0, Is... >
+ Inheritance diagram for fl::fl::make_index_sequence_impl< 0, Is... >:
+ Collaboration diagram for fl::fl::make_index_sequence_impl< 0, Is... >:
Class Members
typedef index_sequence< Is... > type index_sequence<Is...>

◆ fl::fl::max_align

struct fl::fl::max_align
+ Inheritance diagram for fl::fl::max_align< Types >:

◆ fl::fl::max_align_selector

struct fl::fl::max_align_selector
+ Inheritance diagram for fl::fl::max_align_selector< UseLD >:
Class Members
typedef max_align_with_ld type

◆ fl::fl::max_align_selector< false >

struct fl::fl::max_align_selector< false >
+ Inheritance diagram for fl::fl::max_align_selector< false >:
+ Collaboration diagram for fl::fl::max_align_selector< false >:
Class Members
typedef max_align_with_ld type
typedef max_align_without_ld type

◆ fl::fl::max_size

struct fl::fl::max_size
+ Inheritance diagram for fl::fl::max_size< Types >:

◆ fl::fl::remove_const

struct fl::fl::remove_const
+ Inheritance diagram for fl::fl::remove_const< T >:
Class Members
typedef T type T

◆ fl::fl::remove_const< const T >

struct fl::fl::remove_const< const T >
+ Inheritance diagram for fl::fl::remove_const< const T >:
+ Collaboration diagram for fl::fl::remove_const< const T >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_cv

struct fl::fl::remove_cv
+ Inheritance diagram for fl::fl::remove_cv< T >:
Class Members
typedef T type T

◆ fl::fl::remove_cv< const T >

struct fl::fl::remove_cv< const T >
+ Inheritance diagram for fl::fl::remove_cv< const T >:
+ Collaboration diagram for fl::fl::remove_cv< const T >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_cv< const volatile T >

struct fl::fl::remove_cv< const volatile T >
+ Inheritance diagram for fl::fl::remove_cv< const volatile T >:
+ Collaboration diagram for fl::fl::remove_cv< const volatile T >:
Class Members
typedef const volatile T type
typedef T type T

◆ fl::fl::remove_cv< volatile T >

struct fl::fl::remove_cv< volatile T >
+ Inheritance diagram for fl::fl::remove_cv< volatile T >:
+ Collaboration diagram for fl::fl::remove_cv< volatile T >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_extent

struct fl::fl::remove_extent
+ Inheritance diagram for fl::fl::remove_extent< T >:
Class Members
typedef T type T

◆ fl::fl::remove_extent< T[]>

struct fl::fl::remove_extent< T[]>
+ Inheritance diagram for fl::fl::remove_extent< T[]>:
+ Collaboration diagram for fl::fl::remove_extent< T[]>:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_extent< T[N]>

struct fl::fl::remove_extent< T[N]>
+ Inheritance diagram for fl::fl::remove_extent< T[N]>:
+ Collaboration diagram for fl::fl::remove_extent< T[N]>:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_pointer

struct fl::fl::remove_pointer
+ Inheritance diagram for fl::fl::remove_pointer< T >:
Class Members
typedef T type T

◆ fl::fl::remove_pointer< T * >

struct fl::fl::remove_pointer< T * >
+ Inheritance diagram for fl::fl::remove_pointer< T * >:
+ Collaboration diagram for fl::fl::remove_pointer< T * >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_pointer< T *const >

struct fl::fl::remove_pointer< T *const >
+ Inheritance diagram for fl::fl::remove_pointer< T *const >:
+ Collaboration diagram for fl::fl::remove_pointer< T *const >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_pointer< T *const volatile >

struct fl::fl::remove_pointer< T *const volatile >
+ Inheritance diagram for fl::fl::remove_pointer< T *const volatile >:
+ Collaboration diagram for fl::fl::remove_pointer< T *const volatile >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_pointer< T *volatile >

struct fl::fl::remove_pointer< T *volatile >
+ Inheritance diagram for fl::fl::remove_pointer< T *volatile >:
+ Collaboration diagram for fl::fl::remove_pointer< T *volatile >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_reference

struct fl::fl::remove_reference
+ Inheritance diagram for fl::fl::remove_reference< T >:
Class Members
typedef T type T

◆ fl::fl::remove_reference< T & >

struct fl::fl::remove_reference< T & >
+ Inheritance diagram for fl::fl::remove_reference< T & >:
+ Collaboration diagram for fl::fl::remove_reference< T & >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::remove_reference< T && >

struct fl::fl::remove_reference< T && >
+ Inheritance diagram for fl::fl::remove_reference< T && >:
+ Collaboration diagram for fl::fl::remove_reference< T && >:
Class Members
typedef T type
typedef T type T

◆ fl::fl::static_assert_failure

struct fl::fl::static_assert_failure
+ Inheritance diagram for fl::fl::static_assert_failure< bool >:

◆ fl::fl::static_assert_failure< true >

struct fl::fl::static_assert_failure< true >
+ Inheritance diagram for fl::fl::static_assert_failure< true >:
+ Collaboration diagram for fl::fl::static_assert_failure< true >:

◆ fl::fl::swap_impl

struct fl::fl::swap_impl
+ Inheritance diagram for fl::fl::swap_impl< T, bool >:

◆ fl::fl::underlying_type

struct fl::fl::underlying_type
Class Members
typedef int type int

Typedef Documentation

◆ accum124

typedef u16 fl::fl::accum124

no direct ANSI counterpart. 12 bits int, 4 bits fraction

Definition at line 186 of file s16x16x4.h.

◆ accum1616

typedef u32 fl::fl::accum1616

ANSI: signed _Accum. 16 bits int, 16 bits fraction.

Definition at line 184 of file s16x16x4.h.

◆ accum88

typedef u16 fl::fl::accum88

ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction.

Definition at line 182 of file s16x16x4.h.

◆ add_pointer_t

template<typename T>
using fl::fl::add_pointer_t = typename add_pointer<T>::type

Definition at line 180 of file s16x16x4.h.

◆ bool_constant

template<bool B>
using fl::fl::bool_constant = integral_constant<bool, B>

Definition at line 32 of file s16x16x4.h.

◆ common_type_t

template<typename T, typename U>
using fl::fl::common_type_t = typename common_type<T, U>::type

Definition at line 818 of file s16x16x4.h.

◆ conditional_t

template<bool B, typename T, typename F>
using fl::fl::conditional_t = typename conditional<B, T, F>::type

Definition at line 115 of file s16x16x4.h.

◆ decay_t

template<typename T>
using fl::fl::decay_t = typename decay<T>::type

Definition at line 322 of file s16x16x4.h.

◆ enable_if_t

template<bool Condition, typename T = void>
using fl::fl::enable_if_t = typename enable_if<Condition, T>::type

Definition at line 66 of file s16x16x4.h.

◆ false_type

using fl::fl::false_type = integral_constant<bool, false>

Definition at line 28 of file s16x16x4.h.

◆ fract16

typedef u16 fl::fl::fract16

ANSI: unsigned _Fract.

Range is 0 to 0.99998474121 in steps of 0.00001525878. Should be interpreted as unsigned 65536ths.

Definition at line 171 of file s16x16x4.h.

◆ fract32

typedef u32 fl::fl::fract32

ANSI: unsigned long _Fract. 32 bits int, 32 bits fraction.

Definition at line 175 of file s16x16x4.h.

◆ fract8

typedef u8 fl::fl::fract8

Fixed-Point Fractional Types.

Types for storing fractional data.

Example: if a fract8 has the value "64", that should be interpreted as 64/256ths, or one-quarter.

accumXY types should be interpreted as X bits of integer, and Y bits of fraction. E.g., accum88 has 8 bits of int, 8 bits of fraction ANSI: unsigned short _Fract. Range is 0 to 0.99609375 in steps of 0.00390625. Should be interpreted as unsigned 256ths.

Definition at line 161 of file s16x16x4.h.

◆ i8

typedef signed char fl::fl::i8

Definition at line 131 of file s16x16x4.h.

◆ is_derived

template<typename Base, typename Derived>
using fl::fl::is_derived = enable_if_t<is_base_of<Base, Derived>::value>

Definition at line 834 of file s16x16x4.h.

◆ make_index_sequence

template<fl::size N>
using fl::fl::make_index_sequence = typename make_index_sequence_impl<N>::type

Definition at line 1168 of file s16x16x4.h.

◆ max_align_t

typedef max_align_selector<(sizeof(longdouble)>sizeof(double))>::type fl::fl::max_align_t

Definition at line 56 of file s16x16x4.h.

◆ nullptr_t

typedef decltype(nullptr) fl::fl::nullptr_t

Definition at line 13 of file s16x16x4.h.

◆ ptrdiff_t

typedef long fl::fl::ptrdiff_t

Definition at line 22 of file s16x16x4.h.

◆ remove_cv_t

template<typename T>
using fl::fl::remove_cv_t = typename remove_cv<T>::type

Definition at line 263 of file s16x16x4.h.

◆ remove_pointer_t

template<typename T>
using fl::fl::remove_pointer_t = typename remove_pointer<T>::type

Definition at line 307 of file s16x16x4.h.

◆ remove_reference_t

template<typename T>
using fl::fl::remove_reference_t = typename remove_reference<T>::type

Definition at line 24 of file s16x16x4.h.

◆ saccum114

typedef i32 fl::fl::saccum114

no direct ANSI counterpart. 1 bit int, 14 bits fraction

Definition at line 187 of file s16x16x4.h.

◆ saccum1516

typedef i32 fl::fl::saccum1516

ANSI: signed _Accum. 15 bits int, 16 bits fraction.

Definition at line 185 of file s16x16x4.h.

◆ saccum78

typedef i16 fl::fl::saccum78

ANSI: signed short _Accum. 7 bits int, 8 bits fraction.

Definition at line 183 of file s16x16x4.h.

◆ sfract15

typedef i16 fl::fl::sfract15

ANSI: signed _Fract.

Range is -0.99996948242 to 0.99996948242 in steps of 0.00003051757. Should be interpreted as signed 32768ths.

Definition at line 180 of file s16x16x4.h.

◆ sfract31

typedef i32 fl::fl::sfract31

ANSI: signed long _Fract. 31 bits int, 1 bit fraction.

Definition at line 173 of file s16x16x4.h.

◆ sfract7

typedef i8 fl::fl::sfract7

ANSI: signed short _Fract.

Range is -0.9921875 to 0.9921875 in steps of 0.0078125. Should be interpreted as signed 128ths.

Definition at line 166 of file s16x16x4.h.

◆ size_t

typedef __SIZE_TYPE__ fl::fl::size_t

Definition at line 16 of file s16x16x4.h.

◆ true_type

using fl::fl::true_type = integral_constant<bool, true>

Definition at line 27 of file s16x16x4.h.

◆ u8

typedef unsigned char fl::fl::u8

Definition at line 132 of file s16x16x4.h.

◆ uint

typedef unsigned int fl::fl::uint

Definition at line 133 of file s16x16x4.h.

◆ underlying_type_t

template<typename T>
using fl::fl::underlying_type_t = typename underlying_type<T>::type

Definition at line 1008 of file s16x16x4.h.

Function Documentation

◆ assume_aligned() [1/2]

template<fl::size_t N, typename T>
const T * fl::fl::assume_aligned ( const T * ptr)
inline

Definition at line 142 of file s16x16x4.h.

◆ assume_aligned() [2/2]

template<fl::size_t N, typename T>
T * fl::fl::assume_aligned ( T * ptr)
inline

Definition at line 126 of file s16x16x4.h.

131 {
132 s16x16x4 sin_out, cos_out;
133 sincos(sin_out, cos_out);
134 return sin_out;
135 }
136
139 s16x16x4 sin_out, cos_out;
enable_if< is_fixed_point< T >::value, void >::type sincos(T angle, T &out_sin, T &out_cos) FL_NOEXCEPT
enable_if< is_fixed_point< T >::value, T >::type cos(T angle) FL_NOEXCEPT
#define FASTLED_FORCE_INLINE
4-wide s16x16 vector (general fixed-point) Backed by 128-bit SIMD register (4× i32 in Q16 format)
Definition s16x16x4.h:19

Referenced by fl::Big_Caleido_FP::draw(), fl::Caleido1_FP::draw(), fl::Caleido2_FP::draw(), fl::Caleido3_FP::draw(), fl::Center_Field_FP::draw(), fl::Complex_Kaleido_2_FP::draw(), fl::Complex_Kaleido_3_FP::draw(), fl::Complex_Kaleido_4_FP::draw(), fl::Complex_Kaleido_5_FP::draw(), fl::Complex_Kaleido_6_FP::draw(), fl::Complex_Kaleido_FP::draw(), fl::Distance_Experiment_FP::draw(), fl::Fluffy_Blobs_FP::draw(), fl::Hot_Blob_FP::draw(), fl::Lava1_FP::draw(), fl::Module_Experiment10_FP::draw(), fl::Module_Experiment1_FP::draw(), fl::Module_Experiment2_FP::draw(), fl::Module_Experiment3_FP::draw(), fl::Module_Experiment4_FP::draw(), fl::Module_Experiment5_FP::draw(), fl::Module_Experiment6_FP::draw(), fl::Module_Experiment7_FP::draw(), fl::Module_Experiment8_FP::draw(), fl::Module_Experiment9_FP::draw(), fl::Parametric_Water_FP::draw(), fl::Polar_Waves_FP::draw(), fl::RGB_Blobs2_FP::draw(), fl::RGB_Blobs3_FP::draw(), fl::RGB_Blobs4_FP::draw(), fl::RGB_Blobs5_FP::draw(), fl::RGB_Blobs_FP::draw(), fl::Rings_FP::draw(), fl::Rotating_Blob_FP::draw(), fl::Scaledemo1_FP::draw(), fl::Slow_Fade_FP::draw(), fl::SpiralMatrix10_FP::draw(), fl::SpiralMatrix1_FP::draw(), fl::SpiralMatrix2_FP::draw(), fl::SpiralMatrix3_FP::draw(), fl::SpiralMatrix4_FP::draw(), fl::SpiralMatrix5_FP::draw(), fl::SpiralMatrix6_FP::draw(), fl::SpiralMatrix8_FP::draw(), fl::SpiralMatrix9_FP::draw(), fl::Spiralus2_FP::draw(), fl::Spiralus_FP::draw(), fl::Water_FP::draw(), fl::Waves_FP::draw(), fl::Yves_FP::draw(), fl::Zoom2_FP::draw(), fl::Zoom_FP::draw(), fl::anonymous_namespace{chasing_spirals.cpp.hpp}::loadAligned(), and fl::anonymous_namespace{chasing_spirals.cpp.hpp}::setupChasingSpiralFrame().

◆ declval()

template<typename T>
add_rvalue_reference< T >::type fl::fl::declval ( )

◆ forward() [1/2]

template<typename T>
T && fl::fl::forward ( typename remove_reference< T >::type && t)
constexpr

Definition at line 240 of file s16x16x4.h.

251 {
252
253// Forward declaration for cross-type operations
254struct s0x32x4;
255
258struct s16x16x4 {
259 simd::simd_u32x4 raw; // 4× i32 values in Q16 format
260
261 // ---- Construction ------------------------------------------------------
262
265 result.raw = r;
266 return result;
267 }
268
269 // Load 4 s16x16 values from memory (unaligned access supported)
270 static FASTLED_FORCE_INLINE s16x16x4 load(const s16x16* ptr) {
271 return from_raw(simd::platforms::load_u32_4(reinterpret_cast<const u32*>(ptr))); // ok reinterpret cast
272 }
273
274 // Store 4 s16x16 values to memory (unaligned access supported)
275 FASTLED_FORCE_INLINE void store(s16x16* ptr) const {
276 simd::platforms::store_u32_4(reinterpret_cast<u32*>(ptr), raw); // ok reinterpret cast
277 }
278
279 // Broadcast single s16x16 value to all 4 lanes
280 static FASTLED_FORCE_INLINE s16x16x4 set1(s16x16 value) {
281 return from_raw(simd::platforms::set1_u32_4(static_cast<u32>(value.raw())));
282 }
283
284 // ---- SIMD arithmetic (s16x16x4 OP s16x16x4 → s16x16x4) -----------------
285
286 FASTLED_FORCE_INLINE s16x16x4 operator+(s16x16x4 b) const {
287 return from_raw(simd::add_i32_4(raw, b.raw));
288 }
289
290 FASTLED_FORCE_INLINE s16x16x4 operator-(s16x16x4 b) const {
291 return from_raw(simd::sub_i32_4(raw, b.raw));
292 }
293
294 FASTLED_FORCE_INLINE s16x16x4 operator*(s16x16x4 b) const {
295 // Q16 × Q16 = Q32 → shift right 16 → Q16
296 return from_raw(simd::mulhi_i32_4(raw, b.raw));
297 }
298
299 FASTLED_FORCE_INLINE s16x16x4 operator-() const {
300 // Unary negation: -x = 0 - x
301 auto zero = simd::set1_u32_4(0);
302 return from_raw(simd::sub_i32_4(zero, raw));
303 }
304
305 FASTLED_FORCE_INLINE s16x16x4 operator>>(int shift) const {
306 return from_raw(simd::sra_i32_4(raw, shift));
307 }
308
309 FASTLED_FORCE_INLINE s16x16x4 operator<<(int shift) const {
310 return from_raw(simd::sll_u32_4(raw, shift));
311 }
312
313 // Cross-type multiply: s16x16x4 × s0x32x4 → s16x16x4 (commutative)
314 // Implemented after s0x32x4 is defined
315 FASTLED_FORCE_INLINE s16x16x4 operator*(s0x32x4 b) const;
316
317 // ---- Math functions -------------------------------------------------------
318
320 FASTLED_FORCE_INLINE s16x16x4 abs() const {
321 // mask = -1 if negative (sign extended), 0 if positive
322 auto mask = simd::sra_i32_4(raw, 31);
323 // flip bits if negative, then add 1 (two's complement)
324 auto flipped = simd::xor_u32_4(raw, mask);
325 return from_raw(simd::sub_i32_4(flipped, mask));
326 }
327
329 FASTLED_FORCE_INLINE s16x16x4 min(s16x16x4 b) const {
330 return from_raw(simd::min_i32_4(raw, b.raw));
331 }
332
334 FASTLED_FORCE_INLINE s16x16x4 max(s16x16x4 b) const {
335 return from_raw(simd::max_i32_4(raw, b.raw));
336 }
337
339 FASTLED_FORCE_INLINE s16x16x4 clamp(s16x16x4 lo, s16x16x4 hi) const {
340 return max(lo).min(hi);
341 }
342
345 FASTLED_FORCE_INLINE s16x16x4 lerp(s16x16x4 b, s16x16 t) const {
346 auto t_vec = s16x16x4::set1(t);
347 auto diff = b - (*this);
348 return (*this) + (diff * t_vec);
349 }
350
353 FASTLED_FORCE_INLINE void sincos(s16x16x4& out_sin, s16x16x4& out_cos) const {
354 // Convert radians to 24-bit angle units (same as scalar s16x16)
355 // RAD_TO_24 = 2^24 / (2π) in Q16
356 static constexpr i32 RAD_TO_24 = 2670177; // from s16x16.h
357
358 // Convert 4 angles: mulhi_i32_4 does (i64*i64) >> 16
359 auto angles_u32 = simd::mulhi_su32_4(raw, simd::set1_u32_4(static_cast<u32>(RAD_TO_24)));
360
361 // Call vectorized sincos
362 auto sc = sincos32_simd(angles_u32);
363
364 // Shift results right by 15 to convert from raw sin32 output to Q16.16
365 out_sin = from_raw(simd::sra_i32_4(sc.sin_vals, 15));
366 out_cos = from_raw(simd::sra_i32_4(sc.cos_vals, 15));
367 }
368
370 FASTLED_FORCE_INLINE s16x16x4 sin() const {
371 s16x16x4 sin_out, cos_out;
372 sincos(sin_out, cos_out);
373 return sin_out;
374 }
375
377 FASTLED_FORCE_INLINE s16x16x4 cos() const {
378 s16x16x4 sin_out, cos_out;
379 sincos(sin_out, cos_out);
380 return cos_out;
381 }
382};
383
384// Include simd_ops.h to implement cross-type operations
385// Must come after all types are defined
386#include "fl/math/fixed_point/simd_ops.h" // allow-include-after-namespace
387
388} // namespace fl
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
Memory functions are available in fl:: namespace via fl/stl/cstring.h Using declarations cannot work ...
Definition math.h:71
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
Definition math.h:75
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NOEXCEPT
static uint32_t t
Definition Luminova.h:55
FASTLED_FORCE_INLINE CRGB * operator+(const CRGBSet &pixels, int offset)
Retrieve a pointer to a CRGB array, using a CRGBSet and an LED offset.
Definition pixelset.h:488
platforms::simd_u32x4 simd_u32x4
Definition s16x16x4.h:27
ostream & operator<<(ostream &os, const hex_t &) FL_NOEXCEPT
FASTLED_FORCE_INLINE SinCos32_simd sincos32_simd(simd::simd_u32x4 angles) FL_NOEXCEPT
Process 4 angles simultaneously, returning vectorized sin/cos values SIMD-optimized: vectorized angle...
Definition sin32.h:145
FASTLED_FORCE_INLINE CRGB operator*(const CRGB &p1, u8 d) FL_NOEXCEPT
Multiply each of the channels by a constant, saturating each channel at 0xFF.
Definition crgb.hpp:198
FASTLED_FORCE_INLINE CRGB operator-(const CRGB &p1, const CRGB &p2) FL_NOEXCEPT
Subtract one CRGB from another, saturating at 0x00 for each channel.
Definition crgb.hpp:190
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
enable_if< is_fixed_point< T >::value, T >::type sin(T angle) FL_NOEXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NOEXCEPT
FASTLED_FORCE_INLINE float lerp(float t, float a, float b)
Cross-type SIMD fixed-point operations (implemented after all types are defined)
4-wide s0x32 vector (normalized values [-1, 1]) Backed by 128-bit SIMD register (4× i32 in Q31 format...
Definition s16x16x4.h:17

◆ forward() [2/2]

template<typename T>
T && fl::fl::forward ( typename remove_reference< T >::type & t)
constexpr

Definition at line 234 of file s16x16x4.h.

245 {
246
247// Forward declaration for cross-type operations
248struct s0x32x4;
249
252struct s16x16x4 {
253 simd::simd_u32x4 raw; // 4× i32 values in Q16 format
254
255 // ---- Construction ------------------------------------------------------
256
259 result.raw = r;
260 return result;
261 }
262
263 // Load 4 s16x16 values from memory (unaligned access supported)
264 static FASTLED_FORCE_INLINE s16x16x4 load(const s16x16* ptr) {
265 return from_raw(simd::platforms::load_u32_4(reinterpret_cast<const u32*>(ptr))); // ok reinterpret cast
266 }
267
268 // Store 4 s16x16 values to memory (unaligned access supported)
269 FASTLED_FORCE_INLINE void store(s16x16* ptr) const {
270 simd::platforms::store_u32_4(reinterpret_cast<u32*>(ptr), raw); // ok reinterpret cast
271 }
272
273 // Broadcast single s16x16 value to all 4 lanes
274 static FASTLED_FORCE_INLINE s16x16x4 set1(s16x16 value) {
275 return from_raw(simd::platforms::set1_u32_4(static_cast<u32>(value.raw())));
276 }
277
278 // ---- SIMD arithmetic (s16x16x4 OP s16x16x4 → s16x16x4) -----------------
279
280 FASTLED_FORCE_INLINE s16x16x4 operator+(s16x16x4 b) const {
281 return from_raw(simd::add_i32_4(raw, b.raw));
282 }
283
284 FASTLED_FORCE_INLINE s16x16x4 operator-(s16x16x4 b) const {
285 return from_raw(simd::sub_i32_4(raw, b.raw));
286 }
287
288 FASTLED_FORCE_INLINE s16x16x4 operator*(s16x16x4 b) const {
289 // Q16 × Q16 = Q32 → shift right 16 → Q16
290 return from_raw(simd::mulhi_i32_4(raw, b.raw));
291 }
292
293 FASTLED_FORCE_INLINE s16x16x4 operator-() const {
294 // Unary negation: -x = 0 - x
295 auto zero = simd::set1_u32_4(0);
296 return from_raw(simd::sub_i32_4(zero, raw));
297 }
298
299 FASTLED_FORCE_INLINE s16x16x4 operator>>(int shift) const {
300 return from_raw(simd::sra_i32_4(raw, shift));
301 }
302
303 FASTLED_FORCE_INLINE s16x16x4 operator<<(int shift) const {
304 return from_raw(simd::sll_u32_4(raw, shift));
305 }
306
307 // Cross-type multiply: s16x16x4 × s0x32x4 → s16x16x4 (commutative)
308 // Implemented after s0x32x4 is defined
309 FASTLED_FORCE_INLINE s16x16x4 operator*(s0x32x4 b) const;
310
311 // ---- Math functions -------------------------------------------------------
312
314 FASTLED_FORCE_INLINE s16x16x4 abs() const {
315 // mask = -1 if negative (sign extended), 0 if positive
316 auto mask = simd::sra_i32_4(raw, 31);
317 // flip bits if negative, then add 1 (two's complement)
318 auto flipped = simd::xor_u32_4(raw, mask);
319 return from_raw(simd::sub_i32_4(flipped, mask));
320 }
321
323 FASTLED_FORCE_INLINE s16x16x4 min(s16x16x4 b) const {
324 return from_raw(simd::min_i32_4(raw, b.raw));
325 }
326
328 FASTLED_FORCE_INLINE s16x16x4 max(s16x16x4 b) const {
329 return from_raw(simd::max_i32_4(raw, b.raw));
330 }
331
333 FASTLED_FORCE_INLINE s16x16x4 clamp(s16x16x4 lo, s16x16x4 hi) const {
334 return max(lo).min(hi);
335 }
336
339 FASTLED_FORCE_INLINE s16x16x4 lerp(s16x16x4 b, s16x16 t) const {
340 auto t_vec = s16x16x4::set1(t);
341 auto diff = b - (*this);
342 return (*this) + (diff * t_vec);
343 }
344
347 FASTLED_FORCE_INLINE void sincos(s16x16x4& out_sin, s16x16x4& out_cos) const {
348 // Convert radians to 24-bit angle units (same as scalar s16x16)
349 // RAD_TO_24 = 2^24 / (2π) in Q16
350 static constexpr i32 RAD_TO_24 = 2670177; // from s16x16.h
351
352 // Convert 4 angles: mulhi_i32_4 does (i64*i64) >> 16
353 auto angles_u32 = simd::mulhi_su32_4(raw, simd::set1_u32_4(static_cast<u32>(RAD_TO_24)));
354
355 // Call vectorized sincos
356 auto sc = sincos32_simd(angles_u32);
357
358 // Shift results right by 15 to convert from raw sin32 output to Q16.16
359 out_sin = from_raw(simd::sra_i32_4(sc.sin_vals, 15));
360 out_cos = from_raw(simd::sra_i32_4(sc.cos_vals, 15));
361 }
362
364 FASTLED_FORCE_INLINE s16x16x4 sin() const {
365 s16x16x4 sin_out, cos_out;
366 sincos(sin_out, cos_out);
367 return sin_out;
368 }
369
371 FASTLED_FORCE_INLINE s16x16x4 cos() const {
372 s16x16x4 sin_out, cos_out;
373 sincos(sin_out, cos_out);
374 return cos_out;
375 }
376};
377
378// Include simd_ops.h to implement cross-type operations
379// Must come after all types are defined
380#include "fl/math/fixed_point/simd_ops.h" // allow-include-after-namespace
381
382} // namespace fl

Referenced by fl::pair< vec2< u16 >, u8 >::pair(), fl::tuple< Head, Tail... >::tuple(), fl::shared_ptr< filebuf >::allocate_shared, fl::allocator< U >::construct(), fl::allocator_inlined< U, N, typename BaseAllocator::template rebind< U >::other >::construct(), fl::allocator_psram< U >::construct(), fl::allocator_realloc< U >::construct(), fl::allocator_slab< T, SLAB_SIZE >::construct(), fl::deque< int >::emplace(), fl::flat_map< int, FxPtr >::emplace(), fl::flat_set< Key, Less >::emplace(), fl::iterator<, u8 >::emplace(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::emplace(), fl::MultiMapTree< Key, T, Compare, fl::allocator_slab< char > >::emplace(), fl::MultiSetTree< Key, Compare, fl::allocator_slab< char > >::emplace(), fl::Optional< T >::emplace(), fl::priority_queue_stable< T, Compare >::emplace(), fl::PriorityQueue< T, Compare, VectorT >::emplace(), fl::queue< T, Container >::emplace(), fl::RedBlackTree< value_type, PairCompare, Allocator >::emplace(), fl::set< T, fl::allocator_inlined_slab< T, N > >::emplace(), fl::SetRedBlackTree< Key, fl::less< Key >, Allocator >::emplace(), fl::unordered_map_small< Key, Value, Equal >::emplace(), fl::unordered_set< Key, Hash, KeyEqual >::emplace(), fl::VectorSet< Key >::emplace(), fl::VectorSetFixed< Key, N >::emplace(), fl::circular_buffer< T, N >::emplace_back(), fl::circular_buffer_core< T >::emplace_back(), fl::deque< int >::emplace_back(), fl::FixedVector< fl::u32, kMaxBatchSize >::emplace_back(), fl::list< T >::emplace_back(), fl::vector< fl::i16 >::emplace_back(), fl::circular_buffer< T, N >::emplace_front(), fl::circular_buffer_core< T >::emplace_front(), fl::deque< int >::emplace_front(), fl::list< T >::emplace_front(), fl::flat_map< int, FxPtr >::emplace_hint(), fl::flat_set< Key, Less >::emplace_hint(), fl::iterator<, u8 >::emplace_hint(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::emplace_hint(), fl::FL_ALIGN_AS_T(), fl::Optional< T && >::get(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::insert_or_assign(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::insert_or_assign(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::insert_or_assign(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::insert_or_assign(), fl::RedBlackTree< value_type, PairCompare, Allocator >::insertImpl(), fl::invoke(), fl::invoke(), fl::invoke(), fl::make_pair(), fl::make_scope_exit(), fl::shared_ptr< filebuf >::make_shared, fl::make_shared_ptr(), fl::shared_ptr< filebuf >::make_shared_with_deleter, fl::make_tuple(), fl::make_unique(), fl::BindResult< R(Args...)>::operator()(), fl::greater< void >::operator()(), fl::less< void >::operator()(), fl::RpcHandle< R(Args...)>::operator()(), fl::Optional< T && >::operator*(), fl::json_value::operator=(), fl::iterator<, u8 >::try_emplace(), fl::iterator<, u8 >::try_emplace(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::try_emplace(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::try_emplace(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::try_emplace(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::try_emplace(), fl::Optional< T && >::value(), fl::spi::MultiLaneDevice::write(), and fl::Spi::write().

◆ move()

template<typename T>
remove_reference< T >::type && fl::fl::move ( T && t)
constexpr

Definition at line 28 of file s16x16x4.h.

Referenced by fl::bitset_dynamic::bitset_dynamic(), fl::ChannelData::ChannelData(), fl::ChannelData::ChannelData(), fl::circular_buffer< T, N >::circular_buffer(), fl::deque< int >::deque(), fl::task::Error::Error(), fl::flat_map< int, FxPtr >::flat_map(), fl::flat_set< Key, Less >::flat_set(), fl::json::json(), fl::json_value::json_value(), fl::json_value::json_value(), fl::json_value::json_value(), fl::Optional< T >::Optional(), fl::Optional< T >::Optional(), fl::pair< vec2< u16 >, u8 >::pair(), fl::pair< vec2< u16 >, u8 >::pair(), fl::detail::posix_filebuf::posix_filebuf(), fl::RedBlackTree< value_type, PairCompare, Allocator >::RedBlackTree(), fl::RxChannel::RxChannel(), fl::scope_exit< EF >::scope_exit(), fl::SortedHeapVector< T, LessThan >::SortedHeapVector(), fl::Spi::Spi(), fl::string_n< 32 >::string_n(), fl::spi::Transaction::Transaction(), fl::unique_ptr< T, Deleter >::unique_ptr(), fl::unique_ptr< T, Deleter >::unique_ptr(), fl::unique_ptr< T, Deleter >::unique_ptr(), fl::unique_ptr< T[], Deleter >::unique_ptr(), fl::unique_ptr< T[], Deleter >::unique_ptr(), fl::unique_ptr< T[], Deleter >::unique_ptr(), fl::unordered_map_small< Key, Value, Equal >::unordered_map_small(), fl::VectorSet< Key >::VectorSet(), fl::XYDrawComposited::XYDrawComposited(), fl::XYDrawGradient::XYDrawGradient(), fl::audio::fft::Bins::~Bins(), fl::audio::Sample::~Sample(), fl::audio::fft::FloatVectorPool::acquire(), fl::audio::AudioManager::add(), fl::audio::AudioManager::add(), fl::audio::AudioManager::add(), fl::task::Scheduler::add_task(), fl::task::after_frame(), fl::task::after_frame(), fl::unordered_map_small< Key, Value, Equal >::append(), fl::swap_impl< T, false >::apply(), fl::json::as_impl(), fl::basic_string::assign(), fl::Remote::bind(), fl::Rpc::bind(), fl::Remote::bindAsync(), fl::Rpc::bindAsync(), fl::net::http::StreamHandle::catch_(), fl::task::Handle::catch_(), fl::task::Promise< T >::catch_(), fl::net::http::FetchManager::cleanup_completed_promises(), fl::unordered_map_small< Key, Value, Equal >::compact(), fl::task::Promise< T >::complete_with_value(), fl::net::http::ChunkedReader::consume(), fl::detail::JsonToType< fl::ConstCharPtrWrapper, void >::convert(), fl::detail::JsonToType< fl::ConstSpanWrapper< T >, void >::convert(), fl::detail::JsonToType< fl::vector< fl::u8 >, void >::convert(), fl::detail::JsonToType< fl::vector< T >, void >::convert(), fl::ChannelData::create(), fl::ChannelData::create(), fl::list< T >::create_node(), fl::unordered_map_small< Key, Value, Equal >::do_insert(), fl::deque< int >::emplace(), fl::iterator<, u8 >::emplace(), fl::MultiMapTree< Key, T, Compare, fl::allocator_slab< char > >::emplace(), fl::MultiSetTree< Key, Compare, fl::allocator_slab< char > >::emplace(), fl::Optional< T >::emplace(), fl::RedBlackTree< value_type, PairCompare, Allocator >::emplace(), fl::unordered_map_small< Key, Value, Equal >::emplace(), fl::unordered_set< Key, Hash, KeyEqual >::emplace(), fl::VectorSet< Key >::emplace(), fl::VectorSetFixed< Key, N >::emplace(), fl::flat_map< int, FxPtr >::emplace_hint(), fl::flat_set< Key, Less >::emplace_hint(), fl::deque< int >::ensure_capacity(), fl::deque< int >::erase(), fl::deque< int >::erase(), fl::FixedVector< fl::u32, kMaxBatchSize >::erase(), fl::FL_ALIGN_AS_T(), FL_DISABLE_WARNING(), fl::get(), fl::get(), fl::audio::Context::getFFT(), fl::deque< int >::insert(), fl::deque< int >::insert(), fl::deque< int >::insert(), fl::flat_map< int, FxPtr >::insert(), fl::flat_map< int, FxPtr >::insert(), fl::flat_map< int, FxPtr >::insert(), fl::flat_set< Key, Less >::insert(), fl::flat_set< Key, Less >::insert(), fl::iterator<, u8 >::insert(), fl::list< T >::insert(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::insert(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::insert(), fl::MultiMapTree< Key, T, Compare, fl::allocator_slab< char > >::insert(), fl::MultiSetTree< Key, Compare, fl::allocator_slab< char > >::insert(), fl::RedBlackTree< value_type, PairCompare, Allocator >::insert(), fl::set< T, fl::allocator_inlined_slab< T, N > >::insert(), fl::SetRedBlackTree< Key, fl::less< Key >, Allocator >::insert(), fl::unordered_map_small< Key, Value, Equal >::insert(), fl::unordered_map_small< Key, Value, Equal >::insert(), fl::unordered_set< Key, Hash, KeyEqual >::insert(), fl::unsorted_map_fixed< Key, Value, N >::insert(), fl::VectorSet< Key >::insert(), fl::VectorSetFixed< Key, N >::insert(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::insert_or_assign(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::insert_or_assign(), fl::detail::insertion_sort(), fl::task::make_error(), fl::make_optional(), fl::task::make_resolved_promise(), fl::task::make_success(), fl::detail::merge_inplace(), fl::Remote::methods(), fl::basic_string::moveAssign(), fl::basic_string::moveFrom(), fl::anonymous_namespace{json.cpp.hpp}::JsonBuilder::on_token(), fl::net::http::StreamHandle::onData(), fl::back_insert_iterator< Container >::operator=(), fl::bitset_dynamic::operator=(), fl::circular_buffer< T, N >::operator=(), fl::detail::posix_filebuf::operator=(), fl::flat_map< int, FxPtr >::operator=(), fl::flat_set< Key, Less >::operator=(), fl::json_value::operator=(), fl::json_value::operator=(), fl::json_value::operator=(), fl::json_value::operator=(), fl::json_value::operator=(), fl::json_value::operator=(), fl::Optional< T >::operator=(), fl::Optional< T >::operator=(), fl::RedBlackTree< value_type, PairCompare, Allocator >::operator=(), fl::ScreenMap::operator=(), fl::Spi::operator=(), fl::spi::Transaction::operator=(), fl::string::operator=(), fl::string_n< 32 >::operator=(), fl::unordered_map_small< Key, Value, Equal >::operator=(), fl::VectorSet< Key >::operator=(), fl::json::operator[](), fl::json_value::operator[](), fl::unordered_map_small< Key, Value, Equal >::operator[](), fl::anonymous_namespace{json.cpp.hpp}::optimize_array(), fl::net::http::HttpStreamTransport::parseChunkedMessages(), fl::ScreenMap::ParseJson(), fl::parseV2SegmentArray(), fl::unordered_map_small< Key, Value, Equal >::place_at(), fl::circular_buffer_core< T >::pop_back(), fl::circular_buffer_core< T >::pop_front(), fl::Server::pull(), fl::PriorityQueue< T, Compare, VectorT >::push(), fl::queue< T, Container >::push(), fl::deque< int >::push_back(), fl::FixedVector< fl::u32, kMaxBatchSize >::push_back(), fl::json::push_back(), fl::list< T >::push_back(), fl::deque< int >::push_front(), fl::list< T >::push_front(), fl::net::http::HttpStreamTransport::readRequest(), fl::Rpc::registerMethod(), fl::iterator<, u8 >::rehash_internal(), fl::audio::fft::FloatVectorPool::release(), fl::audio::fft::FloatVectorPool::releaseIfNotEmpty(), fl::remove(), fl::remove_if(), fl::task::detail::PromiseImpl< T >::resolve(), fl::task::Promise< T >::resolve(), fl::net::http::HttpStreamTransport::rpc(), fl::net::http::HttpStreamTransport::rpcStream(), fl::net::RpcScheduler< Task >::schedule(), fl::task::TimeTask::set_catch(), fl::task::detail::PromiseImpl< T >::set_catch_callback(), fl::task::TimeTask::set_then(), fl::task::detail::PromiseImpl< T >::set_then_callback(), fl::FxEngine::setAudio(), fl::ChannelData::setPaddingGenerator(), fl::Server::setRequestHandler(), fl::Server::setRequestSource(), fl::Rpc::setResponseSink(), fl::Server::setResponseSink(), fl::audio::Context::setSample(), fl::SpiChannelEngineAdapter::show(), fl::deque< int >::shrink_to_fit(), fl::expected< T, E >::success(), fl::FixedVector< fl::u32, kMaxBatchSize >::swap(), fl::string::swap(), fl::basic_string::swapWith(), fl::net::http::StreamHandle::then(), fl::task::Handle::then(), fl::task::Promise< T >::then(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::try_emplace(), fl::MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > >< Key, T, Compare >::try_emplace(), fl::iterator<, u8 >::unordered_map(), fl::flat_map< int, FxPtr >::update(), fl::unordered_map_small< Key, Value, Equal >::update(), fl::unsorted_map_fixed< Key, Value, N >::update(), fl::Optional< T >::value_or(), and fl::spi::Device::writeAsync().

◆ swap()

template<typename T>
void fl::fl::swap ( T & a,
T & b )

Definition at line 877 of file s16x16x4.h.

888 {
889
890// Forward declaration for cross-type operations
891struct s0x32x4;
892
895struct s16x16x4 {
896 simd::simd_u32x4 raw; // 4× i32 values in Q16 format
897
898 // ---- Construction ------------------------------------------------------
899
902 result.raw = r;
903 return result;
904 }
905
906 // Load 4 s16x16 values from memory (unaligned access supported)
907 static FASTLED_FORCE_INLINE s16x16x4 load(const s16x16* ptr) {
908 return from_raw(simd::platforms::load_u32_4(reinterpret_cast<const u32*>(ptr))); // ok reinterpret cast
909 }
910
911 // Store 4 s16x16 values to memory (unaligned access supported)
912 FASTLED_FORCE_INLINE void store(s16x16* ptr) const {
913 simd::platforms::store_u32_4(reinterpret_cast<u32*>(ptr), raw); // ok reinterpret cast
914 }
915
916 // Broadcast single s16x16 value to all 4 lanes
917 static FASTLED_FORCE_INLINE s16x16x4 set1(s16x16 value) {
918 return from_raw(simd::platforms::set1_u32_4(static_cast<u32>(value.raw())));
919 }
920
921 // ---- SIMD arithmetic (s16x16x4 OP s16x16x4 → s16x16x4) -----------------
922
923 FASTLED_FORCE_INLINE s16x16x4 operator+(s16x16x4 b) const {
924 return from_raw(simd::add_i32_4(raw, b.raw));
925 }
926
927 FASTLED_FORCE_INLINE s16x16x4 operator-(s16x16x4 b) const {
928 return from_raw(simd::sub_i32_4(raw, b.raw));
929 }
930
931 FASTLED_FORCE_INLINE s16x16x4 operator*(s16x16x4 b) const {
932 // Q16 × Q16 = Q32 → shift right 16 → Q16
933 return from_raw(simd::mulhi_i32_4(raw, b.raw));
934 }
935
936 FASTLED_FORCE_INLINE s16x16x4 operator-() const {
937 // Unary negation: -x = 0 - x
938 auto zero = simd::set1_u32_4(0);
939 return from_raw(simd::sub_i32_4(zero, raw));
940 }
941
942 FASTLED_FORCE_INLINE s16x16x4 operator>>(int shift) const {
943 return from_raw(simd::sra_i32_4(raw, shift));
944 }
945
946 FASTLED_FORCE_INLINE s16x16x4 operator<<(int shift) const {
947 return from_raw(simd::sll_u32_4(raw, shift));
948 }
949
950 // Cross-type multiply: s16x16x4 × s0x32x4 → s16x16x4 (commutative)
951 // Implemented after s0x32x4 is defined
952 FASTLED_FORCE_INLINE s16x16x4 operator*(s0x32x4 b) const;
953
954 // ---- Math functions -------------------------------------------------------
955
957 FASTLED_FORCE_INLINE s16x16x4 abs() const {
958 // mask = -1 if negative (sign extended), 0 if positive
959 auto mask = simd::sra_i32_4(raw, 31);
960 // flip bits if negative, then add 1 (two's complement)
961 auto flipped = simd::xor_u32_4(raw, mask);
962 return from_raw(simd::sub_i32_4(flipped, mask));
963 }
964
966 FASTLED_FORCE_INLINE s16x16x4 min(s16x16x4 b) const {
967 return from_raw(simd::min_i32_4(raw, b.raw));
968 }
969
971 FASTLED_FORCE_INLINE s16x16x4 max(s16x16x4 b) const {
972 return from_raw(simd::max_i32_4(raw, b.raw));
973 }
974
976 FASTLED_FORCE_INLINE s16x16x4 clamp(s16x16x4 lo, s16x16x4 hi) const {
977 return max(lo).min(hi);
978 }
979
982 FASTLED_FORCE_INLINE s16x16x4 lerp(s16x16x4 b, s16x16 t) const {
983 auto t_vec = s16x16x4::set1(t);
984 auto diff = b - (*this);
985 return (*this) + (diff * t_vec);
986 }
987
990 FASTLED_FORCE_INLINE void sincos(s16x16x4& out_sin, s16x16x4& out_cos) const {
991 // Convert radians to 24-bit angle units (same as scalar s16x16)
992 // RAD_TO_24 = 2^24 / (2π) in Q16
993 static constexpr i32 RAD_TO_24 = 2670177; // from s16x16.h
994
995 // Convert 4 angles: mulhi_i32_4 does (i64*i64) >> 16
996 auto angles_u32 = simd::mulhi_su32_4(raw, simd::set1_u32_4(static_cast<u32>(RAD_TO_24)));
997
998 // Call vectorized sincos
999 auto sc = sincos32_simd(angles_u32);
1000
1001 // Shift results right by 15 to convert from raw sin32 output to Q16.16
1002 out_sin = from_raw(simd::sra_i32_4(sc.sin_vals, 15));
1003 out_cos = from_raw(simd::sra_i32_4(sc.cos_vals, 15));
1004 }
1005
1007 FASTLED_FORCE_INLINE s16x16x4 sin() const {
1008 s16x16x4 sin_out, cos_out;
1009 sincos(sin_out, cos_out);
1010 return sin_out;
1011 }
1012
1014 FASTLED_FORCE_INLINE s16x16x4 cos() const {
1015 s16x16x4 sin_out, cos_out;
1016 sincos(sin_out, cos_out);
1017 return cos_out;
1018 }
1019};
1020
1021// Include simd_ops.h to implement cross-type operations
1022// Must come after all types are defined
1023#include "fl/math/fixed_point/simd_ops.h" // allow-include-after-namespace
1024
1025} // namespace fl

Referenced by fl::ScreenMap::ScreenMap(), fl::audio::detector::Vocal::computeBroadSpectralFeatures(), fl::gfx::detail::drawLineCore(), fl::array< u8, 3 >::swap(), fl::flat_map< int, FxPtr >::swap(), fl::flat_set< Key, Less >::swap(), fl::HashMapLru< Args, fl::shared_ptr< Impl > >::swap(), fl::MultiMapTree< Key, T, Compare, fl::allocator_slab< char > >::swap(), fl::MultiSetTree< Key, Compare, fl::allocator_slab< char > >::swap(), fl::pair< vec2< u16 >, u8 >::swap(), fl::RedBlackTree< value_type, PairCompare, Allocator >::swap(), fl::unique_ptr< T, Deleter >::swap(), fl::unique_ptr< T[], Deleter >::swap(), fl::unordered_map_small< Key, Value, Equal >::swap(), fl::weak_ptr< T >::swap(), and fl::basic_string::swapWith().

+ Here is the caller graph for this function:

◆ swap_by_copy()

template<typename T>
void fl::fl::swap_by_copy ( T & a,
T & b )

Definition at line 883 of file s16x16x4.h.

894 {
895
896// Forward declaration for cross-type operations
897struct s0x32x4;
898
901struct s16x16x4 {
902 simd::simd_u32x4 raw; // 4× i32 values in Q16 format
903
904 // ---- Construction ------------------------------------------------------
905
908 result.raw = r;
909 return result;
910 }
911
912 // Load 4 s16x16 values from memory (unaligned access supported)
913 static FASTLED_FORCE_INLINE s16x16x4 load(const s16x16* ptr) {
914 return from_raw(simd::platforms::load_u32_4(reinterpret_cast<const u32*>(ptr))); // ok reinterpret cast
915 }
916
917 // Store 4 s16x16 values to memory (unaligned access supported)
918 FASTLED_FORCE_INLINE void store(s16x16* ptr) const {
919 simd::platforms::store_u32_4(reinterpret_cast<u32*>(ptr), raw); // ok reinterpret cast
920 }
921
922 // Broadcast single s16x16 value to all 4 lanes
923 static FASTLED_FORCE_INLINE s16x16x4 set1(s16x16 value) {
924 return from_raw(simd::platforms::set1_u32_4(static_cast<u32>(value.raw())));
925 }
926
927 // ---- SIMD arithmetic (s16x16x4 OP s16x16x4 → s16x16x4) -----------------
928
929 FASTLED_FORCE_INLINE s16x16x4 operator+(s16x16x4 b) const {
930 return from_raw(simd::add_i32_4(raw, b.raw));
931 }
932
933 FASTLED_FORCE_INLINE s16x16x4 operator-(s16x16x4 b) const {
934 return from_raw(simd::sub_i32_4(raw, b.raw));
935 }
936
937 FASTLED_FORCE_INLINE s16x16x4 operator*(s16x16x4 b) const {
938 // Q16 × Q16 = Q32 → shift right 16 → Q16
939 return from_raw(simd::mulhi_i32_4(raw, b.raw));
940 }
941
942 FASTLED_FORCE_INLINE s16x16x4 operator-() const {
943 // Unary negation: -x = 0 - x
944 auto zero = simd::set1_u32_4(0);
945 return from_raw(simd::sub_i32_4(zero, raw));
946 }
947
948 FASTLED_FORCE_INLINE s16x16x4 operator>>(int shift) const {
949 return from_raw(simd::sra_i32_4(raw, shift));
950 }
951
952 FASTLED_FORCE_INLINE s16x16x4 operator<<(int shift) const {
953 return from_raw(simd::sll_u32_4(raw, shift));
954 }
955
956 // Cross-type multiply: s16x16x4 × s0x32x4 → s16x16x4 (commutative)
957 // Implemented after s0x32x4 is defined
958 FASTLED_FORCE_INLINE s16x16x4 operator*(s0x32x4 b) const;
959
960 // ---- Math functions -------------------------------------------------------
961
963 FASTLED_FORCE_INLINE s16x16x4 abs() const {
964 // mask = -1 if negative (sign extended), 0 if positive
965 auto mask = simd::sra_i32_4(raw, 31);
966 // flip bits if negative, then add 1 (two's complement)
967 auto flipped = simd::xor_u32_4(raw, mask);
968 return from_raw(simd::sub_i32_4(flipped, mask));
969 }
970
972 FASTLED_FORCE_INLINE s16x16x4 min(s16x16x4 b) const {
973 return from_raw(simd::min_i32_4(raw, b.raw));
974 }
975
977 FASTLED_FORCE_INLINE s16x16x4 max(s16x16x4 b) const {
978 return from_raw(simd::max_i32_4(raw, b.raw));
979 }
980
982 FASTLED_FORCE_INLINE s16x16x4 clamp(s16x16x4 lo, s16x16x4 hi) const {
983 return max(lo).min(hi);
984 }
985
988 FASTLED_FORCE_INLINE s16x16x4 lerp(s16x16x4 b, s16x16 t) const {
989 auto t_vec = s16x16x4::set1(t);
990 auto diff = b - (*this);
991 return (*this) + (diff * t_vec);
992 }
993
996 FASTLED_FORCE_INLINE void sincos(s16x16x4& out_sin, s16x16x4& out_cos) const {
997 // Convert radians to 24-bit angle units (same as scalar s16x16)
998 // RAD_TO_24 = 2^24 / (2π) in Q16
999 static constexpr i32 RAD_TO_24 = 2670177; // from s16x16.h
1000
1001 // Convert 4 angles: mulhi_i32_4 does (i64*i64) >> 16
1002 auto angles_u32 = simd::mulhi_su32_4(raw, simd::set1_u32_4(static_cast<u32>(RAD_TO_24)));
1003
1004 // Call vectorized sincos
1005 auto sc = sincos32_simd(angles_u32);
1006
1007 // Shift results right by 15 to convert from raw sin32 output to Q16.16
1008 out_sin = from_raw(simd::sra_i32_4(sc.sin_vals, 15));
1009 out_cos = from_raw(simd::sra_i32_4(sc.cos_vals, 15));
1010 }
1011
1013 FASTLED_FORCE_INLINE s16x16x4 sin() const {
1014 s16x16x4 sin_out, cos_out;
1015 sincos(sin_out, cos_out);
1016 return sin_out;
1017 }
1018
1020 FASTLED_FORCE_INLINE s16x16x4 cos() const {
1021 s16x16x4 sin_out, cos_out;
1022 sincos(sin_out, cos_out);
1023 return cos_out;
1024 }
1025};
1026
1027// Include simd_ops.h to implement cross-type operations
1028// Must come after all types are defined
1029#include "fl/math/fixed_point/simd_ops.h" // allow-include-after-namespace
1030
1031} // namespace fl