incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r1224943 - /incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/abi.cxx
Date Tue, 27 Dec 2011 16:40:14 GMT
Author: pfg
Date: Tue Dec 27 16:40:14 2011
New Revision: 1224943

URL: http://svn.apache.org/viewvc?rev=1224943&view=rev
Log:
#i109415# fixed x86_64::classify_argument for FreeBSD

Modified:
    incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/abi.cxx

Modified: incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/abi.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/abi.cxx?rev=1224943&r1=1224942&r2=1224943&view=diff
==============================================================================
--- incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/abi.cxx (original)
+++ incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/abi.cxx Tue Dec 27
16:40:14 2011
@@ -96,8 +96,6 @@ enum x86_64_reg_class
 
 #define MAX_CLASSES 4
 
-#define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
-
 /* x86-64 register passing implementation.  See x86-64 ABI for details.  Goal
    of this code is to classify each 8bytes of incoming argument by the register
    class and assign registers accordingly.  */
@@ -149,11 +147,8 @@ merge_classes (enum x86_64_reg_class cla
    See the x86-64 PS ABI for details.
 */
 static int
-classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_class classes[],
int &rByteOffset )
+classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_class classes[],
int ByteOffset )
 {
-    /* First, align to the right place.  */
-    rByteOffset = ALIGN( rByteOffset, pTypeRef->pType->nAlignment );
-
     switch ( pTypeRef->eTypeClass )
     {
         case typelib_TypeClass_VOID:
@@ -169,13 +164,13 @@ classify_argument( typelib_TypeDescripti
         case typelib_TypeClass_HYPER:
         case typelib_TypeClass_UNSIGNED_HYPER:
         case typelib_TypeClass_ENUM:
-            if ( ( rByteOffset % 8 + pTypeRef->pType->nSize ) <= 4 )
+            if ( ( ByteOffset % 8 + pTypeRef->pType->nSize ) <= 4 )
                 classes[0] = X86_64_INTEGERSI_CLASS;
             else
                 classes[0] = X86_64_INTEGER_CLASS;
             return 1;
         case typelib_TypeClass_FLOAT:
-            if ( ( rByteOffset % 8 ) == 0 )
+            if ( ( ByteOffset % 8 ) == 0 )
                 classes[0] = X86_64_SSESF_CLASS;
             else
                 classes[0] = X86_64_SSE_CLASS;
@@ -222,9 +217,9 @@ classify_argument( typelib_TypeDescripti
                 for ( sal_Int32 nMember = 0; nMember < pStruct->nMembers; ++nMember
)
                 {
                     typelib_TypeDescriptionReference *pTypeInStruct = pStruct->ppTypeRefs[
nMember ];
-                    rByteOffset = pStruct->pMemberOffsets[ nMember ];
+                    int offset = byteOffset + pStruct->pMemberOffsets[ nMember ];
 
-                    int num = classify_argument( pTypeInStruct, subclasses, rByteOffset );
+                    int num = classify_argument( pTypeInStruct, subclasses, offset );
 
                     if ( num == 0 )
                     {
@@ -234,7 +229,7 @@ classify_argument( typelib_TypeDescripti
 
                     for ( int i = 0; i < num; i++ )
                     {
-                        int pos = rByteOffset / 8;
+                        int pos = offset / 8;
                         classes[i + pos] = merge_classes( subclasses[i], classes[i + pos]
);
                     }
                 }
@@ -277,10 +272,9 @@ classify_argument( typelib_TypeDescripti
 bool x86_64::examine_argument( typelib_TypeDescriptionReference *pTypeRef, bool bInReturn,
int &nUsedGPR, int &nUsedSSE )
 {
     enum x86_64_reg_class classes[MAX_CLASSES];
-    int offset = 0;
     int n;
 
-    n = classify_argument( pTypeRef, classes, offset );
+    n = classify_argument( pTypeRef, classes, 0 );
 
     if ( n == 0 )
         return false;
@@ -326,10 +320,9 @@ bool x86_64::return_in_hidden_param( typ
 void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const sal_uInt64 *pGPR,
const double *pSSE, void *pStruct )
 {
     enum x86_64_reg_class classes[MAX_CLASSES];
-    int offset = 0;
     int n;
 
-    n = classify_argument( pTypeRef, classes, offset );
+    n = classify_argument( pTypeRef, classes, 0 );
 
     sal_uInt64 *pStructAlign = reinterpret_cast<sal_uInt64 *>( pStruct );
     for ( n--; n >= 0; n-- )
@@ -437,10 +430,10 @@ ffi_prep_args (stackLayout *stack, exten
 	  /* All easy cases are eliminated. Now fire the big guns.  */
 
 	  enum x86_64_reg_class classes[MAX_CLASSES];
-	  int offset = 0, j, num;
+	  int j, num;
 	  void *a;
 
-	  num = classify_argument (*p_arg, classes, &offset);
+	  num = classify_argument (*p_arg, classes, 0);
 	  for (j=0, a=*p_argv; j<num; j++, a+=8)
 	    {
 	      switch (classes[j])
@@ -567,7 +560,7 @@ ffi_fill_return_value (return_value *rv,
             ;
     }
 
-    num = classify_argument (ecif->cif->rtype, classes, &i);
+    num = classify_argument (ecif->cif->rtype, classes, 0);
 
     if (num == 0)
         /* Return in memory.  */



Mime
View raw message