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

Function test_and_u8_16

examples/SIMD/simd_tests.cpp:195–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193// ============================================================================
194
195void test_and_u8_16(TestResult& result) {
196 uint8_t a_data[16] = {0xFF, 0xF0, 0x0F, 0xAA, 0xFF, 0xF0, 0x0F, 0xAA, 0xFF, 0xF0, 0x0F, 0xAA, 0xFF, 0xF0, 0x0F, 0xAA};
197 uint8_t b_data[16] = {0xF0, 0xFF, 0x0F, 0x55, 0xF0, 0xFF, 0x0F, 0x55, 0xF0, 0xFF, 0x0F, 0x55, 0xF0, 0xFF, 0x0F, 0x55};
198 uint8_t expected[16] = {0xF0, 0xF0, 0x0F, 0x00, 0xF0, 0xF0, 0x0F, 0x00, 0xF0, 0xF0, 0x0F, 0x00, 0xF0, 0xF0, 0x0F, 0x00};
199 uint8_t output[16] = {0};
200
201 simd_u8x16 a = load_u8_16(a_data);
202 simd_u8x16 b = load_u8_16(b_data);
203 simd_u8x16 c = and_u8_16(a, b);
204 store_u8_16(output, c);
205
206 if (!compare_u8_arrays(expected, output, 16)) {
207 result.fail("AND operation produced incorrect results");
208 }
209}
210
211void test_or_u8_16(TestResult& result) {
212 uint8_t a_data[16] = {0xF0, 0x0F, 0xAA, 0x55, 0xF0, 0x0F, 0xAA, 0x55, 0xF0, 0x0F, 0xAA, 0x55, 0xF0, 0x0F, 0xAA, 0x55};

Callers

nothing calls this directly

Calls 2

compare_u8_arraysFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected