N64 icon indicating copy to clipboard operation
N64 copied to clipboard

VMACF: missing test for accumulator 32-bit overflow

Open rasky opened this issue 6 years ago • 0 comments

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).

rasky avatar Jul 09 '18 09:07 rasky