4 ms·
Because 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
by brucehoult 2y ago
Because 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.