[llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp

Chris Lattner clattner at apple.com
Tue Apr 15 15:37:00 PDT 2008


On Apr 15, 2008, at 3:18 PM, Devang Patel wrote:

> Author: dpatel
> Date: Tue Apr 15 17:18:40 2008
> New Revision: 49746
>
> URL: http://llvm.org/viewvc/llvm-project?rev=49746&view=rev
> Log:
> Handle test cases from gcc.target/x86-64/abi/test_struct_return.c

This looks wrong:

>           Elts.push_back(Type::DoubleTy);
>           Bytes -= 16;
> +        } else if (Class[i+1] == X86_64_SSEDF_CLASS && Bytes == 16) {
> +          // struct {float f[2]; double d; } should be returned in  
> SSE registers.
> +          Elts.push_back(Type::DoubleTy);
> +          Elts.push_back(Type::DoubleTy);

Shouldn't this be <4 x float> [or <2 x float> if that works], double  
for performance?


> +        } else if (Class[i+1] == X86_64_INTEGER_CLASS) {
> +          // struct { float f[2]; char c; } should be returned in  
> SSE(low)
> +          // and INT (high).
> +          Elts.push_back(VectorType::get(Type::FloatTy, 2));
> +          Elts.push_back(Type::DoubleTy);

The second half should be i64 for correctness, no?

-Chris




More information about the llvm-commits mailing list