This is the mail archive of the binutils@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]

RE: Feature request: Set the direction flag on x86/x64 register->register operations


Thanks for your help!

So my next task is to get gcc to use this. But I'll look at that after the
holidays...


> -----Original Message-----
> From: binutils-owner@sourceware.org [mailto:binutils-
> owner@sourceware.org] On Behalf Of H.J. Lu
> Sent: Saturday, December 20, 2008 7:23 PM
> To: Stefan Dösinger
> Cc: 'Jan Beulich'; binutils@sourceware.org
> Subject: Re: Feature request: Set the direction flag on x86/x64
> register->register operations
> 
> On Sat, Dec 20, 2008 at 09:35:58AM -0800, H.J. Lu wrote:
> > On Sat, Dec 20, 2008 at 01:47:17AM +0100, Stefan Dösinger wrote:
> > >
> > > > Here is the updated patch. I changed ".r" to ".s". I also removed
> > > > FloatD since you can encode them differently
> > > > with %st vs %st(0).   Stefan, does it work for you?
> > > Looks good on a quick check
> > >
> >
> > I am checking in this patch.
> >
> >
> > H.J.
> > ---
> > gas/
> >
> > 2008-12-20  H.J. Lu  <hongjiu.lu@intel.com>
> >
> > 	* config/tc-i386.c (_i386_insn): Add swap_operand.
> > 	(parse_insn): Handle ".s".
> > 	(match_template): Handle swap_operand.
> >
> > 	* doc/c-i386.texi: Document .s suffix.
> >
> 
> I checked in this patch to optimize a bit.
> 
> 
> H.J.
> --
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/src/src/gas/ChangeLog,v
> retrieving revision 1.3690
> diff -u -p -r1.3690 ChangeLog
> --- ChangeLog	20 Dec 2008 17:40:49 -0000	1.3690
> +++ ChangeLog	20 Dec 2008 18:19:29 -0000
> @@ -1,5 +1,9 @@
>  2008-12-20  H.J. Lu  <hongjiu.lu@intel.com>
> 
> +	* config/tc-i386.c (parse_insn): Optimize ".s" handling.
> +
> +2008-12-20  H.J. Lu  <hongjiu.lu@intel.com>
> +
>  	* config/tc-i386.c (_i386_insn): Add swap_operand.
>  	(parse_insn): Handle ".s".
>  	(match_template): Handle swap_operand.
> Index: config/tc-i386.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-i386.c,v
> retrieving revision 1.357
> diff -u -p -r1.357 tc-i386.c
> --- config/tc-i386.c	20 Dec 2008 17:40:50 -0000	1.357
> +++ config/tc-i386.c	20 Dec 2008 18:19:29 -0000
> @@ -2994,19 +2994,16 @@ parse_insn (char *line, char *mnemonic)
>  	break;
>      }
> 
> -  if (!current_templates && dot_p)
> +  if (!current_templates)
>      {
> -      if (mnem_p - 2 == dot_p)
> -	{
> -	  /* Check if we should swap operand in encoding.  */
> -	  if (dot_p[1] == 's')
> -	    i.swap_operand = 1;
> -	  else
> -	    goto check_suffix;
> -	  mnem_p = dot_p;
> -	  *dot_p = '\0';
> -	  current_templates = hash_find (op_hash, mnemonic);
> -	}
> +      /* Check if we should swap operand in encoding.  */
> +      if (mnem_p - 2 == dot_p && dot_p[1] == 's')
> +	i.swap_operand = 1;
> +      else
> +	goto check_suffix;
> +      mnem_p = dot_p;
> +      *dot_p = '\0';
> +      current_templates = hash_find (op_hash, mnemonic);
>      }
> 
>    if (!current_templates)


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