[llvm-commits] [llvm] r65274 - in /llvm/trunk: lib/Target/X86/X86CallingConv.td lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/ret-mmx.ll
Evan Cheng
evan.cheng at apple.com
Sun Feb 22 17:42:19 PST 2009
On Feb 22, 2009, at 4:24 PM, Dale Johannesen wrote:
>
> On Feb 22, 2009, at 3:01 PM, Dale Johannesen wrote:
>> 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.
>
> To clarify, in "it was right", I meant llvm-gcc. Currently llvm-gcc
> -m64 does a bitcast of MMX types to either double or i64 before
> returning, so I think what you changed in llvm never gets executed.
> I don't think this is ideal, but it allows llvm more
> freedom in interchanging types that *ought* to be equivalent, and
> are in other contexts.
>
Right. Both gcc and llvm-gcc cast _m64 to i64 so it's always returned
in RAX / RDX. The code I changed is only exercised by writing llvm
directly. But I think it makes sense. I'll change v2i32 etc.to be
returned in XMM0 / XMM1.
Evan
More information about the llvm-commits
mailing list