aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-11-17 11:20:25 +0100
committerJan Beulich <jbeulich@suse.com>2023-11-17 11:20:25 +0100
commitd9a1b71137d206f1ff73eee25423cf6d22814495 (patch)
tree12df7ab20c147d94df9b1f75e1687dd7680e547c /gas
parent742b55c7364c2cc9fbbec98e0db2adac498c5ab8 (diff)
downloadgdb-d9a1b71137d206f1ff73eee25423cf6d22814495.zip
gdb-d9a1b71137d206f1ff73eee25423cf6d22814495.tar.gz
gdb-d9a1b71137d206f1ff73eee25423cf6d22814495.tar.bz2
x86: fold conditionals in check_long_reg()
Simplify the code follow ing what check_{,q}word_reg() already do. This the also eliminates a stale comment talking about a warning when an error is raised. While there, correct a similarly stale comment in check_qword_reg() while there.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-i386.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 6dcdccb..8d11955 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -8112,8 +8112,10 @@ check_long_reg (void)
i.suffix);
return 0;
}
- /* Error if the e prefix on a general reg is missing. */
- else if (i.types[op].bitfield.word
+ /* Error if the e prefix on a general reg is missing, or if the r
+ prefix on a general reg is present. */
+ else if ((i.types[op].bitfield.word
+ || i.types[op].bitfield.qword)
&& (i.tm.operand_types[op].bitfield.class == Reg
|| i.tm.operand_types[op].bitfield.instance == Accum)
&& i.tm.operand_types[op].bitfield.dword)
@@ -8123,16 +8125,6 @@ check_long_reg (void)
i.suffix);
return 0;
}
- /* Warn if the r prefix on a general reg is present. */
- else if (i.types[op].bitfield.qword
- && (i.tm.operand_types[op].bitfield.class == Reg
- || i.tm.operand_types[op].bitfield.instance == Accum)
- && i.tm.operand_types[op].bitfield.dword)
- {
- as_bad (_("incorrect register `%s%s' used with `%c' suffix"),
- register_prefix, i.op[op].regs->reg_name, i.suffix);
- return 0;
- }
return 1;
}
@@ -8161,7 +8153,7 @@ check_qword_reg (void)
i.suffix);
return 0;
}
- /* Warn if the r prefix on a general reg is missing. */
+ /* Error if the r prefix on a general reg is missing. */
else if ((i.types[op].bitfield.word
|| i.types[op].bitfield.dword)
&& (i.tm.operand_types[op].bitfield.class == Reg