[cfe-commits] r143530 - in /cfe/trunk: lib/CodeGen/TargetInfo.cpp test/CodeGen/arm-aapcs-vfp.c

James Molloy James.Molloy at arm.com
Wed Nov 2 07:07:04 PDT 2011


Hi Bob,

Nice catch, I had a patch to fix this just complete internal code review and was about to send it. Just beat me to it! ;)

James
________________________________________
From: cfe-commits-bounces at cs.uiuc.edu [cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Bob Wilson [bob.wilson at apple.com]
Sent: 02 November 2011 04:51
To: cfe-commits at cs.uiuc.edu
Subject: [cfe-commits] r143530 - in /cfe/trunk: lib/CodeGen/TargetInfo.cpp test/CodeGen/arm-aapcs-vfp.c

Author: bwilson
Date: Tue Nov  1 23:51:36 2011
New Revision: 143530

URL: http://llvm.org/viewvc/llvm-project?rev=143530&view=rev
Log:
Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.

Modified:
    cfe/trunk/lib/CodeGen/TargetInfo.cpp
    cfe/trunk/test/CodeGen/arm-aapcs-vfp.c

Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=143530&r1=143529&r2=143530&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Tue Nov  1 23:51:36 2011
@@ -2671,6 +2671,14 @@
   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);

Modified: cfe/trunk/test/CodeGen/arm-aapcs-vfp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-aapcs-vfp.c?rev=143530&r1=143529&r2=143530&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/arm-aapcs-vfp.c (original)
+++ cfe/trunk/test/CodeGen/arm-aapcs-vfp.c Tue Nov  1 23:51:36 2011
@@ -12,10 +12,10 @@
   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 {


_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.





More information about the cfe-commits mailing list