mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
target-mips: fix for incorrect multiplication with MULQ_S.PH
The change corrects sign-related issue with MULQ_S.PH. It also includes extension to the already existing test which will trigger the issue. Signed-off-by: Petar Jovanovic <petarj@mips.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
d2123a079d
commit
9c19eb1e20
2 changed files with 16 additions and 1 deletions
|
@ -6,6 +6,21 @@ int main()
|
|||
int rd, rs, rt, dsp;
|
||||
int result, resultdsp;
|
||||
|
||||
rs = 0x80000000;
|
||||
rt = 0x0ffc0000;
|
||||
result = 0xF0040000;
|
||||
resultdsp = 0;
|
||||
|
||||
__asm
|
||||
("mulq_s.ph %0, %2, %3\n\t"
|
||||
"rddsp %1\n\t"
|
||||
: "=r"(rd), "=r"(dsp)
|
||||
: "r"(rs), "r"(rt)
|
||||
);
|
||||
dsp = (dsp >> 21) & 0x01;
|
||||
assert(rd == result);
|
||||
assert(dsp == resultdsp);
|
||||
|
||||
rs = 0x80001234;
|
||||
rt = 0x80004321;
|
||||
result = 0x7FFF098B;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue