From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxeNB-0002yL-I6 for qemu-devel@nongnu.org; Mon, 30 Dec 2013 10:03:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VxeN3-0002lB-3y for qemu-devel@nongnu.org; Mon, 30 Dec 2013 10:03:17 -0500 Received: from mail-qe0-x233.google.com ([2607:f8b0:400d:c02::233]:50772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxeN2-0002l2-Vz for qemu-devel@nongnu.org; Mon, 30 Dec 2013 10:03:09 -0500 Received: by mail-qe0-f51.google.com with SMTP id 1so11419201qee.24 for ; Mon, 30 Dec 2013 07:03:08 -0800 (PST) Sender: Richard Henderson Message-ID: <52C18B27.9060300@twiddle.net> Date: Mon, 30 Dec 2013 07:03:03 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1388267351-31818-1-git-send-email-peter.maydell@linaro.org> <1388267351-31818-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1388267351-31818-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 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: 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/28/2013 01:49 PM, Peter Maydell wrote: > if (size < 4) { > switch (size) { > case 0: > - tcg_gen_ld8u_i64(tmp, cpu_env, freg_offs); > + tcg_gen_ld8u_i64(tmp, cpu_env, fp_reg_offset(srcidx, MO_8)); > break; > case 1: > - tcg_gen_ld16u_i64(tmp, cpu_env, freg_offs); > + tcg_gen_ld16u_i64(tmp, cpu_env, fp_reg_offset(srcidx, MO_16)); > break; > case 2: > - tcg_gen_ld32u_i64(tmp, cpu_env, freg_offs); > + tcg_gen_ld32u_i64(tmp, cpu_env, fp_reg_offset(srcidx, MO_32)); > break; > case 3: > - tcg_gen_ld_i64(tmp, cpu_env, freg_offs); > + tcg_gen_ld_i64(tmp, cpu_env, fp_reg_offset(srcidx, MO_64)); > break; > } > tcg_gen_qemu_st_i64(tmp, tcg_addr, get_mem_index(s), MO_TE + size); It occurs to me to wonder whether it wouldn't just be better to load the whole 64-bit quantity and store the piece we need, ignoring the entire host-endian issue. I agree with the fp_reg_hi_offset helper, I just wonder if we ought not just have a one-argument fp_reg_lo_offset helper instead of the sized one you introduce. r~