$Id: README,v 1.15 2005/01/03 00:25:16 debug Exp $

About mips64emul's regression tests:
------------------------------------

This is a framework for regression testing the emulator. Unfortunately I 
don't have the time or incentive to actually write the individual tests, 
but hopefully this README file should be enough to get someone who wishes
to write tests started.

The regression tests require a MIPS (cross-)compiler to be available.  
Please study Makefile.skel and ../configure for more information.

Adding a new test is done by writing an assembly language file called
test_X.S, where X is the name of the test. test_X.good is a file which
contains the wanted output.

The code in test_common.c calls a function called testmain() in each test
(which should be written to conform to a 64-bit ABI calling model, and
return an int value) and prints the return value in hex. If a test wants
to check more than one int, then it may call printhex() and printstr()
manually, as long as the output of the program and the contents of
test_X.good are the same.


Here is a list of MIPS instructions; some of them are implemented in the 
emulator, only a few so far have regression tests.  NOTE: This list is not 
complete, and probably incorrect in many places.


	ISA level:
	12345,32,64,
Instr.:	MDMX,3D,16	Impl:	Reg. test filename:
-------	-----------	-----	-------------------
abs.fmt	1
add	1		yes
add.fmt	1		yes
adda.s	?
addciu	?
addi	1		yes
addiu	1		yes
addu	1		yes	test_addu.S
alnv.ps	?
and	1		yes
andi	1		yes
bc0f	1
bc0fl	2
bc0t	1
bc0tl	2
bc1f	1
bc1t	1
beq	1		yes
beql	2		yes
bgez	1		yes
bgezal	1		yes
bgezall	2		yes
bgezl	2		yes
bgtz	1		yes
bgtzl	2		yes
blez	1		yes
blezl	2		yes
bltz	1		yes
bltzal	1		yes
bltzall	2		yes
bltzl	2		yes
bne	1		yes
bnel	2		yes
break	1		yes
c.cond	1		yes
cache	3 (?)		yes
ceil.l.fmt	3
ceil.w.fmt	2
cfc1	1		yes
clo	32		yes	test_clo_clz.S
clz	32		yes	test_clo_clz.S
ctc1	1
cvt.d.fmt	1 or 3	yes
cvt.l.fmt	3	yes
cvt.s.fmt	1 or 3	yes
cvt.w.fmt	1	yes
dadd	3		yes
daddi	3		yes
daddiu	3		yes
daddu	3		yes	test_daddu.S
dclo	64		yes	test_dclo_dclz.S
dclz	64		yes	test_dclo_dclz.S
dctr	?
dctw	?
ddiv	3		yes
ddivu	3		yes
deret	?		yes
di	c790		yes(ugly)
div	1		yes
div.fmt	1		yes
div1	c790		no
divu	1		yes
divu1	c790		no
dmadd16	?
dmfc1	3		yes
dmtc1	3		yes
dmult	3
dmultu	3
dsll	3		yes
dsll32	3		yes
dsllv	3		yes
dsra	3		yes
dsra32	3		yes
dsrav	3		yes
dsrl	3		yes
dsrl32	3		yes
dsrlv	3		yes
dsub	3		yes
dsubu	3		yes
ei	c790		yes(ugly)
eret	3 (?)
ffc	?
floor.l.fmt	3
floow.w.fmt	2
flushi	?
flushd	?
flushid	?
hibernate	?
j	1		yes
jal	1		yes
jalx	16
jalr	1		yes
jr	1		yes
lb	1		yes
lbu	1		yes
ld	3		yes
ldc1	2		yes
ldl	3		yes	test_unaligned.S
ldr	3		yes	test_unaligned.S
ldxc1	4
lh	1		yes
lhu	1		yes
ll	2		yes
lld	3		yes
lui	1		yes
luxc1	5
lq	c790		yes
lqc2	?
lw	1		yes
lwc1	1		yes
lwxc1	4
lwl	1		yes	test_unaligned.S
lwr	1		yes	test_unaligned.S
lwu	3		yes
mad	?
madu	?
madd	32,c790
madd1	c790
madd16	?
madda.s	?
maddu	32,c790
maddu1	c790
max.s	?
mfbpc	c790
mfc0	?		yes
mfc1	1		yes
mfdab	c790
mfdabm	c790
mfdvb	c790
mfdvbm	c790
mfhi	1		yes
mfhi1	c790
mfiab	c790
mfiabm	c790
mflo	1		yes
mflo1	c790
mfpc	c790
mfps	c790
mfsa	c790
min.s	?
mov.fmt	1		yes
movn	4		yes
movz	4		yes
mtbpc	c790
mtc0	?		yes
mtc1	1		yes
mtdab	c790
mtdabm	c790
mtdvb	c790
mtdvbm	c790
mthi	1		yes
mthi1	c790
mtiab	c790
mtiabm	c790
mtlo	1		yes
mtlo1	c790
mtpc	c790
mtps	c790
mtsa	c790
mtsab	c790
mtsah	c790
mul.fmt	1		yes
mult	1 (c790 spec.)	yes
mult1	c790
multu	1 (c790 spec.)	yes
multu1	c790
neg.fmt	1		yes
nmadd.fmt	64, 4 or 5
nmsub.fmt	64, 4 or 5
nop	1		yes
nor	1		yes
or	1		yes
ori	1		yes
pabsh	c790
pabsw	c790
paddb	c790
paddh	c790
paddsb	c790
paddsh	c790
paddsw	c790
paddub	c790
padduh	c790
padduw	c790
paddw	c790
padsbh	c790
pand	c790
pceqb	c790
pceqh	c790
pceqw	c790
pcgtb	c790
pcgth	c790
pcgtw	c790
pcpyh	c790
pcpyld	c790
pcpyud	c790
pdivbw	c790
pdivuw	c790
pdivw	c790
pexch	c790
pexcw	c790
pexeh	c790
pexew	c790
pext5	c790
pextlb	c790
pextlh	c790
pextlw	c790
pextub	c790
pextuh	c790
pextuw	c790
phmadh	c790
phmsbh	c790
pinteh	c790
pinth	c790
pll.ps	5, 64
plu.ps	5, 64
plzcw	c790
pmaddh	c790
pmadduw	c790
pmaddw	c790
pmaxh	c790
pmaxw	c790
pmfhi	c790
pmfhl	c790
pmflo	c790
pminh	c790
pminw	c790
pmsubh	c790
pmsubw	c790
pmthi	c790
pmthl	c790
pmtlo	c790
pmulth	c790
pmultuw	c790
pmultw	c790
pnor	c790
por	c790
ppac5	c790
ppacb	c790
ppach	c790
ppacw	c790
prevh	c790
pref	4, 32		yes
prefx	4, 32?, 64
prot3w	c790
psllh	c790
psllvw	c790
psllw	c790
psrah	c790
psravw	c790
psraw	c790
psrlh	c790
psrlvw	c790
psrlw	c790
psubb	c790
psubh	c790
psubsb	c790
psubsh	c790
psubsw	c790
psubub	c790
psubuh	c790
psubuw	c790
psubw	c790
pul.ps	5, 64
puu.ps	5, 64
pxor	c790
qfsrv	c790
recip.fmt	4
rfe	1		yes
round.l.fmt	3
round.w.fmt	2
rsqrt.d	4
rsqrt.s	4 or 5
sb	1		yes
sc	2		yes
scd	3		yes
sd	3		yes
sdbbp	32
sdc1	2		yes
sdl	3		yes
sdr	3		yes
sdxc1	4
selsl	?
selsr	?
sh	1		yes
sll	1		yes
sllv	1		yes
slt	1		yes
slti	1		yes
sltiu	1		yes
sq	c790		yes
sqc2	?
sqrt.fmt	2	yes
stlu	1		yes
sra	1		yes
srav	1		yes
srl	1		yes
srlv	1		yes
ssnop	?		yes
standby	?
sub	1		yes
sub.fmt	1		yes
subu	1		yes
suspend	?
suxc1	5, 64
sw	1		yes
swc1	1		yes
swxc1	4, 64
swl	1		yes
swr	1		yes
sync	2		yes
syscall	1		yes
teq	2		yes
teqi	2		no
tge	2
tgei	2
tgeiu	2
tgeu	2
tlbp	?
tlbr	?
tlbwi	?
tlbwr	?
tlt	2
tlti	2
tltiu	2
tltu	2
tne	2
tnei	2
trunc.l.fmt	3	yes
trunc.w.fmt	2	tes
vabs	?
vadd	?
vaddi	?
vaddq	?
vaddw	?
vaddx	?
vaddy	?
vaddz	?
vadda	?
vaddai	?
vaddaq	?
vaddaw	?
vaddax	?
vadday	?
vaddaz	?
vcallms	?
vcallmsr	?
vclipw	?
vdiv	?
vftoi0	?
vftoi4	?
vftoi12	?
vftoi15	?
viadd	?
viaddi	?
viand	?
vilwr.w	?
vilwr.x	?
vilwr.y	?
vilwr.z	?
vior	?
viswr.w	?
viswr.x	?
viswr.y	?
viswr.z	?
visub	?
vitof0	?
vitof4	?
vitof12	?
vitof15	?
vlqd	?
vlqi	?
vmadd	?
vmaddi	?
vmaddq	?
vmaddw	?
vmaddx	?
vmaddy	?
vmaddz	?
vmadda	?
vmaddai	?
vmaddaq	?
vmaddaw	?
vmaddax	?
vmadday	?
vmaddaz	?
vmax	?
vmaxi	?
vmaxw	?
vmaxx	?
vmaxy	?
vmaxz	?
vmfir	?
vmini	?
vminii	?
vminiw	?
vminix	?
vminiy	?
vminiz	?
vmove	?
vmr32	?
vmsub	?
vmsubi	?
vmsubq	?
vmsubw	?
vmsubx	?
vmsuby	?
vmsubz	?
vmsuba	?
vmsubai	?
vmsubaq	?
vmsubaw	?
vmsubax	?
vmsubay	?
vmsubaz	?
vmtir	?
vmul	?
vmuli	?
vmulq	?
vmulw	?
vmulx	?
vmuly	?
vmulz	?
vmula	?
vmulai	?
vmulaq	?
vmulaw	?
vmulax	?
vmulay	?
vmulaz	?
vnop	?
vopmula	?
vopmsub	?
vrget	?
vrinit	?
vrnext	?
vrsqrt	?
vrxor	?
vsqd	?
vsqi	?
vsqrt	?
vsub	?
vsubi	?
vsubq	?
vsubw	?
vsubx	?
vsuby	?
vsubz	?
vsuba	?
vsubai	?
vsubaq	?
vsubaw	?
vsubax	?
vsubay	?
vsubaz	?
vwaitq	?
wait	32
waiti	?
wb	?
xor	1		yes
xori	1		yes



TODO:
	o)  Hopefully, some day, someone will have the time and energy
	    to actually write all the regression tests necessary.

	o)  32-bit vs 64-bit modes?

	o)  MIPS I, II, III, IV, V (?), MDMX (?)

	o)  MIPS16 encoding?

	o)  32-bit vs 64-bit ELFs?

	o)  Try the regression tests using different compilers automagically?
	    ie gcc vs ccc vs solaris' cc...

	o)  Remove the usage of tmpnam(), and make do_tests.c less
	    ugly in general.


