x86: simplify control register check

Message ID 5B0E55B502000078001C6D89@prv1-mh.provo.novell.com
State New
Headers show
Series
  • x86: simplify control register check
Related show

Commit Message

Jan Beulich May 30, 2018, 7:41 a.m.
... 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.

gas/
2018-05-30  Jan Beulich  <jbeulich@suse.com>

	* config/tc-i386.c (control): Delete.
	(parse_real_register): Simply check "control" bit. Re-wrap.

Comments

H.J. Lu May 30, 2018, 12:40 p.m. | #1
On Wed, May 30, 2018 at 12:41 AM, Jan Beulich <JBeulich@suse.com> wrote:
> ... 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.

>

> gas/

> 2018-05-30  Jan Beulich  <jbeulich@suse.com>

>

>         * config/tc-i386.c (control): Delete.

>         (parse_real_register): Simply check "control" bit. Re-wrap.

>


OK.

Thanks.


-- 
H.J.

Patch

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1830,7 +1830,6 @@  operand_type_xor (i386_operand_type x, i
 
 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
@@ -10276,10 +10275,8 @@  parse_real_register (char *reg_string, c
       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;