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

Evan Cheng evan.cheng at apple.com
Mon Nov 17 17:09:51 PST 2008


Author: evancheng
Date: Mon Nov 17 19:09:51 2008
New Revision: 59481

URL: http://llvm.org/viewvc/llvm-project?rev=59481&view=rev
Log:
For now, only pass _Complex long double as a first class aggregate in 64-bit. Passing other _Complex values as FCA break ABI compatibility. The issue is sdisel expand a _Complex FCA to two scalars. This means some _Complex values can have half of the value passed in a register and the other half in memory.

Modified:
    llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp

Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=59481&r1=59480&r2=59481&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Mon Nov 17 19:09:51 2008
@@ -627,10 +627,13 @@
   const StructType *STy = dyn_cast<StructType>(Ty);
   if (!STy || STy->isPacked()) return false;
 
-  // FIXME: Currently codegen isn't lowering _Complex char / short and _Complex
-  // int in x86-64 in a way that makes it ABI compatible.
+  // FIXME: Currently codegen isn't lowering most _Complex types in a way that
+  // makes it ABI compatible for x86-64. Same for _Complex char and _Complex
+  // short in 32-bit.
   const Type *EltTy = STy->getElementType(0);
-  return !((TARGET_64BIT && EltTy == Type::Int32Ty) ||
+  return !((TARGET_64BIT && (EltTy->isInteger() ||
+                             EltTy == Type::FloatTy ||
+                             EltTy == Type::DoubleTy)) ||
            EltTy == Type::Int16Ty ||
            EltTy == Type::Int8Ty);
 }





More information about the llvm-commits mailing list