>>>>> Duncan Purll writes:

Duncan> I am in the process of verifying that the gnu assembler produces object 
code which corresponds on an instruction-by-instruction basis with the 
interleaved source / assembly language listing obtained via -Wa,-ahls. This is 
for the purposes of software certification. I need to create C source which 
causes the compiler to emit specific mnemonics (eg.mfctr instruction etc.) but 
do not know how to force this. I have looked in rs6000.md but this does not 
contain the instruction mnemonics I am looking for. Can you advise of a way in 
which I can determine / predict which mnemonics will be generated for 
particular C source constructs?

mfctr and similar instructions are generated by the movsi_internal1 and
movdi_internal1 patterns, the

    mf%1 %0
    mt%0 %1

alternatives.

"mfctr" will be very rare.  I'm not sure there is any easy C code that
would produce it.  GCC tries to avoid placing values into CTR unless it
specifically is needed for an instruction that requires that register,
such as a jump or a loop.  PowerPC does not generate any results in CTR.
Either GCC would need to spill the value to reuse CTR for some other
purpos or somehow want the iteration count of a loop only iterated in CTR.

David

Reply via email to