aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-03-10 11:05:51 +0100
committerJan Beulich <jbeulich@suse.com>2023-03-10 11:05:51 +0100
commit0a3eba426589cb2b5dc3a51ee8a3821c578c7c5f (patch)
treeb8a7b5ba2bb49dabdfd0a9d5b35d131efddbc32d /gas
parent4148b4fe9fd15607aad8b082c7b724f355f2da64 (diff)
downloadgdb-0a3eba426589cb2b5dc3a51ee8a3821c578c7c5f.zip
gdb-0a3eba426589cb2b5dc3a51ee8a3821c578c7c5f.tar.gz
gdb-0a3eba426589cb2b5dc3a51ee8a3821c578c7c5f.tar.bz2
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.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-i386.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 3e12bf4..13e33d1 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)
{