[PATCH] x86: Add .nop directive to assembler

Alan Modra amodra@gmail.com
Tue Feb 20 00:05:00 GMT 2018

On Mon, Feb 19, 2018 at 03:24:17PM -0800, H.J. Lu wrote:
> On Mon, Feb 19, 2018 at 3:19 PM, Alan Modra <amodra@gmail.com> wrote:
> > On Mon, Feb 19, 2018 at 10:08:38PM +0000, Maciej W. Rozycki wrote:
> >> On Mon, 19 Feb 2018, Alan Modra wrote:
> >>
> >> > > .nop is similar to .skip, except that it fills with NOPs.  Yes, it can be used
> >> > > wherever .skip can be used.
> >> >
> >> > Given https://sourceware.org/ml/binutils/2018-02/msg00322.html I'm
> >> > inclined to think the name of the directive should change.
> >> > .skipnops perhaps?
> >>
> >>  Just `.nops' maybe?  There doesn't appear to be any matching mnemonic in
> >> opcodes/.
> >
> > I'd be happy with that too.
> There is no guarantee that one of those NO_PSEUDO_DOT targets or the new
> NO_PSEUDO_DOT target won't have an instruction called nops or skipnops in
> the future.

If a target adds an instruction like that, then the target will need
to deal with it.  For example, as the spu target deals with "set" and
"equ" which existed as directives before the spu defined them as

In this case the use of "nop" as an instruction existed before you
decided to define ".nop" as a directive, and lack of testing resulted
in not discovering the NO_PSEUDO_DOT clash.  I suspect we wouldn't be
having this conversation if you had run a full test suite regression,
rather than just testing x86.  You yourself would have chosen
something other than ".nop" as a directive!

Alan Modra
Australia Development Lab, IBM

More information about the Binutils mailing list