Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16 Public archive

Commit

Permalink
8258703: Incorrect 512-bit vector registers restore on x86_32
Browse files Browse the repository at this point in the history
Reviewed-by: kvn, sviswanathan
  • Loading branch information
DamonFool committed Jan 4, 2021
1 parent 73f5415 commit 216c2ec
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 @@ -314,18 +314,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 216c2ec

@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.