RFR: 8314949: linux PPC64 Big Endian: Implementation of Foreign Function & Memory API [v4]
Jorn Vernee
jvernee at openjdk.org
Mon Sep 4 12:47:41 UTC 2023
On Mon, 4 Sep 2023 12:22:00 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
>> I've found a way to solve the remaining FFI problem on linux PPC64 Big Endian. Large structs (>8 Bytes) which are passed in registers or on stack require shifting the Bytes in the last slot if the size is not a multiple of 8. This PR adds the required functionality to the Java code.
>>
>> Please review and provide feedback. There may be better ways to implement it. I just found one which works and makes the tests pass:
>>
>> Test summary
>> ==============================
>> TEST TOTAL PASS FAIL ERROR
>> jtreg:test/jdk/java/foreign 88 88 0 0
>>
>>
>> Note: This PR should be considered as preparation work for AIX which also uses ABIv1.
>
> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
>
> Split Shift into ShiftLeft and ShiftRight + minor improvements.
src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecializer.java line 736:
> 734: cb.i2l();
> 735: popType(int.class);
> 736: pushType(long.class);
These should happen along every code path, so, also in the case where the input type is `long`. This will help catch cases where a previous binding left something else than a `long` on the type stack.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15417#discussion_r1314900942
More information about the core-libs-dev
mailing list