qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Nick Bowler <nbowler@draconx.ca>, qemu-devel@nongnu.org
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Artyom Tarasenko <atar4qemu@gmail.com>
Subject: Re: [PATCH 8/8] target/sparc: Fix VIS subtraction instructions.
Date: Thu, 28 Sep 2023 14:40:10 -0700	[thread overview]
Message-ID: <a617709e-4567-a10e-26e0-e4ffb2308573@linaro.org> (raw)
In-Reply-To: <20230925050545.30912-9-nbowler@draconx.ca>

On 9/24/23 01:03, Nick Bowler wrote:
> All of the VIS subtraction instructions are documented to subtract the
> second input operand from the first.  This is also consistent with how
> the instructions actually work on a real UltraSparc II.
> 
> But the emulator is implementing the subtraction in the wrong order,
> subtracting the first input from the second, so the results are wrong
> in all nontrivial cases.
> 
> Signed-off-by: Nick Bowler <nbowler@draconx.ca>
> ---
>   target/sparc/vis_helper.c | 18 +++++++++---------
>   1 file changed, 9 insertions(+), 9 deletions(-)

While this patch works, better to use

void tcg_gen_vec_add16_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b);
void tcg_gen_vec_add16_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);
void tcg_gen_vec_add32_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);

void tcg_gen_vec_sub16_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b);
void tcg_gen_vec_sub16_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);
void tcg_gen_vec_sub32_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);

from "tcg/tcg-op-gvec.h" and remove the sparc helpers.


r~


  reply	other threads:[~2023-09-28 21:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25  5:03 [PATCH 0/8] SPARC VIS fixes Nick Bowler
2023-09-25  5:03 ` [PATCH 1/8] target/sparc: Fix VIS fmul8x16 input register Nick Bowler
2023-09-28 21:29   ` Richard Henderson
2023-09-25  5:03 ` [PATCH 2/8] target/sparc: Fix VIS fmul8x16au instruction Nick Bowler
2023-09-28 21:32   ` Richard Henderson
2023-09-29  0:41     ` Nick Bowler
2023-09-29  1:04       ` Richard Henderson
2023-09-25  5:03 ` [PATCH 3/8] target/sparc: Fix VIS fmul8x16al instruction Nick Bowler
2023-09-28 21:32   ` Richard Henderson
2023-09-25  5:03 ` [PATCH 4/8] target/sparc: Fix VIS fmuld8sux16 instruction Nick Bowler
2023-09-28 21:33   ` Richard Henderson
2023-09-25  5:03 ` [PATCH 5/8] target/sparc: Fix VIS fmuld8ulx16 instruction Nick Bowler
2023-09-28 21:34   ` Richard Henderson
2023-09-25  5:03 ` [PATCH 6/8] target/sparc: Fix VIS fpmerge input registers Nick Bowler
2023-09-28 21:35   ` Richard Henderson
2023-09-29  0:32     ` Nick Bowler
2023-09-25  5:03 ` [PATCH 7/8] target/sparc: Fix VIS fexpand input register Nick Bowler
2023-09-28 21:36   ` Richard Henderson
2023-09-25  5:03 ` [PATCH 8/8] target/sparc: Fix VIS subtraction instructions Nick Bowler
2023-09-28 21:40   ` Richard Henderson [this message]
2023-09-29  0:31     ` Nick Bowler
2023-09-28 20:05 ` [PATCH 0/8] SPARC VIS fixes Mark Cave-Ayland

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=a617709e-4567-a10e-26e0-e4ffb2308573@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=atar4qemu@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=nbowler@draconx.ca \
    --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).