mirror of
https://github.com/intel/llvm.git
synced 2026-02-06 06:31:50 +08:00
Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.
llvm-svn: 143530
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user