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

Function test_add_f32_4

examples/SIMD/simd_tests.cpp:296–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294// ============================================================================
295
296void test_add_f32_4(TestResult& result) {
297 float a_data[4] = {1.0f, 2.0f, 3.0f, 4.0f};
298 float b_data[4] = {0.5f, 1.5f, 2.5f, 3.5f};
299 float expected[4] = {1.5f, 3.5f, 5.5f, 7.5f};
300 float output[4] = {0.0f};
301
302 simd_f32x4 a = load_f32_4(a_data);
303 simd_f32x4 b = load_f32_4(b_data);
304 simd_f32x4 c = add_f32_4(a, b);
305 store_f32_4(output, c);
306
307 if (!compare_f32_arrays(expected, output, 4)) {
308 result.fail("Float add operation produced incorrect results");
309 }
310}
311
312void test_sub_f32_4(TestResult& result) {
313 float a_data[4] = {5.0f, 4.0f, 3.0f, 2.0f};

Callers

nothing calls this directly

Calls 2

compare_f32_arraysFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected