Which is faster: x<<1 or x<<10?

前端 未结 9 2076
感情败类
感情败类 2020-12-13 03:32

I don\'t want to optimize anything, I swear, I just want to ask this question out of curiosity. I know that on most hardware there\'s an assembly command of bit-shift (e.g.

9条回答
  •  Happy的楠姐
    2020-12-13 03:46

    On ARM, this can be done as a side effect of another instruction. So potentially, there's no latency at all for either of them.

提交回复
热议问题