From 642a97391ae81d6a774aae651889501e4e840f0e Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 8 May 2023 10:39:52 -0700 Subject: [PATCH] gdbserver: Clear upper ZMM registers in the right location. This was previously clearing the upper 32 bytes of ZMM0-15 rather than ZMM16-31. Approved-By: Simon Marchi --- gdbserver/i387-fp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbserver/i387-fp.cc b/gdbserver/i387-fp.cc index 12cb614e5d8..49795ace9a9 100644 --- a/gdbserver/i387-fp.cc +++ b/gdbserver/i387-fp.cc @@ -322,7 +322,7 @@ i387_cache_to_xsave (struct regcache *regcache, void *buf) if ((clear_bv & X86_XSTATE_ZMM)) { for (i = 0; i < num_avx512_zmmh_high_registers; i++) - memset (((char *) &fp->zmmh_low_space[0]) + 32 + i * 64, 0, 32); + memset (((char *) &fp->zmmh_high_space[0]) + 32 + i * 64, 0, 32); for (i = 0; i < num_avx512_xmm_registers; i++) memset (((char *) &fp->zmmh_high_space[0]) + i * 64, 0, 16); for (i = 0; i < num_avx512_ymmh_registers; i++) -- 2.30.2