Branch on ?: operator?

后端 未结 5 995
Happy的楠姐
Happy的楠姐 2021-01-17 23:45

For a typical modern compiler on modern hardware, will the ? : operator result in a branch that affects the instruction pipeline?

In other words which i

5条回答
  •  清歌不尽
    2021-01-18 00:25

    in the first case purge is called twice. In the second case purge is called once

    Its hard to answer the question about branching because its so dependent on compilers and instruction set. For example on an ARM (which has conditional instruction execution) it might not branch. ON an x86 it almost certainly will

提交回复
热议问题