public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: "H. J. Lu" <hjl@lucon.org>
Cc: binutils@sources.redhat.com
Subject: Re: PATCH: Add --alt-nops=short|long to x86/x86-64 assemblers
Date: Wed, 14 Jun 2006 17:20:00 -0000	[thread overview]
Message-ID: <449027CF.3070705@redhat.com> (raw)
In-Reply-To: <20060614150158.GA30299@lucon.org>

Hi H. J.

>> I am not familiar with the x86 instruction set, so please can you 
>> explain why it is necessary to have these two different versions of the 
>> nop and why the user has to select one ?  ie if the space to be padded 
>> is up to 10 bytes why can't the assembler just use the "short" version 
>> automatically and if it is longer than 10 bytes use the "long" version ?
> 
> x86/x86-64 assemblers need to fill the text section from 1 to
> 15 bytes for alignment. We have simple nop instructions for 1 to
> 10 bytes. For 11 to 15 bytes, we can add 0x66 prefix repeatedly
> to 10 byte nop to get 11-15byte nops. However some processors
> prefer simple nops. That is, 3 0x66 prefixes on the 10 byte nop
> are slower on those processors than a 6 byte nop + a 7 byte nop.

Does the assembler not know the target processor variant ?  ie is the 
assembler unable to make an informed choice of which type of nop to use ?

> User can use --alt-nops=short to avoid repeated 0x66 prefixes.
> Maybe we can use something other than short|long. But I don't
> have a better name.

How about "--allow-long-nop-sequences" and its inverse 
"--no-allow-long-nop-sequences" ?  The default would presumably be to 
allow the long sequences since this is faster on more modern processors, 
yes ?

I would also suggest that you extend the description in your patch to 
c-i386.texi to cover the explanation you just gave me, unless you are 
sure that all x86 assembler programmers would know about these two types 
of nop.

Cheers
   Nick


  reply	other threads:[~2006-06-14 15:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13 20:45 H. J. Lu
2006-06-14  8:30 ` Nick Clifton
2006-06-14 15:14   ` H. J. Lu
2006-06-14 17:20     ` Nick Clifton [this message]
2006-06-14 18:07       ` H. J. Lu
2006-06-15  8:10         ` Nick Clifton
2006-06-15 14:51           ` Paul Brook
2006-06-15 15:15             ` H. J. Lu
2006-06-15 15:28               ` Paul Brook
2006-06-15 16:20                 ` H. J. Lu
2006-06-15 17:08                   ` Paul Brook
2006-06-15 17:41                     ` H. J. Lu
2006-06-15 18:45                       ` Paul Brook
2006-06-15 18:58                         ` H. J. Lu
2006-06-15 19:02                           ` Paul Brook
2006-06-16  7:27                             ` PATCH: Add -march=/-mtune= to x86 assembler H. J. Lu
2006-06-16 15:26                               ` H. J. Lu
2006-06-15 15:00           ` PATCH: Add --alt-nops=short|long to x86/x86-64 assemblers H. J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=449027CF.3070705@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=hjl@lucon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).