From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vxh7g-0003yj-5x for qemu-devel@nongnu.org; Mon, 30 Dec 2013 12:59:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vxh7b-0004Nm-Em for qemu-devel@nongnu.org; Mon, 30 Dec 2013 12:59:28 -0500 Received: from mail-qc0-x22a.google.com ([2607:f8b0:400d:c01::22a]:40921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vxh7b-0004Ni-Ah for qemu-devel@nongnu.org; Mon, 30 Dec 2013 12:59:23 -0500 Received: by mail-qc0-f170.google.com with SMTP id x13so11263265qcv.29 for ; Mon, 30 Dec 2013 09:59:22 -0800 (PST) Sender: Richard Henderson Message-ID: <52C1B476.8000705@twiddle.net> Date: Mon, 30 Dec 2013 09:59:18 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1388421275-2035-1-git-send-email-peter.maydell@linaro.org> <1388421275-2035-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1388421275-2035-3-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 02/10] target-arm: A64: Fix vector register access on bigendian hosts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Peter Crosthwaite , patches@linaro.org, Michael Matz , Alexander Graf , Claudio Fontana , Dirk Mueller , Will Newton , Laurent Desnogues , =?ISO-8859-1?Q?Alex_Benn=E9e?= , kvmarm@lists.cs.columbia.edu, Christoffer Dall On 12/30/2013 08:34 AM, Peter Maydell wrote: > The A64 128 bit vector registers are stored as a pair of > uint64_t values in the register array. This means that if > we're directly loading or storing a value of size less than > 64 bits we must adjust the offset appropriately to account > for whether the host is bigendian or not. Provide utility > functions to abstract away the offsetof() calculations for > the FP registers. > > For do_fp_st() we can sidestep most of the issues for 64 bit > and smaller reg-to-mem transfers by always doing a 64 bit > load from the register and writing just the piece we need > to memory. > > Signed-off-by: Peter Maydell > --- > Didn't spot this bug until I started reviewing the FP related > patches (the code also I think is cleaner without offsetof() > scattered everywhere). > --- > target-arm/translate-a64.c | 69 +++++++++++++++++++++++----------------------- > 1 file changed, 35 insertions(+), 34 deletions(-) Reviewed-by: Richard Henderson r~