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

Namespaces

namespace  adl_barrier
 
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  index_sequence_concat
 
struct  index_sequence_concat< index_sequence< Lhs... >, index_sequence< Rhs... > >
 
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 >
 
struct  make_index_sequence_impl< 1 >
 
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_NO_EXCEPT
 
template<fl::size_t N, typename T>
T * assume_aligned (T *ptr) FL_NO_EXCEPT
 
template<typename T>
add_rvalue_reference< T >::type declval () FL_NO_EXCEPT
 
template<typename T, typename U>
enable_if_t< is_same< T, U >::value > swap (T &a, U &b) FL_NO_EXCEPT
 
template<typename T>
void swap_by_copy (T &a, T &b) FL_NO_EXCEPT
 
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::index_sequence_concat

struct fl::fl::index_sequence_concat
+ Inheritance diagram for fl::fl::index_sequence_concat< LhsSeq, RhsSeq >:

◆ fl::fl::index_sequence_concat< index_sequence< Lhs... >, index_sequence< Rhs... > >

struct fl::fl::index_sequence_concat< index_sequence< Lhs... >, index_sequence< Rhs... > >
+ Inheritance diagram for fl::fl::index_sequence_concat< index_sequence< Lhs... >, index_sequence< Rhs... > >:
+ Collaboration diagram for fl::fl::index_sequence_concat< index_sequence< Lhs... >, index_sequence< Rhs... > >:
Class Members
typedef index_sequence< Lhs...,(sizeof...(Lhs)+Rhs)... > type index_sequence<Lhs..., (sizeof...(Lhs) + Rhs)...>

◆ fl::fl::make_index_sequence_impl

struct fl::fl::make_index_sequence_impl
+ Inheritance diagram for fl::fl::make_index_sequence_impl< N >:
Class Members
typedef typename type, typename type >::type type

◆ fl::fl::make_index_sequence_impl< 0 >

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

◆ fl::fl::make_index_sequence_impl< 1 >

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

◆ 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 181 of file s16x16x4.h.

◆ bool_constant

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

Definition at line 33 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 822 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 116 of file s16x16x4.h.

◆ decay_t

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

Definition at line 326 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 67 of file s16x16x4.h.

◆ false_type

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

Definition at line 29 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 838 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 1205 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 267 of file s16x16x4.h.

◆ remove_pointer_t

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

Definition at line 311 of file s16x16x4.h.

◆ remove_reference_t

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

Definition at line 25 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 28 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 1021 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.

142 {
143 s16x16x4 sin_out, cos_out;
144 sincos(sin_out, cos_out);
145 return cos_out;
146 }
147};
148
149// Include simd_ops.h to implement cross-type operations
150// Must come after all types are defined
151#include "fl/math/fixed_point/simd_ops.h" // allow-include-after-namespace
152
153} // namespace fl
enable_if< is_fixed_point< T >::value, void >::type sincos(T angle, T &out_sin, T &out_cos) FL_NO_EXCEPT
Cross-type SIMD fixed-point operations (implemented after all types are defined)
4-wide s16x16 vector (general fixed-point) Backed by 128-bit SIMD register (4× i32 in Q16 format)
Definition s16x16x4.h:23

◆ 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.

135 {
136 s16x16x4 sin_out, cos_out;
137 sincos(sin_out, cos_out);
138 return sin_out;
139 }

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 ( )

◆ swap()

template<typename T, typename U>
enable_if_t< is_same< T, U >::value > fl::fl::swap ( T & a,
U & b )

Definition at line 889 of file s16x16x4.h.

904 {
905
906// Forward declaration for cross-type operations
907struct s0x32x4;
908
911struct s16x16x4 {
912 simd::simd_u32x4 raw; // 4× i32 values in Q16 format
913
914 // ---- Construction ------------------------------------------------------
915
918 result.raw = r;
919 return result;
920 }
921
922 // Load 4 s16x16 values from memory (unaligned access supported)
923 static FASTLED_FORCE_INLINE s16x16x4 load(const s16x16* ptr) {
924 return from_raw(simd::platforms::load_u32_4(reinterpret_cast<const u32*>(ptr))); // ok reinterpret cast
925 }
926
927 // Store 4 s16x16 values to memory (unaligned access supported)
928 FASTLED_FORCE_INLINE void store(s16x16* ptr) const {
929 simd::platforms::store_u32_4(reinterpret_cast<u32*>(ptr), raw); // ok reinterpret cast
930 }
931
932 // Broadcast single s16x16 value to all 4 lanes
933 static FASTLED_FORCE_INLINE s16x16x4 set1(s16x16 value) {
934 return from_raw(simd::platforms::set1_u32_4(static_cast<u32>(value.raw())));
935 }
936
937 // ---- SIMD arithmetic (s16x16x4 OP s16x16x4 → s16x16x4) -----------------
938
939 FASTLED_FORCE_INLINE s16x16x4 operator+(s16x16x4 b) const {
940 return from_raw(simd::add_i32_4(raw, b.raw));
941 }
942
943 FASTLED_FORCE_INLINE s16x16x4 operator-(s16x16x4 b) const {
944 return from_raw(simd::sub_i32_4(raw, b.raw));
945 }
946
947 FASTLED_FORCE_INLINE s16x16x4 operator*(s16x16x4 b) const {
948 // Q16 × Q16 = Q32 → shift right 16 → Q16
949 return from_raw(simd::mulhi_i32_4(raw, b.raw));
950 }
951
952 FASTLED_FORCE_INLINE s16x16x4 operator-() const {
953 // Unary negation: -x = 0 - x
954 auto zero = simd::set1_u32_4(0);
955 return from_raw(simd::sub_i32_4(zero, raw));
956 }
957
958 FASTLED_FORCE_INLINE s16x16x4 operator>>(int shift) const {
959 return from_raw(simd::sra_i32_4(raw, shift));
960 }
961
962 FASTLED_FORCE_INLINE s16x16x4 operator<<(int shift) const {
963 return from_raw(simd::sll_u32_4(raw, shift));
964 }
965
966 // Cross-type multiply: s16x16x4 × s0x32x4 → s16x16x4 (commutative)
967 // Implemented after s0x32x4 is defined
968 FASTLED_FORCE_INLINE s16x16x4 operator*(s0x32x4 b) const;
969
970 // ---- Math functions -------------------------------------------------------
971
973 FASTLED_FORCE_INLINE s16x16x4 abs() const {
974 // mask = -1 if negative (sign extended), 0 if positive
975 auto mask = simd::sra_i32_4(raw, 31);
976 // flip bits if negative, then add 1 (two's complement)
977 auto flipped = simd::xor_u32_4(raw, mask);
978 return from_raw(simd::sub_i32_4(flipped, mask));
979 }
980
982 FASTLED_FORCE_INLINE s16x16x4 min(s16x16x4 b) const {
983 return from_raw(simd::min_i32_4(raw, b.raw));
984 }
985
987 FASTLED_FORCE_INLINE s16x16x4 max(s16x16x4 b) const {
988 return from_raw(simd::max_i32_4(raw, b.raw));
989 }
990
992 FASTLED_FORCE_INLINE s16x16x4 clamp(s16x16x4 lo, s16x16x4 hi) const {
993 return max(lo).min(hi);
994 }
995
998 FASTLED_FORCE_INLINE s16x16x4 lerp(s16x16x4 b, s16x16 t) const {
999 auto t_vec = s16x16x4::set1(t);
1000 auto diff = b - (*this);
1001 return (*this) + (diff * t_vec);
1002 }
1003
1006 FASTLED_FORCE_INLINE void sincos(s16x16x4& out_sin, s16x16x4& out_cos) const {
1007 // Convert radians to 24-bit angle units (same as scalar s16x16)
1008 // RAD_TO_24 = 2^24 / (2π) in Q16
1009 static constexpr i32 RAD_TO_24 = 2670177; // from s16x16.h
1010
1011 // Convert 4 angles: mulhi_i32_4 does (i64*i64) >> 16
1012 auto angles_u32 = simd::mulhi_su32_4(raw, simd::set1_u32_4(static_cast<u32>(RAD_TO_24)));
1013
1014 // Call vectorized sincos
1015 auto sc = sincos32_simd(angles_u32);
1016
1017 // Shift results right by 15 to convert from raw sin32 output to Q16.16
1018 out_sin = from_raw(simd::sra_i32_4(sc.sin_vals, 15));
1019 out_cos = from_raw(simd::sra_i32_4(sc.cos_vals, 15));
1020 }
1021
1023 FASTLED_FORCE_INLINE s16x16x4 sin() const {
1024 s16x16x4 sin_out, cos_out;
1025 sincos(sin_out, cos_out);
1026 return sin_out;
1027 }
1028
1030 FASTLED_FORCE_INLINE s16x16x4 cos() const {
1031 s16x16x4 sin_out, cos_out;
1032 sincos(sin_out, cos_out);
1033 return cos_out;
1034 }
1035};
1036
1037// Include simd_ops.h to implement cross-type operations
1038// Must come after all types are defined
1039#include "fl/math/fixed_point/simd_ops.h" // allow-include-after-namespace
1040
1041} // namespace fl
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
Definition math.h:75
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
Memory functions are available in fl:: namespace via fl/stl/cstring.h Using declarations cannot work ...
Definition math.h:71
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NO_EXCEPT
static uint32_t t
Definition Luminova.h:55
FASTLED_FORCE_INLINE CRGB * operator+(const CRGBSet &pixels, int offset) FL_NO_EXCEPT
Retrieve a pointer to a CRGB array, using a CRGBSet and an LED offset.
Definition pixelset.h:494
platforms::simd_u32x4 simd_u32x4
Definition s16x16x4.h:27
FASTLED_FORCE_INLINE float lerp(float t, float a, float b) FL_NO_EXCEPT
enable_if< is_fixed_point< T >::value, T >::type sin(T angle) FL_NO_EXCEPT
enable_if< is_fixed_point< T >::value, T >::type cos(T angle) FL_NO_EXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NO_EXCEPT
ostream & operator<<(ostream &os, const hex_t &) FL_NO_EXCEPT
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
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...
Definition sin32_simd.h:32
FASTLED_FORCE_INLINE CRGB operator*(const CRGB &p1, u8 d) FL_NO_EXCEPT
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_NO_EXCEPT
Subtract one CRGB from another, saturating at 0x00 for each channel.
Definition crgb.hpp:190
#define FASTLED_FORCE_INLINE
4-wide s0x32 vector (normalized values [-1, 1]) Backed by 128-bit SIMD register (4× i32 in Q31 format...
Definition s16x16x4.h:17

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 896 of file s16x16x4.h.

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