qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/9] target/arm: Make vfp_get_fpscr() call vfp_get_{fpcr,  fpsr}
Date: Fri, 28 Jun 2024 08:37:21 -0700	[thread overview]
Message-ID: <61656f78-4f96-4212-b37e-3c77c937a3ea@linaro.org> (raw)
In-Reply-To: <20240628142347.1283015-3-peter.maydell@linaro.org>

On 6/28/24 07:23, Peter Maydell wrote:
> In AArch32, the floating point control and status bits are all in a
> single register, FPSCR.  In AArch64, these were split into separate
> FPCR and FPSR registers, but the bit layouts remained the same, with
> no overlaps, so that you could construct an FPSCR value by ORing FPCR
> and FPSR, or equivalently could produce FPSR and FPCR by masking an
> FPSCR value.  For QEMU's implementation, we opted to use masking to
> produce FPSR and FPCR, because we started with an AArch32
> implementation of FPSCR.
> 
> The addition of the (AArch64-only) FEAT_AFP adds new bits to the FPCR
> which overlap with some bits in the FPSR.  This means we'll no longer
> be able to consider the FPSCR-encoded value as the primary one, but
> instead need to treat FPSR/FPCR as the primary encoding and construct
> the FPSCR from those.  (This remains possible because the FEAT_AFP
> bits in FPCR don't appear in the FPSCR.)
> 
> As the first step in this refactoring, make vfp_get_fpscr() call
> vfp_get_fpcr() and vfp_get_fpsr(), instead of the other way around.
> 
> Note that vfp_get_fpcsr_from_host() returns only bits in the FPSR
> (for the cumulative fp exception bits), so we can simply rename
> it without needing to add a new function for getting FPCR bits.
> 
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
>   target/arm/cpu.h        | 24 +++++++++++++++---------
>   target/arm/vfp_helper.c | 34 ++++++++++++++++++++++------------
>   2 files changed, 37 insertions(+), 21 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


  reply	other threads:[~2024-06-28 15:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-28 14:23 [PATCH 0/9] target/arm: Refactor FPCR/FPSR handling to prepare for FEAT_AFP Peter Maydell
2024-06-28 14:23 ` [PATCH 1/9] target/arm: Correct comments about M-profile FPSCR Peter Maydell
2024-06-28 14:57   ` Richard Henderson
2024-06-28 14:23 ` [PATCH 2/9] target/arm: Make vfp_get_fpscr() call vfp_get_{fpcr, fpsr} Peter Maydell
2024-06-28 15:37   ` Richard Henderson [this message]
2024-06-28 14:23 ` [PATCH 3/9] target/arm: Make vfp_set_fpscr() call vfp_set_{fpcr, fpsr} Peter Maydell
2024-06-28 15:50   ` Richard Henderson
2024-06-28 14:23 ` [PATCH 4/9] target/arm: Support migration when FPSR/FPCR won't fit in the FPSCR Peter Maydell
2024-06-28 16:01   ` Richard Henderson
2024-06-28 16:27     ` Peter Maydell
2024-06-28 14:23 ` [PATCH 5/9] target/arm: Implement store_cpu_field_low32() macro Peter Maydell
2024-06-28 16:02   ` Richard Henderson
2024-06-28 14:23 ` [PATCH 6/9] target/arm: Store FPSR and FPCR in separate CPU state fields Peter Maydell
2024-06-28 16:06   ` Richard Henderson
2024-06-28 14:23 ` [PATCH 7/9] target/arm: Rename FPCR_ QC, NZCV macros to FPSR_ Peter Maydell
2024-06-28 16:07   ` Richard Henderson
2024-06-28 14:23 ` [PATCH 8/9] target/arm: Rename FPSR_MASK and FPCR_MASK and define them symbolically Peter Maydell
2024-06-28 16:12   ` Richard Henderson
2024-06-28 14:23 ` [PATCH 9/9] target/arm: Allow FPCR bits that aren't in FPSCR Peter Maydell
2024-06-28 16:14   ` Richard Henderson

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=61656f78-4f96-4212-b37e-3c77c937a3ea@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).