opcodes.h 3.99 KB

#define OP_RS  5,0
#define OP_RT  5,0
#define OP_RD  5,0
#define OP_VS  5,0
#define OP_VT  5,0
#define OP_VD  5,0
#define OP_IMMEDIATE 16,0
#define OP_TARGET 26,0
#define OP_BASE 5,0
#define OP_OFFSET 16,0
#define OP_SA 5,0
#define OP_ELEMENT 4,0
#define OP_SHIFT	2,0

#define OP_COP0		6,0x10
#define OP_COP2		6,0x12
#define OP_SPECIAL	6,0x00
#define OP_ONE 		1,0x1
#define OP_ZERO		1,0x0
#define OP_ZERO3	3,0x0
#define OP_ZERO4	4,0x0
#define OP_ZERO5	5,0x00
#define OP_ZERO6	6,0x00
#define OP_ZERO10	10,0x000
#define OP_ZERO11	11,0x000
#define OP_ZERO15	15,0x0000

#define OP_LWC2	6,0x32
#define OP_SWC2	6,0x3a
/* LWC2/SWC2 load/store types: */
#define OP_LSB	5,0x00
#define OP_LSS	5,0x01
#define OP_LSL	5,0x02
#define OP_LSD	5,0x03
#define OP_LSQ	5,0x04
#define OP_LSR	5,0x05
#define OP_LSP	5,0x06
#define OP_LSU	5,0x07
#define OP_LSH	5,0x08
#define OP_LSF	5,0x09
#define OP_LSW	5,0x0a
#define OP_LST	5,0x0b
#define OP_LSBE	5,0x10	/* obsolete? */
#define OP_LSSE	5,0x11
#define OP_LSLE	5,0x12
#define OP_LSDE	5,0x13
#define OP_LSQE	5,0x14
#define OP_LSPE	5,0x15
#define OP_LSUE	5,0x16
#define OP_LSHE	5,0x17
#define OP_LSFE	5,0x18
#define OP_LSAE	5,0x19

#define OP_MFC0	5,0x00
#define OP_MTC0	5,0x04
#define OP_BC0	5,0x08

#define OP_MFC2	5,0x00
#define OP_CFC2	5,0x02
#define OP_MTC2	5,0x04
#define OP_CTC2	5,0x06

#define OP_VALIGN	2,0x3
#define OP_R   1,0x1
#define OP_S   1,0x0

#define OP_ADD 6,0x20
#define OP_ADDI 6,0x08
#define OP_ADDIU 6,0x09
#define OP_ADDU 6,0x21
#define OP_AND 6,0x24
#define OP_ANDI 6,0x0c
#define OP_BEQ 6,0x04
#define OP_REGIMM 6,0x01
#define OP_BGEZ 5,0x01
#define OP_BGEZAL 5,0x11
#define OP_BGTZ 6,0x07
#define OP_BLEZ 6,0x06
#define OP_BLTZ 5,0x00
#define OP_BLTZAL 5,0x10
#define OP_BNE 6,0x05
#define OP_J 6,0x02
#define OP_JAL 6,0x03
#define OP_JALR 6,0x09
#define OP_BREAK 6,0x0d
#define OP_JR 6,0x08
#define OP_LB 6,0x20
#define OP_LBU 6,0x24
#define OP_LH 6,0x21
#define OP_LHU 6,0x25
#define OP_LUI 6,0x0f
#define OP_LW 6,0x23
#define OP_NOR 6,0x27
#define OP_OR 6,0x25
#define OP_ORI 6,0x0d
#define OP_SB 6,0x28
#define OP_SH 6,0x29
#define OP_SLL 6,0x00
#define OP_SLLV 6,0x04
#define OP_SLT 6,0x2a
#define OP_SLTI 6,0x0a
#define OP_SLTIU 6,0x0b
#define OP_SLTU 6,0x2b
#define OP_SRA 6,0x03
#define OP_SRAV 6,0x07
#define OP_SRL 6,0x02
#define OP_SRLV 6,0x06
#define OP_SUB 6,0x22
#define OP_SUBU 6,0x23
#define OP_SW 6,0x2b
#define OP_XOR 6,0x26
#define OP_XORI 6,0x0e

/*
 * added Fri Mar  4 13:52:55 PST 1994
 * by steve
 */

#define OP_MULT 6,0x18
#define OP_MULTU 6,0x19
#define OP_DIV 6,0x1a
#define OP_DIVU 6,0x1b
#define OP_MFHI 6,0x10
#define OP_MTHI 6,0x11
#define OP_MFLO 6,0x12
#define OP_MTLO 6,0x13

/* VU operate instructions */
#define OP_VMULF	6,0x00
#define OP_VMACF	6,0x08
#define OP_VMULU	6,0x01
#define OP_VMACU	6,0x09
#define OP_VRNDP	6,0x02
#define OP_VRNDN	6,0x0a
#define OP_VMULQ	6,0x03
#define OP_VMACQ	6,0x0b
#define OP_VMUDL	6,0x04
#define OP_VMADL	6,0x0c
#define OP_VMUDM	6,0x05
#define OP_VMADM	6,0x0d
#define OP_VMUDN	6,0x06
#define OP_VMADN	6,0x0e
#define OP_VMUDH	6,0x07
#define OP_VMADH	6,0x0f
#define OP_VADD		6,0x10
#define OP_VSUB		6,0x11
#define OP_VSUT		6,0x12
#define OP_VABS		6,0x13
#define OP_VADDC	6,0x14
#define OP_VSUBC	6,0x15
#define OP_VADDB	6,0x16
#define OP_VSUBB	6,0x17
#define OP_VACCB	6,0x18
#define OP_VSUCB	6,0x19
#define OP_VSAD		6,0x1a
#define OP_VSAC		6,0x1b
#define OP_VSUM		6,0x1c
#define OP_VSAW		6,0x1d
#define OP_VLT  6,0x20
#define OP_VEQ  6,0x21
#define OP_VNE  6,0x22
#define OP_VGE  6,0x23
#define OP_VCL  6,0x24
#define OP_VCH  6,0x25
#define OP_VCR  6,0x26
#define OP_VMRG 6,0x27

#define OP_VAND		6,0x28
#define OP_VNAND	6,0x29
#define OP_VOR		6,0x2a
#define OP_VNOR		6,0x2b
#define OP_VXOR		6,0x2c
#define OP_VNXOR	6,0x2d

#define OP_VRCP  6,0x30
#define OP_VRCPL 6,0x31
#define OP_VRCPH 6,0x32
#define OP_VRSQ  6,0x34
#define OP_VRSQL 6,0x35
#define OP_VRSQH 6,0x36
#define OP_VNOP 6,0x37
#define OP_VMOV  6,0x33

#define OP_VINST  6,0x3c
#define OP_VEXTT  6,0x38
#define OP_VINSQ  6,0x3d
#define OP_VEXTQ  6,0x39
#define OP_VINSN  6,0x3e
#define OP_VEXTN  6,0x3a