From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2284 invoked by alias); 3 Feb 2010 13:46:29 -0000 Received: (qmail 2275 invoked by uid 22791); 3 Feb 2010 13:46:29 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-ew0-f223.google.com (HELO mail-ew0-f223.google.com) (209.85.219.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Feb 2010 13:46:24 +0000 Received: by ewy23 with SMTP id 23so1103376ewy.4 for ; Wed, 03 Feb 2010 05:46:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.153.208 with SMTP id f58mr1753568wek.36.1265204782134; Wed, 03 Feb 2010 05:46:22 -0800 (PST) In-Reply-To: <201002030914.o139E4Ti027331@glazunov.sibelius.xs4all.nl> References: <20100203033131.GA21501@lucon.org> <201002030914.o139E4Ti027331@glazunov.sibelius.xs4all.nl> Date: Wed, 03 Feb 2010 13:46:00 -0000 Message-ID: <6dc9ffc81002030546vf0aed60x307ce782133335f4@mail.gmail.com> Subject: Re: PATCH: Add regcache_raw_supply_part/regcache_raw_collect_part From: "H.J. Lu" To: Mark Kettenis Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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-02/txt/msg00064.txt.bz2 On Wed, Feb 3, 2010 at 1:14 AM, Mark Kettenis wro= te: >> Date: Tue, 2 Feb 2010 19:31:31 -0800 >> From: "H.J. Lu" >> >> Hi, >> >> Intel AVX saves a 256bit YMM register in lower 128bit and upper 128bit >> separately. This patch adds regcache_raw_supply_part and >> regcache_raw_collect_part. They will be used in AVX gdb patches . OK >> to install? > > I think introducing these functions would be a mistake. =A0If you're not > careful, you'll end up with a register cache where part of some > registers is filled with garbage. They are used if ((clear_bv & bit_XSTATE_SSE)) regcache_raw_supply_part (regcache, i, NULL, 0, 16, 0); else regcache_raw_supply_part (regcache, i, XSAVE_SSE_ADDR (tdep, regs, i), 0, 16, 0); if ((clear_bv & bit_XSTATE_AVX)) regcache_raw_supply_part (regcache, i, NULL, 16, 16, 1); else regcache_raw_supply_part (regcache, i, XSAVE_AVXH_ADDR (tdep, regs, i), 16, 16, 1); I mark regcache as valid after full register is updated. If we get garbage = in regcache, it is a bug. > I think it is better for the code that fills the register cache, to > collect the pieces and build the full 256-bit value, and then use > regcache_raw_supply() to fill the register cache. > I can do that with extra memory copy. --=20 H.J.