diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-01-30 18:40:10 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-01-30 18:40:10 +0000 |
commit | e33edf150adc44a34c5f6c8ed6109f6dcd2f70c6 (patch) | |
tree | 7e7280b9f0477094e7a3b89497553cba25a11663 /lib/CodeGen/CGCall.cpp | |
parent | d079b2d6005bdade40ae4a0f228aba2affc591cf (diff) |
x86_64 ABI: Split small vectors which cross an eightbyte boundary. Down to 33/500 return type failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index b8f0ae868f..8027612cd4 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -530,6 +530,11 @@ void X86_64ABIInfo::classify(QualType Ty, // 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 @@ void X86_64ABIInfo::classify(QualType Ty, } 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 @@ void X86_64ABIInfo::classify(QualType Ty, // 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)) { |