[llvm-commits] Turning off SSE codegen for x86-64?

Török Edwin edwintorok at gmail.com
Sun Feb 1 02:28:59 PST 2009


On 2009-01-28 23:30, Dale Johannesen wrote:
>> So far I found that functions with va-args get SSE registers pushed on
>> the stack on x86-64/linux.
>> Could you point me to the place where this happens in llvm codegen? If
>> its not too complicated I may try to propose a patch when I find  
>> some time.
>>     
>
> LowerCALL in X86ISelLowering.cpp, and X86CallingConv.td.  You'll need  
> to match up with the
> prolog code which is in LowerFORMAL_ARGUMENTS.
>   

Thanks, attached is a patch I've tested on the Linux kernel, with this
patch it now builds and boots to the login prompt! (with a few
workarounds [1])

Can I commit the patch? (I would like it to be part of 2.5).

It should only have an effect if the user uses -mno-sse, or llc's
-mattr=-sse, everything should work as before otherwise. Of course you
won't be able to pass floating point values (since that requires an SSE
register), but the kernel doesn't use floating point, and gcc gives an
error (trying to use SSE register when SSE is disabled) anyway if you
try to do so, so llvm would mimic gcc's behaviour here quite well I hope.

[1]
Workarounds:
arch/x86/boot compiled with gcc
http://llvm.org/bugs/show_bug.cgi?id=2989#c2 patch applied to llvm-gcc
the put_user() fix applied to the linux kernel
a workaround for a bug in lib/vsprintf.c (undefined behaviour: pointer
arithmetic that overflows)

Best regards,
--Edwin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nosse.patch
Type: text/x-diff
Size: 1710 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090201/66a2e266/attachment.patch>


More information about the llvm-commits mailing list