[master] RFR: Fix arrays-equals intrinsic on AArch64
Andrew Haley
aph at openjdk.org
Wed Apr 24 15:37:41 UTC 2024
On Wed, 24 Apr 2024 14:36:31 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> The arrays-equals intrinsic on AArch64 assumes that array elements start at 8-byte-aligned boundary. There are several problems with that:
>
> * Doing unaligned loads is likely rather slow.
I doubt that. The design goal for AArch64 was that unaligned loads that don't cross cache-line boundaries shouldn't be penalized.
> * I believe it may give wrong results when comparing some junk after the end of the array.
>
> * We may crash when loading beyond the heap boundary.
The resulting code is really pretty ugly and hard to follow. We should be able to use an array comparison that doesn't have all of those `if (is_8aligned)`, surely? If we need to align, then we just check the first sub-words, then compare as many full-size words as we have, then check any remaining sub-words.
-------------
PR Comment: https://git.openjdk.org/lilliput/pull/170#issuecomment-2075234109
More information about the lilliput-dev
mailing list