3 ms·
> The if statement compiled to 3 important instructions, mov, cmp and jg. Mov will load some memory into a register, cmp will compare two registers and set anot
by mmastrac 8y ago
> The if statement compiled to 3 important instructions, mov, cmp and jg. Mov will load some memory into a register, cmp will compare two registers and set another based off the result and jg will do a conditional jump based off the value of another register.
Interesting puzzle. Is it possible that asking the compiler to make this jump likely or unlikely (GCC's __builtin_expect) to be taken might help?