Right. But there are 8 registers on the floating point stack from ST0 to ST7 and I think llvm is only using ST0 to ST6 in some code fragments. Could this be because of the assumption that X86::FP registers run from X86::FP0 to X86:FP6 ?<br>
<br><br><br><br>--Aparna <br><br><div class="gmail_quote">On Wed, May 25, 2011 at 2:28 PM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
On May 25, 2011, at 11:09 AM, aparna kotha wrote:<br>
<br>
> Hi Guys,<br>
><br>
> I was working on some floating point intensive benchmarks and realize that the floating point register allocation in llvm assumes that there are only 7 floating point registers in X86, whereas the hardware has 8.<br>

><br>
> Line number<br>
> 00266   assert(Reg >= X86::FP0 && Reg <= X86::FP6 && "Expected FP register!");<br>
><br>
> of X86FloatingPoint.cpp.<br>
><br>
> Is there any reason for only counting from 0 to 6, when there are actually 8  in hardware ?<br>
<br>
</div>It has to do with the weird tricks that are needed to generate code for a stack machine.<br>
<div class="im"><br>
> Is there an assumption somewhere else, that I am missing.<br>
<br>
</div>Yes, the default cpu on Linux is i386 which doesn't have SSE support.<br>
<br>
Use SSE if you care about floating point performance. I think -mcpu=... is all you need.<br>
<font color="#888888"><br>
/jakob<br>
<br>
</font></blockquote></div><br>