This is the mail archive of the 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: Universality of nop

On Aug 20, 2014, at 3:45 PM, Joel Sherrill <> wrote:

> On 8/20/2014 2:38 PM, wrote:
>> On Aug 20, 2014, at 3:31 PM, Joel Sherrill <> wrote:
>>> Hi
>>> In getting RTEMS and tests to build for the or1k, Hesham ran into
>>> test which had inline assembly for "nop". or1k does not have nop
>>> defined. Interestingly, this has not been a problem on the 17 other
>>> architectures we build RTEMS for.
>>> Should all targets have a nop instruction? Or did we just get lucky
>>> 17 times? :)
>> Do you mean “an instruction that does not touch the system state in a way that matters”?  Or do you mean “an instruction like that, whose assembly language mnemonic is NOP”?
> Well in this case, I mean the actual mnemonic NOP. I realize you can
> always do
> something like "mov register to same register" and do nothing.  And the x86
> has nop-like instructions of varying lengths.
>> I don’t think it makes sense to count on the no operation instruction to be called “nop”.  I can think of at least a couple of machines (thought not RTEMS targets) where there is no such mnemonic.  It’s probably true that for every machine you can find something that has the behavior you want, but it might not have the same name.  (It might be “skip” or “jfcl”, or “no” for example.)
> I think it is likely always true. I was hoping for either the
> architecture itself used nop
> or binutils decided it would always provide nop as a pseudo-mnemonic.

That would be a pretty reasonable thing to do.  It could at least be a builtin macro.  The only way to get into trouble is if an ISA had “nop” as an opcode that means something other than “do nothing”.  I can’t think of any machine where that applies.


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