aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2020-02-17 08:57:54 +0100
committerJan Beulich <jbeulich@suse.com>2020-02-17 08:57:54 +0100
commiteedb0f2cfd2a54ab6be1065385f40f03045b42f2 (patch)
tree58e1c976680e641d6a1073f0a3cf862cf5102da4 /gas/config
parentb9915cbc7d3ac2b9cd136248defbf9538b9a9bcf (diff)
downloadgdb-eedb0f2cfd2a54ab6be1065385f40f03045b42f2.zip
gdb-eedb0f2cfd2a54ab6be1065385f40f03045b42f2.tar.gz
gdb-eedb0f2cfd2a54ab6be1065385f40f03045b42f2.tar.bz2
x86/Intel: don't swap operands of MONITOR{,X} and MWAIT{,X}
Generally, the documentation doesn't allow for any explicit operands to be specified with MONITOR/MWAIT. To permit the more legible overriding of the address size via specifying operands, the option is being retained even in Intel mode, but operand swapping is being suppressed by this patch. This is both because it makes no sense here (all of the operands are inputs) and because, as a result, old gcc (prior to 4.8) actually expects it this way with -mintel-syntax (and hence gets fixed by this change rather than, as claimed by a reply in the bug report, broken).
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index acade9d..4074a90 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4324,14 +4324,16 @@ md_assemble (char *line)
/* Now we've parsed the mnemonic into a set of templates, and have the
operands at hand. */
- /* All intel opcodes have reversed operands except for "bound" and
- "enter". We also don't reverse intersegment "jmp" and "call"
- instructions with 2 immediate operands so that the immediate segment
- precedes the offset, as it does when in AT&T mode. */
+ /* All Intel opcodes have reversed operands except for "bound", "enter"
+ "monitor*", and "mwait*". We also don't reverse intersegment "jmp"
+ and "call" instructions with 2 immediate operands so that the immediate
+ segment precedes the offset, as it does when in AT&T mode. */
if (intel_syntax
&& i.operands > 1
&& (strcmp (mnemonic, "bound") != 0)
&& (strcmp (mnemonic, "invlpga") != 0)
+ && (strncmp (mnemonic, "monitor", 7) != 0)
+ && (strncmp (mnemonic, "mwait", 5) != 0)
&& !(operand_type_check (i.types[0], imm)
&& operand_type_check (i.types[1], imm)))
swap_operands ();