diff options
author | Peter Bergner <bergner@vnet.ibm.com> | 2018-05-07 09:40:59 -0500 |
---|---|---|
committer | Peter Bergner <bergner@vnet.ibm.com> | 2018-05-07 09:40:59 -0500 |
commit | 2ceb7719f763b9e541a379d8ac7d53a72794fdd4 (patch) | |
tree | c8670b17f7f33270471dd6dbf6e750485b96e6e0 /gas | |
parent | ce4ec1a9b6c442a9feefa18dd8734372a718665c (diff) | |
download | gdb-2ceb7719f763b9e541a379d8ac7d53a72794fdd4.zip gdb-2ceb7719f763b9e541a379d8ac7d53a72794fdd4.tar.gz gdb-2ceb7719f763b9e541a379d8ac7d53a72794fdd4.tar.bz2 |
Cleanup ppc code dealing with opcode dumps.
include/
* opcode/ppc.h (powerpc_num_opcodes): Change type to unsigned.
(vle_num_opcodes): Likewise.
(spe2_num_opcodes): Likewise.
opcodes/
* ppc-opc.c (powerpc_num_opcodes): Likewise.
(vle_num_opcodes): Likewise.
(spe2_num_opcodes): Likewise.
* ppc-dis.c (disassemble_init_powerpc) <powerpc_opcd_indices>: Rewrite
initialization loop.
(disassemble_init_powerpc) <vle_opcd_indices>: Likewise.
(disassemble_init_powerpc) <spe2_opcd_indices>: Likewise. Initialize
only once.
gas/
* config/tc-ppc.c (ppc_setup_opcodes) <powerpc_opcodes>: Rewrite code
to dump the entire opcode table.
(ppc_setup_opcodes) <spe2_opcodes>: Likewise.
(ppc_setup_opcodes) <vle_opcodes>: Likewise. Fix calculation of
opcode index.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 8 | ||||
-rw-r--r-- | gas/config/tc-ppc.c | 64 |
2 files changed, 34 insertions, 38 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 900a9ce..53c1751 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2018-05-07 Peter Bergner <bergner@vnet.ibm.com.com> + + * config/tc-ppc.c (ppc_setup_opcodes) <powerpc_opcodes>: Rewrite code + to dump the entire opcode table. + (ppc_setup_opcodes) <spe2_opcodes>: Likewise. + (ppc_setup_opcodes) <vle_opcodes>: Likewise. Fix calculation of + opcode index. + 2018-05-06 H.J. Lu <hongjiu.lu@intel.com> * testsuite/gas/i386/xmmhi32.d: Also allow dir32 relocation. diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index e6cc26a..22ca332 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -1602,28 +1602,24 @@ ppc_setup_opcodes (void) { if (ENABLE_CHECKING) { - if (op != powerpc_opcodes) - { - int old_opcode = PPC_OP (op[-1].opcode); - int new_opcode = PPC_OP (op[0].opcode); + unsigned int new_opcode = PPC_OP (op[0].opcode); #ifdef PRINT_OPCODE_TABLE - printf ("%-14s\t#%04u\tmajor op: 0x%x\top: 0x%llx\tmask: 0x%llx\tflags: 0x%llx\n", - op->name, (unsigned int) (op - powerpc_opcodes), - (unsigned int) new_opcode, (unsigned long long) op->opcode, - (unsigned long long) op->mask, (unsigned long long) op->flags); + printf ("%-14s\t#%04u\tmajor op: 0x%x\top: 0x%llx\tmask: 0x%llx\tflags: 0x%llx\n", + op->name, (unsigned int) (op - powerpc_opcodes), + new_opcode, (unsigned long long) op->opcode, + (unsigned long long) op->mask, (unsigned long long) op->flags); #endif - /* The major opcodes had better be sorted. Code in the - disassembler assumes the insns are sorted according to - major opcode. */ - if (new_opcode < old_opcode) - { - as_bad (_("major opcode is not sorted for %s"), - op->name); - bad_insn = TRUE; - } + /* The major opcodes had better be sorted. Code in the disassembler + assumes the insns are sorted according to major opcode. */ + if (op != powerpc_opcodes + && new_opcode < PPC_OP (op[-1].opcode)) + { + as_bad (_("major opcode is not sorted for %s"), op->name); + bad_insn = TRUE; } + if ((op->flags & PPC_OPCODE_VLE) != 0) { as_bad (_("%s is enabled by vle flag"), op->name); @@ -1663,30 +1659,22 @@ ppc_setup_opcodes (void) { if (ENABLE_CHECKING) { - if (op != vle_opcodes) - { - unsigned old_seg, new_seg; - - old_seg = VLE_OP (op[-1].opcode, op[-1].mask); - old_seg = VLE_OP_TO_SEG (old_seg); - new_seg = VLE_OP (op[0].opcode, op[0].mask); - new_seg = VLE_OP_TO_SEG (new_seg); + unsigned new_seg = VLE_OP_TO_SEG (VLE_OP (op[0].opcode, op[0].mask)); #ifdef PRINT_OPCODE_TABLE - printf ("%-14s\t#%04u\tmajor op: 0x%x\top: 0x%llx\tmask: 0x%llx\tflags: 0x%llx\n", - op->name, (unsigned int) (op - powerpc_opcodes), - (unsigned int) new_seg, (unsigned long long) op->opcode, - (unsigned long long) op->mask, (unsigned long long) op->flags); + printf ("%-14s\t#%04u\tmajor op: 0x%x\top: 0x%llx\tmask: 0x%llx\tflags: 0x%llx\n", + op->name, (unsigned int) (op - vle_opcodes), + (unsigned int) new_seg, (unsigned long long) op->opcode, + (unsigned long long) op->mask, (unsigned long long) op->flags); #endif - /* The major opcodes had better be sorted. Code in the - disassembler assumes the insns are sorted according to - major opcode. */ - if (new_seg < old_seg) - { - as_bad (_("major opcode is not sorted for %s"), - op->name); - bad_insn = TRUE; - } + + /* The major opcodes had better be sorted. Code in the disassembler + assumes the insns are sorted according to major opcode. */ + if (op != vle_opcodes + && new_seg < VLE_OP_TO_SEG (VLE_OP (op[-1].opcode, op[-1].mask))) + { + as_bad (_("major opcode is not sorted for %s"), op->name); + bad_insn = TRUE; } bad_insn |= insn_validate (op); |