Multi-byte NOP opcode made official
software.intel.com
software.intel.com
I had a private email thread with H. Peter Anvin (formerly of Transmeta) about this.
I think there was an Intel patent about them.
https://blogs.msdn.microsoft.com/oldnewthing/20110112-00/?p=...
My brain hurts imagining how they figured out and verified that this bug exists.
If you care about optimising NOPs, you're probably wrting a compiler, so I am curious if these instructions have found their way into any mainstream compiler such as GCC or Clang. Does this post explain some odd compiler behaviour?
Has newer information been published making this anything other than abuse of an undocumented quirk? I.e., liable to blow up on new processors, as it does on the Pentium MMX, according to the second post.
I mean, it's interesting but I'm not sure why it's here.
Or low-level systems code. For instance, the Linux kernel makes extensive use of multi-byte NOPs.
http://stackoverflow.com/a/18279617/319204
As part of researching this, i discovered an empirically verified list of NOPs (all the way from 1byte to 10bytes each.)
https://android.googlesource.com/toolchain/binutils/+/f22651...
That doesn't make sense. Segment:offset jumps are always unconditional.
6502 actually had pretty good performance at the time on a per cycle basis.
poke 19215,25 It was used on MS basic on the Interact computer (1978/9) to enable peek and poke. Oddly the poke instruction would execute and THEN error, but poking this one value disabled the error. There was also a set of 3 pokes that disabled address checking which was used to prevent people from reading the system ROM and the basic interpreter itself.
I believe I still have quite a collection of the "Interaction" newsletter that was published in the Detroit area about this machine, which is where the above info came from. Yeah, the stuff we remember...
A multibyte nop counts as one instruction, taking just one cycle to decode, and leaving room for upto 3 more instructions to decode that cycle.
Likewise, after Pentium 4 REP NOP (F3 90) became PAUSE, the spinlock waiting hint instruction, so one needs to be careful about prefixes with the old NOP as well.
Not sure you should ever use a multi-byte instruction for alignment, but then you shouldn't use NOP for alignment in general. That's what 0xCC is for.
http://patents.com/us-9330011.html Microprocessor with integrated NOP slide detector, May 3, 2016 - VIA Technologies, Inc