[GAS][ARM]Generate unpredictable warning for pc used in data processing instructions with register-shifted register operand

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Tue Oct 11 13:25:00 GMT 2016


On 11/10/16 14:06, Nick Clifton wrote:
> Hi Renlin,
> 
>> In ARMARM (ARMv7-A and ARMv7-R edition),
> 
> Ah - good we are using the same manual.
>  
>> if d == 15 || n == 15 || m == 15 || s == 15 then UNPREDICTABLE;
> 
> Right - thanks - I was looking at the wrong instruction - CMN (register)
> rather than CMN (register-shifted register). Doh!
> 
> It seems a little strange that the PC cannot be read by these type
> of instructions, but if that is what the ARMARM says, then so be it.
> 

Hysterical raisons.  In very early implementations of the ARM,
register-shifted registers needed an extra cycle which meant the PC
sometimes read +12 rather than the normal +8 from the current location.

Since the instructions are of little real use (why would you shift the
PC by a non-constant amount, or use the value in the PC to control the
shift?) it was easier to just make such uses unpredictable.

R.




More information about the Binutils mailing list