Kaydet (Commit) e8ac3b5b authored tarafından Caolan McNamara's avatar Caolan McNamara Kaydeden (comit) Caolán McNamara

ppc64: using a fp register also consumes a gp register slot

Change-Id: Idf6f40081f4598c0fa9d1e10bdc208eae49e4cd1
Reviewed-on: https://gerrit.libreoffice.org/16936Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst fe14c55f
......@@ -133,6 +133,12 @@ static typelib_TypeClass cpp2uno_call(
}
pCppArgs[nPos] = pUnoArgs[nPos] = fpreg++;
nf++;
if (ng < ppc64::MAX_GPR_REGS)
{
ng++;
gpreg++;
}
}
else
{
......
......@@ -229,16 +229,20 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
// The value in %xmm register is already prepared to be retrieved as a float,
// thus we treat float and double the same
#define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverflow ) \
if ( nr < ppc64::MAX_SSE_REGS ) \
#define INSERT_FLOAT( pSV, nr, pFPR, nGPR, pDS, bOverflow ) \
if ( nGPR < ppc64::MAX_GPR_REGS ) \
++nGPR; \
if ( nr < ppc64::MAX_SSE_REGS ) \
pFPR[nr++] = *reinterpret_cast<float *>( pSV ); \
else \
bOverflow = true; \
if (bOverflow) \
*pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); // verbatim!
#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, bOverflow ) \
if ( nr < ppc64::MAX_SSE_REGS ) \
#define INSERT_DOUBLE( pSV, nr, pFPR, nGPR, pDS, bOverflow ) \
if ( nGPR < ppc64::MAX_GPR_REGS ) \
++nGPR; \
if ( nr < ppc64::MAX_SSE_REGS ) \
pFPR[nr++] = *reinterpret_cast<double *>( pSV ); \
else \
bOverflow = true; \
......@@ -390,10 +394,10 @@ static void cpp_call(
INSERT_INT8( pCppArgs[nPos], nGPR, pGPR, pStack, bOverflow );
break;
case typelib_TypeClass_FLOAT:
INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, pStack, bOverflow );
INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverflow );
break;
case typelib_TypeClass_DOUBLE:
INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, pStack, bOverflow );
INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverflow );
break;
default:
break;
......
......@@ -498,6 +498,10 @@ public class TestComponent {
return i2;
}
public int testPPC64Alignment( double d1, double d2, double d3, int i1 ) throws com.sun.star.uno.RuntimeException {
return i1;
}
public double testTenDoubles( double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10 ) {
return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10;
}
......
......@@ -528,6 +528,10 @@ static bool performTest(
sal_Int32 i2 = xLBT->testPPCAlignment(0, 0, 0, 0, 0xBEAF);
bRet &= check(i2 == 0xBEAF, "ppc-style alignment test");
}
{
sal_Int32 i1 = xLBT->testPPC64Alignment(1.0, 2.0, 3.0, 0xBEAF);
bRet &= check(i1 == 0xBEAF, "ppc64-style alignment test");
}
{
double d1 = xLBT->testTenDoubles(0.1, 0.2, 0.3, 0.4, 0.5,
0.6, 0.7, 0.8, 0.9, 1.0);
......
......@@ -255,6 +255,11 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2
return i2;
}
public int testPPC64Alignment( double d1, double d2, double d3, int i1 )
{
return i1;
}
public double testTenDoubles( double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10 )
{
return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10;
......
......@@ -220,6 +220,8 @@ public:
{ return rStruct; }
virtual sal_Int32 SAL_CALL testPPCAlignment( sal_Int64, sal_Int64, sal_Int32, sal_Int64, sal_Int32 i2 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
{ return i2; }
virtual sal_Int32 SAL_CALL testPPC64Alignment( double , double , double , sal_Int32 i1 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
{ return i1; }
virtual double SAL_CALL testTenDoubles( double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
{ return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10; }
virtual sal_Bool SAL_CALL getBool() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
......
......@@ -306,6 +306,12 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface
*/
long testPPCAlignment( [in] hyper l1, [in] hyper l2, [in] long i1, [in] hyper l3, [in] long i2 );
/**
* PPC64 Alignment test
*/
long testPPC64Alignment( [in] double d1, [in] double d2, [in] double d3, [in] long i1 );
/**
* VFP ABI (armhf) doubles test
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment