[binutils-gdb] x86: use set_rex_vrex() also for short-form handling
Jan Beulich
jbeulich@sourceware.org
Fri Mar 10 10:07:23 GMT 2023
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0a3eba426589cb2b5dc3a51ee8a3821c578c7c5f
commit 0a3eba426589cb2b5dc3a51ee8a3821c578c7c5f
Author: Jan Beulich <jbeulich@suse.com>
Date: Fri Mar 10 11:05:51 2023 +0100
x86: use set_rex_vrex() also for short-form handling
This is benign for all existing insns, but is going to be needed for
handling of .insn operands. The earlier use requires moving up the
function, to avoid the need for a forward declaration.
Diff:
---
gas/config/tc-i386.c | 41 ++++++++++++++++++++---------------------
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 3e12bf4c831..13e33d18ac3 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7972,6 +7972,25 @@ finalize_imm (void)
return 1;
}
+static INLINE void set_rex_vrex (const reg_entry *r, unsigned int rex_bit,
+ bool do_sse2avx)
+{
+ if (r->reg_flags & RegRex)
+ {
+ if (i.rex & rex_bit)
+ as_bad (_("same type of prefix used twice"));
+ i.rex |= rex_bit;
+ }
+ else if (do_sse2avx && (i.rex & rex_bit) && i.vex.register_specifier)
+ {
+ gas_assert (i.vex.register_specifier == r);
+ i.vex.register_specifier += 8;
+ }
+
+ if (r->reg_flags & RegVRex)
+ i.vrex |= rex_bit;
+}
+
static int
process_operands (void)
{
@@ -8196,8 +8215,7 @@ process_operands (void)
r = i.op[1].regs;
/* Register goes in low 3 bits of opcode. */
i.tm.base_opcode |= r->reg_num;
- if ((r->reg_flags & RegRex) != 0)
- i.rex |= REX_B;
+ set_rex_vrex (r, REX_B, false);
}
if ((i.seg[0] || i.prefix[SEG_PREFIX])
@@ -8227,25 +8245,6 @@ process_operands (void)
return 1;
}
-static INLINE void set_rex_vrex (const reg_entry *r, unsigned int rex_bit,
- bool do_sse2avx)
-{
- if (r->reg_flags & RegRex)
- {
- if (i.rex & rex_bit)
- as_bad (_("same type of prefix used twice"));
- i.rex |= rex_bit;
- }
- else if (do_sse2avx && (i.rex & rex_bit) && i.vex.register_specifier)
- {
- gas_assert (i.vex.register_specifier == r);
- i.vex.register_specifier += 8;
- }
-
- if (r->reg_flags & RegVRex)
- i.vrex |= rex_bit;
-}
-
static const reg_entry *
build_modrm_byte (void)
{
More information about the Binutils-cvs
mailing list