Why are conditionally executed instructions not present in later ARM instruction sets?

后端 未结 7 1032
隐瞒了意图╮
隐瞒了意图╮ 2020-12-31 02:57

Naively, conditionally executed instructions seem like a great idea to me.

As I read more about ARM (and ARM-like) instruction sets (Thumb2, Unicore, AArch64) I find

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-31 03:38

    Conditional execution is a good choice in implementation of many auxiliary or bit-twiddling routines, such as sorting, list or tree manipulation, number to string conversion, sqrt or long division. We could add UART drivers and extracting bit fields in routers. Those have a high branch to non-branch ratio with somewhat high unpredictability too.

    However, once you get beyond the lowest level of services (or increase the abstraction level by using a higher level language), the code looks completely different: code blocks inside different branches of conditions consists more of moving data and calling sub-routines. Here the benefits of those extra 4 bits rapidly fade away. It's not only personal development but cultural: Culturally programming has grown from unstructured (Basic, Fortran, Assembler) towards structural. Different programming paradigms are supported better also in different instruction set architectures.

    A technological compromise could have been the possibility to compress the five bit 'cond.S' field to four or three most frequently used combinations.


    • A paper on profile guided mode selection, giving power, cycle time, code size and instruction count benchmarks for popular SA-110 thumb/ARM compiled routines. Some routines are better in ARM mode and other do better in Thumb. It depends on the algorithm and ultimately the code/compiler.

提交回复
热议问题