FastLED 3.10.9
Loading...
Searching...
No Matches

◆ test_add_i32_4()

bool autoresearch::simd_check::test_add_i32_4 ( )
inline

Definition at line 406 of file AutoResearchSimd.h.

406 {
407 // Use signed values stored as u32
408 uint32_t a[4] = {as_u32(100), as_u32(-100), as_u32(0x7FFFFFFF), as_u32(0)};
409 uint32_t b[4] = {as_u32(200), as_u32(-200), as_u32(1), as_u32(0)};
410 uint32_t output[4] = {0};
411 store_u32_4(output, add_i32_4(load_u32_4(a), load_u32_4(b)));
412 if (as_i32(output[0]) != 300) return false;
413 if (as_i32(output[1]) != -300) return false;
414 // 0x7FFFFFFF + 1 wraps (expected behavior, no saturation)
415 if (output[2] != 0x80000000) return false;
416 if (as_i32(output[3]) != 0) return false;
417 return true;
418}
uint32_t as_u32(int32_t v)
int32_t as_i32(uint32_t v)

References as_i32(), and as_u32().

Referenced by getTests().

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