通过分支指令访问条件结构的 False 部分,这不是最优的方式,但是访问它的可能性不大。
The False portion of the conditional would then be available through the branch instruction, which is less optimal but also less likely.
问题的关键是 SPU 有几个条件指令,例如 selb、 shufb 和位操作,它们可以不用分支就能实现条件操作。
The key is that the SPU has several conditional instructions, such as selb, shufb, and the bit operations, which allow conditional operations to occur without branching.
例如,如果一个条件标上了“likely”,那么编译器可以把代码的True部分直接放在分支指令后面(这样就不需要执行分支指令)。
For example, if the conditional is marked "likely" then the compiler can place the True portion of the code immediately following the branch (which will not be taken).
应用推荐