611 lines
20 KiB
Text
611 lines
20 KiB
Text
|
// The following is called when ever an illegal instruction is
|
||
|
// encountered
|
||
|
::internal::illegal
|
||
|
engine_error (sd, cia, "illegal instruction at 0x%lx", cia.ip);
|
||
|
|
||
|
// Signed Integer Add - add source1, source2, dest
|
||
|
void::function::do_add:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
ALU_BEGIN (Source1);
|
||
|
ALU_ADD (Source2);
|
||
|
ALU_END (*rDest);
|
||
|
31.Dest,26.Source2,21.0b101100,15.0,14.SI::::add i
|
||
|
do_add (_SD, rDest, SI, rSource2);
|
||
|
31.Dest,26.Source2,21.0b11101100,13.0,12.0,11./,4.Source1::::add r
|
||
|
do_add (_SD, rDest, rSource1, rSource2);
|
||
|
31.Dest,26.Source2,21.0b11101100,13.0,12.1,11./::::add l
|
||
|
long_immediate (LSI);
|
||
|
do_add (_SD, rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// Unsigned Integer Add - addu source1, source2, dest
|
||
|
void::function::do_addu:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
*rDest = Source1 + Source2;
|
||
|
31.Dest,26.Source2,21.0b101100,15.1,14.SI::::addu i
|
||
|
do_addu (_SD, rDest, SI, rSource2);
|
||
|
31.Dest,26.Source2,21.0b11101100,13.1,12.0,11./,4.Source1::::addu r
|
||
|
do_addu (_SD, rDest, rSource1, rSource2);
|
||
|
31.Dest,26.Source2,21.0b11101100,13.1,12.1,11./::::addu l
|
||
|
long_immediate (LSI);
|
||
|
do_addu (_SD, rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
#void::function::do_and:unsigned_word *rDest, unsigned_word source1, unsigned_word source2
|
||
|
# *rD = source1 & source2;
|
||
|
|
||
|
|
||
|
// and, and.tt
|
||
|
#31.Dest,26.Source2,21.0b0010001,14.SI::::and.tt i
|
||
|
# do_and (_SD, *rDest, SI, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010001,0,11./,4.Source1::::and.tt r
|
||
|
# do_and (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010001,1,11./::::and.tt l
|
||
|
# do_and (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// and.ff
|
||
|
#31.Dest,26.Source2,21.0b0010001,14.SI::::and.ff i
|
||
|
# do_and (_SD, *rDest, ~SI, ~rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010001,0,11./,4.Source1::::and.ff r
|
||
|
# do_and (_SD, *rDest, ~rSource1, ~rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010001,1,11./::::and.ff l
|
||
|
# do_and (_SD, *rDest, ~LSI, ~rSource2);
|
||
|
|
||
|
|
||
|
// and.ft
|
||
|
#31.Dest,26.Source2,21.0b0010001,14.SI::::and.ft i
|
||
|
# do_and (_SD, *rDest, ~SI, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010001,0,11./,4.Source1::::and.ft r
|
||
|
# do_and (_SD, *rDest, ~rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010001,1,11./::::and.ft l
|
||
|
# do_and (_SD, *rDest, ~LSI, rSource2);
|
||
|
|
||
|
|
||
|
// and.tf
|
||
|
#31.Dest,26.Source2,21.0b0010001,14.SI::::and.tf i
|
||
|
# do_and (_SD, *rDest, SI, ~rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010001,0,11./,4.Source1::::and.tf r
|
||
|
# do_and (_SD, *rDest, rSource1, ~rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010001,1,11./::::and.tf l
|
||
|
# do_and (_SD, *rDest, LSI, ~rSource2);
|
||
|
|
||
|
|
||
|
// bbo.[a]
|
||
|
#void::function::do_bbo:int annul, int bitnum, unsigned_word offset, unsigned_word source
|
||
|
# sim_io_error ("bbo");
|
||
|
#31.BM,26.Source2,21.0b100101,A,14.SI14::::and.tf i
|
||
|
# do_bbo (_SD, A, SI, rSource2);
|
||
|
#31.BM,26.Source2,21.0b11100101,A,0,11./,4.Source1::::and.tf r
|
||
|
# do_bbo (_SD, A, rSource1, rSource2);
|
||
|
#31.BM,26.Source2,21.0b11100101,A,1,11./::::and.tf l
|
||
|
# do_bbo (_SD, A, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// bbz[.a]
|
||
|
instruction_address::function::do_bbz:instruction_address cia, instruction_address nia, int bitnum, unsigned_word source, int annul, unsigned_word offset
|
||
|
if (!MASKED32 (source, bitnum, bitnum))
|
||
|
{
|
||
|
if (annul)
|
||
|
nia.ip = -1;
|
||
|
nia.dp = cia.ip + 4 * offset;
|
||
|
}
|
||
|
return nia;
|
||
|
31.BITNUM,26.Source,21.0b100100,15.A,14.SI::::bbz i
|
||
|
nia = do_bbz (_SD, cia, nia, BITNUM, rSource, A, SignedOffset);
|
||
|
31.BITNUM,26.Source,21.0b11100100,13.A,12.0,11./,4.IndOff::::bbz r
|
||
|
nia = do_bbz (_SD, cia, nia, BITNUM, rSource, A, rIndOff);
|
||
|
31.BITNUM,26.Source,21.0b11100100,13.A,12.1,11./::::bbz l
|
||
|
long_immediate (LSI);
|
||
|
nia = do_bbz (_SD, cia, nia, BITNUM, rSource, A, LSI);
|
||
|
|
||
|
|
||
|
// bcnd[.a]
|
||
|
#void::function::do_bcnd:int annul, int bitnum, unsigned_word offset, unsigned_word source
|
||
|
# sim_io_error ("bcnd");
|
||
|
#31.BM,26.Source2,21.0b100110,A,14.SI::::and.tf i
|
||
|
# do_bcnd (_SD, A, SI, rSource2);
|
||
|
#31.BM,26.Source2,21.0b11100110,A,0,11./,4.Source1::::and.tf r
|
||
|
# do_bcnd (_SD, A, rSource1, rSource2);
|
||
|
#31.BM,26.Source2,21.0b11100110,A,1,11./::::and.tf l
|
||
|
# do_bcnd (_SD, A, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// br[.a] - see bbz[.a]
|
||
|
|
||
|
|
||
|
// brcr
|
||
|
#void::function::do_brcr:unsigned_word offset
|
||
|
# sim_io_error ("brcr");
|
||
|
#31.//,27.0,26.//,21.0b0000110,14.CRN::::and.tf i
|
||
|
# do_brcr (_SD, rCRN_val);
|
||
|
#31.//,27.0,26.//,21.0b110000110,0,11./,4.Source1::::and.tf r
|
||
|
# do_brcr (_SD, CRN[rSource1]);
|
||
|
#31.//,27.0,26.//,21.0b110000110,1,11./::::and.tf l
|
||
|
# do_brcr (_SD, CRN[SL]);
|
||
|
|
||
|
|
||
|
// bsr[.a]
|
||
|
#void::function::do_bsr:int annul, int bitnum, unsigned_word offset, unsigned_word source
|
||
|
# sim_io_error ("bsr");
|
||
|
#31.Link,26.//,21.0b100000,A,14.SI::::and.tf i
|
||
|
# do_bsr (_SD, A, LK, SI);
|
||
|
#31.Link,26.//,21.0b11100000,A,0,11./,4.Source1::::and.tf r
|
||
|
# do_bsr (_SD, A, LK, rSource1);
|
||
|
#31.Link,26.//,21.0b11100000,A,1,11./::::and.tf l
|
||
|
# do_bsr (_SD, A, LK, SL);
|
||
|
|
||
|
|
||
|
// cmnd
|
||
|
#31./,21.0b0000010,14.UI::::cmnd i
|
||
|
#31./,21.0b110000010,12.0,11./,4.Source1::::cmnd r
|
||
|
#31./,21.0b110000010,12.1,11./::::cmnd l
|
||
|
|
||
|
|
||
|
// cmp
|
||
|
#void::function::do_cmp:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("cmp");
|
||
|
#31.Dest,26.Source2,21.0b1010000,14.SI::::cmp i
|
||
|
# do_cmp (_SD, *rDest, SI, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b111010000,0,11./,4.Source1::::cmp r
|
||
|
# do_cmp (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b111010000,1,11./::::cmp l
|
||
|
# do_cmp (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// dcache
|
||
|
#31./,27.F,26.S1,21.0b0111,M,00,14.SO::::dcache i
|
||
|
#31./,27.F,26.S1,21.0b110111,M,00,12.0,11./,4.Source1::::dcache r
|
||
|
#31./,27.F,26.S1,21.0b110111,M,00,12.1,11./::::dcache l
|
||
|
|
||
|
|
||
|
// dld[{.b|.h|.d}]
|
||
|
#void::function::do_dld:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("dld");
|
||
|
#31.Dest,26.Source2,21.0b110100,m,sz,0,S,1,9./,4.Source1::::dld r
|
||
|
# do_dld (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11110100,m,sz,1,S,1,9./::::dld l
|
||
|
# do_dld (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// dld.u[{.b|.h|.d}]
|
||
|
#void::function::do_dld_u:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("dld.u");
|
||
|
#31.Dest,26.Source2,21.0b110101,m,sz,0,S,1,9./,4.Source1::::dld.u r
|
||
|
# do_dld_u (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11110101,m,sz,1,S,1,9./::::dld.u l
|
||
|
# do_dld_u (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// dst[{.b|.h|.d}]
|
||
|
#void::function::do_dst:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("dst");
|
||
|
#31.Dest,26.Source2,21.0b110110,m,sz,0,S,1,9./,4.Source1::::dst r
|
||
|
# do_dst (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11110110,m,sz,1,S,1,9./::::dst l
|
||
|
# do_dst (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// estop
|
||
|
#31./,21.0b1111111,1,0,0,11./::::estop
|
||
|
|
||
|
|
||
|
// etrap
|
||
|
#31./,27.1,26./,21.0b0000001,14.UTN::::etrap i
|
||
|
#31./,27.1,26./,21.0b110000001,12.0,11./,4.iUTN::::etrap r
|
||
|
#31./,27.1,26./,21.0b110000001,12.1,11./::::etrap l
|
||
|
|
||
|
|
||
|
// exts - see shift.ds
|
||
|
|
||
|
|
||
|
// extu - see shift.dz
|
||
|
|
||
|
|
||
|
// fadd.{s|d}{s|d}{s|d}
|
||
|
#void::function::do_fadd:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("fadd");
|
||
|
#31.Dest,26.Source2,21.0b111110000,0,r,PD,P2,P1,4.Source1::::fadd r
|
||
|
# do_fadd (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110000,1,r,PD,P2,P1,4./::::fadd l
|
||
|
# do_fadd (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// fcmp.{s|d}{s|d}{s|d}
|
||
|
#void::function::do_fcmp:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("fcmp");
|
||
|
#31.Dest,26.Source2,21.0b111110101,0,/,00,P2,P1,4.Source1::::fcmp r
|
||
|
# do_fcmp (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110101,1,/,00,P2,P1,4./::::fcmp l
|
||
|
# do_fcmp (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// fdiv.{s|d}{s|d}{s|d}
|
||
|
#void::function::do_fdiv:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("fdiv");
|
||
|
#31.Dest,26.Source2,21.0b111110011,0,/,PD,P2,P1,4.Source1::::fdiv r
|
||
|
# do_fdiv (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110011,1,/,PD,P2,P1,4./::::fdiv l
|
||
|
# do_fdiv (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// fmpy.{s|d|i|u}{s|d|i|u}{s|d|i|u}
|
||
|
#void::function::do_fmpy:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("fmpy");
|
||
|
#31.Dest,26.Source2,21.0b111110010,0,/,PD,P2,P1,4.Source1::::fmpy r
|
||
|
# do_fmpy (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110010,1,/,PD,P2,P1,4./::::fmpy l
|
||
|
# do_fmpy (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// frndm.{s|d|i|u}{s|d|i|u}{s|d|i|u}
|
||
|
#void::function::do_frndm:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("frndm");
|
||
|
#31.Dest,26.Source2,21.0b111110100,0,r,PD,11,P1,4.Source1::::frndm r
|
||
|
# do_frndm (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110100,1,r,PD,11,P1,4./::::frndm l
|
||
|
# do_frndm (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// frndn.{s|d|i|u}{s|d|i|u}{s|d|i|u}
|
||
|
#void::function::do_frndn:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("frndn");
|
||
|
#31.Dest,26.Source2,21.0b111110100,0,r,PD,00,P1,4.Source1::::frndn r
|
||
|
# do_frndn (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110100,1,r,PD,00,P1,4./::::frndn l
|
||
|
# do_frndn (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// frndp.{s|d|i|u}{s|d|i|u}{s|d|i|u}
|
||
|
#void::function::do_frndp:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("frndp");
|
||
|
#31.Dest,26.Source2,21.0b111110100,0,r,PD,10,P1,4.Source1::::frndp r
|
||
|
# do_frndp (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110100,1,r,PD,10,P1,4./::::frndp l
|
||
|
# do_frndp (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// frndz.{s|d|i|u}{s|d|i|u}{s|d|i|u}
|
||
|
#void::function::do_frndz:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("frndz");
|
||
|
#31.Dest,26.Source2,21.0b111110100,0,r,PD,01,P1,4.Source1::::frndz r
|
||
|
# do_frndz (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110100,1,r,PD,01,P1,4./::::frndz l
|
||
|
# do_frndz (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// fsqrt.{s|d}{s|d}{s|d}
|
||
|
#void::function::do_fsqrt:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("fsqrt");
|
||
|
#31.Dest,26.Source2,21.0b111110111,0,/,PD,//,P1,4.Source1::::fsqrt r
|
||
|
# do_fsqrt (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110111,1,/,PD,//,P1,4./::::fsqrt l
|
||
|
# do_fsqrt (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// fsub.{s|d}{s|d}{s|d}
|
||
|
#void::function::do_fsub:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("fsub");
|
||
|
#31.Dest,26.Source2,21.0b111110001,0,r,PD,P2,P1,4.Source1::::fsub r
|
||
|
# do_fsub (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11111110001,1,r,PD,P2,P1,4./::::fsub l
|
||
|
# do_fsub (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// illop
|
||
|
#31./,21.0b0000000,14./::::illop
|
||
|
#31./,21.0b111111111,12./::::illop l
|
||
|
|
||
|
|
||
|
// ins - see shift.im
|
||
|
|
||
|
|
||
|
// jsr[.a]
|
||
|
#void::function::do_jsr:int annul, int bitnum, unsigned_word offset, unsigned_word source
|
||
|
# sim_io_error ("jsr");
|
||
|
#31.Link,26.Base,21.0b100010,A,14.SI::::and.tf i
|
||
|
# do_jsr (_SD, A, LK, SI);
|
||
|
#31.Link,26.Base,21.0b11100010,A,0,11./,4.Source1::::and.tf r
|
||
|
# do_jsr (_SD, A, LK, rSource1);
|
||
|
#31.Link,26.Base,21.0b11100010,A,1,11./::::and.tf l
|
||
|
# do_jsr (_SD, A, LK, SL);
|
||
|
|
||
|
|
||
|
// ld[{.b.h.d}]
|
||
|
#void::function::do_ld:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("dld.u");
|
||
|
#31.Dest,26.Base,21.0b0100,m,sz,14.SI::::ld i
|
||
|
# do_ld (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Base,21.0b110100,m,sz,0,S,0,9./::::ld r
|
||
|
# do_ld (_SD, *rDest, LSI, rSource2);
|
||
|
#31.Dest,26.Base,21.0b110100,m,sz,1,S,0,9./::::ld l
|
||
|
# do_ld (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// ld.u[{.b.h.d}]
|
||
|
#void::function::do_ld_u:unsigned_word *rDest, unsigned_word Source1, unsigned_word Source2
|
||
|
# sim_io_error ("dld.u");
|
||
|
#31.Dest,26.Base,21.0b0100,m,sz,14.SI::::ld.u i
|
||
|
# do_ld_u (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Base,21.0b110100,m,sz,0,S,0,9./::::ld.u r
|
||
|
# do_ld_u (_SD, *rDest, LSI, rSource2);
|
||
|
#31.Dest,26.Base,21.0b110100,m,sz,1,S,0,9./::::ld.u l
|
||
|
# do_ld_u (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// lmo
|
||
|
#31.Dest,26.Source,111111000,0,11./::::lmo
|
||
|
|
||
|
|
||
|
// nop
|
||
|
#31.0,26.0,21.0b0000100,14.0::::nop
|
||
|
|
||
|
|
||
|
#void::function::do_or:unsigned_word *rDest, unsigned_word source1, unsigned_word source2
|
||
|
# *rD = source1 | source2;
|
||
|
|
||
|
|
||
|
// or, or.tt
|
||
|
#31.Dest,26.Source2,21.0b0010111,14.SI::::or.tt i
|
||
|
# do_or (_SD, *rDest, SI, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010111,0,11./,4.Source1::::or.tt r
|
||
|
# do_or (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110010111,1,11./::::or.tt l
|
||
|
# do_or (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// or.ff
|
||
|
#31.Dest,26.Source2,21.0b0011110,14.SI::::or.ff i
|
||
|
# do_or (_SD, *rDest, ~SI, ~rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110011110,0,11./,4.Source1::::or.ff r
|
||
|
# do_or (_SD, *rDest, ~rSource1, ~rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110011110,1,11./::::or.ff l
|
||
|
# do_or (_SD, *rDest, ~LSI, ~rSource2);
|
||
|
|
||
|
|
||
|
// or.ft
|
||
|
#31.Dest,26.Source2,21.0b0011101,14.SI::::or.ft i
|
||
|
# do_or (_SD, *rDest, ~SI, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110011101,0,11./,4.Source1::::or.ft r
|
||
|
# do_or (_SD, *rDest, ~rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110011101,1,11./::::or.ft l
|
||
|
# do_or (_SD, *rDest, ~LSI, rSource2);
|
||
|
|
||
|
|
||
|
// or.tf
|
||
|
#31.Dest,26.Source2,21.0b0011011,14.SI::::or.tf i
|
||
|
# do_or (_SD, *rDest, SI, ~rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110011011,0,11./,4.Source1::::or.tf r
|
||
|
# do_or (_SD, *rDest, rSource1, ~rSource2);
|
||
|
#31.Dest,26.Source2,21.0b110011011,1,11./::::or.tf l
|
||
|
# do_or (_SD, *rDest, LSI, ~rSource2);
|
||
|
|
||
|
|
||
|
// rdcr
|
||
|
#31.Dest,26.0,21.0b0000100,14.UCRN::::rdcr i
|
||
|
#31.Dest,26.0,21.0b110000100,0,11./,4.INDCR::::rdcr r
|
||
|
#31.Dest,26.0,21.0b110000100,1,11./::::rdcr l
|
||
|
|
||
|
|
||
|
// rmo
|
||
|
#31.Dest,26.Source,21.0b111111001,0,11./::::rmo
|
||
|
|
||
|
|
||
|
// rotl - see shift.dz
|
||
|
|
||
|
|
||
|
//rotr - see shift.dz
|
||
|
|
||
|
|
||
|
// shl - see shift.iz
|
||
|
|
||
|
|
||
|
// sl.{d|e|i}{m|s|z}
|
||
|
#31.Dest,26.Source,21.0b0001,17.Merge,14./,11.0,0,9.EndMask::::4.Rotate:sl i
|
||
|
#31.Dest,26.Source,21.0b110001,15.Merge,12.0,11.0,0,9.EndMask::::4.RotReg:sl r
|
||
|
|
||
|
|
||
|
// sli.{d|e|i}{m|s|z}
|
||
|
#31.Dest,26.Source,21.0b0001,17.Merge,14./,11.1,0,9.EndMask::::4.Rotate:sli i
|
||
|
#31.Dest,26.Source,21.0b110001,15.Merge,12.0,11.1,0,9.EndMask::::4.RotReg:sli r
|
||
|
|
||
|
|
||
|
// sr.{d|e|i}{m|s|z}
|
||
|
#31.Dest,26.Source,21.0b0001,17.Merge,14./,11.0,1,9.EndMask::::4.Rotate:sr i
|
||
|
#31.Dest,26.Source,21.0b110001,15.Merge,12.0,11.0,1,9.EndMask::::4.RotReg:sr r
|
||
|
|
||
|
|
||
|
// sra - see sr.es
|
||
|
|
||
|
|
||
|
// sri.{d|e|i}{m|s|z}
|
||
|
#31.Dest,26.Source,21.0b0001,17.Merge,14./,11.1,1,9.EndMask::::4.Rotate:sri i
|
||
|
#31.Dest,26.Source,21.0b110001,15.Merge,12.0,11.1,1,9.EndMask::::4.RotReg:sri r
|
||
|
|
||
|
|
||
|
// srl - see sr.ez
|
||
|
|
||
|
|
||
|
// st[{.b|.h|.d}]
|
||
|
#31.Dest,26.Base,21.0b0110,m,sz,14.SO::::st i
|
||
|
#31.Dest,26.Base,21.0b110110,m,sz,0,S,0,14./,4.IO::::st i
|
||
|
#31.Dest,26.Base,21.0b110110,m,sz,1,S,0,14./::::st i
|
||
|
|
||
|
|
||
|
// sub
|
||
|
#void::function::do_sub:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
# ALU_BEGIN (Source1);
|
||
|
# ALU_SUB (Source2);
|
||
|
# ALU_END (*rD);
|
||
|
#31.Dest,26.Source2,21.0b101100,0,14.SI::::sub i
|
||
|
# do_sub (_SD, *rDest, SI, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11101100,0,0,11./,4.Source1::::sub r
|
||
|
# do_sub (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11101100,0,1,11./::::sub l
|
||
|
# do_sub (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// subu
|
||
|
#void::function::do_subu:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
# ALU_BEGIN (Source1);
|
||
|
# ALU_SUBU (Source2);
|
||
|
# ALU_END (*rD);
|
||
|
#31.Dest,26.Source,21.0b101100,0,14.SI::::subu i
|
||
|
# do_subu (_SD, *rDest, SI, rSource2);
|
||
|
#31.Dest,26.Source,21.0b11101100,0,0,11./,4.Source1::::subu r
|
||
|
# do_subu (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source,21.0b11101100,0,1,11./::::subu l
|
||
|
# do_subu (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// swcr
|
||
|
#void::function::do_swcr:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
#31.Dest,26.Source,21.0b000010,1,14.SI::::swcr i
|
||
|
# do_swcr (_SD, *rDest, SI, rSource2);
|
||
|
#31.Dest,26.Source,21.0b11000010,1,0,11./,4.INDCR::::swcr r
|
||
|
# do_swcr (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source,21.0b11000010,1,1,11./::::swcr l
|
||
|
# do_swcr (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// trap
|
||
|
void::function::do_trap:instruction_address cia, unsigned_word trap_number
|
||
|
if (trap_number == 72)
|
||
|
{
|
||
|
switch (GPR(2))
|
||
|
{
|
||
|
case 1: /* EXIT */
|
||
|
{
|
||
|
engine_halt (SD, cia, sim_exited, GPR(3));
|
||
|
break;
|
||
|
}
|
||
|
case 4: /* WRITE */
|
||
|
{
|
||
|
int i;
|
||
|
if (GPR(3) != 1)
|
||
|
engine_error (SD, cia, "write to invalid fid %d", GPR(3));
|
||
|
for (i = 0; i < GPR(5); i++)
|
||
|
{
|
||
|
char c;
|
||
|
c = MEM (unsigned, GPR(4) + i, 1);
|
||
|
sim_io_write_stdout (SD, &c, 1);
|
||
|
}
|
||
|
GPR(2) = GPR(5);
|
||
|
break;
|
||
|
}
|
||
|
default:
|
||
|
engine_error (SD, cia, "unknown trap %d", GPR(2));
|
||
|
}
|
||
|
}
|
||
|
31./,27.0,26./,21.0b0000001,14.UTN::::trap i
|
||
|
do_trap (_SD, cia, UTN);
|
||
|
31./,27.0,26./,21.0b110000001,12.0,11./,4.INDTR::::trap r
|
||
|
do_trap (_SD, cia, UTN);
|
||
|
31./,27.0,26./,21.0b110000001,12.1,11./::::trap l
|
||
|
long_immediate (UTN);
|
||
|
do_trap (_SD, cia, UTN);
|
||
|
|
||
|
|
||
|
// vadd.{s|d}{s|d}
|
||
|
#void::function::do_vadd:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
#31.*,26.Dest,21.0b11110,r,000,r,*,**,7.PD,6.*,5.P1,4.Source::::vadd r
|
||
|
# do_vadd (_SD, *rDest, SI, rSource2);
|
||
|
#31.*,26.Dest,21.0b1111110,r,000,r,*,**,7.PD,6.*,5.P1,4./::::vadd l
|
||
|
# do_vadd (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// vld{0|1}.{s|d}
|
||
|
#31.Dest,26.*,21.0b11110,18.*,10.1,S,**,p,******::::vld r
|
||
|
|
||
|
|
||
|
// vmac.ss{s|d}
|
||
|
#31.*,26.Source2,21.0b11110,a,110,0,a,**,Z,r,*,r,4.Source1::::vmac.ss ra
|
||
|
#31.Dest,26.Source2,21.0b11110,a,110,0,a,**,Z,r,*,r,4.Source1::::vmac.ss rr
|
||
|
#31.*,26.Source2,21.0b11110,a,110,0,a,**,Z,r,*,r,4.Source1::::vmac.ss ia
|
||
|
#31.Dest,26.Source2,21.0b11110,a,110,0,a,**,Z,r,*,r,4.Source1::::vmac.ss ir
|
||
|
|
||
|
|
||
|
// vmpy.{s|d}{s|d}
|
||
|
#void::function::do_vmpy:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
#31.*,26.Dest,21.0b11110,r,000,r,*,**,7.PD,6.*,5.P1,4.Source::::vmpy r
|
||
|
# do_vmpy (_SD, *rDest, SI, rSource2);
|
||
|
#31.*,26.Dest,21.0b1111110,r,000,r,*,**,7.PD,6.*,5.P1,4./::::vmpy l
|
||
|
# do_vmpy (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// vmsc.ss{s|d}
|
||
|
#31.*,26.Source2,21.0b11110,a,110,0,a,**,Z,r,*,r,4.Source1::::vmsc.ss ra
|
||
|
#31.Dest,26.Source2,21.0b11110,a,110,0,a,**,Z,r,*,r,4.Source1::::vmsc.ss rr
|
||
|
#31.*,26.Source2,21.0b11110,a,110,0,a,**,Z,r,*,r,4.Source1::::vmsc.ss ia
|
||
|
#31.Dest,26.Source2,21.0b11110,a,110,0,a,**,Z,r,*,r,4.Source1::::vmsc.ss ir
|
||
|
|
||
|
|
||
|
// vmsub.{s|d}{s|d}
|
||
|
#void::function::do_vmsub:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
#31.*,26.Dest,21.0b11110,r,000,r,*,**,7.PD,6.*,5.P1,4.Source::::vmsub r
|
||
|
# do_vmsub (_SD, *rDest, SI, rSource2);
|
||
|
#31.*,26.Dest,21.0b1111110,r,000,r,*,**,7.PD,6.*,5.P1,4./::::vmsub l
|
||
|
# do_vmsub (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// vrnd.{s|d}{s|d}
|
||
|
#void::function::do_vrnd:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
#31.*,26.Dest,21.0b11110,r,000,r,*,**,7.PD,6.*,5.P1,4.Source::::vrnd r
|
||
|
# do_vrnd (_SD, *rDest, SI, rSource2);
|
||
|
#31.*,26.Dest,21.0b1111110,r,000,r,*,**,7.PD,6.*,5.P1,4./::::vrnd l
|
||
|
# do_vrnd (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// vrnd.{i|u}{s|d}
|
||
|
#void::function::do_vrnd:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
#31.*,26.Dest,21.0b11110,r,000,r,*,**,7.PD,6.*,5.P1,4.Source::::vrnd r
|
||
|
# do_vrnd (_SD, *rDest, SI, rSource2);
|
||
|
#31.*,26.Dest,21.0b1111110,r,000,r,*,**,7.PD,6.*,5.P1,4./::::vrnd l
|
||
|
# do_vrnd (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// vst.{s|d}
|
||
|
#31.Source,26.*,21.0b1110,16.*,10.0,9.S,**,1,******::::vst
|
||
|
|
||
|
|
||
|
// vsub.{i|u}{s|d}
|
||
|
#void::function::do_vsub:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
#31.*,26.Dest,21.0b11110,r,000,r,*,**,7.PD,6.*,5.P1,4.Source::::vsub r
|
||
|
# do_vsub (_SD, *rDest, SI, rSource2);
|
||
|
#31.*,26.Dest,21.0b1111110,r,000,r,*,**,7.PD,6.*,5.P1,4./::::vsub l
|
||
|
# do_vsub (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// wrcr
|
||
|
#void::function::do_wrcr:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
#31.Dest,26.Source,21.0b000010,1,14.SI::::wrcr i
|
||
|
# do_wrcr (_SD, *rDest, SI, rSource2);
|
||
|
#31.Dest,26.Source,21.0b11000010,1,0,11./,4.INDCR::::wrcr r
|
||
|
# do_wrcr (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source,21.0b11000010,1,1,11./::::wrcr l
|
||
|
# do_wrcr (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// xnor
|
||
|
#void::function::do_xnor:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
# ALU_BEGIN (Source1);
|
||
|
# ALU_XNOR (Source2);
|
||
|
# ALU_END (*rD);
|
||
|
#31.Dest,26.Source2,21.0b101100,0,14.SI::::xnor i
|
||
|
# do_xnor (_SD, *rDest, SI, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11101100,0,0,11./,4.Source1::::xnor r
|
||
|
# do_xnor (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11101100,0,1,11./::::xnor l
|
||
|
# do_xnor (_SD, *rDest, LSI, rSource2);
|
||
|
|
||
|
|
||
|
// xor
|
||
|
#void::function::do_xor:signed_word *rDest, signed_word Source1, signed_word Source2
|
||
|
# ALU_BEGIN (Source1);
|
||
|
# ALU_XOR (Source2);
|
||
|
# ALU_END (*rD);
|
||
|
#31.Dest,26.Source2,21.0b101100,0,14.SI::::xor i
|
||
|
# do_xor (_SD, *rDest, SI, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11101100,0,0,11./,4.Source1::::xor r
|
||
|
# do_xor (_SD, *rDest, rSource1, rSource2);
|
||
|
#31.Dest,26.Source2,21.0b11101100,0,1,11./::::xor l
|
||
|
# do_xor (_SD, *rDest, LSI, rSource2);
|