qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] tcg/s390x: Fixes for host vector codegen
@ 2022-03-03  3:11 Richard Henderson
  2022-03-03  3:11 ` [PATCH 1/3] tcg/s390x: Fix tcg_out_dupi_vec vs VGM Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Richard Henderson @ 2022-03-03  3:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-s390x

I've run some risu tests for target arm neon on s390x
and have found a couple of bugs.


r~


Richard Henderson (3):
  tcg/s390x: Fix tcg_out_dupi_vec vs VGM
  tcg/s390x: Fix INDEX_op_bitsel_vec vs VSEL
  tcg/s390x: Fix tcg_out_dup_vec vs general registers

 tcg/s390x/tcg-target.c.inc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] tcg/s390x: Fix tcg_out_dupi_vec vs VGM
  2022-03-03  3:11 [PATCH 0/3] tcg/s390x: Fixes for host vector codegen Richard Henderson
@ 2022-03-03  3:11 ` Richard Henderson
  2022-03-03  3:11 ` [PATCH 2/3] tcg/s390x: Fix INDEX_op_bitsel_vec vs VSEL Richard Henderson
  2022-03-03  3:11 ` [PATCH 3/3] tcg/s390x: Fix tcg_out_dup_vec vs general registers Richard Henderson
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2022-03-03  3:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-s390x

The immediate operands to VGM were in the wrong order,
producing an inverse mask.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/s390x/tcg-target.c.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
index 6e65828c09..508f1bccc7 100644
--- a/tcg/s390x/tcg-target.c.inc
+++ b/tcg/s390x/tcg-target.c.inc
@@ -2715,7 +2715,7 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece,
                 msb = clz32(val);
                 lsb = 31 - ctz32(val);
             }
-            tcg_out_insn(s, VRIb, VGM, dst, lsb, msb, MO_32);
+            tcg_out_insn(s, VRIb, VGM, dst, msb, lsb, MO_32);
             return;
         }
     } else {
@@ -2729,7 +2729,7 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece,
                 msb = clz64(val);
                 lsb = 63 - ctz64(val);
             }
-            tcg_out_insn(s, VRIb, VGM, dst, lsb, msb, MO_64);
+            tcg_out_insn(s, VRIb, VGM, dst, msb, lsb, MO_64);
             return;
         }
     }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] tcg/s390x: Fix INDEX_op_bitsel_vec vs VSEL
  2022-03-03  3:11 [PATCH 0/3] tcg/s390x: Fixes for host vector codegen Richard Henderson
  2022-03-03  3:11 ` [PATCH 1/3] tcg/s390x: Fix tcg_out_dupi_vec vs VGM Richard Henderson
@ 2022-03-03  3:11 ` Richard Henderson
  2022-03-03  3:11 ` [PATCH 3/3] tcg/s390x: Fix tcg_out_dup_vec vs general registers Richard Henderson
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2022-03-03  3:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-s390x

The operands are output in the wrong order: the tcg selector
argument is first, whereas the s390x selector argument is last.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/s390x/tcg-target.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
index 508f1bccc7..3b185b3c96 100644
--- a/tcg/s390x/tcg-target.c.inc
+++ b/tcg/s390x/tcg-target.c.inc
@@ -2868,7 +2868,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
         break;
 
     case INDEX_op_bitsel_vec:
-        tcg_out_insn(s, VRRe, VSEL, a0, a1, a2, args[3]);
+        tcg_out_insn(s, VRRe, VSEL, a0, a2, args[3], a1);
         break;
 
     case INDEX_op_cmp_vec:
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] tcg/s390x: Fix tcg_out_dup_vec vs general registers
  2022-03-03  3:11 [PATCH 0/3] tcg/s390x: Fixes for host vector codegen Richard Henderson
  2022-03-03  3:11 ` [PATCH 1/3] tcg/s390x: Fix tcg_out_dupi_vec vs VGM Richard Henderson
  2022-03-03  3:11 ` [PATCH 2/3] tcg/s390x: Fix INDEX_op_bitsel_vec vs VSEL Richard Henderson
@ 2022-03-03  3:11 ` Richard Henderson
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2022-03-03  3:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-s390x

We copied the data from the general register input to the
vector register output, but have not yet replicated it.
We intended to fall through into the vector-vector case,
but failed to redirect the input register.

This is caught by an assertion failure in tcg_out_insn_VRIc,
which diagnosed the incorrect register class.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/s390x/tcg-target.c.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
index 3b185b3c96..33becd7694 100644
--- a/tcg/s390x/tcg-target.c.inc
+++ b/tcg/s390x/tcg-target.c.inc
@@ -2675,6 +2675,7 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
         if (vece == MO_64) {
             return true;
         }
+        src = dst;
     }
 
     /*
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-03  3:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-03  3:11 [PATCH 0/3] tcg/s390x: Fixes for host vector codegen Richard Henderson
2022-03-03  3:11 ` [PATCH 1/3] tcg/s390x: Fix tcg_out_dupi_vec vs VGM Richard Henderson
2022-03-03  3:11 ` [PATCH 2/3] tcg/s390x: Fix INDEX_op_bitsel_vec vs VSEL Richard Henderson
2022-03-03  3:11 ` [PATCH 3/3] tcg/s390x: Fix tcg_out_dup_vec vs general registers Richard Henderson

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).