[LLVMdev] XMM in X86 Backend

kapil anand kapilanand2 at gmail.com
Mon Jun 7 10:04:40 PDT 2010

Hi all,

I am observing an excessive use of xmm registers in the output assembly
produced by x86 backend.  Basically, for a code like this

double test(double a, double b) {
 double c;

 c = 1.0 + sin (a + b*b);

 return c;

llc produced somthing like....

movsd   16(%ebp), %xmm0
       mulsd   %xmm0, %xmm0
       addsd   8(%ebp), %xmm0
       movsd   %xmm0, (%esp)
       fstpl   -8(%ebp
       movsd   -8(%ebp), %xmm0
       addsd   .LC1, %xmm0
       movsd   %xmm0, -8(%ebp)
       fldl    -8(%ebp)

LLVM Backend is using xmms it involves a lot of register moves. llc has one
option -mcpu=686, where output does not use xmm but it disables some other
instructions also. Is there any fine grain optimization flag like ( -mfpmath
= 387 which is present in gcc) which would just instruction backend to use
fpstack instead of SSE instructions and still not limit the instructions



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100607/2ae7d924/attachment.html>

More information about the llvm-dev mailing list