diff options
author | Jan Beulich <jbeulich@novell.com> | 2018-08-03 09:30:02 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2018-08-03 09:30:02 +0200 |
commit | c48dadc9a87f4fc3408987fc4dbd312bed50da9c (patch) | |
tree | abac271e381eddbc6174d2d5c8301df01bf09c29 /gas | |
parent | 3ed12f02a20a487ce46b463746c52c2905e16c03 (diff) | |
download | binutils-c48dadc9a87f4fc3408987fc4dbd312bed50da9c.zip binutils-c48dadc9a87f4fc3408987fc4dbd312bed50da9c.tar.gz binutils-c48dadc9a87f4fc3408987fc4dbd312bed50da9c.tar.bz2 |
x86: drop "mem" operand type attribute
No template specifies this bit, so there's no point recording it in the
templates. Use a flags[] bit instead.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 9 | ||||
-rw-r--r-- | gas/config/tc-i386-intel.c | 4 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 19 |
3 files changed, 24 insertions, 8 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 4ba57b8..54928d8 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2018-08-03 Jan Beulich <jbeulich@suse.com> + + * config/tc-i386.c (Operand_Mem): Define. + (operand_size_match): Use it. + (check_VecOperands): Likewise. + (i386_att_operand): Likewise. + (swap_2_operands): Also swap flags fields. + * config/tc-i386-intel.c (i386_intel_operand): Likewise. + 2018-08-01 James Patrick Conlon <cptjustice@gmail.com> Nick Clifton <nickc@redhat.com> diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c index 26fc3ef..dd509d5 100644 --- a/gas/config/tc-i386-intel.c +++ b/gas/config/tc-i386-intel.c @@ -875,7 +875,7 @@ i386_intel_operand (char *operand_string, int got_a_float) i.mem_operands = 0; i.disp_operands = 0; i.imm_operands = 2; - i.types[0].bitfield.mem = 0; + i.flags[0] &= ~Operand_Mem; i.types[0].bitfield.disp16 = 0; i.types[0].bitfield.disp32 = 0; i.types[0].bitfield.disp32s = 0; @@ -1009,7 +1009,7 @@ i386_intel_operand (char *operand_string, int got_a_float) if (!i386_index_check (operand_string)) return 0; - i.types[this_operand].bitfield.mem = 1; + i.flags[this_operand] |= Operand_Mem; if (i.mem_operands == 0) i.memop1_string = xstrdup (operand_string); ++i.mem_operands; diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index e07056f..e9e55f4 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -309,6 +309,7 @@ struct _i386_insn /* Flags for operands. */ unsigned int flags[MAX_OPERANDS]; #define Operand_PCrel 1 +#define Operand_Mem 2 /* Relocation type for operand */ enum bfd_reloc_code_real reloc[MAX_OPERANDS]; @@ -2010,7 +2011,7 @@ operand_size_match (const insn_template *t) break; } - if (i.types[j].bitfield.mem && !match_mem_size (t, j, j)) + if ((i.flags[j] & Operand_Mem) && !match_mem_size (t, j, j)) { match = 0; break; @@ -2035,8 +2036,7 @@ mismatch: && !match_operand_size (t, j, !j)) goto mismatch; - if (i.types[!j].bitfield.mem - && !match_mem_size (t, j, !j)) + if ((i.flags[!j] & Operand_Mem) && !match_mem_size (t, j, !j)) goto mismatch; } @@ -4753,14 +4753,21 @@ swap_2_operands (int xchg1, int xchg2) { union i386_op temp_op; i386_operand_type temp_type; + unsigned int temp_flags; enum bfd_reloc_code_real temp_reloc; temp_type = i.types[xchg2]; i.types[xchg2] = i.types[xchg1]; i.types[xchg1] = temp_type; + + temp_flags = i.flags[xchg2]; + i.flags[xchg2] = i.flags[xchg1]; + i.flags[xchg1] = temp_flags; + temp_op = i.op[xchg2]; i.op[xchg2] = i.op[xchg1]; i.op[xchg1] = temp_op; + temp_reloc = i.reloc[xchg2]; i.reloc[xchg2] = i.reloc[xchg1]; i.reloc[xchg1] = temp_reloc; @@ -5180,7 +5187,7 @@ check_VecOperands (const insn_template *t) and its broadcast bytes match the memory operand. */ op = i.broadcast->operand; if (!t->opcode_modifier.broadcast - || !i.types[op].bitfield.mem + || !(i.flags[op] & Operand_Mem) || (!i.types[op].bitfield.unspecified && !match_broadcast_size (t, op))) { @@ -5276,7 +5283,7 @@ check_VecOperands (const insn_template *t) { /* Find memory operand. */ for (op = 0; op < i.operands; op++) - if (i.types[op].bitfield.mem) + if (i.flags[op] & Operand_Mem) break; gas_assert (op < i.operands); if (op == i.operands - 1) @@ -9814,7 +9821,7 @@ i386_att_operand (char *operand_string) if (i386_index_check (operand_string) == 0) return 0; - i.types[this_operand].bitfield.mem = 1; + i.flags[this_operand] |= Operand_Mem; if (i.mem_operands == 0) i.memop1_string = xstrdup (operand_string); i.mem_operands++; |