All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes
@ 2022-03-04 17:51 matheus.ferst
  2022-03-04 17:51 ` [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07 matheus.ferst
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: matheus.ferst @ 2022-03-04 17:51 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: danielhb413, richard.henderson, groug, clg, Matheus Ferst, david

From: Matheus Ferst <matheus.ferst@eldorado.org.br>

Some fixes to the insns of our last patch series.

Lucas Mateus Castro (alqotel) (1):
  target/ppc: Fix vmul[eo]* instructions marked 2.07

Matheus Ferst (4):
  target/ppc: use ext32u and deposit in do_vx_vmulhw_i64
  target/ppc: use extract/extract2 to create vrlqnm mask
  target/ppc: use andc in vrlqmi
  target/ppc: split XXGENPCV macros for readability

Víctor Colombo (2):
  target/ppc: Add missing helper_reset_fpstatus to VSX_MAX_MINC
  target/ppc: Add missing helper_reset_fpstatus to helper_XVCVSPBF16

 target/ppc/fpu_helper.c             |  4 ++
 target/ppc/int_helper.c             | 28 +++++++++---
 target/ppc/translate/vmx-impl.c.inc | 42 +++++++----------
 target/ppc/translate/vsx-impl.c.inc | 71 +++++++++++++++--------------
 4 files changed, 77 insertions(+), 68 deletions(-)

-- 
2.25.1



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

* [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07
  2022-03-04 17:51 [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes matheus.ferst
@ 2022-03-04 17:51 ` matheus.ferst
  2022-03-04 22:35   ` Richard Henderson
  2022-03-05  6:36   ` Cédric Le Goater
  2022-03-04 17:51 ` [PATCH 2/7] target/ppc: use ext32u and deposit in do_vx_vmulhw_i64 matheus.ferst
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 18+ messages in thread
From: matheus.ferst @ 2022-03-04 17:51 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: Fabiano Rosas, danielhb413, richard.henderson, groug,
	Lucas Mateus Castro (alqotel),
	clg, Howard Spoelstra, Matheus Ferst, david

From: "Lucas Mateus Castro (alqotel)" <lucas.araujo@eldorado.org.br>

Some ISA v2.03 Vector Multiply instructions marked to be ISA v2.07 only.
This patch fixes it.

Fixes: 80eca687c851 ("target/ppc: moved vector even and odd multiplication to decodetree")
Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
Suggested-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
 target/ppc/translate/vmx-impl.c.inc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc
index f91bee839d..c5d02d13fe 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -3141,14 +3141,14 @@ static bool trans_VMULLD(DisasContext *ctx, arg_VX *a)
     return true;
 }
 
-TRANS_FLAGS2(ALTIVEC_207, VMULESB, do_vx_helper, gen_helper_VMULESB)
-TRANS_FLAGS2(ALTIVEC_207, VMULOSB, do_vx_helper, gen_helper_VMULOSB)
-TRANS_FLAGS2(ALTIVEC_207, VMULEUB, do_vx_helper, gen_helper_VMULEUB)
-TRANS_FLAGS2(ALTIVEC_207, VMULOUB, do_vx_helper, gen_helper_VMULOUB)
-TRANS_FLAGS2(ALTIVEC_207, VMULESH, do_vx_helper, gen_helper_VMULESH)
-TRANS_FLAGS2(ALTIVEC_207, VMULOSH, do_vx_helper, gen_helper_VMULOSH)
-TRANS_FLAGS2(ALTIVEC_207, VMULEUH, do_vx_helper, gen_helper_VMULEUH)
-TRANS_FLAGS2(ALTIVEC_207, VMULOUH, do_vx_helper, gen_helper_VMULOUH)
+TRANS_FLAGS(ALTIVEC, VMULESB, do_vx_helper, gen_helper_VMULESB)
+TRANS_FLAGS(ALTIVEC, VMULOSB, do_vx_helper, gen_helper_VMULOSB)
+TRANS_FLAGS(ALTIVEC, VMULEUB, do_vx_helper, gen_helper_VMULEUB)
+TRANS_FLAGS(ALTIVEC, VMULOUB, do_vx_helper, gen_helper_VMULOUB)
+TRANS_FLAGS(ALTIVEC, VMULESH, do_vx_helper, gen_helper_VMULESH)
+TRANS_FLAGS(ALTIVEC, VMULOSH, do_vx_helper, gen_helper_VMULOSH)
+TRANS_FLAGS(ALTIVEC, VMULEUH, do_vx_helper, gen_helper_VMULEUH)
+TRANS_FLAGS(ALTIVEC, VMULOUH, do_vx_helper, gen_helper_VMULOUH)
 TRANS_FLAGS2(ALTIVEC_207, VMULESW, do_vx_helper, gen_helper_VMULESW)
 TRANS_FLAGS2(ALTIVEC_207, VMULOSW, do_vx_helper, gen_helper_VMULOSW)
 TRANS_FLAGS2(ALTIVEC_207, VMULEUW, do_vx_helper, gen_helper_VMULEUW)
-- 
2.25.1



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

* [PATCH 2/7] target/ppc: use ext32u and deposit in do_vx_vmulhw_i64
  2022-03-04 17:51 [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes matheus.ferst
  2022-03-04 17:51 ` [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07 matheus.ferst
@ 2022-03-04 17:51 ` matheus.ferst
  2022-03-04 22:36   ` Richard Henderson
  2022-03-04 17:51 ` [PATCH 3/7] target/ppc: use extract/extract2 to create vrlqnm mask matheus.ferst
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: matheus.ferst @ 2022-03-04 17:51 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: danielhb413, richard.henderson, groug, clg, Matheus Ferst, david

From: Matheus Ferst <matheus.ferst@eldorado.org.br>

Fixes: 29e9dfcf755e ("target/ppc: vmulh* instructions without helpers")
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
 target/ppc/translate/vmx-impl.c.inc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc
index c5d02d13fe..8ea1d2c96a 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -3162,19 +3162,16 @@ static void do_vx_vmulhw_i64(TCGv_i64 t, TCGv_i64 a, TCGv_i64 b, bool sign)
 {
     TCGv_i64 hh, lh, temp;
 
-    uint64_t c;
     hh = tcg_temp_new_i64();
     lh = tcg_temp_new_i64();
     temp = tcg_temp_new_i64();
 
-    c = 0xFFFFFFFF;
-
     if (sign) {
         tcg_gen_ext32s_i64(lh, a);
         tcg_gen_ext32s_i64(temp, b);
     } else {
-        tcg_gen_andi_i64(lh, a, c);
-        tcg_gen_andi_i64(temp, b, c);
+        tcg_gen_ext32u_i64(lh, a);
+        tcg_gen_ext32u_i64(temp, b);
     }
     tcg_gen_mul_i64(lh, lh, temp);
 
@@ -3188,8 +3185,7 @@ static void do_vx_vmulhw_i64(TCGv_i64 t, TCGv_i64 a, TCGv_i64 b, bool sign)
     tcg_gen_mul_i64(hh, hh, temp);
 
     tcg_gen_shri_i64(lh, lh, 32);
-    tcg_gen_andi_i64(hh, hh, c << 32);
-    tcg_gen_or_i64(t, hh, lh);
+    tcg_gen_deposit_i64(t, hh, lh, 0, 32);
 
     tcg_temp_free_i64(hh);
     tcg_temp_free_i64(lh);
-- 
2.25.1



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

* [PATCH 3/7] target/ppc: use extract/extract2 to create vrlqnm mask
  2022-03-04 17:51 [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes matheus.ferst
  2022-03-04 17:51 ` [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07 matheus.ferst
  2022-03-04 17:51 ` [PATCH 2/7] target/ppc: use ext32u and deposit in do_vx_vmulhw_i64 matheus.ferst
@ 2022-03-04 17:51 ` matheus.ferst
  2022-03-04 22:37   ` Richard Henderson
  2022-03-04 17:51 ` [PATCH 4/7] target/ppc: use andc in vrlqmi matheus.ferst
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: matheus.ferst @ 2022-03-04 17:51 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: danielhb413, richard.henderson, groug, clg, Matheus Ferst, david

From: Matheus Ferst <matheus.ferst@eldorado.org.br>

Fixes: 4e272668406b ("target/ppc: implement vrlqnm")
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
 target/ppc/translate/vmx-impl.c.inc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc
index 8ea1d2c96a..8108e59d4d 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -1088,10 +1088,8 @@ static void do_vrlq_mask(TCGv_i64 mh, TCGv_i64 ml, TCGv_i64 b, TCGv_i64 e)
     tcg_gen_or_i64(tl, t1, tl);
 
     /* t = t >> 1 */
-    tcg_gen_shli_i64(t0, th, 63);
-    tcg_gen_shri_i64(tl, tl, 1);
+    tcg_gen_extract2_i64(tl, tl, th, 1);
     tcg_gen_shri_i64(th, th, 1);
-    tcg_gen_or_i64(tl, t0, tl);
 
     /* m = m ^ t */
     tcg_gen_xor_i64(mh, mh, th);
@@ -1148,10 +1146,8 @@ static bool do_vector_rotl_quad(DisasContext *ctx, arg_VX *a, bool mask,
     tcg_gen_or_i64(t1, ah, t1);
 
     if (mask || insert) {
-        tcg_gen_shri_i64(n, vrb, 8);
-        tcg_gen_shri_i64(vrb, vrb, 16);
-        tcg_gen_andi_i64(n, n, 0x7f);
-        tcg_gen_andi_i64(vrb, vrb, 0x7f);
+        tcg_gen_extract_i64(n, vrb, 8, 7);
+        tcg_gen_extract_i64(vrb, vrb, 16, 7);
 
         do_vrlq_mask(ah, al, vrb, n);
 
-- 
2.25.1



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

* [PATCH 4/7] target/ppc: use andc in vrlqmi
  2022-03-04 17:51 [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes matheus.ferst
                   ` (2 preceding siblings ...)
  2022-03-04 17:51 ` [PATCH 3/7] target/ppc: use extract/extract2 to create vrlqnm mask matheus.ferst
@ 2022-03-04 17:51 ` matheus.ferst
  2022-03-04 22:37   ` Richard Henderson
  2022-03-04 17:51 ` [PATCH 5/7] target/ppc: split XXGENPCV macros for readability matheus.ferst
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: matheus.ferst @ 2022-03-04 17:51 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: danielhb413, richard.henderson, groug, clg, Matheus Ferst, david

From: Matheus Ferst <matheus.ferst@eldorado.org.br>

Fixes: 7e5947df6e94 ("target/ppc: implement vrlqmi")
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
 target/ppc/translate/vmx-impl.c.inc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc
index 8108e59d4d..6101bca3fd 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -1157,10 +1157,8 @@ static bool do_vector_rotl_quad(DisasContext *ctx, arg_VX *a, bool mask,
         if (insert) {
             get_avr64(n, a->vrt, true);
             get_avr64(vrb, a->vrt, false);
-            tcg_gen_not_i64(ah, ah);
-            tcg_gen_not_i64(al, al);
-            tcg_gen_and_i64(n, n, ah);
-            tcg_gen_and_i64(vrb, vrb, al);
+            tcg_gen_andc_i64(n, n, ah);
+            tcg_gen_andc_i64(vrb, vrb, al);
             tcg_gen_or_i64(t0, t0, n);
             tcg_gen_or_i64(t1, t1, vrb);
         }
-- 
2.25.1



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

* [PATCH 5/7] target/ppc: split XXGENPCV macros for readability
  2022-03-04 17:51 [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes matheus.ferst
                   ` (3 preceding siblings ...)
  2022-03-04 17:51 ` [PATCH 4/7] target/ppc: use andc in vrlqmi matheus.ferst
@ 2022-03-04 17:51 ` matheus.ferst
  2022-03-04 22:38   ` Richard Henderson
  2022-03-04 17:51 ` [PATCH 6/7] target/ppc: Add missing helper_reset_fpstatus to VSX_MAX_MINC matheus.ferst
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: matheus.ferst @ 2022-03-04 17:51 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: danielhb413, richard.henderson, groug, clg, Matheus Ferst, david

From: Matheus Ferst <matheus.ferst@eldorado.org.br>

Fixes: b090f4f1e3c9 ("target/ppc: Implement xxgenpcv[bhwd]m instruction")
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
 target/ppc/int_helper.c             | 28 +++++++++---
 target/ppc/translate/vsx-impl.c.inc | 71 +++++++++++++++--------------
 2 files changed, 57 insertions(+), 42 deletions(-)

diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
index b2b17bb1ca..492f34c499 100644
--- a/target/ppc/int_helper.c
+++ b/target/ppc/int_helper.c
@@ -1072,7 +1072,7 @@ void helper_VPERMR(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
     *r = result;
 }
 
-#define XXGENPCV(NAME, SZ) \
+#define XXGENPCV_BE_EXP(NAME, SZ) \
 void glue(helper_, glue(NAME, _be_exp))(ppc_vsr_t *t, ppc_vsr_t *b) \
 {                                                                   \
     ppc_vsr_t tmp;                                                  \
@@ -1093,8 +1093,9 @@ void glue(helper_, glue(NAME, _be_exp))(ppc_vsr_t *t, ppc_vsr_t *b) \
     }                                                               \
                                                                     \
     *t = tmp;                                                       \
-}                                                                   \
-                                                                    \
+}
+
+#define XXGENPCV_BE_COMP(NAME, SZ) \
 void glue(helper_, glue(NAME, _be_comp))(ppc_vsr_t *t, ppc_vsr_t *b)\
 {                                                                   \
     ppc_vsr_t tmp = { .u64 = { 0, 0 } };                            \
@@ -1111,8 +1112,9 @@ void glue(helper_, glue(NAME, _be_comp))(ppc_vsr_t *t, ppc_vsr_t *b)\
     }                                                               \
                                                                     \
     *t = tmp;                                                       \
-}                                                                   \
-                                                                    \
+}
+
+#define XXGENPCV_LE_EXP(NAME, SZ) \
 void glue(helper_, glue(NAME, _le_exp))(ppc_vsr_t *t, ppc_vsr_t *b) \
 {                                                                   \
     ppc_vsr_t tmp;                                                  \
@@ -1135,8 +1137,9 @@ void glue(helper_, glue(NAME, _le_exp))(ppc_vsr_t *t, ppc_vsr_t *b) \
     }                                                               \
                                                                     \
     *t = tmp;                                                       \
-}                                                                   \
-                                                                    \
+}
+
+#define XXGENPCV_LE_COMP(NAME, SZ) \
 void glue(helper_, glue(NAME, _le_comp))(ppc_vsr_t *t, ppc_vsr_t *b)\
 {                                                                   \
     ppc_vsr_t tmp = { .u64 = { 0, 0 } };                            \
@@ -1157,10 +1160,21 @@ void glue(helper_, glue(NAME, _le_comp))(ppc_vsr_t *t, ppc_vsr_t *b)\
     *t = tmp;                                                       \
 }
 
+#define XXGENPCV(NAME, SZ) \
+    XXGENPCV_BE_EXP(NAME, SZ)  \
+    XXGENPCV_BE_COMP(NAME, SZ) \
+    XXGENPCV_LE_EXP(NAME, SZ)  \
+    XXGENPCV_LE_COMP(NAME, SZ) \
+
 XXGENPCV(XXGENPCVBM, 1)
 XXGENPCV(XXGENPCVHM, 2)
 XXGENPCV(XXGENPCVWM, 4)
 XXGENPCV(XXGENPCVDM, 8)
+
+#undef XXGENPCV_BE_EXP
+#undef XXGENPCV_BE_COMP
+#undef XXGENPCV_LE_EXP
+#undef XXGENPCV_LE_COMP
 #undef XXGENPCV
 
 #if defined(HOST_WORDS_BIGENDIAN)
diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc
index 2ffeab5287..48a97b2d7e 100644
--- a/target/ppc/translate/vsx-impl.c.inc
+++ b/target/ppc/translate/vsx-impl.c.inc
@@ -1204,43 +1204,44 @@ static bool trans_XXPERMX(DisasContext *ctx, arg_8RR_XX4_uim3 *a)
     return true;
 }
 
-#define XXGENPCV(NAME) \
-static bool trans_##NAME(DisasContext *ctx, arg_X_imm5 *a)  \
-{                                                           \
-    TCGv_ptr xt, vrb;                                       \
-                                                            \
-    REQUIRE_INSNS_FLAGS2(ctx, ISA310);                      \
-    REQUIRE_VSX(ctx);                                       \
-                                                            \
-    if (a->imm & ~0x3) {                                    \
-        gen_invalid(ctx);                                   \
-        return true;                                        \
-    }                                                       \
-                                                            \
-    xt = gen_vsr_ptr(a->xt);                                \
-    vrb = gen_avr_ptr(a->vrb);                              \
-                                                            \
-    switch (a->imm) {                                       \
-    case 0b00000: /* Big-Endian expansion */                \
-        glue(gen_helper_, glue(NAME, _be_exp))(xt, vrb);    \
-        break;                                              \
-    case 0b00001: /* Big-Endian compression */              \
-        glue(gen_helper_, glue(NAME, _be_comp))(xt, vrb);   \
-        break;                                              \
-    case 0b00010: /* Little-Endian expansion */             \
-        glue(gen_helper_, glue(NAME, _le_exp))(xt, vrb);    \
-        break;                                              \
-    case 0b00011: /* Little-Endian compression */           \
-        glue(gen_helper_, glue(NAME, _le_comp))(xt, vrb);   \
-        break;                                              \
-    }                                                       \
-                                                            \
-    tcg_temp_free_ptr(xt);                                  \
-    tcg_temp_free_ptr(vrb);                                 \
-                                                            \
-    return true;                                            \
+typedef void (*xxgenpcv_genfn)(TCGv_ptr, TCGv_ptr);
+
+static bool do_xxgenpcv(DisasContext *ctx, arg_X_imm5 *a,
+                        const xxgenpcv_genfn fn[4])
+{
+    TCGv_ptr xt, vrb;
+
+    REQUIRE_INSNS_FLAGS2(ctx, ISA310);
+    REQUIRE_VSX(ctx);
+
+    if (a->imm & ~0x3) {
+        gen_invalid(ctx);
+        return true;
+    }
+
+    xt = gen_vsr_ptr(a->xt);
+    vrb = gen_avr_ptr(a->vrb);
+
+    fn[a->imm](xt, vrb);
+
+    tcg_temp_free_ptr(xt);
+    tcg_temp_free_ptr(vrb);
+
+    return true;
 }
 
+#define XXGENPCV(NAME) \
+    static bool trans_##NAME(DisasContext *ctx, arg_X_imm5 *a)  \
+    {                                                           \
+        static const xxgenpcv_genfn fn[4] = {                   \
+            gen_helper_##NAME##_be_exp,                         \
+            gen_helper_##NAME##_be_comp,                        \
+            gen_helper_##NAME##_le_exp,                         \
+            gen_helper_##NAME##_le_comp,                        \
+        };                                                      \
+        return do_xxgenpcv(ctx, a, fn);                         \
+    }
+
 XXGENPCV(XXGENPCVBM)
 XXGENPCV(XXGENPCVHM)
 XXGENPCV(XXGENPCVWM)
-- 
2.25.1



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

* [PATCH 6/7] target/ppc: Add missing helper_reset_fpstatus to VSX_MAX_MINC
  2022-03-04 17:51 [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes matheus.ferst
                   ` (4 preceding siblings ...)
  2022-03-04 17:51 ` [PATCH 5/7] target/ppc: split XXGENPCV macros for readability matheus.ferst
@ 2022-03-04 17:51 ` matheus.ferst
  2022-03-04 22:39   ` Richard Henderson
  2022-03-04 17:51 ` [PATCH 7/7] target/ppc: Add missing helper_reset_fpstatus to helper_XVCVSPBF16 matheus.ferst
  2022-03-05  8:06 ` [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes Cédric Le Goater
  7 siblings, 1 reply; 18+ messages in thread
From: matheus.ferst @ 2022-03-04 17:51 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: danielhb413, richard.henderson, groug, Víctor Colombo, clg,
	Matheus Ferst, david

From: Víctor Colombo <victor.colombo@eldorado.org.br>

Fixes: da499405aa ("target/ppc: Refactor VSX_MAX_MINC helper")
Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
 target/ppc/fpu_helper.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index c973968ed6..cf5f8f20dd 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -2517,6 +2517,8 @@ void helper_##name(CPUPPCState *env,                                          \
     ppc_vsr_t t = { };                                                        \
     bool first;                                                               \
                                                                               \
+    helper_reset_fpstatus(env);                                               \
+                                                                              \
     if (max) {                                                                \
         first = tp##_le_quiet(xb->fld, xa->fld, &env->fp_status);             \
     } else {                                                                  \
-- 
2.25.1



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

* [PATCH 7/7] target/ppc: Add missing helper_reset_fpstatus to helper_XVCVSPBF16
  2022-03-04 17:51 [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes matheus.ferst
                   ` (5 preceding siblings ...)
  2022-03-04 17:51 ` [PATCH 6/7] target/ppc: Add missing helper_reset_fpstatus to VSX_MAX_MINC matheus.ferst
@ 2022-03-04 17:51 ` matheus.ferst
  2022-03-04 22:39   ` Richard Henderson
  2022-03-05  8:06 ` [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes Cédric Le Goater
  7 siblings, 1 reply; 18+ messages in thread
From: matheus.ferst @ 2022-03-04 17:51 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: danielhb413, richard.henderson, groug, Víctor Colombo, clg,
	Matheus Ferst, david

From: Víctor Colombo <victor.colombo@eldorado.org.br>

Fixes: 3909ff1fac ("target/ppc: Implement xvcvbf16spn and xvcvspbf16 instructions")
Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
 target/ppc/fpu_helper.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index cf5f8f20dd..06eb36f7b6 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -2769,6 +2769,8 @@ void helper_XVCVSPBF16(CPUPPCState *env, ppc_vsr_t *xt, ppc_vsr_t *xb)
     ppc_vsr_t t = { };
     int i, status;
 
+    helper_reset_fpstatus(env);
+
     for (i = 0; i < 4; i++) {
         t.VsrH(2 * i + 1) = float32_to_bfloat16(xb->VsrW(i), &env->fp_status);
     }
-- 
2.25.1



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

* Re: [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07
  2022-03-04 17:51 ` [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07 matheus.ferst
@ 2022-03-04 22:35   ` Richard Henderson
  2022-03-05  6:36   ` Cédric Le Goater
  1 sibling, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2022-03-04 22:35 UTC (permalink / raw)
  To: matheus.ferst, qemu-devel, qemu-ppc
  Cc: Fabiano Rosas, danielhb413, groug, Lucas Mateus Castro (alqotel),
	clg, Howard Spoelstra, david

On 3/4/22 07:51, matheus.ferst@eldorado.org.br wrote:
> From: "Lucas Mateus Castro (alqotel)"<lucas.araujo@eldorado.org.br>
> 
> Some ISA v2.03 Vector Multiply instructions marked to be ISA v2.07 only.
> This patch fixes it.
> 
> Fixes: 80eca687c851 ("target/ppc: moved vector even and odd multiplication to decodetree")
> Reported-by: Howard Spoelstra<hsp.cat7@gmail.com>
> Suggested-by: Fabiano Rosas<farosas@linux.ibm.com>
> Signed-off-by: Lucas Mateus Castro (alqotel)<lucas.araujo@eldorado.org.br>
> Signed-off-by: Matheus Ferst<matheus.ferst@eldorado.org.br>
> ---
>   target/ppc/translate/vmx-impl.c.inc | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)

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

r~


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

* Re: [PATCH 2/7] target/ppc: use ext32u and deposit in do_vx_vmulhw_i64
  2022-03-04 17:51 ` [PATCH 2/7] target/ppc: use ext32u and deposit in do_vx_vmulhw_i64 matheus.ferst
@ 2022-03-04 22:36   ` Richard Henderson
  0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2022-03-04 22:36 UTC (permalink / raw)
  To: matheus.ferst, qemu-devel, qemu-ppc; +Cc: groug, danielhb413, clg, david

On 3/4/22 07:51, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst<matheus.ferst@eldorado.org.br>
> 
> Fixes: 29e9dfcf755e ("target/ppc: vmulh* instructions without helpers")
> Signed-off-by: Matheus Ferst<matheus.ferst@eldorado.org.br>
> ---
>   target/ppc/translate/vmx-impl.c.inc | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)

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

r~


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

* Re: [PATCH 3/7] target/ppc: use extract/extract2 to create vrlqnm mask
  2022-03-04 17:51 ` [PATCH 3/7] target/ppc: use extract/extract2 to create vrlqnm mask matheus.ferst
@ 2022-03-04 22:37   ` Richard Henderson
  0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2022-03-04 22:37 UTC (permalink / raw)
  To: matheus.ferst, qemu-devel, qemu-ppc; +Cc: groug, danielhb413, clg, david

On 3/4/22 07:51, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst<matheus.ferst@eldorado.org.br>
> 
> Fixes: 4e272668406b ("target/ppc: implement vrlqnm")
> Signed-off-by: Matheus Ferst<matheus.ferst@eldorado.org.br>
> ---
>   target/ppc/translate/vmx-impl.c.inc | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)

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

r~


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

* Re: [PATCH 4/7] target/ppc: use andc in vrlqmi
  2022-03-04 17:51 ` [PATCH 4/7] target/ppc: use andc in vrlqmi matheus.ferst
@ 2022-03-04 22:37   ` Richard Henderson
  0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2022-03-04 22:37 UTC (permalink / raw)
  To: matheus.ferst, qemu-devel, qemu-ppc; +Cc: groug, danielhb413, clg, david

On 3/4/22 07:51, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst<matheus.ferst@eldorado.org.br>
> 
> Fixes: 7e5947df6e94 ("target/ppc: implement vrlqmi")
> Signed-off-by: Matheus Ferst<matheus.ferst@eldorado.org.br>
> ---
>   target/ppc/translate/vmx-impl.c.inc | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)

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

r~


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

* Re: [PATCH 5/7] target/ppc: split XXGENPCV macros for readability
  2022-03-04 17:51 ` [PATCH 5/7] target/ppc: split XXGENPCV macros for readability matheus.ferst
@ 2022-03-04 22:38   ` Richard Henderson
  0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2022-03-04 22:38 UTC (permalink / raw)
  To: matheus.ferst, qemu-devel, qemu-ppc; +Cc: groug, danielhb413, clg, david

On 3/4/22 07:51, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst<matheus.ferst@eldorado.org.br>
> 
> Fixes: b090f4f1e3c9 ("target/ppc: Implement xxgenpcv[bhwd]m instruction")
> Signed-off-by: Matheus Ferst<matheus.ferst@eldorado.org.br>
> ---
>   target/ppc/int_helper.c             | 28 +++++++++---
>   target/ppc/translate/vsx-impl.c.inc | 71 +++++++++++++++--------------
>   2 files changed, 57 insertions(+), 42 deletions(-)

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

r~


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

* Re: [PATCH 6/7] target/ppc: Add missing helper_reset_fpstatus to VSX_MAX_MINC
  2022-03-04 17:51 ` [PATCH 6/7] target/ppc: Add missing helper_reset_fpstatus to VSX_MAX_MINC matheus.ferst
@ 2022-03-04 22:39   ` Richard Henderson
  0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2022-03-04 22:39 UTC (permalink / raw)
  To: matheus.ferst, qemu-devel, qemu-ppc
  Cc: Víctor Colombo, groug, danielhb413, clg, david

On 3/4/22 07:51, matheus.ferst@eldorado.org.br wrote:
> From: Víctor Colombo<victor.colombo@eldorado.org.br>
> 
> Fixes: da499405aa ("target/ppc: Refactor VSX_MAX_MINC helper")
> Signed-off-by: Víctor Colombo<victor.colombo@eldorado.org.br>
> Signed-off-by: Matheus Ferst<matheus.ferst@eldorado.org.br>
> ---
>   target/ppc/fpu_helper.c | 2 ++
>   1 file changed, 2 insertions(+)

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

r~


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

* Re: [PATCH 7/7] target/ppc: Add missing helper_reset_fpstatus to helper_XVCVSPBF16
  2022-03-04 17:51 ` [PATCH 7/7] target/ppc: Add missing helper_reset_fpstatus to helper_XVCVSPBF16 matheus.ferst
@ 2022-03-04 22:39   ` Richard Henderson
  0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2022-03-04 22:39 UTC (permalink / raw)
  To: matheus.ferst, qemu-devel, qemu-ppc
  Cc: Víctor Colombo, groug, danielhb413, clg, david

On 3/4/22 07:51, matheus.ferst@eldorado.org.br wrote:
> From: Víctor Colombo<victor.colombo@eldorado.org.br>
> 
> Fixes: 3909ff1fac ("target/ppc: Implement xvcvbf16spn and xvcvspbf16 instructions")
> Signed-off-by: Víctor Colombo<victor.colombo@eldorado.org.br>
> Signed-off-by: Matheus Ferst<matheus.ferst@eldorado.org.br>
> ---
>   target/ppc/fpu_helper.c | 2 ++
>   1 file changed, 2 insertions(+)

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

r~


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

* Re: [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07
  2022-03-04 17:51 ` [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07 matheus.ferst
  2022-03-04 22:35   ` Richard Henderson
@ 2022-03-05  6:36   ` Cédric Le Goater
  2022-03-07  8:53     ` Mark Cave-Ayland
  1 sibling, 1 reply; 18+ messages in thread
From: Cédric Le Goater @ 2022-03-05  6:36 UTC (permalink / raw)
  To: matheus.ferst, qemu-devel, qemu-ppc
  Cc: Fabiano Rosas, Mark Cave-Ayland, danielhb413, richard.henderson,
	groug, Lucas Mateus Castro (alqotel),
	Howard Spoelstra, david

On 3/4/22 18:51, matheus.ferst@eldorado.org.br wrote:
> From: "Lucas Mateus Castro (alqotel)" <lucas.araujo@eldorado.org.br>
> 
> Some ISA v2.03 Vector Multiply instructions marked to be ISA v2.07 only.
> This patch fixes it.

and MacOSX 10 is also fixed.

There are of lot invalid writes when openbios is loaded :

   ...
   Invalid write at addr 0xB70A8, size 4, region 'ppc_core99.bios', reason: rejected
   Invalid write at addr 0xB70AC, size 4, region 'ppc_core99.bios', reason: rejected
   Invalid write at addr 0xB70B0, size 4, region 'ppc_core99.bios', reason: rejected
   Invalid write at addr 0xB70B4, size 4, region 'ppc_core99.bios', reason: rejected
   ...

Mark,

shouldn't we model the FW region with RAM instead ?

@@ -162,7 +162,7 @@ static void ppc_core99_init(MachineState
      memory_region_add_subregion(get_system_memory(), 0, machine->ram);
  
      /* allocate and load firmware ROM */
-    memory_region_init_rom(bios, NULL, "ppc_core99.bios", PROM_SIZE,
+    memory_region_init_ram(bios, NULL, "ppc_core99.bios", PROM_SIZE,
                             &error_fatal);
      memory_region_add_subregion(get_system_memory(), PROM_BASE, bios);
  

Thanks,

C.


> 
> Fixes: 80eca687c851 ("target/ppc: moved vector even and odd multiplication to decodetree")
> Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
> Suggested-by: Fabiano Rosas <farosas@linux.ibm.com>
> Signed-off-by: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
> ---
>   target/ppc/translate/vmx-impl.c.inc | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc
> index f91bee839d..c5d02d13fe 100644
> --- a/target/ppc/translate/vmx-impl.c.inc
> +++ b/target/ppc/translate/vmx-impl.c.inc
> @@ -3141,14 +3141,14 @@ static bool trans_VMULLD(DisasContext *ctx, arg_VX *a)
>       return true;
>   }
>   
> -TRANS_FLAGS2(ALTIVEC_207, VMULESB, do_vx_helper, gen_helper_VMULESB)
> -TRANS_FLAGS2(ALTIVEC_207, VMULOSB, do_vx_helper, gen_helper_VMULOSB)
> -TRANS_FLAGS2(ALTIVEC_207, VMULEUB, do_vx_helper, gen_helper_VMULEUB)
> -TRANS_FLAGS2(ALTIVEC_207, VMULOUB, do_vx_helper, gen_helper_VMULOUB)
> -TRANS_FLAGS2(ALTIVEC_207, VMULESH, do_vx_helper, gen_helper_VMULESH)
> -TRANS_FLAGS2(ALTIVEC_207, VMULOSH, do_vx_helper, gen_helper_VMULOSH)
> -TRANS_FLAGS2(ALTIVEC_207, VMULEUH, do_vx_helper, gen_helper_VMULEUH)
> -TRANS_FLAGS2(ALTIVEC_207, VMULOUH, do_vx_helper, gen_helper_VMULOUH)
> +TRANS_FLAGS(ALTIVEC, VMULESB, do_vx_helper, gen_helper_VMULESB)
> +TRANS_FLAGS(ALTIVEC, VMULOSB, do_vx_helper, gen_helper_VMULOSB)
> +TRANS_FLAGS(ALTIVEC, VMULEUB, do_vx_helper, gen_helper_VMULEUB)
> +TRANS_FLAGS(ALTIVEC, VMULOUB, do_vx_helper, gen_helper_VMULOUB)
> +TRANS_FLAGS(ALTIVEC, VMULESH, do_vx_helper, gen_helper_VMULESH)
> +TRANS_FLAGS(ALTIVEC, VMULOSH, do_vx_helper, gen_helper_VMULOSH)
> +TRANS_FLAGS(ALTIVEC, VMULEUH, do_vx_helper, gen_helper_VMULEUH)
> +TRANS_FLAGS(ALTIVEC, VMULOUH, do_vx_helper, gen_helper_VMULOUH)
>   TRANS_FLAGS2(ALTIVEC_207, VMULESW, do_vx_helper, gen_helper_VMULESW)
>   TRANS_FLAGS2(ALTIVEC_207, VMULOSW, do_vx_helper, gen_helper_VMULOSW)
>   TRANS_FLAGS2(ALTIVEC_207, VMULEUW, do_vx_helper, gen_helper_VMULEUW)



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

* Re: [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes
  2022-03-04 17:51 [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes matheus.ferst
                   ` (6 preceding siblings ...)
  2022-03-04 17:51 ` [PATCH 7/7] target/ppc: Add missing helper_reset_fpstatus to helper_XVCVSPBF16 matheus.ferst
@ 2022-03-05  8:06 ` Cédric Le Goater
  7 siblings, 0 replies; 18+ messages in thread
From: Cédric Le Goater @ 2022-03-05  8:06 UTC (permalink / raw)
  To: matheus.ferst, qemu-devel, qemu-ppc
  Cc: danielhb413, richard.henderson, groug, david

On 3/4/22 18:51, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst <matheus.ferst@eldorado.org.br>
> 
> Some fixes to the insns of our last patch series.
> 
> Lucas Mateus Castro (alqotel) (1):
>    target/ppc: Fix vmul[eo]* instructions marked 2.07
> 
> Matheus Ferst (4):
>    target/ppc: use ext32u and deposit in do_vx_vmulhw_i64
>    target/ppc: use extract/extract2 to create vrlqnm mask
>    target/ppc: use andc in vrlqmi
>    target/ppc: split XXGENPCV macros for readability
> 
> Víctor Colombo (2):
>    target/ppc: Add missing helper_reset_fpstatus to VSX_MAX_MINC
>    target/ppc: Add missing helper_reset_fpstatus to helper_XVCVSPBF16
> 
>   target/ppc/fpu_helper.c             |  4 ++
>   target/ppc/int_helper.c             | 28 +++++++++---
>   target/ppc/translate/vmx-impl.c.inc | 42 +++++++----------
>   target/ppc/translate/vsx-impl.c.inc | 71 +++++++++++++++--------------
>   4 files changed, 77 insertions(+), 68 deletions(-)
> 

Queued for ppc-7.0.

Thanks,

C.


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

* Re: [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07
  2022-03-05  6:36   ` Cédric Le Goater
@ 2022-03-07  8:53     ` Mark Cave-Ayland
  0 siblings, 0 replies; 18+ messages in thread
From: Mark Cave-Ayland @ 2022-03-07  8:53 UTC (permalink / raw)
  To: Cédric Le Goater, matheus.ferst, qemu-devel, qemu-ppc
  Cc: Fabiano Rosas, danielhb413, richard.henderson, groug,
	Lucas Mateus Castro (alqotel),
	Howard Spoelstra, david

On 05/03/2022 06:36, Cédric Le Goater wrote:

> On 3/4/22 18:51, matheus.ferst@eldorado.org.br wrote:
>> From: "Lucas Mateus Castro (alqotel)" <lucas.araujo@eldorado.org.br>
>>
>> Some ISA v2.03 Vector Multiply instructions marked to be ISA v2.07 only.
>> This patch fixes it.
> 
> and MacOSX 10 is also fixed.
> 
> There are of lot invalid writes when openbios is loaded :
> 
>    ...
>    Invalid write at addr 0xB70A8, size 4, region 'ppc_core99.bios', reason: rejected
>    Invalid write at addr 0xB70AC, size 4, region 'ppc_core99.bios', reason: rejected
>    Invalid write at addr 0xB70B0, size 4, region 'ppc_core99.bios', reason: rejected
>    Invalid write at addr 0xB70B4, size 4, region 'ppc_core99.bios', reason: rejected
>    ...
> 
> Mark,
> 
> shouldn't we model the FW region with RAM instead ?
> 
> @@ -162,7 +162,7 @@ static void ppc_core99_init(MachineState
>       memory_region_add_subregion(get_system_memory(), 0, machine->ram);
> 
>       /* allocate and load firmware ROM */
> -    memory_region_init_rom(bios, NULL, "ppc_core99.bios", PROM_SIZE,
> +    memory_region_init_ram(bios, NULL, "ppc_core99.bios", PROM_SIZE,
>                              &error_fatal);
>       memory_region_add_subregion(get_system_memory(), PROM_BASE, bios);
> 
> 
> Thanks,
> 
> C.

I don't believe so. The original aim of OpenBIOS was to run as a free replacement 
firmware on real hardware, so what should happen is that OpenBIOS should copy at 
least the bss section into RAM early in the startup process. There could well be 
errors in those calculations as I have tried to adjust them over time though.


ATB,

Mark.


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

end of thread, other threads:[~2022-03-07  8:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-04 17:51 [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes matheus.ferst
2022-03-04 17:51 ` [PATCH 1/7] target/ppc: Fix vmul[eo]* instructions marked 2.07 matheus.ferst
2022-03-04 22:35   ` Richard Henderson
2022-03-05  6:36   ` Cédric Le Goater
2022-03-07  8:53     ` Mark Cave-Ayland
2022-03-04 17:51 ` [PATCH 2/7] target/ppc: use ext32u and deposit in do_vx_vmulhw_i64 matheus.ferst
2022-03-04 22:36   ` Richard Henderson
2022-03-04 17:51 ` [PATCH 3/7] target/ppc: use extract/extract2 to create vrlqnm mask matheus.ferst
2022-03-04 22:37   ` Richard Henderson
2022-03-04 17:51 ` [PATCH 4/7] target/ppc: use andc in vrlqmi matheus.ferst
2022-03-04 22:37   ` Richard Henderson
2022-03-04 17:51 ` [PATCH 5/7] target/ppc: split XXGENPCV macros for readability matheus.ferst
2022-03-04 22:38   ` Richard Henderson
2022-03-04 17:51 ` [PATCH 6/7] target/ppc: Add missing helper_reset_fpstatus to VSX_MAX_MINC matheus.ferst
2022-03-04 22:39   ` Richard Henderson
2022-03-04 17:51 ` [PATCH 7/7] target/ppc: Add missing helper_reset_fpstatus to helper_XVCVSPBF16 matheus.ferst
2022-03-04 22:39   ` Richard Henderson
2022-03-05  8:06 ` [PATCH 0/7] target/ppc: Vector/VSX instruction batch fixes Cédric Le Goater

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.