diff options
author | Jan Beulich <jbeulich@suse.com> | 2019-07-01 08:38:50 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2019-07-01 08:38:50 +0200 |
commit | 9d3bf266fd601031d12584982ef43df22c95e933 (patch) | |
tree | 819ccc648355ca9ef44015b02e20a81be262cc87 /gas | |
parent | c3949f432f4f7e4a776bd15e10dad56593abeb47 (diff) | |
download | gdb-9d3bf266fd601031d12584982ef43df22c95e933.zip gdb-9d3bf266fd601031d12584982ef43df22c95e933.tar.gz gdb-9d3bf266fd601031d12584982ef43df22c95e933.tar.bz2 |
x86: drop Vec_Imm4
It is pretty wasteful to have a per-operand flag which is used in
exactly 4 cases. It can be relatively easily replaced, and by doing so
I've actually found some dead code to remove at the same time (there's
no case of ImmExt set at the same time as Vec_Imm4).
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 8 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 36 |
2 files changed, 19 insertions, 25 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index d78bbc9..ac4a132 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,13 @@ 2019-07-01 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (vec_imm4): Delete. + (VEX_check_operands): Replace Vec_Imm4 check by CpuXOP with five + operands one. Clear Imm<N> by different means. + (build_modrm_byte): Adjust comment. Remove dead code. Add and + adjust assertions. + +2019-07-01 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (output_insn): Adjust recognition of xFENCE insns. Move PadLock special case of prefix emission to 3-byte long base opcode handling. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 1741c0e..596dde4 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1915,7 +1915,6 @@ static const i386_operand_type imm64 = OPERAND_TYPE_IMM64; static const i386_operand_type imm16_32 = OPERAND_TYPE_IMM16_32; static const i386_operand_type imm16_32s = OPERAND_TYPE_IMM16_32S; static const i386_operand_type imm16_32_32s = OPERAND_TYPE_IMM16_32_32S; -static const i386_operand_type vec_imm4 = OPERAND_TYPE_VEC_IMM4; enum operand_type { @@ -5649,8 +5648,8 @@ VEX_check_operands (const insn_template *t) return 0; } - /* Only check VEX_Imm4, which must be the first operand. */ - if (t->operand_types[0].bitfield.vec_imm4) + /* Check the special Imm4 cases; must be the first operand. */ + if (t->cpu_flags.bitfield.cpuxop && t->operands == 5) { if (i.op[0].imms->X_op != O_constant || !fits_in_imm4 (i.op[0].imms->X_add_number)) @@ -5659,8 +5658,8 @@ VEX_check_operands (const insn_template *t) return 1; } - /* Turn off Imm8 so that update_imm won't complain. */ - i.types[0] = vec_imm4; + /* Turn off Imm<N> so that update_imm won't complain. */ + operand_type_set (&i.types[0], 0); } return 0; @@ -7098,7 +7097,7 @@ build_modrm_byte (void) /* There are 2 kinds of instructions: 1. 5 operands: 4 register operands or 3 register operands - plus 1 memory operand plus one Vec_Imm4 operand, VexXDS, and + plus 1 memory operand plus one Imm4 operand, VexXDS, and VexW0 or VexW1. The destination must be either XMM, YMM or ZMM register. 2. 4 operands: 4 register operands or 3 register operands @@ -7138,28 +7137,15 @@ build_modrm_byte (void) } else { - unsigned int imm_slot; + gas_assert (i.imm_operands == 1); + gas_assert (fits_in_imm4 (i.op[0].imms->X_add_number)); + gas_assert (!i.tm.opcode_modifier.immext); - gas_assert (i.imm_operands == 1 && i.types[0].bitfield.vec_imm4); - - if (i.tm.opcode_modifier.immext) - { - /* When ImmExt is set, the immediate byte is the last - operand. */ - imm_slot = i.operands - 1; - source--; - reg_slot--; - } - else - { - imm_slot = 0; - - /* Turn on Imm8 so that output_imm will generate it. */ - i.types[imm_slot].bitfield.imm8 = 1; - } + /* Turn on Imm8 again so that output_imm will generate it. */ + i.types[0].bitfield.imm8 = 1; gas_assert (i.tm.operand_types[reg_slot].bitfield.regsimd); - i.op[imm_slot].imms->X_add_number + i.op[0].imms->X_add_number |= register_number (i.op[reg_slot].regs) << 4; gas_assert ((i.op[reg_slot].regs->reg_flags & RegVRex) == 0); } |