diff --git a/0001-ppc64-simplify-this-a-little.patch b/0001-ppc64-simplify-this-a-little.patch new file mode 100644 index 0000000..5816ed4 --- /dev/null +++ b/0001-ppc64-simplify-this-a-little.patch @@ -0,0 +1,129 @@ +From c56030a7b50e589de97bb23da65dd9ca2c8d41d3 Mon Sep 17 00:00:00 2001 +From: Caolan McNamara +Date: Fri, 10 Jul 2015 16:00:22 +0100 +Subject: [PATCH 1/2] ppc64: simplify this a little + +Change-Id: I8166f65625d389a604750852d6d5a4fee25a88fa +--- + .../cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx | 61 +++++++++------------- + 1 file changed, 24 insertions(+), 37 deletions(-) + +diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx +index 4013076..81d3d5c 100644 +--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx ++++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx +@@ -124,6 +124,8 @@ void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference* + if (pReturnType->pType->nSize > 8) + pRegisters[1] = r4; + } ++#else ++ (void)r4; + #endif + default: + break; +@@ -185,45 +187,29 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, + + // fill registers + __asm__ __volatile__ ( +- "ld 3, 0(%0)\n\t" +- "ld 4, 8(%0)\n\t" +- "ld 5, 16(%0)\n\t" +- "ld 6, 24(%0)\n\t" +- "ld 7, 32(%0)\n\t" +- "ld 8, 40(%0)\n\t" +- "ld 9, 48(%0)\n\t" +- "ld 10, 56(%0)\n\t" +- "lfd 1, 0(%1)\n\t" +- "lfd 2, 8(%1)\n\t" +- "lfd 3, 16(%1)\n\t" +- "lfd 4, 24(%1)\n\t" +- "lfd 5, 32(%1)\n\t" +- "lfd 6, 40(%1)\n\t" +- "lfd 7, 48(%1)\n\t" +- "lfd 8, 56(%1)\n\t" +- "lfd 9, 64(%1)\n\t" +- "lfd 10, 72(%1)\n\t" +- "lfd 11, 80(%1)\n\t" +- "lfd 12, 88(%1)\n\t" +- "lfd 13, 96(%1)\n\t" +- : : "r" (pGPR), "r" (pFPR) +- : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", +- "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", +- "fr10", "fr11", "fr12", "fr13" ++ "lfd 1, 0(%0)\n\t" ++ "lfd 2, 8(%0)\n\t" ++ "lfd 3, 16(%0)\n\t" ++ "lfd 4, 24(%0)\n\t" ++ "lfd 5, 32(%0)\n\t" ++ "lfd 6, 40(%0)\n\t" ++ "lfd 7, 48(%0)\n\t" ++ "lfd 8, 56(%0)\n\t" ++ "lfd 9, 64(%0)\n\t" ++ "lfd 10, 72(%0)\n\t" ++ "lfd 11, 80(%0)\n\t" ++ "lfd 12, 88(%0)\n\t" ++ "lfd 13, 96(%0)\n\t" ++ : : "r" (pFPR) ++ : "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", ++ "fr10", "fr11", "fr12", "fr13" + ); + + // tell gcc that r3 to r11 are not available to it for doing the TOC and exception munge on the func call + register sal_uInt64 r3 asm("r3"); + register sal_uInt64 r4 asm("r4"); +- register sal_uInt64 r5 asm("r5"); +- register sal_uInt64 r6 asm("r6"); +- register sal_uInt64 r7 asm("r7"); +- register sal_uInt64 r8 asm("r8"); +- register sal_uInt64 r9 asm("r9"); +- register sal_uInt64 r10 asm("r10"); +- register sal_uInt64 r11 asm("r11"); + +- (*pFunc)(r3, r4, r5, r6, r7, r8, r9, r10); ++ (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3], pGPR[4], pGPR[5], pGPR[6], pGPR[7]); + + // get return value + __asm__ __volatile__ ( +@@ -375,7 +361,6 @@ static void cpp_call( + + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + { +-// uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, + uno_copyAndConvertData( pCppArgs[nPos] = pStack, pUnoArgs[nPos], pParamTypeDescr, + pThis->getBridge()->getUno2Cpp() ); + switch (pParamTypeDescr->eTypeClass) +@@ -383,7 +368,7 @@ static void cpp_call( + case typelib_TypeClass_HYPER: + case typelib_TypeClass_UNSIGNED_HYPER: + #if OSL_DEBUG_LEVEL > 2 +- fprintf(stderr, "hyper is %lx\n", pCppArgs[nPos]); ++ fprintf(stderr, "hyper is %lx\n", pCppArgs[nPos]); + #endif + INSERT_INT64( pCppArgs[nPos], nGPR, pGPR, pStack, bOverflow ); + break; +@@ -391,7 +376,7 @@ static void cpp_call( + case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_ENUM: + #if OSL_DEBUG_LEVEL > 2 +- fprintf(stderr, "long is %x\n", pCppArgs[nPos]); ++ fprintf(stderr, "long is %x\n", pCppArgs[nPos]); + #endif + INSERT_INT32( pCppArgs[nPos], nGPR, pGPR, pStack, bOverflow ); + break; +@@ -406,10 +391,12 @@ static void cpp_call( + break; + case typelib_TypeClass_FLOAT: + INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, pStack, bOverflow ); +- break; ++ break; + case typelib_TypeClass_DOUBLE: + INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, pStack, bOverflow ); + break; ++ default: ++ break; + } + + // no longer needed +-- +2.4.0 + diff --git a/0002-ppc64-using-a-fp-register-also-consumes-a-gp-registe.patch b/0002-ppc64-using-a-fp-register-also-consumes-a-gp-registe.patch new file mode 100644 index 0000000..6ecc05a --- /dev/null +++ b/0002-ppc64-using-a-fp-register-also-consumes-a-gp-registe.patch @@ -0,0 +1,155 @@ +From 14b96327143e7e519a0acc5c309460c04a16f55b Mon Sep 17 00:00:00 2001 +From: Caolan McNamara +Date: Fri, 10 Jul 2015 16:36:41 +0100 +Subject: [PATCH 2/2] ppc64: using a fp register also consumes a gp register + slot + +Change-Id: Idf6f40081f4598c0fa9d1e10bdc208eae49e4cd1 +--- + bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx | 6 ++++++ + bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx | 16 ++++++++++------ + testtools/com/sun/star/comp/bridge/TestComponent.java | 4 ++++ + testtools/source/bridgetest/bridgetest.cxx | 4 ++++ + testtools/source/bridgetest/cli/cli_cs_testobj.cs | 5 +++++ + testtools/source/bridgetest/cppobj.cxx | 2 ++ + testtools/source/bridgetest/idl/bridgetest.idl | 6 ++++++ + 7 files changed, 37 insertions(+), 6 deletions(-) + +diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx +index 6b58246..6ac003b 100644 +--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx ++++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx +@@ -133,6 +133,12 @@ static typelib_TypeClass cpp2uno_call( + } + pCppArgs[nPos] = pUnoArgs[nPos] = fpreg++; + nf++; ++ ++ if (ng < ppc64::MAX_GPR_REGS) ++ { ++ ng++; ++ gpreg++; ++ } + } + else + { +diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx +index 81d3d5c..28dfaf8 100644 +--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx ++++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx +@@ -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( pSV ); \ + else \ + bOverflow = true; \ + if (bOverflow) \ + *pDS++ = *reinterpret_cast( 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( 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; +diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java +index a6966eb..f8b50f2 100644 +--- a/testtools/com/sun/star/comp/bridge/TestComponent.java ++++ b/testtools/com/sun/star/comp/bridge/TestComponent.java +@@ -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; + } +diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx +index 52e337f..d17900f 100644 +--- a/testtools/source/bridgetest/bridgetest.cxx ++++ b/testtools/source/bridgetest/bridgetest.cxx +@@ -529,6 +529,10 @@ static bool performTest( + 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); + bRet &= check(d1 == 5.5, "armhf doubles test"); +diff --git a/testtools/source/bridgetest/cli/cli_cs_testobj.cs b/testtools/source/bridgetest/cli/cli_cs_testobj.cs +index 9d0ac7a..8f396c9 100644 +--- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs ++++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs +@@ -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; +diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx +index d21d753..d39f854 100644 +--- a/testtools/source/bridgetest/cppobj.cxx ++++ b/testtools/source/bridgetest/cppobj.cxx +@@ -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 f1, double f2, double f3, 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 +diff --git a/testtools/source/bridgetest/idl/bridgetest.idl b/testtools/source/bridgetest/idl/bridgetest.idl +index a11ba28..22612b8 100644 +--- a/testtools/source/bridgetest/idl/bridgetest.idl ++++ b/testtools/source/bridgetest/idl/bridgetest.idl +@@ -307,6 +307,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 + */ + double testTenDoubles( [in] double d1, [in] double d2, [in] double d3, [in] double d4, [in] double d5, [in] double d6, [in] double d7, [in] double d8, [in] double d9, [in] double d10 ); +-- +2.4.0 + diff --git a/libreoffice.spec b/libreoffice.spec index e17b9b3..ddb49ad 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -400,6 +400,8 @@ Patch88: 0001-Resolves-tdf-92275-impress-grinds-to-a-halt-constant.patch Patch89: 0001-Resolves-tdf-31577-volatile-lookup-ranges-must-not-b.patch Patch90: 0001-always-justify-a-referenced-range-in-order-tdf-92468.patch Patch91: 0001-Resolves-tdf-84762-collect-all-recalc-always-cells-b.patch +Patch92: 0001-ppc64-simplify-this-a-little.patch +Patch93: 0002-ppc64-using-a-fp-register-also-consumes-a-gp-registe.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2376,7 +2378,8 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog -* Thu Jul 09 2015 Eike Rathke - 1:4.3.7.2-9-UNBUILT +* Sat Jul 11 2015 Eike Rathke - 1:4.3.7.2-9 +- Resolves: rhbz#1146058 using a fp register also consumes a gp register slot - Resolves: tdf#31577 volatile lookup ranges must not be cached - Resolves: tdf#92468 always justify a referenced range in order - Resolves: tdf#84762 collect all recalc-always cells before setting any dirty