[LLVMdev] [cfe-dev] should -mno-sse -mno-mmx -msse -mmmx work?

Andrew Fish afish at apple.com
Fri Jul 1 16:58:30 PDT 2011


On Jul 1, 2011, at 3:55 PM, Alistair Lynn wrote:

> Hi Andrew-
> 
>> Well -no-sse -mno-mmx works for EFI as it is pre-boot firmware and does not have any floating point C code.  We use -no-sse and -mno-mmx code to prevent optimized code gen using these registers for optimizations. 
> 
> Whether it's optimised or not doesn't particularly matter, the x86_64 ABI says that floating-point return values go into SSE registers, so that is where LLVM is required to put them. If you need to avoid these registers, then you may well need to write a separate calling convention for the backend which stores those return values elsewhere (like the x87 fp stack), or just do not return floating-point values.
> 

Why can't I make a calling convention that states C source code can not use any floating point? At that point -mno-sse and -mno-mmx make sense, and it is a lot easier than adding a new calling convention code gen to the compiler.  This is kind of where EFI started from.

> Alistair
> 




More information about the llvm-dev mailing list