This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] x86: simplify legacy prefix emission


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bd59a6313dbbf349dff197975f1b6a78be51b7d6

commit bd59a6313dbbf349dff197975f1b6a78be51b7d6
Author: Jan Beulich <jbeulich@novell.com>
Date:   Wed Jul 11 10:28:16 2018 +0200

    x86: simplify legacy prefix emission
    
    The check_prefix label was bogus from the beginning: The special
    checking is supposed to happen for PadLock insns only; no
    3-opcode-byte insn should go this path.

Diff:
---
 gas/ChangeLog        |  5 +++++
 gas/config/tc-i386.c | 14 ++++----------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index ddb6235..e6a6d09 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
 2018-07-11  Jan Beulich  <jbeulich@suse.com>
 
+	* config/tc-i386.c (output_insn): Remove check_prefix label and
+	fold remaining expression.
+
+2018-07-11  Jan Beulich  <jbeulich@suse.com>
+
 	* testsuite/gas/i386/cet.s, testsuite/gas/i386/x86-64-cet.s:
 	Add Intel cases with operand size specifiers.
 	* testsuite/gas/i386/cet-intel.d, testsuite/gas/i386/cet.d,
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index a7b8400..61c1518 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7676,22 +7676,16 @@ output_insn (void)
 	      if (i.tm.base_opcode & 0xff000000)
 		{
 		  prefix = (i.tm.base_opcode >> 24) & 0xff;
-		  goto check_prefix;
+		  add_prefix (prefix);
 		}
 	      break;
 	    case 2:
 	      if ((i.tm.base_opcode & 0xff0000) != 0)
 		{
 		  prefix = (i.tm.base_opcode >> 16) & 0xff;
-		  if (i.tm.cpu_flags.bitfield.cpupadlock)
-		    {
-check_prefix:
-		      if (prefix != REPE_PREFIX_OPCODE
-			  || (i.prefix[REP_PREFIX]
-			      != REPE_PREFIX_OPCODE))
-			add_prefix (prefix);
-		    }
-		  else
+		  if (!i.tm.cpu_flags.bitfield.cpupadlock
+		      || prefix != REPE_PREFIX_OPCODE
+		      || (i.prefix[REP_PREFIX] != REPE_PREFIX_OPCODE))
 		    add_prefix (prefix);
 		}
 	      break;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]