FastLED 3.9.15
Loading...
Searching...
No Matches
s0x32x4.h
Go to the documentation of this file.
1#pragma once
2
5
6#include "fl/math/simd.h"
9
10namespace fl {
11
12// Forward declaration for cross-type operations
13struct s16x16x4;
14
17struct s0x32x4 {
18 simd::simd_u32x4 raw; // 4× i32 values in Q31 format
19
20 // ---- Construction ------------------------------------------------------
21
24 result.raw = r;
25 return result;
26 }
27
28 // Load 4 s0x32 values from memory (unaligned access supported)
30 return from_raw(simd::platforms::load_u32_4(reinterpret_cast<const u32*>(ptr))); // ok reinterpret cast
31 }
32
33 // Store 4 s0x32 values to memory (unaligned access supported)
34 FASTLED_FORCE_INLINE void store(s0x32* ptr) const {
35 simd::platforms::store_u32_4(reinterpret_cast<u32*>(ptr), raw); // ok reinterpret cast
36 }
37
38 // Broadcast single s0x32 value to all 4 lanes
40 return from_raw(simd::platforms::set1_u32_4(static_cast<u32>(value.raw())));
41 }
42
43 // ---- SIMD multiply: s0x32x4 × s16x16x4 → s16x16x4 ----------------------
44 // Math: Q31 × Q16 = Q47 → shift right 31 → Q16
45 // Implemented after s16x16x4 is defined
47};
48
49} // namespace fl
platforms::simd_u32x4 simd_u32x4
Definition types.h:26
constexpr int type_rank< T >::value
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
Base definition for an LED controller.
Definition crgb.hpp:179
#define FASTLED_FORCE_INLINE
Umbrella header for SIMD subsystem.
FASTLED_FORCE_INLINE s16x16x4 operator*(s16x16x4 b) const
simd::simd_u32x4 raw
Definition s0x32x4.h:18
static FASTLED_FORCE_INLINE s0x32x4 set1(s0x32 value)
Definition s0x32x4.h:39
static FASTLED_FORCE_INLINE s0x32x4 from_raw(simd::simd_u32x4 r)
Definition s0x32x4.h:22
static FASTLED_FORCE_INLINE s0x32x4 load(const s0x32 *ptr)
Definition s0x32x4.h:29
FASTLED_FORCE_INLINE void store(s0x32 *ptr) const
Definition s0x32x4.h:34
4-wide s0x32 vector (normalized values [-1, 1]) Backed by 128-bit SIMD register (4× i32 in Q31 format...
Definition s0x32x4.h:17
4-wide s16x16 vector (general fixed-point) Backed by 128-bit SIMD register (4× i32 in Q16 format)
Definition s16x16x4.h:19