4 ms·
int ret int ret ret call call call int jmp No conditional branches. As long as you ignore what happens on the other side of those in
by Stratoscope 12y ago
int
ret
int
ret
ret
call
call
call
int
jmp
No conditional branches. As long as you ignore what happens on the other side of those int instructions! Especially that last one...
- inglor 12y agoCare to elaborate? Isn't `jmp` just a non-conditional jump? How is that branching?
- mikeash 12y agoBranch and jump are synonyms in this context.
- inglor 12y agoOh cool! I always thought of a branch as a conditional jump - I guess I was wrong. It appears that even unconditional branches are still branches! "A branch is an instruction in a computer program that may, when executed by a computer, cause the computer to begin execution of a different instruction sequence. Branch (or branching, branched) may also refer to the act of beginning execution of a different instruction sequence due to executing a branch instruction. A branch instruction can be either an unconditional branch, which always results in branching, or a conditional branch, which may or may not cause branching depending on some condition."
- mikeash 12y agoI wouldn't be surprised if there was some place that used "branch" to indicate conditional-only. Assembly language terminology seems to be wonderfully inconsistent. But typical usage these days seems to be as you quoted.
- spc476 12y agoIntel uses Jcc (Jump conditional) while Motorola uses Bcc (Branch conditional). Additionally, the Motorola 68k has both JMP and BRA (branch unconditionally) and the Motorola 6809 has JMP, BRA and BRN (branch never---useful for a two or four byte NOP, or for changing a conditional branch when patching code).
- xenadu02 12y agoBut generally being branch-free is in the context of avoiding a mispredict and pipeline stall. The processor is perfectly capable of pipelining an unconditional jump
- deleted 12y ago[deleted]
- pepijndevos 12y agoYea, you could probably inline the calls and unroll the loop, but I don't see a way of getting around the syscalls. I'd be curious to know what those syscalls are doing inside.