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 control register check


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

commit 4787f4a5860864337c4f1261713b9462b79ea16a
Author: Jan Beulich <jbeulich@novell.com>
Date:   Fri Jun 1 08:39:08 2018 +0200

    x86: simplify control register check
    
    ... as is already done elsewhere: There's no need for the use of
    operand_type_equal() here - the bit identifying control registers isn't
    used for any other purposes.

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

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 199a48d..fdf8b2b 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
 2018-06-01  Jan Beulich  <jbeulich@suse.com>
 
+	* config/tc-i386.c (control): Delete.
+	(parse_real_register): Simply check "control" bit. Re-wrap.
+
+2018-06-01  Jan Beulich  <jbeulich@suse.com>
+
 	* config/tc-i386.c (build_modrm_byte): Drop REX_B from condition
 	checking for the need of emitting LOCK. Check "control" bit just
 	once.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 3d04a83..07a4e11 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1832,7 +1832,6 @@ operand_type_xor (i386_operand_type x, i386_operand_type y)
 
 static const i386_operand_type acc32 = OPERAND_TYPE_ACC32;
 static const i386_operand_type acc64 = OPERAND_TYPE_ACC64;
-static const i386_operand_type control = OPERAND_TYPE_CONTROL;
 static const i386_operand_type inoutportreg
   = OPERAND_TYPE_INOUTPORTREG;
 static const i386_operand_type reg16_inoutportreg
@@ -10274,10 +10273,8 @@ parse_real_register (char *reg_string, char **end_op)
       i.vec_encoding = vex_encoding_evex;
     }
 
-  if (((r->reg_flags & (RegRex64 | RegRex))
-       || r->reg_type.bitfield.qword)
-      && (!cpu_arch_flags.bitfield.cpulm
-	  || !operand_type_equal (&r->reg_type, &control))
+  if (((r->reg_flags & (RegRex64 | RegRex)) || r->reg_type.bitfield.qword)
+      && (!cpu_arch_flags.bitfield.cpulm || !r->reg_type.bitfield.control)
       && flag_code != CODE_64BIT)
     return (const reg_entry *) NULL;


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