Skip to content
Snippets Groups Projects
Commit 3b694fab authored by Bob Wilson's avatar Bob Wilson
Browse files

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143530 91177308-0d34-0410-b5e6-96231b3b80d8
parent 19bda3ad
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment