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

Function test_sub_f32_4

examples/SIMD/simd_tests.cpp:312–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312void test_sub_f32_4(TestResult& result) {
313 float a_data[4] = {5.0f, 4.0f, 3.0f, 2.0f};
314 float b_data[4] = {1.5f, 1.5f, 1.5f, 1.5f};
315 float expected[4] = {3.5f, 2.5f, 1.5f, 0.5f};
316 float output[4] = {0.0f};
317
318 simd_f32x4 a = load_f32_4(a_data);
319 simd_f32x4 b = load_f32_4(b_data);
320 simd_f32x4 c = sub_f32_4(a, b);
321 store_f32_4(output, c);
322
323 if (!compare_f32_arrays(expected, output, 4)) {
324 result.fail("Float subtract operation produced incorrect results");
325 }
326}
327
328void test_mul_f32_4(TestResult& result) {
329 float a_data[4] = {2.0f, 3.0f, 4.0f, 5.0f};

Callers

nothing calls this directly

Calls 2

compare_f32_arraysFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected