<div dir="ltr">Hmm, it seems PPC is working too.<div style>Actually, maybe it's just SH4. I think my tests on other arch's were thrown by bad compiler options.</div><div style>Hmmm...</div><div style><br></div><div style>
<div>extern(C) float testfunc(float v, float v2)</div><div>{</div><div><span class="" style="white-space:pre">  </span>return v*v2 + v2;<br></div><div>}</div><div><br></div><div><br></div><div style>PPC:</div><div style><br>
</div><div style><div>testfunc:</div><div><span class="" style="white-space:pre">       </span>fmadds 1,1,2,2<br></div><div><span class="" style="white-space:pre">   </span>blr</div><div><br></div><div><br></div></div><div style>
MIPS:</div><div style><br></div><div style><div>testfunc:</div><div><span class="" style="white-space:pre">   </span>j<span class="" style="white-space:pre"> </span>$31<br></div><div><span class="" style="white-space:pre">      </span>madd.s<span class="" style="white-space:pre">    </span>$f0,$f13,$f12,$f13</div>
<div><br></div></div><div><br></div><div><br></div><div style>SH4 Produces:</div><div style><br></div><div><div>testfunc:</div><div><span class="" style="white-space:pre"> </span>mov.l<span class="" style="white-space:pre">     </span>.L3,r1<br>
</div><div><span class="" style="white-space:pre">        </span>lds.l<span class="" style="white-space:pre">     </span>@r1+,fpscr</div><div><span class="" style="white-space:pre"> </span>add<span class="" style="white-space:pre">       </span>#-4,r1</div>
<div><span class="" style="white-space:pre">    </span>fmov<span class="" style="white-space:pre">      </span>fr4,fr0</div><div><span class="" style="white-space:pre">    </span>add<span class="" style="white-space:pre">       </span>#4,r1</div>
<div><span class="" style="white-space:pre">    </span>fmac<span class="" style="white-space:pre">      </span>fr0,fr5,fr0</div><div><span class="" style="white-space:pre">        </span>rts<span class="" style="white-space:pre">       </span></div>
<div><span class="" style="white-space:pre">    </span>lds.l<span class="" style="white-space:pre">     </span>@r1+,fpscr</div></div><div><br></div><div><br></div><div style>But it should be:</div><div style><div><br></div><div>
testfunc:</div><div><span class="" style="white-space:pre">       </span>fmov<span class="" style="white-space:pre">      </span>fr4,fr0<br></div><div><span class="" style="white-space:pre">  </span>fmac<span class="" style="white-space:pre">      </span>fr0,fr5,fr0<br>
</div><div><span class="" style="white-space:pre">        </span>rts<span class="" style="white-space:pre">       </span></div><div><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 5 March 2013 03:39, David Nadlinger <span dir="ltr"><<a href="mailto:see@klickverbot.at" target="_blank">see@klickverbot.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Monday, 4 March 2013 at 15:25:43 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm doing a lot of experiments with GDC, and I'm noticing that leaf<br>
functions are still generating a stack frame and doing pointless work...<br>
<br>
int leaf() pure nothrow<br>
{<br>
  return 0;<br>
}<br>
<br>
compile with -frelease -finline -O3, etc<br>
<br>
I expect 2 opcodes, load immediate and return, but I get a whole pointless<br>
function including memory access O_O<br>
<br>
Any ideas? Is this normal?<br>
</blockquote>
<br>
</div><a href="http://d.godbolt.org/#%7B%22version%22%3A3%2C%22filterAsm%22%3A%7B%22labels%22%3Atrue%2C%22directives%22%3Atrue%2C%22commentOnly%22%3Atrue%2C%22intel%22%3Atrue%7D%2C%22compilers%22%3A%5B%7B%22source%22%3A%22int%20leaf()%20pure%20nothrow%5Cn%7B%5Cn%20%20return%200%3B%5Cn%7D%22%2C%22compiler%22%3A%22%2Fusr%2Fbin%2Fgdc%22%2C%22options%22%3A%22-O3%20-march%3Dnative%22%7D%5D%7D" target="_blank">http://d.godbolt.org/#%7B%<u></u>22version%22%3A3%2C%<u></u>22filterAsm%22%3A%7B%22labels%<u></u>22%3Atrue%2C%22directives%22%<u></u>3Atrue%2C%22commentOnly%22%<u></u>3Atrue%2C%22intel%22%3Atrue%<u></u>7D%2C%22compilers%22%3A%5B%7B%<u></u>22source%22%3A%22int%20leaf()%<u></u>20pure%20nothrow%5Cn%7B%5Cn%<u></u>20%20return%200%3B%5Cn%7D%22%<u></u>2C%22compiler%22%3A%22%2Fusr%<u></u>2Fbin%2Fgdc%22%2C%22options%<u></u>22%3A%22-O3%20-march%3Dnative%<u></u>22%7D%5D%7D</a><br>

<br>
The rest is just code for registering the ModuleInfo of the given module in the global list.<span class="HOEnZb"><font color="#888888"><br>
<br>
David<br>
</font></span></blockquote></div><br></div>