From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6279 invoked by alias); 7 Apr 2010 15:19:56 -0000 Received: (qmail 6222 invoked by uid 22791); 7 Apr 2010 15:19:46 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Apr 2010 15:19:34 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o37FJPCl010023; Wed, 7 Apr 2010 17:19:25 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o37FJOAp000649; Wed, 7 Apr 2010 17:19:24 +0200 (CEST) Date: Wed, 07 Apr 2010 15:19:00 -0000 Message-Id: <201004071519.o37FJOAp000649@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: hjl.tools@gmail.com CC: gdb-patches@sourceware.org In-reply-to: (hjl.tools@gmail.com) Subject: Re: PATCH: 3/6 [3rd try]: Add AVX support (i386 changes) References: <20100304180219.GA10826@intel.com> <20100304180643.GB10869@intel.com> <20100306222037.GD21133@intel.com> <20100312164930.GB6144@intel.com> <20100329011124.GA27275@intel.com> <20100402143107.GA24450@intel.com> <201004021441.o32EfT7s024414@glazunov.sibelius.xs4all.nl> <201004071013.o37ADH21025897@glazunov.sibelius.xs4all.nl> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00133.txt.bz2 > Date: Wed, 7 Apr 2010 08:04:17 -0700 > From: "H.J. Lu" > > On Wed, Apr 7, 2010 at 7:55 AM, H.J. Lu wrote: > > On Wed, Apr 7, 2010 at 3:13 AM, Mark Kettenis wrote: > >>> > >>> XSAVE is different from FXSAVE in some subtle ways, although > >>> XSAVE memory layout is an extension to FXSAVE memory layout. > >>> XSAVE has used or initialized states for SSE and AVX registers. > >>> Most of the codes in i387_collect_xsave deal with used/initialized states. > >>> > >>> Please identify the duplication of code in i387_collect_xsave. I will take > >>> a look. > >> > >> There is in if (gcore) { } else { } there, that has quite a bit of > >> duplicated code.  I may be missing something, but the fact that > >> i387_collect_xsave() does different things whether it is generating a > >> core file or not seems to be undesirable and wrong to me. > >> > > > > I will take a look. > > > > That is xstate_bv optimization. xstate_bv controls how vector registers > are restored via xsave. If we will eventually call xsave, we set up xstate_bv > such that xsave will do minimum work to properly restore vector registers. > If it is for gcore, we don't need to optimize xstate_bv. Of course, we can > always optimize xstate_bv even for gcore. I can do that if it is desired. Please do; for generating core files, you should just call i387_collect_xsave(..., -1, ...).