PowerPC Assembly Question

Joel Sherrill joel.sherrill at OARcorp.com
Tue Jan 25 23:27:30 UTC 2011


Hi,

When looking at coverage on qemuppc, I came across this
fragment at

http://www.rtems.org/ftp/pub/rtems/people/joel/coverage/qemuppc-OsPD-20110125-1704/annotated.html#range346

Notice that the code saves a handful of general purpose
registers, then tests cr1 and jumps around saving FP
registers.  Can someone explain how to trip the
fp code in this path?

ffc04ffc <printk>:
  * printk
  *
  * Kernel printf function requiring minimal infrastrure.
  */
void printk(const char *fmt, ...)
{

ffc04ffc:    94 21 ff 88     stwu    r1,-120(r1)
ffc05000:    7c 08 02 a6     mflr    r0
ffc05004:    90 81 00 1c     stw     r4,28(r1)
ffc05008:    90 01 00 7c     stw     r0,124(r1)
ffc0500c:    90 a1 00 20     stw     r5,32(r1)
ffc05010:    90 c1 00 24     stw     r6,36(r1)
ffc05014:    90 e1 00 28     stw     r7,40(r1)
ffc05018:    91 01 00 2c     stw     r8,44(r1)
ffc0501c:    91 21 00 30     stw     r9,48(r1)
ffc05020:    91 41 00 34     stw     r10,52(r1)

ffc05024:    40 86 00 24     bne-    cr1,ffc05048 <printk+0x4c> <== 
ALWAYS TAKEN

ffc05028:    d8 21 00 38     stfd    f1,56(r1) <== NOT EXECUTED
ffc0502c:    d8 41 00 40     stfd    f2,64(r1) <== NOT EXECUTED
ffc05030:    d8 61 00 48     stfd    f3,72(r1) <== NOT EXECUTED
ffc05034:    d8 81 00 50     stfd    f4,80(r1) <== NOT EXECUTED
ffc05038:    d8 a1 00 58     stfd    f5,88(r1) <== NOT EXECUTED
ffc0503c:    d8 c1 00 60     stfd    f6,96(r1) <== NOT EXECUTED
ffc05040:    d8 e1 00 68     stfd    f7,104(r1) <== NOT EXECUTED
ffc05044:    d9 01 00 70     stfd    f8,112(r1) <== NOT EXECUTED

-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985





More information about the users mailing list