Re: [PATCH 2/8] target/sparc: Fix VIS fmul8x16au instruction.

2023-09-28 Thread Nick Bowler
On 2023-09-28, Richard Henderson wrote: > Belated follow-up suggestion: > > - if ((tmp & 0xff) > 0x7f) { > - tmp += 0x100; > - } > + tmp += 0x80; > > 7 occurrences throughout vis_helper.c. I agree with making this particular change but I think since it doesn't fix a bug, it should go

Re: [PATCH 6/8] target/sparc: Fix VIS fpmerge input registers.

2023-09-28 Thread Nick Bowler
On 2023-09-28, Richard Henderson wrote: > On 9/24/23 01:03, Nick Bowler wrote: >> case 0x04b: /* VIS I fpmerge */ >> CHECK_FPU_FEATURE(dc, VIS1); >> -gen_ne_fop_DDD(dc, rd, rs1, rs2,

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

2023-09-28 Thread Nick Bowler
On 2023-09-28, Richard Henderson wrote: > 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 Ult

[PATCH 7/8] target/sparc: Fix VIS fexpand input register.

2023-09-25 Thread Nick Bowler
the second. This will not normally contain the correct data so the emulated instruction usually just produces garbage. Signed-off-by: Nick Bowler --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 5 - target/sparc/vis_helper.c | 5 ++--- 3 files changed, 7 insertions(+), 5

[PATCH 1/8] target/sparc: Fix VIS fmul8x16 input register.

2023-09-25 Thread Nick Bowler
therefore the output of the emulated instruction is just garbage. Signed-off-by: Nick Bowler Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1901 --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 6 +- target/sparc/vis_helper.c | 9 + 3 files changed, 11 insertions

[PATCH 3/8] target/sparc: Fix VIS fmul8x16al instruction.

2023-09-25 Thread Nick Bowler
except in trivial cases. Signed-off-by: Nick Bowler --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 2 +- target/sparc/vis_helper.c | 11 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 76e06b8ea5

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

2023-09-25 Thread Nick Bowler
from the second, so the results are wrong in all nontrivial cases. Signed-off-by: Nick Bowler --- target/sparc/vis_helper.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 3903beaf5d..fa97e09ffa

[PATCH 6/8] target/sparc: Fix VIS fpmerge input registers.

2023-09-25 Thread Nick Bowler
instances. Signed-off-by: Nick Bowler --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 6 +- target/sparc/vis_helper.c | 26 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index

[PATCH 4/8] target/sparc: Fix VIS fmuld8sux16 instruction.

2023-09-25 Thread Nick Bowler
rounding the output, which the real processor does not do. And the real processor shifts both outputs left by 8, which the emulator does not do. So the results are wrong except in trivial cases. Signed-off-by: Nick Bowler --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 2 +- target

[PATCH 2/8] target/sparc: Fix VIS fmul8x16au instruction.

2023-09-25 Thread Nick Bowler
except in trivial cases. Signed-off-by: Nick Bowler --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 19 ++- target/sparc/vis_helper.c | 14 +- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h

[PATCH 5/8] target/sparc: Fix VIS fmuld8ulx16 instruction.

2023-09-25 Thread Nick Bowler
. Even if the inputs happen to be correct, the emulator is rounding the output, which the real processor does not do. Signed-off-by: Nick Bowler --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 2 +- target/sparc/vis_helper.c | 17 +++-- 3 files changed, 9 insertions

[PATCH 0/8] SPARC VIS fixes

2023-09-25 Thread Nick Bowler
3, 4 and 5. Emulation results are tested by manually comparing the output of a small Linux test program on an UltraSparc II against the output of running the same binary under qemu-sparc32plus on a ppc64le host system. [1] https://gitlab.com/qemu-project/qemu/-/issues/1901 Nick Bowler (8