On Thu, 17 Oct 2013 22:40:32 +0800Hi Steve and Will,
Jiang Liu <liuj97@xxxxxxxxx> wrote:
I naively thought "NOP" is cheaper than a "B" :(You could make the code more concise by limiting your patching ability toI guess a NOP should be more effecient than a "B #4" on real CPUs:)
branch immediates. Then a nop is simply a branch to the next instruction (I
doubt any modern CPUs will choke on this, whereas the architecture requires
a NOP to take time).
Well, I was actually questioning that. A NOP *has* to take time (the
architecture prevents implementations from discaring it) whereas a static,
unconditional branch will likely be discarded early on by CPUs with even
simple branch prediction logic.
Will use a "B #1" to replace "NOP".
Really?? What's the purpose of a NOP then? It seems to me that an
architecture is broken if a NOP is slower than a static branch.
-- Steve