<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">I see. We should bite the bullet and
      save/restore volatile FP registers<br>
      across exceptions. Honestly, I thought we had added this but
      apparently<br>
      we didn't. Hadn't looked at this code in a while.<br>
      <br>
      OTOH, I'm pretty sure that the FPU is disabled during PPC
      exception handling<br>
      so you should be alerted to the compiler playing tricks.<br>
      <br>
      -T.<br>
      <br>
      On 12/12/2013 10:53 AM, Matt Wette wrote:<br>
    </div>
    <blockquote
      cite="mid:F0569F87-5A5C-4F81-A333-05A35D5E894F@alumni.caltech.edu"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <br>
      <div>
        <div>On Dec 12, 2013, at 9:18 AM, Till Straumann <<a
            moz-do-not-send="true"
            href="mailto:strauman@slac.stanford.edu">strauman@slac.stanford.edu</a>>
          wrote:</div>
        <br>
        <blockquote type="cite">BTW: I have not, with recent gcc, seen
          implicit use of the FPU.<br>
          <br>
          - Till<br>
        </blockquote>
        <br>
      </div>
      <div>on ppc stfd = store float double</div>
      <div><br>
      </div>
      mwette$ cat isr.c<br>
      <div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;">struct
          ts { int s, f; };</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;
          min-height: 13px;"><br>
        </div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;">extern
          struct ts clktim;</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br>
        </div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;">extern
          volatile int *sec, *frac;</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;
          min-height: 13px;"><br>
        </div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;">void
          isr() {</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"> 
          struct ts a, b;</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"> 
          a.s = -1;</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"> 
          do { </div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;">  
            b = a;</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;">  
            a.s = *sec;</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;">  
            a.f = *frac;</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"> 
          } while (a.s != b.s);</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"> 
          /* oops move a to clktim */</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;">}</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;
          min-height: 13px;"><br>
        </div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;">
          <div style="margin: 0px;">mwette$ powerpc-rtems4.11-gcc -S
            isr.c</div>
          <div style="margin: 0px;"><br>
          </div>
          <div style="margin: 0px;">mwette$ cat isr.s</div>
          <div style="margin: 0px;">
            <div style="margin: 0px;">        .file   "isr.c"</div>
            <div style="margin: 0px;">        .section        ".text"</div>
            <div style="margin: 0px;">        .align 2</div>
            <div style="margin: 0px;">        .globl isr</div>
            <div style="margin: 0px;">        .type   isr, @function</div>
            <div style="margin: 0px;">isr:</div>
            <div style="margin: 0px;">        stwu 1,-32(1)</div>
            <div style="margin: 0px;">        stw 31,28(1)</div>
            <div style="margin: 0px;">        mr 31,1</div>
            <div style="margin: 0px;">        li 9,-1</div>
            <div style="margin: 0px;">        stw 9,8(31)</div>
            <div style="margin: 0px;">.L2:</div>
            <div style="margin: 0px;">        lfd 0,8(31)</div>
            <div style="margin: 0px;">        stfd 0,16(31)</div>
            <div style="margin: 0px;">        lis 9,sec@ha</div>
            <div style="margin: 0px;">        lwz 9,sec@l(9)</div>
            <div style="margin: 0px;">        lwz 9,0(9)</div>
            <div style="margin: 0px;">        stw 9,8(31)</div>
            <div style="margin: 0px;">        lis 9,frac@ha</div>
            <div style="margin: 0px;">        lwz 9,frac@l(9)</div>
            <div style="margin: 0px;">        lwz 9,0(9)</div>
            <div style="margin: 0px;">        stw 9,12(31)</div>
            <div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>lwz 10,8(31)</div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>lwz 9,16(31)</div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>cmpw 7,10,9</div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>bne 7,.L2</div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>addi 11,31,32</div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>lwz 31,-4(11)</div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>mr 1,11</div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>blr</div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>.size<span
                  class="Apple-tab-span" style="white-space:pre"> </span>isr,
                .-isr</div>
              <div style="margin: 0px;"><span class="Apple-tab-span"
                  style="white-space:pre"> </span>.ident<span
                  class="Apple-tab-span" style="white-space:pre"> </span>"GCC:
                (GNU) 4.8.2 20131016 (RTEMS
                gcc-4.8.2-3.el6/newlib-1.20.0-29.el6)"</div>
            </div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>