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

◆ test_add_i32_4()

bool autoresearch::simd_check::test_add_i32_4 ( )
inline

Definition at line 405 of file AutoResearchSimd.h.

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