
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sh4/sh4.def	Mon Feb 25 23:40:10 2008 +0000
@@ -0,0 +1,236 @@
+##
+## Instruction file for the SH4 - from the SH4 manual.
+##   line ::= bitpattern WHITESPACE result NEWLINE
+##   bitpattern ::= { '0' | '1' | '(' operand ')' }
+##   operand ::= IDENTIFIER ':' NUMBER signspec
+##   signspec ::= 'u' | 's' |
+##   result ::= { IDENTIFIER | NON-IDENT-CHAR }
+
+registers {
+   uint32    Rm, Rn = r0..r15
+   uint32    Rm_BANK, Rn_BANK = r8_bank..r15_bank
+   float     Frm, Frn = fr0..fr15
+   float     XFm, XFn = xf0..xf15
+   double    Drm, Drn = dr0..dr8 overlaps fr0..fr15 swapped
+   double    XDm, XDn = xd0..xd8 overlaps xf0..xf15 swapped
+   float[4]  FVm, FVn = fv0..fv3 overlaps fr0..fr15
+   float[16] XMTRX = xmtrx overlaps xf0..xf15
+
+## Special registers
+   uint32 GBR, SR, VBR, SSR, SGR SPC, DBR
+   uint32 FPSCR, FPUL, MACH, MACL, PR, PC
+   
+}
+
+0011(Rn:4)(Rm:4)1100 ADD Rm, Rn
+0111(Rn:4)(imm:8s)   ADD #imm, Rn
+0011(Rn:4)(Rm:4)1110 ADDC Rm, Rn
+0011(Rn:4)(Rm:4)1111 ADDV Rm, Rn
+0010(Rn:4)(Rm:4)1001 AND Rm, Rn
+11001001(imm:8u)     AND #imm, R0
+11001101(imm:8u)     AND.B #imm, @(R0, GBR)
+10001011(disp:8s<<1)    BF disp
+10001111(disp:8s<<1)    BF/S disp
+1010(disp:12s<<1)       BRA disp
+0000(Rn:4)00100011   BRAF Rn
+1011(disp:12s<<1)       BSR disp
+0000(Rn:4)00000011   BSRF Rn
+10001001(disp:8s<<1)    BT disp
+10001101(disp:8s<<1)    BT/S disp
+0000000000101000     CLRMAC
+0000000001001000     CLRS
+0000000000001000     CLRT
+0011(Rn:4)(Rm:4)0000 CMP/EQ Rm, Rn
+10001000(imm:8s)     CMP/EQ #imm, R0
+0011(Rn:4)(Rm:4)0011 CMP/GE Rm, Rn
+0011(Rn:4)(Rm:4)0111 CMP/GT Rm, Rn
+0011(Rn:4)(Rm:4)0110 CMP/HI Rm, Rn
+0011(Rn:4)(Rm:4)0010 CMP/HS Rm, Rn
+0100(Rn:4)00010101   CMP/PL Rn
+0100(Rn:4)00010001   CMP/PZ Rn
+0010(Rn:4)(Rm:4)1100 CMP/STR Rm, Rn
+0010(Rn:4)(Rm:4)0111 DIV0S Rm, Rn
+0000000000011001     DIV0U
+0011(Rn:4)(Rm:4)0100 DIV1 Rm, Rn
+0011(Rn:4)(Rm:4)1101 DMULS.L Rm, Rn
+0011(Rn:4)(Rm:4)0101 DMULU.L Rm, Rn
+0100(Rn:4)00010000   DT Rn
+0110(Rn:4)(Rm:4)1110 EXTS.B Rm, Rn
+0110(Rn:4)(Rm:4)1111 EXTS.W Rm, Rn
+0110(Rn:4)(Rm:4)1100 EXTU.B Rm, Rn
+0110(Rn:4)(Rm:4)1101 EXTU.W Rm, Rn
+1111(FRn:4)01011101    FABS FRn
+1111(FRn:4)(FRm:4)0000 FADD FRm, FRn
+1111(FRn:4)(FRm:4)0100 FCMP/EQ FRm, FRn
+1111(FRn:4)(FRm:4)0101 FCMP/GT FRm, FRn
+1111(FRm:4)10111101    FCNVDS FRm, FPUL
+1111(FRn:4)10101101    FCNVSD FPUL, FRn
+1111(FRn:4)(FRm:4)0011 FDIV FRm, FRn
+1111(FVn:2)(FVm:2)11101101 FIPR FVm, FVn
+1111(FRm:4)00011101    FLDS FRm, FPUL
+1111(FRn:4)10001101    FLDI0 FRn
+1111(FRn:4)10011101    FLDI1 FRn
+1111(FRn:4)00101101    FLOAT FPUL, FRn
+1111(FRn:4)(FRm:4)1110 FMAC FR0, FRm, FRn
+1111(FRn:4)(FRm:4)1100 FMOV FRm, FRn
+1111(Rn:4)(FRm:4)1010  FMOV FRm, @Rn
+1111(Rn:4)(FRm:4)1011  FMOV FRm, @-Rn
+1111(Rn:4)(FRm:4)0111  FMOV FRm, @(R0, Rn)
+1111(FRn:4)(Rm:4)1000  FMOV @Rm, FRn
+1111(FRn:4)(Rm:4)1001  FMOV @Rm+, FRn
+1111(FRn:4)(Rm:4)0110  FMOV @(R0, Rm), FRn
+1111(FRn:4)(FRm:4)0010 FMUL FRm, FRn
+1111(FRn:4)01001101    FNEG FRn
+1111101111111101       FRCHG
+1111(FRn:3<<1)011111101   FSCA FPUL, FRn
+1111001111111101       FSCHG
+1111(FRn:4)01101101    FSQRT FRn
+1111(FRn:4)01111101    FSRRA FRn
+1111(FRn:4)00001101    FSTS FPUL, FRn
+1111(FRn:4)(FRm:4)0001 FSUB FRm, FRn
+1111(FRm:4)00111101    FTRC FRm, FPUL
+1111(FVn:2)0111111101  FTRV XMTRX, FVn
+0100(Rn:4)00101011   JMP @Rn
+0100(Rn:4)00001011   JSR @Rn
+0100(Rm:4)00011110   LDC Rm, GBR
+0100(Rm:4)00001110   LDC Rm, SR
+0100(Rm:4)00101110   LDC Rm, VBR
+0100(Rm:4)00111110   LDC Rm, SSR
+0100(Rm:4)00111010   LDC Rm, SGR
+0100(Rm:4)01001110   LDC Rm, SPC
+0100(Rm:4)11111010   LDC Rm, DBR
+0100(Rm:4)1(Rn_BANK:3)1110 LDC Rm, Rn_BANK
+0100(Rm:4)00010111   LDC.L @Rm+, GBR
+0100(Rm:4)00000111   LDC.L @Rm+, SR
+0100(Rm:4)00100111   LDC.L @Rm+, VBR
+0100(Rm:4)00110111   LDC.L @Rm+, SSR
+0100(Rm:4)00110110   LDC.L @Rm+, SGR
+0100(Rm:4)01000111   LDC.L @Rm+, SPC
+0100(Rm:4)11110110   LDC.L @Rm+, DBR
+0100(Rm:4)1(Rn_BANK:3)0111 LDC.L @Rm+, Rn_BANK
+0100(Rm:4)01101010   LDS Rm, FPSCR
+0100(Rm:4)01100110   LDS.L @Rm+, FPSCR
+0100(Rm:4)01011010   LDS Rm, FPUL
+0100(Rm:4)01010110   LDS.L @Rm+, FPUL
+0100(Rm:4)00001010   LDS Rm, MACH
+0100(Rm:4)00000110   LDS.L @Rm+, MACH
+0100(Rm:4)00011010   LDS Rm, MACL
+0100(Rm:4)00010110   LDS.L @Rm+, MACL
+0100(Rm:4)00101010   LDS Rm, PR
+0100(Rm:4)00100110   LDS.L @Rm+, PR
+0000000000111000     LDTLB
+0000(Rn:4)(Rm:4)1111 MAC.L @Rm+, @Rn+
+0100(Rn:4)(Rm:4)1111 MAC.W @Rm+, @Rn+
+0110(Rn:4)(Rm:4)0011 MOV Rm, Rn
+1110(Rn:4)(imm:8s)   MOV #imm, Rn
+0010(Rn:4)(Rm:4)0000 MOV.B Rm, @Rn
+0010(Rn:4)(Rm:4)0100 MOV.B Rm, @-Rn
+0000(Rn:4)(Rm:4)0100 MOV.B Rm, @(R0, Rn)
+11000000(disp:8)     MOV.B R0, @(disp, GBR)
+10000000(Rn:4)(disp:4) MOV.B R0, @(disp, Rn)
+0110(Rn:4)(Rm:4)0000 MOV.B @Rm, Rn
+0110(Rn:4)(Rm:4)0100 MOV.B @Rm+, Rn
+0000(Rn:4)(Rm:4)1100 MOV.B @(R0, Rm), Rn
+11000100(disp:8)     MOV.B @(disp, GBR), R0
+10000100(Rm:4)(disp:4) MOV.B @(disp, Rm), R0
+0010(Rn:4)(Rm:4)0010 MOV.L Rm, @Rn
+0010(Rn:4)(Rm:4)0110 MOV.L Rm, @-Rn
+0000(Rn:4)(Rm:4)0110 MOV.L Rm, @(R0, Rn)
+11000010(disp:8<<2)     MOV.L R0, @(disp, GBR)
+0001(Rn:4)(Rm:4)(disp:4<<2) MOV.L Rm, @(disp, Rn)
+0110(Rn:4)(Rm:4)0010 MOV.L @Rm, Rn
+0110(Rn:4)(Rm:4)0110 MOV.L @Rm+, Rn
+0000(Rn:4)(Rm:4)1110 MOV.L @(R0, Rm), Rn
+11000110(disp:8<<2)     MOV.L @(disp, GBR), R0
+1101(Rn:4)(disp:8<<2)   MOV.L @(disp, PC), Rn
+0101(Rn:4)(Rm:4)(disp:4<<2) MOV.L @(disp, Rm), Rn
+0010(Rn:4)(Rm:4)0001 MOV.W Rm, @Rn
+0010(Rn:4)(Rm:4)0101 MOV.W Rm, @-Rn
+0000(Rn:4)(Rm:4)0101 MOV.W Rm, @(R0, Rn)
+11000001(disp:8<<1)     MOV.W R0, @(disp, GBR)
+10000001(Rn:4)(disp:4<<1) MOV.W R0, @(disp, Rn)
+0110(Rn:4)(Rm:4)0001 MOV.W @Rm, Rn
+0110(Rn:4)(Rm:4)0101 MOV.W @Rm+, Rn
+0000(Rn:4)(Rm:4)1101 MOV.W @(R0, Rm), Rn
+11000101(disp:8<<1)     MOV.W @(disp, GBR), R0
+1001(Rn:4)(disp:8<<1)   MOV.W @(disp, PC), Rn
+10000101(Rm:4)(disp:4<<1) MOV.W @(disp, Rm), R0
+11000111(disp:8<<2)     MOVA @(disp, PC), R0
+0000(Rn:4)11000011   MOVCA.L R0, @Rn
+0000(Rn:4)00101001   MOVT Rn
+0000(Rn:4)(Rm:4)0111 MUL.L Rm, Rn
+0010(Rn:4)(Rm:4)1111 MULS.W Rm, Rn
+0010(Rn:4)(Rm:4)1110 MULU.W Rm, Rn
+0110(Rn:4)(Rm:4)1011 NEG Rm, Rn
+0110(Rn:4)(Rm:4)1010 NEGC Rm, Rn
+0000000000001001     NOP
+0110(Rn:4)(Rm:4)0111 NOT Rm, Rn
+0000(Rn:4)10010011   OCBI @Rn
+0000(Rn:4)10100011   OCBP @Rn
+0000(Rn:4)10110011   OCBWB @Rn
+0010(Rn:4)(Rm:4)1011 OR Rm, Rn
+11001011(imm:8)      OR #imm, R0
+11001111(imm:8)      OR.B #imm, @(R0, GBR)
+0000(Rn:4)10000011   PREF @Rn
+0100(Rn:4)00100100   ROTCL Rn
+0100(Rn:4)00100101   ROTCR Rn
+0100(Rn:4)00000100   ROTL Rn
+0100(Rn:4)00000101   ROTR Rn
+0000000000101011     RTE
+0000000000001011     RTS
+0000000001011000     SETS
+0000000000011000     SETT
+0100(Rn:4)(Rm:4)1100 SHAD Rm, Rn
+0100(Rn:4)00100000   SHAL Rn
+0100(Rn:4)00100001   SHAR Rn
+0100(Rn:4)(Rm:4)1101 SHLD Rm, Rn
+0100(Rn:4)00000000   SHLL Rn
+0100(Rn:4)00001000   SHLL2 Rn
+0100(Rn:4)00011000   SHLL8 Rn
+0100(Rn:4)00101000   SHLL16 Rn
+0100(Rn:4)00000001   SHLR Rn
+0100(Rn:4)00001001   SHLR2 Rn
+0100(Rn:4)00011001   SHLR8 Rn
+0100(Rn:4)00101001   SHLR16 Rn
+0000000000011011     SLEEP
+0000(Rn:4)00000010   STC SR, Rn
+0000(Rn:4)00010010   STC GBR, Rn
+0000(Rn:4)00100010   STC VBR, Rn
+0000(Rn:4)00110010   STC SSR, Rn
+0000(Rn:4)01000010   STC SPC, Rn
+0000(Rn:4)00111010   STC SGR, Rn
+0000(Rn:4)11111010   STC DBR, Rn
+0000(Rn:4)1(Rm_BANK:3)0010 STC Rm_BANK, Rn
+0100(Rn:4)00000011   STC.L SR, @-Rn
+0100(Rn:4)00100011   STC.L VBR, @-Rn
+0100(Rn:4)00110011   STC.L SSR, @-Rn
+0100(Rn:4)01000011   STC.L SPC, @-Rn
+0100(Rn:4)00110010   STC.L SGR, @-Rn
+0100(Rn:4)11110010   STC.L DBR, @-Rn
+0100(Rn:4)1(Rm_BANK:3)0011 STC.L Rm_BANK, @-Rn
+0100(Rn:4)00010011   STC.L GBR, @-Rn
+0000(Rn:4)01101010   STS FPSCR, Rn
+0100(Rn:4)01100010   STS.L FPSCR, @-Rn
+0000(Rn:4)01011010   STS FPUL, Rn
+0100(Rn:4)01010010   STS.L FPUL, @-Rn
+0000(Rn:4)00001010   STS MACH, Rn
+0100(Rn:4)00000010   STS.L MACH, @-Rn
+0000(Rn:4)00011010   STS MACL, Rn
+0100(Rn:4)00010010   STS.L MACL, @-Rn
+0000(Rn:4)00101010   STS PR, Rn
+0100(Rn:4)00100010   STS.L PR, @-Rn
+0011(Rn:4)(Rm:4)1000 SUB Rm, Rn
+0011(Rn:4)(Rm:4)1010 SUBC Rm, Rn
+0011(Rn:4)(Rm:4)1011 SUBV Rm, Rn
+0110(Rn:4)(Rm:4)1000 SWAP.B Rm, Rn
+0110(Rn:4)(Rm:4)1001 SWAP.W Rm, Rn
+0100(Rn:4)00011011   TAS.B @Rn
+11000011(imm:8)      TRAPA #imm
+0010(Rn:4)(Rm:4)1000 TST Rm, Rn
+11001000(imm:8)      TST #imm, R0
+11001100(imm:8)      TST.B #imm, @(R0, GBR)
+0010(Rn:4)(Rm:4)1010 XOR Rm, Rn
+11001010(imm:8)      XOR #imm, R0
+11001110(imm:8)      XOR.B #imm, @(R0, GBR)
+0010(Rn:4)(Rm:4)1101 XTRCT Rm, Rn
+1111111111111101     UNDEF




