Skip to content

Commit

Permalink
8258703: Incorrect 512-bit vector registers restore on x86_32
Browse files Browse the repository at this point in the history
Backport-of: 216c2ec
  • Loading branch information
shipilev committed Aug 13, 2021
1 parent d24982f commit 8e63ecb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,19 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_ve
}

if (restore_vectors) {
off = additional_frame_bytes - ymm_bytes;
// Restore upper half of YMM registers.
for (int n = 0; n < num_xmm_regs; n++) {
__ vinsertf128_high(as_XMMRegister(n), Address(rsp, n*16+off));
}

if (UseAVX > 2) {
// Restore upper half of ZMM registers.
for (int n = 0; n < num_xmm_regs; n++) {
__ vinsertf64x4_high(as_XMMRegister(n), Address(rsp, n*32));
}
__ addptr(rsp, zmm_bytes);
}
// Restore upper half of YMM registers.
for (int n = 0; n < num_xmm_regs; n++) {
__ vinsertf128_high(as_XMMRegister(n), Address(rsp, n*16));
}
__ addptr(rsp, ymm_bytes);
__ addptr(rsp, additional_frame_bytes);
}

__ pop_FPU_state();
Expand Down

1 comment on commit 8e63ecb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.