Resolves: rhbz#1125588 ppc64le passes testtools

*bzzt*, <lightning arcs, faint smell of ozone>, it's alive!

Change-Id: I0b42f4e2603e6d76200d63ab2e26bbb856ae1173
This commit is contained in:
Caolán McNamara
2014-08-22 15:06:53 +01:00
parent e426e448ce
commit 6ab1951ea2
2 changed files with 22 additions and 3 deletions

View File

@@ -545,7 +545,11 @@ extern "C" void privateSnippetExecutor( ... )
"mr %0, 1\n\t" "mr %0, 1\n\t"
: "=r" (sp) : ); : "=r" (sp) : );
#if _CALL_ELF == 2
volatile long nRegReturn[1]; volatile long nRegReturn[1];
#else
volatile long nRegReturn[2];
#endif
typelib_TypeClass aType = typelib_TypeClass aType =
cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, sp, (sal_Int64*)nRegReturn); cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, sp, (sal_Int64*)nRegReturn);
@@ -588,6 +592,10 @@ extern "C" void privateSnippetExecutor( ... )
default: default:
__asm__( "ld 3,%0\n\t" __asm__( "ld 3,%0\n\t"
: : "m" (nRegReturn[0]) ); : : "m" (nRegReturn[0]) );
#if _CALL_ELF == 2
__asm__( "ld 4,%0\n\t"
: : "m" (nRegReturn[1]) );
#endif
break; break;
} }
} }

View File

@@ -87,9 +87,9 @@ namespace ppc64
} }
} }
void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegisterReturn) void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference* pReturnType, void *pRegisterReturn)
{ {
switch (eTypeClass) switch (pReturnType->eTypeClass)
{ {
case typelib_TypeClass_HYPER: case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER: case typelib_TypeClass_UNSIGNED_HYPER:
@@ -115,6 +115,17 @@ void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegist
case typelib_TypeClass_DOUBLE: case typelib_TypeClass_DOUBLE:
*reinterpret_cast<double *>( pRegisterReturn ) = dret; *reinterpret_cast<double *>( pRegisterReturn ) = dret;
break; break;
#if _CALL_ELF == 2
case typelib_TypeClass_STRUCT:
case typelib_TypeClass_EXCEPTION:
if (!ppc64::return_in_hidden_param(pReturnType))
{
sal_uInt64 *pRegisters = reinterpret_cast<sal_uInt64*>(pRegisterReturn);
pRegisters[0] = r3;
if (pReturnType->pType->nSize > 8)
pRegisters[1] = r4;
}
#endif
default: default:
break; break;
} }
@@ -222,7 +233,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
"fmr %0, 1\n\t" "fmr %0, 1\n\t"
: "=f" (dret), "=r" (r3), "=r" (r4) : ); : "=f" (dret), "=r" (r3), "=r" (r4) : );
MapReturn(r3, dret, pReturnTypeDescr->eTypeClass, pRegisterReturn); MapReturn(r3, r4, dret, pReturnTypeRef, pRegisterReturn);
} }
// Macros for easier insertion of values to registers or stack // Macros for easier insertion of values to registers or stack