3 ms·
>Not having condition codes and PC not being a GPR are major advantages here. What's GPR?
by brokenmachine 2y ago
>Not having condition codes and PC not being a GPR are major advantages here.
What's GPR?
- hakfoo 2y agoGeneral Purpose Register?
- brokenmachine 2y agoWhy is that an advantage?
- brucehoult 2y agoBecause instructions that change the PC have to be handled specially because if not correctly predicted taken/not taken, and the target address) then they cause a pipeline break, throwing away speculatively executed work etc. When the PC is a GPR then any instruction (with PC as the destination) can be a jump to different code. Even a subtract, for example. In fact I have many times written `sub pc,pc,#3` to switch an Arm CPU to running the next instruction in Thumb mode. Gross.
- brokenmachine 2y agoCool, makes sense. Thanks for the explanation.
- snvzz 2y agoBecause PC as GPR complicates implementations immensely, for virtually no benefit.