From c0e54661f755b1eb1cbf745bc4eb4a068cd5ada2 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 25 Mar 2021 08:18:41 +0100 Subject: x86: fix AMD Zen3 insns For INVLPGB the operand count was wrong (besides %edx there's also %ecx which is an input to the insn). In this case I see little sense in retaining the bogus 2-operand template. Plus swapping of the operands wasn't properly suppressed for Intel syntax. For PVALIDATE, RMPADJUST, and RMPUPDATE bogus single operand templates were specified. These get retained, as the address operand is the only one really needed to expressed non-default address size, but only for compatibility reasons. Proper multi-operand insn get introduced and the testcases get adjusted / extended accordingly. While at it also drop the redundant definition of __amd64__ - we already have x86_64 defined (or not) to distinguish 64-bit and non-64-bit cases. --- gas/config/tc-i386.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'gas/config/tc-i386.c') diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index c2c5b69..785d0c4 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -4679,16 +4679,18 @@ md_assemble (char *line) operands at hand. */ /* All Intel opcodes have reversed operands except for "bound", "enter", - "monitor*", "mwait*", "tpause", and "umwait". 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. */ + "invlpg*", "monitor*", "mwait*", "tpause", "umwait", "pvalidate", + "rmpadjust", and "rmpupdate". We also don't reverse intersegment "jmp" + and "call" instructions with 2 immediate operands so that the immediate + segment precedes the offset consistently in Intel and AT&T modes. */ if (intel_syntax && i.operands > 1 && (strcmp (mnemonic, "bound") != 0) - && (strcmp (mnemonic, "invlpga") != 0) + && (strncmp (mnemonic, "invlpg", 6) != 0) && (strncmp (mnemonic, "monitor", 7) != 0) && (strncmp (mnemonic, "mwait", 5) != 0) + && (strcmp (mnemonic, "pvalidate") != 0) + && (strncmp (mnemonic, "rmp", 3) != 0) && (strcmp (mnemonic, "tpause") != 0) && (strcmp (mnemonic, "umwait") != 0) && !(operand_type_check (i.types[0], imm) -- cgit v1.1