N64
N64 copied to clipboard
VMACF: missing test for accumulator 32-bit overflow
The current testcases for VMACF do not show what happens if the accumulator hits the 32-bit signed overflow. For instance, see the following sequence where I show a single 16-bit element of a full register:
0000: VMULF $5656, $7654 => ACC: $0000_4FD0_7070, RESULT: $4FD0
0004: VMACF $5656, $7654 => ACC: $0000_7FFF_FFFF, RESULT: $7FFF (???)
This example assumes that the 32-bit accumulator goes into signed saturation (0x4FD07070 * 2 => overflows), but there is not testcase to show this behavior.
Instead, there is a test for VMACU that shows that saturation does not happen (but it doesn't show what happens when the 32-bit unsigned result overflows... probably there is 1-bit carry into the high part of the accumulator, but no test is shown).