diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 8 | ||||
-rw-r--r-- | gas/config/tc-i386-intel.c | 4 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 8 |
3 files changed, 17 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 468be74..210a938 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,13 @@ 2021-03-30 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (reg_eax): New. + (md_begin): Initialize reg_eax. + * config/tc-i386-intel.c (i386_intel_simplify_register): Use + reg_eax. + (i386_intel_simplify): Likewise. + +2021-03-30 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (reg_st0): New. (md_begin): Convert to switch(). Initialize reg_st0. Don't insert other st(N). diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c index 4c9f0b7..e61e757 100644 --- a/gas/config/tc-i386-intel.c +++ b/gas/config/tc-i386-intel.c @@ -335,7 +335,7 @@ i386_intel_simplify_register (expressionS *e) else { /* esp is invalid as index */ - intel_state.index = i386_regtab + REGNAM_EAX + ESP_REG_NUM; + intel_state.index = reg_eax + ESP_REG_NUM; } return 2; } @@ -500,7 +500,7 @@ static int i386_intel_simplify (expressionS *e) break; default: /* esp is invalid as index */ - intel_state.index = i386_regtab + REGNAM_EAX + ESP_REG_NUM; + intel_state.index = reg_eax + ESP_REG_NUM; break; } diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 3a7d504..7fa31da 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -214,6 +214,7 @@ static const char *default_arch = DEFAULT_ARCH; static const reg_entry bad_reg = { "<bad>", OPERAND_TYPE_NONE, 0, 0, { Dw2Inval, Dw2Inval } }; +static const reg_entry *reg_eax; static const reg_entry *reg_st0; static const reg_entry *reg_k0; @@ -3091,7 +3092,12 @@ md_begin (void) switch (regtab->reg_type.bitfield.class) { case Reg: - if (regtab->reg_type.bitfield.tbyte) + if (regtab->reg_type.bitfield.dword) + { + if (regtab->reg_type.bitfield.instance == Accum) + reg_eax = regtab; + } + else if (regtab->reg_type.bitfield.tbyte) { /* There's no point inserting st(<N>) in the hash table, as parentheses aren't included in register_chars[] anyway. */ |