This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Clean up x86 assembler
- From: "H.J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Tue, 4 Sep 2007 22:26:09 -0700
- Subject: PATCH: Clean up x86 assembler
RegRex is for the reg_flags field, not the reg_type field. It also
changes
if ((A | B) != 0)
to
if (A || B)
H.J.
---
2007-09-04 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (i386_index_check): Don't use RegRex
on the reg_type field.
(parse_real_register): Use `||' instead of `|'.
--- gas/config/tc-i386.c.foo 2007-09-04 22:12:09.000000000 -0700
+++ gas/config/tc-i386.c 2007-09-04 22:17:48.000000000 -0700
@@ -4981,7 +4981,7 @@ i386_index_check (const char *operand_st
{
/* 16bit checks. */
if ((i.base_reg
- && ((i.base_reg->reg_type & (Reg16 | BaseIndex | RegRex))
+ && ((i.base_reg->reg_type & (Reg16 | BaseIndex))
!= (Reg16 | BaseIndex)))
|| (i.index_reg
&& (((i.index_reg->reg_type & (Reg16 | BaseIndex))
@@ -4996,9 +4996,9 @@ i386_index_check (const char *operand_st
{
/* 32bit checks. */
if ((i.base_reg
- && (i.base_reg->reg_type & (Reg32 | RegRex)) != Reg32)
+ && (i.base_reg->reg_type & Reg32) != Reg32)
|| (i.index_reg
- && ((i.index_reg->reg_type & (Reg32 | BaseIndex | RegRex))
+ && ((i.index_reg->reg_type & (Reg32 | BaseIndex))
!= (Reg32 | BaseIndex))))
ok = 0;
}
@@ -5885,7 +5885,8 @@ parse_real_register (char *reg_string, c
}
if (r != NULL
- && ((r->reg_flags & (RegRex64 | RegRex)) | (r->reg_type & Reg64)) != 0
+ && ((r->reg_flags & (RegRex64 | RegRex))
+ || (r->reg_type & Reg64))
&& (r->reg_type != Control || !(cpu_arch_flags & CpuSledgehammer))
&& flag_code != CODE_64BIT)
return (const reg_entry *) NULL;