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

Tim Northover Tim.Northover at arm.com
Fri Jul 20 15:29:29 PDT 2012


Author: tnorthover
Date: Fri Jul 20 17:29:29 2012
New Revision: 160586

URL: http://llvm.org/viewvc/llvm-project?rev=160586&view=rev
Log:
Add "long double" to permitted list of ARM complex homogeneous aggregates.

Under AAPCS, long double is the same as double, which means it should be
allowed as part of a homogeneous aggregate.

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=160586&r1=160585&r2=160586&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Fri Jul 20 17:29:29 2012
@@ -2623,7 +2623,8 @@
     // double, or 64-bit or 128-bit vectors.
     if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) {
       if (BT->getKind() != BuiltinType::Float && 
-          BT->getKind() != BuiltinType::Double)
+          BT->getKind() != BuiltinType::Double &&
+          BT->getKind() != BuiltinType::LongDouble)
         return false;
     } else if (const VectorType *VT = Ty->getAs<VectorType>()) {
       unsigned VecSize = Context.getTypeSize(VT);

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=160586&r1=160585&r2=160586&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/arm-aapcs-vfp.c (original)
+++ cfe/trunk/test/CodeGen/arm-aapcs-vfp.c Fri Jul 20 17:29:29 2012
@@ -34,6 +34,13 @@
   complex_callee(cd);
 }
 
+// Long double is the same as double on AAPCS, it should be homogeneous.
+extern void complex_long_callee(__complex__ long double);
+// CHECK: define arm_aapcs_vfpcc void @test_complex_long(double %{{.*}}, double %{{.*}})
+void test_complex_long(__complex__ long double cd) {
+  complex_callee(cd);
+}
+
 // Structs with more than 4 elements of the base type are not treated
 // as homogeneous aggregates.  Test that.
 





More information about the cfe-commits mailing list