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: [PATCH] x86: Add .nop directive to assembler


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.

-- 
H.J.


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