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: [Qemu-devel] [PATCH 18/42] target/arm: Convert VFP VMLA to decodetree
Date: Sat, 8 Jun 2019 09:14:59 -0500	[thread overview]
Message-ID: <b6cf60b7-55c0-dc9c-1731-3e46dd8824ca@linaro.org> (raw)
In-Reply-To: <20190606174609.20487-19-peter.maydell@linaro.org>

On 6/6/19 12:45 PM, Peter Maydell wrote:
> Convert the VFP VMLA instruction to decodetree.
> 
> This is the first of the VFP 3-operand data processing instructions,
> so we include in this patch the code which loops over the elements
> for an old-style VFP vector operation. The existing code to do this
> looping uses the deprecated cpu_F0s/F0d/F1s/F1d TCG globals; since
> we are going to be converting instructions one at a time anyway
> we can take the opportunity to make the new loop use TCG temporaries,
> which means we can do that conversion one operation at a time
> rather than needing to do it all in one go.
> 
> We include an UNDEF check which was missing in the old code:
> short-vector operations (with stride or length non-zero) were
> deprecated in v7A and must UNDEF in v8A, so if the MVFR0 FPShVec
> field does not indicate that support for short vectors is present
> we UNDEF the operations that would use them. (This is a change
> of behaviour for Cortex-A7, Cortex-A15 and the v8 CPUs, which
> previously were all incorrectly allowing short-vector operations.)
> 
> Note that the conversion fixes a bug in the old code for the
> case of VFP short-vector "mixed scalar/vector operations". These
> happen where the destination register is in a vector bank but
> but the second operand is in a scalar bank. For example
>   vmla.f64 d10, d1, d16   with length 2 stride 2
> is equivalent to the pair of scalar operations
>   vmla.f64 d10, d1, d16
>   vmla.f64 d8, d3, d16
> where the destination and first input register cycle through
> their vector but the second input is scalar (d16). In the
> old decoder the gen_vfp_F1_mul() operation uses cpu_F1{s,d}
> as a temporary output for the multiply, which trashes the
> second input operand. For the fully-scalar case (where we
> never do a second iteration) and the fully-vector case
> (where the loop loads the new second input operand) this
> doesn't matter, but for the mixed scalar/vector case we
> will end up using the wrong value for later loop iterations.
> In the new code we use TCG temporaries and so avoid the bug.
> This bug is present for all the multiply-accumulate insns
> that operate on short vectors: VMLA, VMLS, VNMLA, VNMLS.
> 
> Note 2: the expression used to calculate the next register
> number in the vector bank is not in fact correct; we leave
> this behaviour unchanged from the old decoder and will
> fix this bug later in the series.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target/arm/cpu.h               |   5 +
>  target/arm/translate-vfp.inc.c | 205 +++++++++++++++++++++++++++++++++
>  target/arm/translate.c         |  14 ++-
>  target/arm/vfp.decode          |   6 +
>  4 files changed, 224 insertions(+), 6 deletions(-)

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


r~



  reply	other threads:[~2019-06-08 14:18 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 17:45 [Qemu-devel] [PATCH 00/42] target/arm: Convert VFP decoder to decodetree Peter Maydell
2019-06-06 17:45 ` [Qemu-devel] [PATCH 01/42] decodetree: Fix comparison of Field Peter Maydell
2019-06-06 17:45 ` [Qemu-devel] [PATCH 02/42] target/arm: Add stubs for AArch32 VFP decodetree Peter Maydell
2019-06-07 14:47   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 03/42] target/arm: Factor out VFP access checking code Peter Maydell
2019-06-07 14:49   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 04/42] target/arm: Fix Cortex-R5F MVFR values Peter Maydell
2019-06-07 14:50   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 05/42] target/arm: Explicitly enable VFP short-vectors for aarch32 -cpu max Peter Maydell
2019-06-07 14:51   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 06/42] target/arm: Convert the VSEL instructions to decodetree Peter Maydell
2019-06-07 14:54   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 07/42] target/arm: Convert VMINNM, VMAXNM " Peter Maydell
2019-06-07 14:55   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 08/42] target/arm: Convert VRINTA/VRINTN/VRINTP/VRINTM " Peter Maydell
2019-06-07 14:57   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 09/42] target/arm: Convert VCVTA/VCVTN/VCVTP/VCVTM " Peter Maydell
2019-06-07 15:38   ` Richard Henderson
2019-06-07 15:39     ` Peter Maydell
2019-06-06 17:45 ` [Qemu-devel] [PATCH 10/42] target/arm: Move the VFP trans_* functions to translate-vfp.inc.c Peter Maydell
2019-06-07 15:53   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 11/42] target/arm: Add helpers for VFP register loads and stores Peter Maydell
2019-06-07 17:11   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 12/42] target/arm: Convert "double-precision" register moves to decodetree Peter Maydell
2019-06-07 17:27   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 13/42] target/arm: Convert "single-precision" " Peter Maydell
2019-06-07 18:08   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 14/42] target/arm: Convert VFP two-register transfer insns " Peter Maydell
2019-06-08 13:46   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 15/42] target/arm: Convert VFP VLDR and VSTR " Peter Maydell
2019-06-08 13:54   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 16/42] target/arm: Convert the VFP load/store multiple insns " Peter Maydell
2019-06-08 14:04   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 17/42] target/arm: Remove VLDR/VSTR/VLDM/VSTM use of cpu_F0s and cpu_F0d Peter Maydell
2019-06-08 14:05   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 18/42] target/arm: Convert VFP VMLA to decodetree Peter Maydell
2019-06-08 14:14   ` Richard Henderson [this message]
2019-06-06 17:45 ` [Qemu-devel] [PATCH 19/42] target/arm: Convert VFP VMLS " Peter Maydell
2019-06-08 18:21   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 20/42] target/arm: Convert VFP VNMLS " Peter Maydell
2019-06-08 18:25   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 21/42] target/arm: Convert VFP VNMLA " Peter Maydell
2019-06-08 18:26   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 22/42] target/arm: Convert VMUL " Peter Maydell
2019-06-08 18:28   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 23/42] target/arm: Convert VNMUL " Peter Maydell
2019-06-08 18:29   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 24/42] target/arm: Convert VADD " Peter Maydell
2019-06-08 18:29   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 25/42] target/arm: Convert VSUB " Peter Maydell
2019-06-08 18:30   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 26/42] target/arm: Convert VDIV " Peter Maydell
2019-06-08 18:31   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 27/42] target/arm: Convert VFP fused multiply-add insns " Peter Maydell
2019-06-08 18:40   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 28/42] target/arm: Convert VMOV (imm) " Peter Maydell
2019-06-08 18:55   ` Richard Henderson
2019-06-10 17:12     ` Peter Maydell
2019-06-10 18:40       ` Richard Henderson
2019-06-10 19:27         ` [Qemu-devel] [Qemu-arm] " Ali Mezgani
2019-06-06 17:45 ` [Qemu-devel] [PATCH 29/42] target/arm: Convert VABS " Peter Maydell
2019-06-08 18:57   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 30/42] target/arm: Convert VNEG " Peter Maydell
2019-06-08 18:57   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 31/42] target/arm: Convert VSQRT " Peter Maydell
2019-06-08 18:59   ` Richard Henderson
2019-06-06 17:45 ` [Qemu-devel] [PATCH 32/42] target/arm: Convert VMOV (register) " Peter Maydell
2019-06-08 19:00   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 33/42] target/arm: Convert VFP comparison insns " Peter Maydell
2019-06-08 19:02   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 34/42] target/arm: Convert the VCVT-from-f16 " Peter Maydell
2019-06-08 19:08   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 35/42] target/arm: Convert the VCVT-to-f16 " Peter Maydell
2019-06-08 19:10   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 36/42] target/arm: Convert VFP round " Peter Maydell
2019-06-08 19:11   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 37/42] target/arm: Convert double-single precision conversion " Peter Maydell
2019-06-08 19:14   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 38/42] target/arm: Convert integer-to-float " Peter Maydell
2019-06-08 19:15   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 39/42] target/arm: Convert VJCVT " Peter Maydell
2019-06-08 19:16   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 40/42] target/arm: Convert VCVT fp/fixed-point conversion insns " Peter Maydell
2019-06-08 19:22   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 41/42] target/arm: Convert float-to-integer VCVT " Peter Maydell
2019-06-08 19:24   ` Richard Henderson
2019-06-06 17:46 ` [Qemu-devel] [PATCH 42/42] target/arm: Fix short-vector increment behaviour Peter Maydell
2019-06-08 19:26   ` 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=b6cf60b7-55c0-dc9c-1731-3e46dd8824ca@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).