All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabien Chouteau <chouteau@adacore.com>
To: Paul Brook <paul@codesourcery.com>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH 3/4] target-arm: Fix VFP register byte order in GDB remote
Date: Mon, 04 Mar 2013 18:31:44 +0100	[thread overview]
Message-ID: <5134DA80.7070304@adacore.com> (raw)
In-Reply-To: <201303041330.37991.paul@codesourcery.com>

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

  reply	other threads:[~2013-03-04 17:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-01 17:21 [Qemu-devel] [PATCH 0/4] ARM: Misc ARM big-endian bug fixes Fabien Chouteau
2013-03-01 17:21 ` [Qemu-devel] [PATCH 1/4] QAPI: Add ARMEB target-type Fabien Chouteau
2013-03-01 17:21 ` [Qemu-devel] [PATCH 2/4] Add default config for armeb-softmmu Fabien Chouteau
2013-03-01 17:21 ` [Qemu-devel] [PATCH 3/4] target-arm: Fix VFP register byte order in GDB remote Fabien Chouteau
2013-03-01 20:51   ` Paul Brook
2013-03-04 10:03     ` Fabien Chouteau
2013-03-04 13:30       ` Paul Brook
2013-03-04 17:31         ` Fabien Chouteau [this message]
     [not found]           ` <201303042334.02147.paul@codesourcery.com>
2013-03-05 10:59             ` Fabien Chouteau
2013-03-01 17:21 ` [Qemu-devel] [PATCH 4/4] target-arm: always set endian bits in big-endian mode Fabien Chouteau
2013-03-01 20:58   ` Paul Brook
2013-03-04 10:30     ` Fabien Chouteau
2013-03-04 13:24       ` Paul Brook
2013-03-05 10:56         ` Fabien Chouteau
2013-03-05 12:33           ` Peter Maydell
2013-03-05 15:07             ` Fabien Chouteau
2013-03-05 23:08               ` Peter Maydell
2013-03-06 17:39                 ` Fabien Chouteau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5134DA80.7070304@adacore.com \
    --to=chouteau@adacore.com \
    --cc=afaerber@suse.de \
    --cc=paul@codesourcery.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.