mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
target-mips: fix mipsdsp_mul_q15_q15 and tests for MAQ_SA_W_PHL/PHR
The operands for MAQ_SA_W.PHL/MAQ_SA_W.PHR must in specified format. Otherwise, the results are unpredictable. Once the operands were corrected in the tests (part of this change), a bug in mipsdsp_mul_q15_q15 became visible. This change corrects the tests for MAQ_SA_W.PHL/MAQ_SA_W.PHR and fixes sign-related issue in mipsdsp_mul_q15_q15. It also removes unnecessary comment. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
This commit is contained in:
parent
e3d142d073
commit
b1ca31d7ce
3 changed files with 19 additions and 31 deletions
|
@ -10,12 +10,12 @@ int main()
|
|||
int resulth, resultl;
|
||||
int resdsp;
|
||||
|
||||
achi = 0x05;
|
||||
acli = 0xB4CB;
|
||||
achi = 0x00000000;
|
||||
acli = 0x0000B4CB;
|
||||
rs = 0xFF060000;
|
||||
rt = 0xCB000000;
|
||||
resulth = 0x00;
|
||||
resultl = 0x7FFFFFFF;
|
||||
resulth = 0x00000000;
|
||||
resultl = 0x006838CB;
|
||||
|
||||
__asm
|
||||
("mthi %2, $ac1\n\t"
|
||||
|
@ -29,8 +29,8 @@ int main()
|
|||
assert(resulth == acho);
|
||||
assert(resultl == aclo);
|
||||
|
||||
achi = 0x06;
|
||||
acli = 0xB4CB;
|
||||
achi = 0x00000000;
|
||||
acli = 0x0000B4CB;
|
||||
rs = 0x80000000;
|
||||
rt = 0x80000000;
|
||||
resulth = 0x00;
|
||||
|
|
|
@ -10,12 +10,12 @@ int main()
|
|||
int resulth, resultl;
|
||||
int resdsp;
|
||||
|
||||
achi = 0x05;
|
||||
acli = 0xB4CB;
|
||||
rs = 0xFF06;
|
||||
rt = 0xCB00;
|
||||
resulth = 0x00;
|
||||
resultl = 0x7FFFFFFF;
|
||||
achi = 0x00000000;
|
||||
acli = 0x0000B4CB;
|
||||
rs = 0x0000FF06;
|
||||
rt = 0x0000CB00;
|
||||
resulth = 0x00000000;
|
||||
resultl = 0x006838CB;
|
||||
|
||||
__asm
|
||||
("mthi %2, $ac1\n\t"
|
||||
|
@ -29,12 +29,12 @@ int main()
|
|||
assert(resulth == acho);
|
||||
assert(resultl == aclo);
|
||||
|
||||
achi = 0x06;
|
||||
acli = 0xB4CB;
|
||||
rs = 0x8000;
|
||||
rt = 0x8000;
|
||||
resulth = 0x00;
|
||||
resultl = 0x7fffffff;
|
||||
achi = 0x00000000;
|
||||
acli = 0x0000B4CB;
|
||||
rs = 0x00008000;
|
||||
rt = 0x00008000;
|
||||
resulth = 0x00000000;
|
||||
resultl = 0x7FFFFFFF;
|
||||
resdsp = 0x01;
|
||||
|
||||
__asm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue