FastLED 3.9.15
Loading...
Searching...
No Matches
simd_ops.h
Go to the documentation of this file.
1#pragma once
2
10
13#include "fl/stl/align.h"
14
15// Implementation of s0x32x4 × s16x16x4 (after s16x16x4 is defined)
16FASTLED_FORCE_INLINE s16x16x4 s0x32x4::operator*(s16x16x4 b) const {
17 // Q31 × Q16 = Q47 → shift right 31 → Q16
18 // Use mulhi32_i32_4 which computes (i64*i64) >> 32, then shift left 1
19 // (because >> 31 is equivalent to >> 32 then << 1)
20 auto hi = simd::mulhi32_i32_4(raw, b.raw);
21 return s16x16x4::from_raw(simd::sll_u32_4(hi, 1));
22}
23
24// Implementation of s16x16x4 × s0x32x4 (commutative)
25FASTLED_FORCE_INLINE s16x16x4 s16x16x4::operator*(s0x32x4 b) const {
26 return b * (*this); // Delegate to s0x32x4::operator*
27}
Alignment macros and utilities for FastLED.
SIMD 4-wide s0x32 fixed-point vector type.
#define FASTLED_FORCE_INLINE
SIMD 4-wide s16x16 fixed-point vector type.