[cfe-commits] r63413 - /cfe/trunk/lib/CodeGen/CGCall.cpp

Douglas Gregor dgregor at apple.com
Fri Jan 30 11:46:09 PST 2009


On Jan 30, 2009, at 11:38 AM, Daniel Dunbar wrote:

> Author: ddunbar
> Date: Fri Jan 30 13:38:39 2009
> New Revision: 63413
>
> URL: http://llvm.org/viewvc/llvm-project?rev=63413&view=rev
> Log:
> x86_64 ABI: Pass <1 x double> in memory. This is arguably wrong, but
> matches gcc 4.2 (not llvm-gcc).

How frightening. Did you check any other compilers, e.g., Intel?

I suggest that you put some kind of marker in the source for this kind  
of issue, e.g., FIXME or BUGCOMPAT or something like it, so we know  
where we've intentionally deviated from the specification.

	- Doug

> Modified:
>    cfe/trunk/lib/CodeGen/CGCall.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=63413&r1=63412&r2=63413&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Fri Jan 30 13:38:39 2009
> @@ -521,10 +521,13 @@
>   } else if (const VectorType *VT = Ty->getAsVectorType()) {
>     uint64_t Size = Context.getTypeSize(VT);
>     if (Size == 64) {
> -      // FIXME: For some reason, gcc appears to be treating <1 x
> -      // double> as INTEGER; this seems wrong, but we will match for
> -      // now (icc rejects <1 x double>, so...).
> -      Lo = (VT->getElementType() == Context.DoubleTy) ? Integer :  
> SSE;
> +      // gcc passes <1 x double> in memory.
> +      if (VT->getElementType() == Context.DoubleTy) {
> +        Lo = Memory;
> +        return;
> +      }
> +
> +      Lo = Integer;
>
>       // If this type crosses an eightbyte boundary, it should be
>       // split.
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list