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

◆ test_mulhi_i32_4()

bool autoresearch::simd_check::test_mulhi_i32_4 ( )
inline

Definition at line 495 of file AutoResearchSimd.h.

495 {
496 // mulhi_i32_4: ((i64)a * (i64)b) >> 16
497 // Test: 0x00010000 * 0x00020000 >> 16 = 0x00020000 (1.0 * 2.0 = 2.0 in Q16.16)
498 uint32_t a[4] = {0x00010000, 0x00020000, as_u32(-0x00010000), 0x00008000};
499 uint32_t b[4] = {0x00020000, 0x00010000, 0x00020000, 0x00008000};
500 uint32_t output[4] = {0};
501 store_u32_4(output, mulhi_i32_4(load_u32_4(a), load_u32_4(b)));
502 if (output[0] != 0x00020000) return false; // 1.0 * 2.0 = 2.0
503 if (output[1] != 0x00020000) return false; // 2.0 * 1.0 = 2.0
504 if (as_i32(output[2]) != -0x00020000) return false; // -1.0 * 2.0 = -2.0
505 if (output[3] != 0x00004000) return false; // 0.5 * 0.5 = 0.25
506 return true;
507}
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: