DSP: heavily extend mul test. Seems that only MULX* family instructions support unsigned operation.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3138 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-05-02 21:43:38 +00:00
parent e7c7142c9d
commit ae86ec4df6
1 changed files with 230 additions and 38 deletions

View File

@ -2,57 +2,249 @@
incdir "tests"
include "dsp_base.inc"
SET40
LRI $AC0.M, #0x1234
LRI $AC0.L, #0x5678
SET16
; Results is in capitails like this: UNSIGNED
m2
CLR15
; Test MULXMVZ - SET15
CLR $ACC0
CLRP
LRI $AX0.L, #0xFFFF
LRI $AX1.H, #0x100
MULXMVZ $AX0.L, $AX1.H, $ACC0 ; SIGNED
MOVP $ACC0
call send_back
CLR $ACC0
CLRP
SET15
LRI $AX0.L, #0xFFFF
LRI $AX1.H, #0x100
MULXMVZ $AX0.L, $AX1.H, $ACC0 ; UNSIGNED
MOVP $ACC0
call send_back
CLR15
; Test MULXMV - SET15
CLR $ACC0
CLRP
LRI $AX0.L, #0xFFFF
LRI $AX1.H, #0x100
MULXMV $AX0.L, $AX1.H, $ACC0 ; SIGNED
MOVP $ACC0
call send_back
CLR $ACC0
CLRP
SET15
LRI $AX0.L, #0xFFFF
LRI $AX1.H, #0x100
MULXMV $AX0.L, $AX1.H, $ACC0 ; UNSIGNED
MOVP $ACC0
call send_back
CLR15
; Test MULXAC - SET15
CLR $ACC0
CLRP
LRI $AX0.L, #0xFFFF
LRI $AX1.H, #0x100
MULXAC $AX0.L, $AX1.H, $ACC0 ; SIGNED
MOVP $ACC0
call send_back
CLR $ACC0
CLRP
SET15
LRI $AX0.L, #0xFFFF
LRI $AX1.H, #0x100
MULXAC $AX0.L, $AX1.H, $ACC0 ; UNSIGNED
MOVP $ACC0
call send_back
CLR15
; Test MULX - SET15
CLR $ACC0
CLRP
LRI $AX0.L, #0xFFFF
LRI $AX1.H, #0x100
MULX $AX0.L, $AX1.H ; SIGNED
MOVP $ACC0
call send_back
CLR $ACC0
CLRP
SET15
LRI $AX0.L, #0xFFFF
LRI $AX1.H, #0x100
MULX $AX0.L, $AX1.H ; UNSIGNED
MOVP $ACC0
call send_back
CLR15
; Test MADDX - SET15
CLR $ACC0
CLRP
LRI $AX0.L, #0xFFFF
LRI $AX1.L, #0x100
MULX $AX0.L, $AX1.L
MULXAC $AX0.L, $AX1.L, $ACC0
MADDX $AX0.L, $AX1.L ; SIGNED
MOVP $ACC0
call send_back
CLR $ACC0
CLRP
SET15
LRI $AX0.L, #0xFFFF
LRI $AX1.L, #0x100
MADDX $AX0.L, $AX1.L ; SIGNED (!)
MOVP $ACC0
call send_back
CLR15
; Test MULC - SET15
CLR $ACC0
CLRP
LRI $AC0.M, #0xFFFF
LRI $AX0.H, #0x100
MULC $AC0.M, $AX0.H ; SIGNED
MOVP $ACC0
call send_back
CLR $ACC0
CLRP
SET15
LRI $AC0.M, #0xFFFF
LRI $AX0.H, #0x100
MULC $AC0.M, $AX0.H ; SIGNED (!)
MOVP $ACC0
call send_back
CLR15
; Test MULCAC - SET15
CLR $ACC0
CLRP
LRI $AC0.M, #0xFFFF
LRI $AX0.H, #0x100
MULCAC $AC0.M, $AX0.H, $ACC0 ; SIGNED
MOVP $ACC0
call send_back
CLR $ACC0
CLRP
SET15
LRI $AC0.M, #0xFFFF
LRI $AX0.H, #0x100
MULCAC $AC0.M, $AX0.H, $ACC0 ; SIGNED (!)
MOVP $ACC0
call send_back
CLR15
; Test MUL - SET15
CLR $ACC0
CLRP
LRI $AX0.L, #0xFFFF
LRI $AX0.H, #0x100
MUL $AX0.L, $AX0.H ; SIGNED
MOVP $ACC0
call send_back
CLR $ACC0
SET15
LRI $AX0.L, #0xFFFF
LRI $AX1.L, #0x100
MULX $AX0.L, $AX1.L
MULXAC $AX0.L, $AX1.L, $ACC0
CLR15
LRI $AX0.H, #0x100
MUL $AX0.L, $AX0.H ; SIGNED (!)
MOVP $ACC0
call send_back
m0
lri $AX0.L, #1
lri $AX1.L, #2
mulx $AX0.L, $AX1.L
movp $ACC0
call send_back ; 1
CLR15
; Test MULAC - SET15
CLR $ACC0
CLRP
LRI $AX0.L, #0xFFFF
LRI $AX0.H, #0x100
MULAC $AX0.L, $AX0.H, $ACC0 ; SIGNED
MOVP $ACC0
call send_back
CLR $ACC0
SET15
LRI $AX0.L, #0xFFFF
LRI $AX0.H, #0x100
MULAC $AX0.L, $AX0.H, $ACC0 ; SIGNED (!)
MOVP $ACC0
call send_back
CLR15
set15
lri $AX0.L, #2
lri $AX1.L, #4
mulx $AX0.L, $AX1.L
movp $ACC0
clr15
call send_back ; 1
m2
lri $AX0.L, #1
lri $AX1.L, #2
mulx $AX0.L, $AX1.L
movp $ACC0
call send_back ; 1
set15
lri $AX0.L, #2
lri $AX1.L, #4
mulx $AX0.L, $AX1.L
movp $ACC0
clr15
call send_back ; 1
m0
; We're done, DO NOT DELETE THIS LINE
jmp end_of_test
; test accelerator
; TODO: DSPSpy puts a 16-bit ramp at 0x10000000
LRIS $AC1.M, #0x0a ; 16-bit PCM audio
;SRS @SampleFormat, $AC1.M
; Start accelerator position
LRI $AC1.M, #0x0100
SRS @ACCAH, $AC1.M
LRI $AC1.M, #0x1000
SRS @ACCAH, $AC1.M
; Current accelerator position
LRI $AC1.M, #0x0100
SRS @ACCAH, $AC1.M
LRI $AC1.M, #0x1000
SRS @ACCAH, $AC1.M
; End accelerator position
LRI $AC1.M, #0x0100
SRS @ACCAH, $AC1.M
LRI $AC1.M, #0x2000
SRS @ACCAH, $AC1.M
; Now to the interesting parameter - gain.
LRI $AC1.M, #0xFFFF
SRS @GAIN, $AC1.M
; Let's now load a sample through the accelerator.
LRS $AC1.M, @ARAM
call send_back
jmp end_of_test
; test addpaxz
call send_back
clrp
lri $AX0.L, #0x1111
lri $AX0.H, #0x2222
call send_back
clrp
addpaxz $ACC0, $AX0.H
call send_back
clrp
set40
addpaxz $ACC0, $AX0.H
set16
call send_back
clrp
set15
addpaxz $ACC0, $AX0.H
clr15
call send_back
jmp end_of_test