FastLED 3.10.8
Loading...
Searching...
No Matches

◆ operator/()

FASTLED_FORCE_INLINE u16x16 fl::u16x16::operator/ ( u16x16 b) const
inlineconstexpr

Definition at line 84 of file u16x16.h.

84 {
85#if FL_FIXED_POINT_NARROW_DIVIDE
86 // See `s16x16::operator/`. FastLED#4307 measured this one at 33x the
87 // cost of `s8x8`; the signed twin pays more again for the sign
88 // handling `__aeabi_ldivmod` layers on top.
89 return from_raw(divide64By32(mValue >> (32 - FRAC_BITS),
90 mValue << FRAC_BITS, b.mValue));
91#else
92 return from_raw(static_cast<u32>(
93 (static_cast<u64>(mValue) * (static_cast<u64>(1) << FRAC_BITS)) / b.mValue));
94#endif
95 }
u32 mValue
Definition u16x16.h:210
static constexpr FASTLED_FORCE_INLINE u16x16 from_raw(u32 raw) FL_NO_EXCEPT
Definition u16x16.h:54
static constexpr int FRAC_BITS
Definition u16x16.h:22
FL_FIXED_POINT_DIVIDE_INLINE u32 divide64By32(u32 hi, u32 lo, u32 divisor) FL_NO_EXCEPT
(hi:lo) / divisor, for a quotient that fits 32 bits.
fl::u64 u64
Definition stdint.h:220

References u16x16(), fl::divide64By32(), FASTLED_FORCE_INLINE, fl::FL_NO_EXCEPT, FRAC_BITS, from_raw(), and mValue.

+ Here is the call graph for this function: