RFR: 8262901: [macos_aarch64] NativeCallTest expected:<-3.8194101E18> but was:<3.02668882E10>

Andrew Haley aph at openjdk.java.net
Wed Dec 1 17:04:22 UTC 2021


On Wed, 1 Dec 2021 16:17:21 GMT, Danil Bubnov <duke at openjdk.java.net> wrote:

> This is the fix of aarch64 jvmci calling convention.
> 
> On MacOS/aarch64 "Function arguments may consume slots on the stack that are not multiples of 8 bytes" [1], but current approach uses only wordsize or bigger slots, which is incorrect (that is why tests were failing [4]). Now arguments consume the right amount of bytes.
> 
> Another problem is that current approach don't make 16-byte alignment of Stack Pointer [1][2][3]. However, tests not fail on Linux/aarch64 and Windows/aarch64. They pass because in this tests all functions have even number of argumets, that is why 16-byte alignment comes automatically. But if you try to add or delete one argumets, tests will fail with SIGBUS.
> 
> I've tested this patch on MacOS/aarch64 and Linux/aarch64, all tests have passed.
> 
> Also I don't understand, why current tests (NativeCallTest) use only int, long, float and double as arguments types. Is it possible to add functions with another types like byte or short? I tried, but it fails on every platform.
> 
> [1] https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
> [2] https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#the-stack
> [3] https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-160#stack
> [4] https://bugs.openjdk.java.net/browse/JDK-8262901

Thanks for this contribution. Which set of tests have you been using?

-------------

PR: https://git.openjdk.java.net/jdk/pull/6641


More information about the hotspot-compiler-dev mailing list