From: <aot...@us...> - 2005-07-17 00:15:02
|
Update of /cvsroot/gc-linux/binutils/opcodes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4543/opcodes Modified Files: ppc-dis.c ppc-opc.c Log Message: From: Anders M Montonen <amm...@cc...> To: gc-...@li... Subject: [Gc-linux-devel] Gekko binutils patch Date: Sun, 2 May 2004 19:11:02 +0300 (EET DST) Hi, this is a in-progress patch for adding support for the Gekko instructions to binutils (as and objdump). It's not well-tested at all, and it's incomplete because the load and store instructions are still missing because I don't really understand their encoding (eg. what do the W and I fields represent?) The patch is against current CVS, and any help testing/fixing/whatever is appreciated. To assemble Gekko instructions, pass "-mgekko" to as, and to disassemble them pass "-Mgekko" to objdump. -Anders Index: ppc-dis.c =================================================================== RCS file: /cvsroot/gc-linux/binutils/opcodes/ppc-dis.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- ppc-dis.c 16 Jul 2005 23:02:52 -0000 1.1.1.1 +++ ppc-dis.c 17 Jul 2005 00:14:51 -0000 1.2 @@ -83,6 +83,15 @@ dialect |= PPC_OPCODE_64; } + if (info->disassembler_options) + { + if (strstr (info->disassembler_options, "gekko") != NULL) + { + dialect &= ~(PPC_OPCODE_ALTIVEC | PPC_OPCODE_403); + dialect |= PPC_OPCODE_GEKKO; + } + } + ((struct dis_private *) &info->private_data)->dialect = dialect; return dialect; } @@ -304,4 +313,5 @@ fprintf (stream, " power4 Disassemble the Power4 instructions\n"); fprintf (stream, " 32 Do not disassemble 64-bit instructions\n"); fprintf (stream, " 64 Allow disassembly of 64-bit instructions\n"); + fprintf (stream, " gekko Disassemble the Gamecube Gekko instructions\n"); } Index: ppc-opc.c =================================================================== RCS file: /cvsroot/gc-linux/binutils/opcodes/ppc-opc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- ppc-opc.c 16 Jul 2005 23:03:08 -0000 1.1.1.1 +++ ppc-opc.c 17 Jul 2005 00:14:51 -0000 1.2 @@ -1805,6 +1805,7 @@ #define PPCCHLK PPC_OPCODE_CACHELCK #define PPCCHLK64 PPC_OPCODE_CACHELCK | PPC_OPCODE_BOOKE64 #define PPCRFMCI PPC_OPCODE_RFMCI +#define PPCGEKKO PPC_OPCODE_GEKKO /* The opcode table. @@ -2398,6 +2399,61 @@ { "evdivws", VX(4, 1222), VX_MASK, PPCSPE, { RS, RA, RB } }, { "evdivwu", VX(4, 1223), VX_MASK, PPCSPE, { RS, RA, RB } }, +{ "ps_abs", XRC(4,264,0),XRA_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_abs.", XRC(4,264,1),XRA_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_add", A(4,21,0), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_add.", A(4,21,1), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_cmpo0", X(4,32),X_MASK|(3<<21), PPCGEKKO, { BF, FRA, FRB } }, +{ "ps_cmpo1", X(4,96),X_MASK|(3<<21), PPCGEKKO, { BF, FRA, FRB } }, +{ "ps_cmpu0", X(4,0), X_MASK|(3<<21), PPCGEKKO, { BF, FRA, FRB } }, +{ "ps_cmpu1", X(4,64),X_MASK|(3<<21), PPCGEKKO, { BF, FRA, FRB } }, +{ "ps_div", A(4,18,0), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_div.", A(4,18,1), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_merge00", A(4,528,0), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_merge00.",A(4,528,1), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_merge01", A(4,560,0), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_merge01.",A(4,560,1), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_merge10", A(4,597,0), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_merge10.",A(4,597,1), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_merge11", A(4,624,0), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_merge11.",A(4,624,1), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB } }, +{ "ps_mr", XRC(4,72,0), XRA_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_mr.", XRC(4,72,1), XRA_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_nabs", XRC(4,136,0),XRA_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_nabs.", XRC(4,136,1),XRA_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_neg", XRC(4,40,0), XRA_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_neg.", XRC(4,40,1), XRA_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_res", A(4,24,0), AFRAFRC_MASK,PPCGEKKO, { FRT, FRB } }, +{ "ps_res.", A(4,24,1), AFRAFRC_MASK,PPCGEKKO, { FRT, FRB } }, +{ "ps_rsqrte", A(4,26,0), AFRAFRC_MASK,PPCGEKKO, { FRT, FRB } }, +{ "ps_rsqrte.", A(4,26,1), AFRAFRC_MASK,PPCGEKKO, { FRT, FRB } }, +{ "ps_sub", A(4,20,0), AFRC_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_sub.", A(4,20,1), AFRC_MASK, PPCGEKKO, { FRT, FRB } }, +{ "ps_madd", A(4,29,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_madd.", A(4,29,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_madds0", A(4,14,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_madds0.", A(4,14,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_madds1", A(4,15,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_madds1.", A(4,15,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_msub", A(4,28,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_msub.", A(4,28,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_mul", A(4,25,0), AFRB_MASK, PPCGEKKO, { FRT, FRA, FRC } }, +{ "ps_mul.", A(4,25,1), AFRB_MASK, PPCGEKKO, { FRT, FRA, FRC } }, +{ "ps_muls0", A(4,12,0), AFRB_MASK, PPCGEKKO, { FRT, FRA, FRC } }, +{ "ps_muls0.", A(4,12,1), AFRB_MASK, PPCGEKKO, { FRT, FRA, FRC } }, +{ "ps_muls1", A(4,13,0), AFRB_MASK, PPCGEKKO, { FRT, FRA, FRC } }, +{ "ps_muls1.", A(4,13,1), AFRB_MASK, PPCGEKKO, { FRT, FRA, FRC } }, +{ "ps_nmadd", A(4,31,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_nmadd.", A(4,31,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_nmsub", A(4,30,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_nmsub.", A(4,30,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_sel", A(4,23,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_sel.", A(4,23,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_sum0", A(4,10,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_sum0.", A(4,10,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_sum1", A(4,11,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, +{ "ps_sum1.", A(4,11,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB } }, + { "mulli", OP(7), OP_MASK, PPCCOM, { RT, RA, SI } }, { "muli", OP(7), OP_MASK, PWRCOM, { RT, RA, SI } }, |