[PATCH] i386: cr8 handling

Alan Modra amodra@bigpond.net.au
Tue Mar 1 12:06:00 GMT 2005


On Tue, Mar 01, 2005 at 09:51:08AM +0100, Jan Beulich wrote:
> --- /home/jbeulich/src/binutils/mainline/2005-02-28/gas/config/tc-i386.c	2005-02-01 16:15:56.000000000 +0100
> +++ 2005-02-28/gas/config/tc-i386.c	2005-02-28 17:42:09.000000000 +0100
> @@ -2868,6 +2868,13 @@ build_modrm_byte ()
>  	  if ((i.op[source].regs->reg_flags & RegRex) != 0)
>  	    i.rex |= REX_EXTX;
>  	}
> +      if (flag_code != CODE_64BIT && (i.rex & (REX_EXTX|REX_EXTZ)))

Spaces around "|".  (Yes, I know tc-i386.c isn't consistent.)

> +	{
> +	  if (!((i.types[0] | i.types[1]) & Control))
> +	    abort ();
> +	  i.rex &= ~(REX_EXTX|REX_EXTZ);

Same here.

> +	  add_prefix (LOCK_PREFIX_OPCODE);
> +	}
>      }
>    else
>      {			/* If it's not 2 reg operands...  */
> @@ -5040,6 +5047,7 @@ parse_register (reg_string, end_op)
>  
>    if (r != NULL
>        && ((r->reg_flags & (RegRex64 | RegRex)) | (r->reg_type & Reg64)) != 0
> +      && r->reg_type != Control

I think this should be
      && (r->reg_type != Control || (cpu_arch_flags & CpuSledgehammer) != 0)

ie. Only enable cr8..cr15 if given ".arch sledgehammer".

>        && flag_code != CODE_64BIT)
>      return (const reg_entry *) NULL;

Otherwise the patch looks OK to apply.  Of course, you'll need to adjust
your testcases to supply .arch.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list