Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.

llvm-svn: 143530
This commit is contained in:
Bob Wilson
2011-11-02 04:51:36 +00:00
parent 682b850602
commit 1d9269a8d6
2 changed files with 12 additions and 4 deletions

View File

@@ -2671,6 +2671,14 @@ ABIArgInfo ARMABIInfo::classifyReturnType(QualType RetTy) const {
if (isEmptyRecord(getContext(), RetTy, true))
return ABIArgInfo::getIgnore();
// Check for homogeneous aggregates with AAPCS-VFP.
if (getABIKind() == AAPCS_VFP) {
const Type *Base = 0;
if (isHomogeneousAggregate(RetTy, Base, getContext()))
// Homogeneous Aggregates are returned directly.
return ABIArgInfo::getDirect();
}
// Aggregates <= 4 bytes are returned in r0; other aggregates
// are returned indirectly.
uint64_t Size = getContext().getTypeSize(RetTy);

View File

@@ -12,10 +12,10 @@ struct homogeneous_struct {
float f3;
float f4;
};
// CHECK: define arm_aapcs_vfpcc void @test_struct(float %{{.*}}, float %{{.*}}, float %{{.*}}, float %{{.*}})
extern void struct_callee(struct homogeneous_struct);
void test_struct(struct homogeneous_struct arg) {
struct_callee(arg);
// CHECK: define arm_aapcs_vfpcc %struct.homogeneous_struct @test_struct(float %{{.*}}, float %{{.*}}, float %{{.*}}, float %{{.*}})
extern struct homogeneous_struct struct_callee(struct homogeneous_struct);
struct homogeneous_struct test_struct(struct homogeneous_struct arg) {
return struct_callee(arg);
}
struct nested_array {