Integrated: 8283122: [AIX, s390] UnsafeCopyMemory 'Mismatched' Tests Fail on Big Endian Systems
Tyler Steele
duke at openjdk.java.net
Tue Mar 15 14:55:42 UTC 2022
On Mon, 14 Mar 2022 18:19:46 GMT, Tyler Steele <duke at openjdk.java.net> wrote:
> This is a testbug present on big endian systems. UnsafeCopyMemory.java contains a few tests with 'mismatched' source and destination size. These tests use Unsafe.copyMemory to copy 4 bytes between longs and ints. The location of the bytes to be copied (if the copy comes from a long), or the offset into which the bytes should be copied (if the copy is into a long) are different on big and little endian systems.
>
> Copying from a long to int on a little endian system, the bytes to be copied are those present at the long's address.
>
>
> src: _ _ _ _ | _ _ _ _
> ^ ~ ~ ^ LE copy
> dst: _ _ _ _
>
>
> On BE systems, the bytes are offset by 4.
>
>
> src: _ _ _ _ | _ _ _ _
> ^ ~ ~ ^ BE copy
> dst: _ _ _ _
>
>
> The situation for copying into a long from an int is analogous.
>
> This PR adds the required offset for the 'mismatched copy' tests. With this change, UnsafeCopyMemory.java now passes on AIX and s390.
This pull request has now been integrated.
Changeset: 4de72014
Author: Tyler Steele <tyler.steele at ibm.com>
Committer: Thomas Stuefe <stuefe at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/4de72014d3a33469399fec6f428f35c47c4cfbe0
Stats: 11 lines in 1 file changed: 9 ins; 0 del; 2 mod
8283122: [AIX, s390] UnsafeCopyMemory 'Mismatched' Tests Fail on Big Endian Systems
Reviewed-by: thartmann, stuefe
-------------
PR: https://git.openjdk.java.net/jdk/pull/7811
More information about the hotspot-compiler-dev
mailing list