4 ms·
General Purpose Register?
by hakfoo 2y ago
General 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.