4 ms·
> On their own, % and / are way slower than +, -, *, <<, >>. And the branch instruction is free??
by 35bge57dtjku 9y ago
> On their own, % and / are way slower than +, -, *, <<, >>.
And the branch instruction is free??
- hacking_again 9y agoMore or less, assuming you can predict it. But there's a penalty for misprediction. So it boils down to whether using % frequently (either as a native instruction or as a sequence of instructions) is more or less expensive than predicting a branch frequently, given a certain misprediction rate.
- 35bge57dtjku 9y ago> More or less, assuming you can predict it. But there's a penalty for misprediction. Yeah, no, that's not free.
- hacking_again 9y agoOk, so what changes would you make to my explanations?