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

◆ test_mulhi_su32_4()

bool autoresearch::simd_check::test_mulhi_su32_4 ( )
inline

Definition at line 522 of file AutoResearchSimd.h.

522 {
523 // mulhi_su32_4: signed a * unsigned b >> 16
524 // When b >= 0, should match mulhi_i32_4
525 uint32_t a[4] = {as_u32(-0x00010000), 0x00020000, as_u32(-0x00020000), 0x00010000};
526 uint32_t b[4] = {0x00020000, 0x00010000, 0x00010000, 0x00030000};
527 uint32_t output[4] = {0};
528 store_u32_4(output, mulhi_su32_4(load_u32_4(a), load_u32_4(b)));
529 if (as_i32(output[0]) != -0x00020000) return false; // -1.0 * 2.0 = -2.0
530 if (output[1] != 0x00020000) return false; // 2.0 * 1.0 = 2.0
531 if (as_i32(output[2]) != -0x00020000) return false; // -2.0 * 1.0 = -2.0
532 if (output[3] != 0x00030000) return false; // 1.0 * 3.0 = 3.0
533 return true;
534}
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: