[PATCH] x86: Add .nop directive to assembler

H.J. Lu hjl.tools@gmail.com
Fri Feb 23 23:56:00 GMT 2018


On Tue, Feb 20, 2018 at 5:24 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Feb 19, 2018 at 5:03 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Mon, Feb 19, 2018 at 4:05 PM, Alan Modra <amodra@gmail.com> wrote:
>>> 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
>>> instructions.
>>>
>>> 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!
>>
>> I would have chosen .nop and handled it for NO_PSEUDO_DOT targets.
>>
>> Here is a patch to rename .nop to .nops.  OK for master?
>>
>
> Just for the record, I found it is extremely odd that .nop has to be
> renamed to .nops just because of NO_PSEUDO_DOT targets.
>

How about this patch?

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Skip-pseudo-op-for-instruction-of-the-same-name.patch
Type: text/x-patch
Size: 10615 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20180223/f1289345/attachment.bin>


More information about the Binutils mailing list