From 50128d0cab8445e97ee89f55082dadb69d2bfbc8 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 11 Feb 2020 11:20:55 +0100 Subject: x86: drop ShortForm attribute It is very simple to derive from other template properties, and hence there's little point wasting storage for it. --- gas/ChangeLog | 7 +++++++ gas/config/tc-i386.c | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 7da1708..6eb7f4f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2020-02-11 Jan Beulich + + (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 * 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 543fe25..fec132a 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. */ -- cgit v1.1