From: <aot...@us...> - 2005-07-18 00:18:31
|
Update of /cvsroot/gc-linux/binutils/opcodes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25832/opcodes Modified Files: ppc-dis.c ppc-opc.c Log Message: Merge http://www.helsinki.fi/~ammonton/gekko-041107.patch - Add support for General Quantization Registers (GQRs) - Accompanying insns: psq_lx,lux,stx,stux,l,lu,st,stu dcbz_l Index: ppc-dis.c =================================================================== RCS file: /cvsroot/gc-linux/binutils/opcodes/ppc-dis.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ppc-dis.c 17 Jul 2005 00:14:51 -0000 1.2 +++ ppc-dis.c 18 Jul 2005 00:18:20 -0000 1.3 @@ -63,6 +63,9 @@ else if (info->disassembler_options && strstr (info->disassembler_options, "efs") != NULL) dialect |= PPC_OPCODE_EFS; + else if (info->disassembler_options + && strstr (info->disassembler_options, "gekko") != NULL) + dialect |= PPC_OPCODE_GEKKO; else dialect |= (PPC_OPCODE_403 | PPC_OPCODE_601 | PPC_OPCODE_CLASSIC | PPC_OPCODE_COMMON | PPC_OPCODE_ALTIVEC); @@ -83,15 +86,6 @@ 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; } @@ -248,6 +242,8 @@ (*info->print_address_func) (memaddr + value, info); else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0) (*info->print_address_func) ((bfd_vma) value & 0xffffffff, info); + else if ((operand->flags & PPC_OPERAND_GQR) != 0) + (*info->fprintf_func) (info->stream, "gqr%ld", value); else if ((operand->flags & PPC_OPERAND_CR) == 0 || (dialect & PPC_OPCODE_PPC) == 0) (*info->fprintf_func) (info->stream, "%ld", value); Index: ppc-opc.c =================================================================== RCS file: /cvsroot/gc-linux/binutils/opcodes/ppc-opc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ppc-opc.c 17 Jul 2005 00:14:51 -0000 1.2 +++ ppc-opc.c 18 Jul 2005 00:18:20 -0000 1.3 @@ -92,6 +92,10 @@ static long extract_ev4 (unsigned long, int, int *); static unsigned long insert_ev8 (unsigned long, long, int, const char **); static long extract_ev8 (unsigned long, int, int *); +static unsigned long insert_psq_gd (unsigned long, long, int, const char **); +static long extract_psq_gd (unsigned long, int, int *); +static unsigned long insert_psq_gx (unsigned long, long, int, const char **); +static long extract_psq_gx (unsigned long, int, int *); /* The operands table. @@ -558,8 +562,21 @@ #define MTMSRD_L WS + 1 { 1, 16, NULL, NULL, PPC_OPERAND_OPTIONAL }, -}; +#define PSQ_DD MTMSRD_L + 1 + { 12, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED }, + +#define PSQ_WD PSQ_DD + 1 + { 1, 15, 0, 0, 0 }, + +#define PSQ_GD PSQ_WD + 1 + { 10, 12, insert_psq_gd, extract_psq_gd, PPC_OPERAND_GQR }, + +#define PSQ_WX PSQ_GD + 1 + { 1, 10, 0, 0, 0 }, +#define PSQ_GX PSQ_WX + 1 + { 10, 7, insert_psq_gx, extract_psq_gx, PPC_OPERAND_GQR } +}; /* The functions used to insert and extract complicated operands. */ /* The BA field in an XL form instruction when it must be the same as @@ -1432,6 +1449,48 @@ return ret; } +static unsigned long +insert_psq_gd (unsigned long insn, + long value, + int dialect ATTRIBUTE_UNUSED, + const char **errmsg) +{ + if (value >= 912 && value <= 919) + value -= 912; + if (value < 0 || value > 7) + *errmsg = _("invalid quantization register"); + return insn | ((value & 7) << 12); +} + +static long +extract_psq_gd (unsigned long insn, + int dialect ATTRIBUTE_UNUSED, + int *invalid ATTRIBUTE_UNUSED) +{ + return ((insn & 0x7000) >> 12); +} + +static unsigned long +insert_psq_gx (unsigned long insn, + long value, + int dialect ATTRIBUTE_UNUSED, + const char **errmsg) +{ + if (value >= 912 && value <= 919) + value -= 912; + if (value < 0 || value > 7) + *errmsg = _("invalid quantization register"); + return insn | ((value & 7) << 7); +} + +static long +extract_psq_gx (unsigned long insn, + int dialect ATTRIBUTE_UNUSED, + int *invalid ATTRIBUTE_UNUSED) +{ + return ((insn & 0x380) >> 7); +} + /* Macros used to form opcodes. */ /* The main opcode. */ @@ -1715,6 +1774,10 @@ #define XUC(op, xop) (OP (op) | (((unsigned long)(xop)) & 0x1f)) #define XUC_MASK XUC(0x3f, 0x1f) +/* A PSQ style load/store indexed */ +#define PSQX(op, xop) (OP (op) | (((unsigned long)(xop)) & 0x7f)) +#define PSQX_MASK PSQX(0x3f,0x7f) + /* The BO encodings used in extended conditional branch mnemonics. */ #define BODNZF (0x0) #define BODNZFP (0x1) @@ -2399,60 +2462,65 @@ { "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 } }, +{ "psq_lx", PSQX(4,12),PSQX_MASK, PPCGEKKO, { FRT,RA0,RB,PSQ_WX,PSQ_GX } }, +{ "psq_lux", PSQX(4,76),PSQX_MASK, PPCGEKKO, { FRT,RAS,RB,PSQ_WX,PSQ_GX } }, +{ "psq_stx", PSQX(4,14),PSQX_MASK, PPCGEKKO, { FRS,RA0,RB,PSQ_WX,PSQ_GX } }, +{ "psq_stux",PSQX(4,78),PSQX_MASK, PPCGEKKO, { FRS,RAS,RB,PSQ_WX,PSQ_GX } }, +{ "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, FRA, FRB } }, +{ "ps_sub.", A(4,20,1), AFRC_MASK,PPCGEKKO, { FRT, FRA, 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 } }, +{ "dcbz_l", X(4,1014), XRT_MASK, PPCGEKKO, { RA, RB } }, { "mulli", OP(7), OP_MASK, PPCCOM, { RT, RA, SI } }, { "muli", OP(7), OP_MASK, PWRCOM, { RT, RA, SI } }, @@ -4485,10 +4553,14 @@ { "stfdu", OP(55), OP_MASK, COM, { FRS, D, RAS } }, +{ "psq_l", OP(56), OP_MASK, PPCGEKKO,{ FRT,PSQ_DD,RA,PSQ_WD,PSQ_GD} }, + { "lq", OP(56), OP_MASK, POWER4, { RTQ, DQ, RAQ } }, { "lfq", OP(56), OP_MASK, POWER2, { FRT, D, RA0 } }, +{ "psq_lu", OP(57), OP_MASK, PPCGEKKO,{ FRT,PSQ_DD,RA,PSQ_WD,PSQ_GD} }, + { "lfqu", OP(57), OP_MASK, POWER2, { FRT, D, RA0 } }, { "lbze", DEO(58,0), DE_MASK, BOOKE64, { RT, DE, RA0 } }, @@ -4542,8 +4614,12 @@ { "fnmadds", A(59,31,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } }, { "fnmadds.",A(59,31,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } }, +{ "psq_st", OP(60), OP_MASK, PPCGEKKO,{ FRS,PSQ_DD,RA,PSQ_WD,PSQ_GD} }, + { "stfq", OP(60), OP_MASK, POWER2, { FRS, D, RA } }, +{ "psq_stu", OP(61), OP_MASK, PPCGEKKO,{ FRS,PSQ_DD,RA,PSQ_WD,PSQ_GD} }, + { "stfqu", OP(61), OP_MASK, POWER2, { FRS, D, RA } }, { "lde", DEO(62,0), DE_MASK, BOOKE64, { RT, DES, RA0 } }, |