[jdk16] RFR: 8258703: Incorrect 512-bit vector registers restore on x86_32
Vladimir Kozlov
kvn at openjdk.java.net
Wed Dec 23 18:34:58 UTC 2020
On Wed, 23 Dec 2020 09:06:00 GMT, Jie Fu <jiefu at openjdk.org> wrote:
> Hi all,
>
> Following tests fail on our AVX512 machines with x86_32:
> - compiler/runtime/Test7196199.java
> - compiler/runtime/safepoints/TestRegisterRestoring.java
> - compiler/vectorization/TestVectorsNotSavedAtSafepoint.java
>
> The reason is that 512-bit registers (zmm0 ~ zmm7) are restored incorrectly.
>
> Current restore logic for 512-bit registers includes:
> 1) restore zmm[511..256] [1]
> 2) restore zmm[255..128] [2] <-- Wrong on AVX512 with avx512vl
>
> On our AVX512 machine, Assembler::vinsertf128 [3] was called in step 2).
> According to the Intel instruction set reference, vinsertf128 just copies the lower half of zmm, which lost the upper half of zmm.
> VINSERTF128 (VEX encoded version)
> TEMP[255:0] <- SRC1[255:0]
> CASE (imm8[0]) OF
> 0: TEMP[127:0] <- SRC2[127:0]
> 1: TEMP[255:128] <- SRC2[127:0]
> ESAC
> DEST <- TEMP
>
> The fix just changes the order of the restore logic for 512-bit registers:
> 1) restore zmm[255..128]
> 2) restore zmm[511..256]
>
> Thanks.
> Best regards,
> Jie
>
> [1] https://github.com/openjdk/jdk16/blob/master/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp#L320
> [2] https://github.com/openjdk/jdk16/blob/master/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp#L326
> [3] https://github.com/openjdk/jdk16/blob/master/src/hotspot/cpu/x86/macroAssembler_x86.hpp#L1463
Someone from Intel should review this. @jatin-bhateja or @sviswa7, please.
-------------
PR: https://git.openjdk.java.net/jdk16/pull/64
More information about the hotspot-compiler-dev
mailing list