qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 8/8] target/sparc: Fix VIS subtraction instructions.


From: Richard Henderson
Subject: Re: [PATCH 8/8] target/sparc: Fix VIS subtraction instructions.
Date: Thu, 28 Sep 2023 14:40:10 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]