GNU replacing obsolete assembly instructions in PowerPc architecture

David Brown david@westcontrol.com
Mon Mar 18 11:00:00 GMT 2019


On 18/03/2019 10:08, Florian Weimer wrote:
> * ilya german:
> 
>> I have a quastion regarding reading TBR registers on PPC p2020 e500v2 CPU.
>>
>> I wrote the following asm instructions to read the TBR:
>>
>> mftbu r5 /* Read upper Time Base */
>> mftb r6 /* Read lower Time Base */
>> mftbu r7 /* Read upper Time Base again */
>>
>> When I compiled (using GNU 4) and viewed the asm instruction I saw that
>> *mftbu* and *mftb* were replaced with *mfspr* instruction.
> 
> How did you determine that it was replaced?
> 

I expect he could see it from looking at a disassembly.

On The PPC cores, mftb and mftbu are simplified mnemonics, not
instructions - they are implemented as "mfspr" instructions on the
appropriate SPR registers (268 and 269).



More information about the Gcc-help mailing list