MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_add_sat_u8_16

Function test_add_sat_u8_16

examples/AutoResearch/AutoResearchSimd.h:131–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129// ============================================================================
130
131inline bool test_add_sat_u8_16() {
132 uint8_t a[16] = {100,150,200,250, 100,150,200,250, 100,150,200,250, 100,150,200,250};
133 uint8_t b[16] = {50,100,50,100, 50,100,50,100, 50,100,50,100, 50,100,50,100};
134 uint8_t expected[16] = {150,250,250,255, 150,250,250,255, 150,250,250,255, 150,250,250,255};
135 uint8_t output[16] = {0};
136 simd_u8x16 va = load_u8_16(a);
137 simd_u8x16 vb = load_u8_16(b);
138 store_u8_16(output, add_sat_u8_16(va, vb));
139 return compare_u8(expected, output, 16);
140}
141
142inline bool test_add_sat_u8_16_full_saturate() {
143 // 255 + 255 = 255 (saturated), 0 + 0 = 0

Callers

nothing calls this directly

Calls 1

compare_u8Function · 0.85

Tested by

no test coverage detected