diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-07-27 23:45:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-07-28 13:08:07 +0200 |
commit | ca344be7aabf88dddde38841e6af6292ece6829b (patch) | |
tree | 18e553d2b9958507e1cd9e5891006a473764a09d /testtools/source | |
parent | f7709a6594753b99973258d33ce3b901ed24df85 (diff) |
tdf#143450: Fix special fp+integer struct return case for gcc_*_x86-64
For one, the loop in x86_64::fill_struct was backwards.
And for another, privateSnippedExecutor does not need special handling of FLOAT
and DOUBLE return values (they can simply be moved to %xmm0, as covered by the
general case), but rather for those small structs where floating-point member(s)
in a first eightbyte (targeting %xmm0) are followed by integer member(s) in a
second eightbyte (targeting %rax). Extended testtools to cover two such cases.
Change-Id: I8e775a1d1ce2312610f265bcc8e40b09bdac56df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119576
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'testtools/source')
-rw-r--r-- | testtools/source/bridgetest/bridgetest.cxx | 14 | ||||
-rw-r--r-- | testtools/source/bridgetest/cli/cli_cs_testobj.cs | 4 | ||||
-rw-r--r-- | testtools/source/bridgetest/cppobj.cxx | 4 | ||||
-rw-r--r-- | testtools/source/bridgetest/idl/bridgetest.idl | 14 |
4 files changed, 36 insertions, 0 deletions
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 16f9bd199b24..2d3de2aca07f 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -485,6 +485,20 @@ static bool performTest( bRet = check( memcmp(&aIn, &aOut, sizeof(MixedFloatAndInteger)) == 0, "mixed float and integer struct test" ) && bRet; } { + DoubleHyper in(10.0, 11); + DoubleHyper out = xLBT->echoDoubleHyper(in); + bRet &= check(out.a == in.a, "double and hyper struct test: double") + && check(out.b == in.b, "double and hyper struct test: hyper"); + } + { + FloatFloatLongByte in(20.0f, 21.0f, 22, '3'); + FloatFloatLongByte out = xLBT->echoFloatFloatLongByte(in); + bRet &= check(out.a == in.a, "double and hyper struct test: first float") + && check(out.b == in.b, "double and hyper struct test: second float") + && check(out.c == in.c, "double and hyper struct test: long") + && check(out.d == in.d, "double and hyper struct test: byte"); + } + { ThreeByteStruct aIn(9, 10, 11); ThreeByteStruct aOut = xLBT->echoThreeByteStruct(aIn); bRet = check( memcmp(&aIn, &aOut, sizeof(ThreeByteStruct)) == 0, "three byte struct test" ) && bRet; diff --git a/testtools/source/bridgetest/cli/cli_cs_testobj.cs b/testtools/source/bridgetest/cli/cli_cs_testobj.cs index a8722edc65aa..fb4148cc2a68 100644 --- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs +++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs @@ -259,6 +259,10 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2 return arg; } + public DoubleHyper echoDoubleHyper(Mix s) { return s; } + + public FloatFloatLongByte echoFloatFloatLongByte(Mix s) { return s; } + public ThreeByteStruct echoThreeByteStruct(/*[in]*/ThreeByteStruct arg) { return arg; diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index 44cc0ec76edd..27b06ea7f0ad 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -245,6 +245,10 @@ public: { return rStruct; } virtual MixedFloatAndInteger SAL_CALL echoMixedFloatAndInteger(const MixedFloatAndInteger& rStruct) override { return rStruct; } + virtual DoubleHyper SAL_CALL echoDoubleHyper(DoubleHyper const & s) override { return s; } + virtual FloatFloatLongByte SAL_CALL echoFloatFloatLongByte(FloatFloatLongByte const & s) + override + { return s; } virtual ThreeByteStruct SAL_CALL echoThreeByteStruct(const ThreeByteStruct& rStruct) override { return rStruct; } virtual sal_Int32 SAL_CALL testPPCAlignment( sal_Int64, sal_Int64, sal_Int32, sal_Int64, sal_Int32 i2 ) override diff --git a/testtools/source/bridgetest/idl/bridgetest.idl b/testtools/source/bridgetest/idl/bridgetest.idl index b40d46d0764f..d9732edde7a8 100644 --- a/testtools/source/bridgetest/idl/bridgetest.idl +++ b/testtools/source/bridgetest/idl/bridgetest.idl @@ -122,6 +122,16 @@ struct MixedFloatAndInteger float a; long b; }; +struct DoubleHyper { + double a; + hyper b; +}; +struct FloatFloatLongByte { + float a; + float b; + long c; + byte d; +}; /** * Small struct with three bytes. Should *not* return in registers on * BSDs/MACOSx @@ -328,6 +338,10 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface */ MixedFloatAndInteger echoMixedFloatAndInteger( [in] MixedFloatAndInteger aStruct ); + DoubleHyper echoDoubleHyper([in] DoubleHyper s); + + FloatFloatLongByte echoFloatFloatLongByte([in] FloatFloatLongByte s); + /** * register return test 7 */ |