diff options
author | Jan Beulich <jbeulich@suse.com> | 2020-02-11 11:20:55 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2020-02-11 11:20:55 +0100 |
commit | 50128d0cab8445e97ee89f55082dadb69d2bfbc8 (patch) | |
tree | 8e2994daf381e9d793796be2fcfd7ef957db1067 /gas | |
parent | 1e05b5c489289e60aac4e5cb73dd4b73ddfaaa32 (diff) | |
download | binutils-gdb-50128d0cab8445e97ee89f55082dadb69d2bfbc8.tar.gz |
x86: drop ShortForm attribute
It is very simple to derive from other template properties, and hence
there's little point wasting storage for it.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 7da17080370..6eb7f4f94a0 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2020-02-11 Jan Beulich <jbeulich@suse.com> + + (struct _i386_insn): New field "short_form". + (optimize_encoding): Drop setting of shortform field. + (process_suffix): Set i.short_form. Replace shortform use. + (process_operands): Replace shortform use. + 2020-02-11 Matthew Malcomson <matthew.malcomson@arm.com> * config/tc-arm.c (vcx_handle_register_arguments): Remove `for` diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 543fe25b4d4..fec132ab760 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -354,6 +354,9 @@ struct _i386_insn unsigned int prefixes; unsigned char prefix[MAX_PREFIXES]; + /* Register is in low 3 bits of opcode. */ + bfd_boolean short_form; + /* The operand to a branch insn indicates an absolute branch. */ bfd_boolean jumpabsolute; @@ -4084,7 +4087,6 @@ optimize_encoding (void) i.tm.base_opcode = 0xb8; i.tm.extension_opcode = None; i.tm.opcode_modifier.w = 0; - i.tm.opcode_modifier.shortform = 1; i.tm.opcode_modifier.modrm = 0; } } @@ -6495,6 +6497,10 @@ process_suffix (void) } } + if (!i.tm.opcode_modifier.modrm && i.reg_operands && i.tm.operands < 3) + i.short_form = (i.tm.operand_types[0].bitfield.class == Reg) + != (i.tm.operand_types[1].bitfield.class == Reg); + /* Change the opcode based on the operand size given by i.suffix. */ switch (i.suffix) { @@ -6511,7 +6517,7 @@ process_suffix (void) /* It's not a byte, select word/dword operation. */ if (i.tm.opcode_modifier.w) { - if (i.tm.opcode_modifier.shortform) + if (i.short_form) i.tm.base_opcode |= 8; else i.tm.base_opcode |= 1; @@ -7109,7 +7115,7 @@ duplicate: on one of their operands, the default segment is ds. */ default_seg = &ds; } - else if (i.tm.opcode_modifier.shortform) + else if (i.short_form) { /* The register or float register operand is in operand 0 or 1. */ |