| 520 | } |
| 521 | |
| 522 | inline bool test_mulhi_su32_4() { |
| 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 | } |
| 535 | |
| 536 | inline bool test_mulhi32_i32_4() { |
| 537 | // mulhi32_i32_4: ((i64)a * (i64)b) >> 32 |