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

Daniel Dunbar daniel at zuster.org
Fri Jan 30 10:40:10 PST 2009


Author: ddunbar
Date: Fri Jan 30 12:40:10 2009
New Revision: 63404

URL: http://llvm.org/viewvc/llvm-project?rev=63404&view=rev
Log:
x86_64 ABI: Split small vectors which cross an eightbyte boundary. Down to 33/500 return type failures.

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=63404&r1=63403&r2=63404&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Fri Jan 30 12:40:10 2009
@@ -530,6 +530,11 @@
       // 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;
+
+      // If this type crosses an eightbyte boundary, it should be
+      // split.
+      if (OffsetBase && OffsetBase != 8)
+        Hi = Lo;
     } else if (Size == 128) {
       Lo = SSE;
       Hi = SSEUp;
@@ -537,8 +542,8 @@
   } else if (const ComplexType *CT = Ty->getAsComplexType()) {
     QualType ET = CT->getElementType();
     
+    uint64_t Size = Context.getTypeSize(Ty);
     if (ET->isIntegerType()) {
-      uint64_t Size = Context.getTypeSize(Ty);
       if (Size <= 64)
         Lo = Integer;
       else if (Size <= 128)
@@ -553,7 +558,7 @@
     // If this complex type crosses an eightbyte boundary then it
     // should be split.
     uint64_t EB_Real = (OffsetBase) >> 3;
-    uint64_t EB_Imag = (OffsetBase + Context.getTypeSize(ET)) >> 3;
+    uint64_t EB_Imag = (OffsetBase + Size) >> 3;
     if (Hi == NoClass && EB_Real != EB_Imag)
       Hi = Lo;
   } else if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) {





More information about the cfe-commits mailing list