armemu: Fix underflows in USAD8/USADA8

Initially reported by xdec.
This commit is contained in:
Lioncash 2014-12-28 06:07:24 -05:00
parent 28e64806cd
commit 059c65a27a
3 changed files with 14 additions and 4 deletions

View file

@ -392,6 +392,15 @@ ARMul_NthReg (ARMword instr, unsigned number)
return (bit - 1);
}
/* Unsigned sum of absolute difference */
u8 ARMul_UnsignedAbsoluteDifference(u8 left, u8 right)
{
if (left > right)
return left - right;
return right - left;
}
/* Assigns the N and Z flags depending on the value of result. */
void