[llvm-commits] [llvm] r65274 - in /llvm/trunk: lib/Target/X86/X86CallingConv.td lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/ret-mmx.ll

Dale Johannesen dalej at apple.com
Sun Feb 22 15:01:01 PST 2009


On Feb 22, 2009, at 12:11 AM, Bill Wendling wrote:

> On Feb 22, 2009, at 12:05 AM, Evan Cheng wrote:
>
>> Author: evancheng
>> Date: Sun Feb 22 02:05:12 2009
>> New Revision: 65274
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=65274&view=rev
>> Log:
>> Be bug compatible with gcc by returning MMX values in RAX.
>>
> Really?! What was this breaking? I hate ruining our ABI just because
> of GCC. :-)

This isn't what gcc does.  The __m64 type is returned in RAX.  __v2si,  
__v4hi and __v8qi are returned in XMM0 as they are supposed to be.  I  
am pretty sure it was "right" (i.e. gcc-compatible)  before your change.

Checking the spec I noticed an ABI violation that's probably more  
important (shared by gcc):   we should  be generating EMMS before a  
call or a return in functions that reference MMX registers.  Inserting  
EMMS in the best places in general is not all that easy, but this case  
should be easy enough.   Since existing MMX code generally has  
explicit EMMS calls, we should probably insert others only if there  
isn't an explicit one already.





More information about the llvm-commits mailing list