From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCZEo-0002lJ-WC for qemu-devel@nongnu.org; Mon, 04 Mar 2013 12:31:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCZEn-0008DF-Ui for qemu-devel@nongnu.org; Mon, 04 Mar 2013 12:31:46 -0500 Received: from mel.act-europe.fr ([194.98.77.210]:48941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCZEn-0008D6-Nz for qemu-devel@nongnu.org; Mon, 04 Mar 2013 12:31:45 -0500 Message-ID: <5134DA80.7070304@adacore.com> Date: Mon, 04 Mar 2013 18:31:44 +0100 From: Fabien Chouteau MIME-Version: 1.0 References: <1362158507-19310-1-git-send-email-chouteau@adacore.com> <201303012051.17503.paul@codesourcery.com> <5134716C.9020001@adacore.com> <201303041330.37991.paul@codesourcery.com> In-Reply-To: <201303041330.37991.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-6 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/4] target-arm: Fix VFP register byte order in GDB remote List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, afaerber@suse.de On 03/04/2013 02:30 PM, Paul Brook wrote: >>>> "The bytes with the register are transmitted in target byte order." >>>> >>>> /* Aliases for Q regs. */ >>>> nregs += 16; >>>> if (reg < nregs) { >>>> >>>> - stfq_le_p(buf, env->vfp.regs[(reg - 32) * 2]); >>>> - stfq_le_p(buf + 8, env->vfp.regs[(reg - 32) * 2 + 1]); >>>> + stfq_p(buf, env->vfp.regs[(reg - 32) * 2]); >>>> + stfq_p(buf + 8, env->vfp.regs[(reg - 32) * 2 + 1]); >>> >>> This is wrong. You're still using little-endian ordering of words. >> >> Can you explain a little bit further? If I'm in big-endian mode, stfq_p() >> will be stfq_be_p(), right? > > Because we're actually storing two halves of a 128-bit value. You still > store the least significant half first. > Right, I'm sorry I didn't see you comment was only about the Q registers. What would be the solution then? #ifdef TARGET_WORDS_BIGENDIAN stfq_p(buf, env->vfp.regs[(reg - 32) * 2 + 1]); stfq_p(buf + 8, env->vfp.regs[(reg - 32) * 2]); #else stfq_p(buf, env->vfp.regs[(reg - 32) * 2]); stfq_p(buf + 8, env->vfp.regs[(reg - 32) * 2 + 1]); #endif /* TARGET_WORDS_BIGENDIAN */ Regards, -- Fabien Chouteau