FastLED 3.9.15
Loading...
Searching...
No Matches

◆ test_sub_f32_4()

void simd_test::test_sub_f32_4 ( TestResult & result)

Definition at line 312 of file simd_tests.cpp.

312 {
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}
platforms::simd_f32x4 simd_f32x4
Definition types.h:27
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
bool compare_f32_arrays(const float *a, const float *b, size_t count, float epsilon)
Compare two float arrays element-wise with epsilon tolerance.

References compare_f32_arrays().

Referenced by setup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: