This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] x86-64: fix ZMM register state tracking
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Jan Beulich <JBeulich at suse dot com>, GDB <gdb-patches at sourceware dot org>
- Cc: "Wiederhake, Tim" <tim dot wiederhake at intel dot com>
- Date: Sat, 8 Sep 2018 00:12:04 +0100
- Subject: Re: [PATCH] x86-64: fix ZMM register state tracking
- References: <5B8FD8B302000078001E5940@prv1-mh.provo.novell.com>
Hi Jan,
Would it be possible to update or create a test to exercise that?
arch-specific tests are in testsuite/gdb.arch.
I have some comments about the form. Tim, could you or somebody
else from Intel take a look at the functional side of the changes?
On 2018-09-05 02:22 PM, Jan Beulich wrote:
> The three AVX512 state components are entirely independent - one being
> in its "init state" has no implication whatsoever on either of the other
> two. Fully separate X86_XSTATE_ZMM_H and X86_XSTATE_ZMM handling, to
> prevent upper halves of the upper 16 ZMM registers to display as if they
> were zero (when they aren't) after e.g. VZEROALL/VZEROUPPER.
>
> gdb/
> 2018-09-05 Jan Beulich <jbeulich@suse.com>
>
> * i387-tdep.c (i387_supply_xsave): Split handling of
> X86_XSTATE_ZMM_H and X86_XSTATE_ZMM.
> (i387_collect_xsave): Likewise.
>
> --- a/gdb/i387-tdep.c
> +++ b/gdb/i387-tdep.c
> @@ -923,7 +923,8 @@ i387_supply_xsave (struct regcache *regc
> enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
> struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
> const gdb_byte *regs = (const gdb_byte *) xsave;
> - int i;
> + int i, zmm_endlo_regnum = I387_ZMM0H_REGNUM (tdep)
> + + std::min (tdep->num_zmm_regs, 16);
The GNU standard requires to parenthesis when breaking lines:
int i, zmm_endlo_regnum = (I387_ZMM0H_REGNUM (tdep)
+ std::min (tdep->num_zmm_regs, 16));
Simon