Skip to contentSkip to conversation

target/s390x: Clean up mem ops and byte swapping

PATCH In review Richard Henderson 3 participants 45 messages Jul 31 – Aug 6

lore
Share & tools
lore
#0 lore raw

cover target/s390x: Clean up mem ops and byte swapping

Once upon a time we didn't have controllable endianness in our memory ops, so we were forced to perform the bswap for LOAD/STORE REVERSED manually. But that hasn't been true for quite some time. Tidy up all of the simple loads and stores by stashing the complete MemOp for each instruction.

r~

Richard Henderson (14):
target/s390x: Convert op_ld8s to op_ld
target/s390x: Convert op_ld8u to op_ld
target/s390x: Convert op_ld16s to op_ld
target/s390x: Convert op_ld16u to op_ld
target/s390x: Convert op_ld32s to op_ld
target/s390x: Convert op_ld32u to op_ld
target/s390x: Convert op_ld64 to op_ld
target/s390x: Convert op_st8 to op_st
target/s390x: Convert op_st16 to op_st
target/s390x: Convert op_st32 to op_st
target/s390x: Convert op_st64 to op_st
target/s390x: Use op_ld for LOAD REVERSED
target/s390x: Use op_st for STORE REVERSED
target/s390x: Simplify LRVR

 target/s390x/tcg/translate.c     |  89 ++-----------------------
 target/s390x/tcg/insn-data.h.inc | 108 +++++++++++++++----------------
 2 files changed, 59 insertions(+), 138 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/14 target/s390x: Convert op_ld8s to op_ld

Begin unifying load operations by storing MemOp in insn->data. Start with op_ld8s.

---
 target/s390x/tcg/translate.c     | 4 ++--
 target/s390x/tcg/insn-data.h.inc | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
target/s390x/tcg/translate.c +2 -2
index 82165ac1ec..25a7842409 100644
@@ -2749,9 +2749,9 @@ static DisasJumpType op_llgt(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_ld8s(DisasContext *s, DisasOps *o)
+static DisasJumpType op_ld(DisasContext *s, DisasOps *o)
 {
-    tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s), MO_SB);
+    tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s), s->insn->data);
     return DISAS_NEXT;
 }
 
target/s390x/tcg/insn-data.h.inc +3 -3
index 0d5392eac5..989e40ce34 100644
@@ -481,10 +481,10 @@
 /* LOAD BYTE */
     C(0xb926, LBR,     RRE,   EI,  0, r2_8s, 0, r1_32, mov2, 0)
     C(0xb906, LGBR,    RRE,   EI,  0, r2_8s, 0, r1, mov2, 0)
-    C(0xe376, LB,      RXY_a, LD,  0, a2, new, r1_32, ld8s, 0)
-    C(0xe377, LGB,     RXY_a, LD,  0, a2, r1, 0, ld8s, 0)
+    D(0xe376, LB,      RXY_a, LD,  0, a2, new, r1_32, ld, 0, MO_SB)
+    D(0xe377, LGB,     RXY_a, LD,  0, a2, r1, 0, ld, 0, MO_SB)
 /* LOAD BYTE HIGH */
-    C(0xe3c0, LBH,     RXY_a, HW,  0, a2, new, r1_32h, ld8s, 0)
+    D(0xe3c0, LBH,     RXY_a, HW,  0, a2, new, r1_32h, ld, 0, MO_SB)
 /* LOAD COMPLEMENT */
     C(0x1300, LCR,     RR_a,  Z,   0, r2, new, r1_32, neg, neg32)
     C(0xb903, LCGR,    RRE,   Z,   0, r2, r1, 0, neg, neg64)
Signature · 1 line
2.43.0
Reviewed-by on v1 1/14
#3 lore raw

Re: [PATCH 01/14] target/s390x: Convert op_ld8s to op_ld

In reply to Richard Henderson
Quoted 8 lines · Richard Henderson

Begin unifying load operations by storing MemOp in insn->data. Start with op_ld8s.

---
  target/s390x/tcg/translate.c     | 4 ++--
  target/s390x/tcg/insn-data.h.inc | 6 +++---
  2 files changed, 5 insertions(+), 5 deletions(-)
#4 lore raw

PATCH 2/14 target/s390x: Convert op_ld8u to op_ld

In reply to Richard Henderson
---
 target/s390x/tcg/translate.c     | 6 ------
 target/s390x/tcg/insn-data.h.inc | 6 +++---
 2 files changed, 3 insertions(+), 9 deletions(-)
target/s390x/tcg/translate.c +0 -6
index 25a7842409..055e163837 100644
@@ -2755,12 +2755,6 @@ static DisasJumpType op_ld(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_ld8u(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s), MO_UB);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_ld16s(DisasContext *s, DisasOps *o)
 {
     tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s), MO_BESW);
target/s390x/tcg/insn-data.h.inc +3 -3
index 989e40ce34..865ef23ebd 100644
@@ -523,10 +523,10 @@
 /* LOAD LOGICAL CHARACTER */
     C(0xb994, LLCR,    RRE,   EI,  0, r2_8u, 0, r1_32, mov2, 0)
     C(0xb984, LLGCR,   RRE,   EI,  0, r2_8u, 0, r1, mov2, 0)
-    C(0xe394, LLC,     RXY_a, EI,  0, a2, new, r1_32, ld8u, 0)
-    C(0xe390, LLGC,    RXY_a, Z,   0, a2, r1, 0, ld8u, 0)
+    D(0xe394, LLC,     RXY_a, EI,  0, a2, new, r1_32, ld, 0, MO_UB)
+    D(0xe390, LLGC,    RXY_a, Z,   0, a2, r1, 0, ld, 0, MO_UB)
 /* LOAD LOGICAL CHARACTER HIGH */
-    C(0xe3c2, LLCH,    RXY_a, HW,  0, a2, new, r1_32h, ld8u, 0)
+    D(0xe3c2, LLCH,    RXY_a, HW,  0, a2, new, r1_32h, ld, 0, MO_UB)
 /* LOAD LOGICAL HALFWORD */
     C(0xb995, LLHR,    RRE,   EI,  0, r2_16u, 0, r1_32, mov2, 0)
     C(0xb985, LLGHR,   RRE,   EI,  0, r2_16u, 0, r1, mov2, 0)
Signature · 1 line
2.43.0
#7 lore raw

PATCH 3/14 target/s390x: Convert op_ld16s to op_ld

In reply to Richard Henderson
---
 target/s390x/tcg/translate.c     |  6 ------
 target/s390x/tcg/insn-data.h.inc | 12 ++++++------
 2 files changed, 6 insertions(+), 12 deletions(-)
target/s390x/tcg/translate.c +0 -6
index 055e163837..e0546ba791 100644
@@ -2755,12 +2755,6 @@ static DisasJumpType op_ld(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_ld16s(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s), MO_BESW);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_ld16u(DisasContext *s, DisasOps *o)
 {
     tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s), MO_BEUW);
target/s390x/tcg/insn-data.h.inc +6 -6
index 865ef23ebd..ea023fc168 100644
@@ -498,17 +498,17 @@
 /* LOAD HALFWORD */
     C(0xb927, LHR,     RRE,   EI,  0, r2_16s, 0, r1_32, mov2, 0)
     C(0xb907, LGHR,    RRE,   EI,  0, r2_16s, 0, r1, mov2, 0)
-    C(0x4800, LH,      RX_a,  Z,   0, a2, new, r1_32, ld16s, 0)
-    C(0xe378, LHY,     RXY_a, LD,  0, a2, new, r1_32, ld16s, 0)
-    C(0xe315, LGH,     RXY_a, Z,   0, a2, r1, 0, ld16s, 0)
+    D(0x4800, LH,      RX_a,  Z,   0, a2, new, r1_32, ld, 0, MO_BESW)
+    D(0xe378, LHY,     RXY_a, LD,  0, a2, new, r1_32, ld, 0, MO_BESW)
+    D(0xe315, LGH,     RXY_a, Z,   0, a2, r1, 0, ld, 0, MO_BESW)
 /* LOAD HALFWORD HIGH */
-    C(0xe3c4, LHH,     RXY_a, HW,  0, a2, new, r1_32h, ld16s, 0)
+    D(0xe3c4, LHH,     RXY_a, HW,  0, a2, new, r1_32h, ld, 0, MO_BESW)
 /* LOAD HALFWORD IMMEDIATE */
     C(0xa708, LHI,     RI_a,  Z,   0, i2, 0, r1_32, mov2, 0)
     C(0xa709, LGHI,    RI_a,  Z,   0, i2, 0, r1, mov2, 0)
 /* LOAD HALFWORD RELATIVE LONG */
-    C(0xc405, LHRL,    RIL_b, GIE, 0, ri2, new, r1_32, ld16s, 0)
-    C(0xc404, LGHRL,   RIL_b, GIE, 0, ri2, r1, 0, ld16s, 0)
+    D(0xc405, LHRL,    RIL_b, GIE, 0, ri2, new, r1_32, ld, 0, MO_BESW)
+    D(0xc404, LGHRL,   RIL_b, GIE, 0, ri2, r1, 0, ld, 0, MO_BESW)
 /* LOAD HIGH */
     D(0xe3ca, LFH,     RXY_a, HW,  0, a2, new, r1_32h, ld32u, 0, 0)
 /* LOAG HIGH AND TRAP */
Signature · 1 line
2.43.0
#10 lore raw

PATCH 4/14 target/s390x: Convert op_ld16u to op_ld

In reply to Richard Henderson
---
 target/s390x/tcg/translate.c     |  6 ------
 target/s390x/tcg/insn-data.h.inc | 10 +++++-----
 2 files changed, 5 insertions(+), 11 deletions(-)
target/s390x/tcg/translate.c +0 -6
index e0546ba791..d18450f764 100644
@@ -2755,12 +2755,6 @@ static DisasJumpType op_ld(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_ld16u(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s), MO_BEUW);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_ld32s(DisasContext *s, DisasOps *o)
 {
     tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s),
target/s390x/tcg/insn-data.h.inc +5 -5
index ea023fc168..d6cc157cb2 100644
@@ -530,13 +530,13 @@
 /* LOAD LOGICAL HALFWORD */
     C(0xb995, LLHR,    RRE,   EI,  0, r2_16u, 0, r1_32, mov2, 0)
     C(0xb985, LLGHR,   RRE,   EI,  0, r2_16u, 0, r1, mov2, 0)
-    C(0xe395, LLH,     RXY_a, EI,  0, a2, new, r1_32, ld16u, 0)
-    C(0xe391, LLGH,    RXY_a, Z,   0, a2, r1, 0, ld16u, 0)
+    D(0xe395, LLH,     RXY_a, EI,  0, a2, new, r1_32, ld, 0, MO_BEUW)
+    D(0xe391, LLGH,    RXY_a, Z,   0, a2, r1, 0, ld, 0, MO_BEUW)
 /* LOAD LOGICAL HALFWORD HIGH */
-    C(0xe3c6, LLHH,    RXY_a, HW,  0, a2, new, r1_32h, ld16u, 0)
+    D(0xe3c6, LLHH,    RXY_a, HW,  0, a2, new, r1_32h, ld, 0, MO_BEUW)
 /* LOAD LOGICAL HALFWORD RELATIVE LONG */
-    C(0xc402, LLHRL,   RIL_b, GIE, 0, ri2, new, r1_32, ld16u, 0)
-    C(0xc406, LLGHRL,  RIL_b, GIE, 0, ri2, r1, 0, ld16u, 0)
+    D(0xc402, LLHRL,   RIL_b, GIE, 0, ri2, new, r1_32, ld, 0, MO_BEUW)
+    D(0xc406, LLGHRL,  RIL_b, GIE, 0, ri2, r1, 0, ld, 0, MO_BEUW)
 /* LOAD LOGICAL IMMEDIATE */
     D(0xc00e, LLIHF,   RIL_a, EI, 0, i2_32u_shl, 0, r1, mov2, 0, 32)
     D(0xc00f, LLILF,   RIL_a, EI, 0, i2_32u_shl, 0, r1, mov2, 0, 0)
Signature · 1 line
2.43.0
#13 lore raw

PATCH 5/14 target/s390x: Convert op_ld32s to op_ld

In reply to Richard Henderson

Note that op_ld32s already or'd in insn->data, with the only use being MO_ALIGN. We now put the entire MemOp in insn->data.

---
 target/s390x/tcg/translate.c     |  7 -------
 target/s390x/tcg/insn-data.h.inc | 14 +++++++-------
 2 files changed, 7 insertions(+), 14 deletions(-)
target/s390x/tcg/translate.c +0 -7
index d18450f764..79e02534cd 100644
@@ -2755,13 +2755,6 @@ static DisasJumpType op_ld(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_ld32s(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s),
-                        MO_BESL | s->insn->data);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_ld32u(DisasContext *s, DisasOps *o)
 {
     tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s),
target/s390x/tcg/insn-data.h.inc +7 -7
index d6cc157cb2..46a4a23d2a 100644
@@ -418,12 +418,12 @@
 
 /* LOAD */
     C(0x1800, LR,      RR_a,  Z,   0, r2_o, 0, cond_r1r2_32, mov2, 0)
-    D(0x5800, L,       RX_a,  Z,   0, a2, new, r1_32, ld32s, 0, 0)
-    D(0xe358, LY,      RXY_a, LD,  0, a2, new, r1_32, ld32s, 0, 0)
+    D(0x5800, L,       RX_a,  Z,   0, a2, new, r1_32, ld, 0, MO_BESL)
+    D(0xe358, LY,      RXY_a, LD,  0, a2, new, r1_32, ld, 0, MO_BESL)
     C(0xb904, LGR,     RRE,   Z,   0, r2_o, 0, r1, mov2, 0)
     C(0xb914, LGFR,    RRE,   Z,   0, r2_32s, 0, r1, mov2, 0)
     D(0xe304, LG,      RXY_a, Z,   0, a2, r1, 0, ld64, 0, 0)
-    D(0xe314, LGF,     RXY_a, Z,   0, a2, r1, 0, ld32s, 0, 0)
+    D(0xe314, LGF,     RXY_a, Z,   0, a2, r1, 0, ld, 0, MO_BESL)
     F(0x2800, LDR,     RR_a,  Z,   0, f2, 0, f1, mov2, 0, IF_AFP1 | IF_AFP2)
     F(0x6800, LD,      RX_a,  Z,   0, m2_64, 0, f1, mov2, 0, IF_AFP1)
     F(0xed65, LDY,     RXY_a, LD,  0, m2_64, 0, f1, mov2, 0, IF_AFP1)
@@ -434,9 +434,9 @@
 /* LOAD IMMEDIATE */
     C(0xc001, LGFI,    RIL_a, EI,  0, i2, 0, r1, mov2, 0)
 /* LOAD RELATIVE LONG */
-    D(0xc40d, LRL,     RIL_b, GIE, 0, ri2, new, r1_32, ld32s, 0, MO_ALIGN)
+    D(0xc40d, LRL,     RIL_b, GIE, 0, ri2, new, r1_32, ld, 0, MO_BESL | MO_ALIGN)
     D(0xc408, LGRL,    RIL_b, GIE, 0, ri2, r1, 0, ld64, 0, MO_ALIGN)
-    D(0xc40c, LGFRL,   RIL_b, GIE, 0, ri2, r1, 0, ld32s, 0, MO_ALIGN)
+    D(0xc40c, LGFRL,   RIL_b, GIE, 0, ri2, r1, 0, ld, 0, MO_BESL | MO_ALIGN)
 /* LOAD ADDRESS */
     C(0x4100, LA,      RX_a,  Z,   0, a2, 0, r1, mov2, 0)
     C(0xe371, LAY,     RXY_a, LD,  0, a2, 0, r1, mov2, 0)
@@ -464,9 +464,9 @@
     C(0x1200, LTR,     RR_a,  Z,   0, r2_o, 0, cond_r1r2_32, mov2, s32)
     C(0xb902, LTGR,    RRE,   Z,   0, r2_o, 0, r1, mov2, s64)
     C(0xb912, LTGFR,   RRE,   Z,   0, r2_32s, 0, r1, mov2, s64)
-    D(0xe312, LT,      RXY_a, EI,  0, a2, new, r1_32, ld32s, s64, 0)
+    D(0xe312, LT,      RXY_a, EI,  0, a2, new, r1_32, ld, s64, MO_BESL)
     D(0xe302, LTG,     RXY_a, EI,  0, a2, r1, 0, ld64, s64, 0)
-    D(0xe332, LTGF,    RXY_a, GIE, 0, a2, r1, 0, ld32s, s64, 0)
+    D(0xe332, LTGF,    RXY_a, GIE, 0, a2, r1, 0, ld, s64, MO_BESL)
     F(0xb302, LTEBR,   RRE,   Z,   0, e2, 0, cond_e1e2, mov2, f32, IF_BFP)
     F(0xb312, LTDBR,   RRE,   Z,   0, f2, 0, f1, mov2, f64, IF_BFP)
     F(0xb342, LTXBR,   RRE,   Z,   x2h, x2l, 0, x1_P, movx, f128, IF_BFP)
Signature · 1 line
2.43.0
Reviewed-by on v1 5/14
#14 lore raw

Re: [PATCH 05/14] target/s390x: Convert op_ld32s to op_ld

Quoted 8 lines · Richard Henderson

Note that op_ld32s already or'd in insn->data, with the only use being MO_ALIGN. We now put the entire MemOp in insn->data.

---
  target/s390x/tcg/translate.c     |  7 -------
  target/s390x/tcg/insn-data.h.inc | 14 +++++++-------
  2 files changed, 7 insertions(+), 14 deletions(-)
Reviewed-by on v1 5/14
#15 lore raw

Re: [PATCH 05/14] target/s390x: Convert op_ld32s to op_ld

In reply to Richard Henderson
Quoted 8 lines · Richard Henderson

Note that op_ld32s already or'd in insn->data, with the only use being MO_ALIGN. We now put the entire MemOp in insn->data.

---
  target/s390x/tcg/translate.c     |  7 -------
  target/s390x/tcg/insn-data.h.inc | 14 +++++++-------
  2 files changed, 7 insertions(+), 14 deletions(-)
#16 lore raw

PATCH 6/14 target/s390x: Convert op_ld32u to op_ld

In reply to Richard Henderson
---
 target/s390x/tcg/translate.c     | 7 -------
 target/s390x/tcg/insn-data.h.inc | 6 +++---
 2 files changed, 3 insertions(+), 10 deletions(-)
target/s390x/tcg/translate.c +0 -7
index 79e02534cd..4f1e8db780 100644
@@ -2755,13 +2755,6 @@ static DisasJumpType op_ld(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_ld32u(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s),
-                        MO_BEUL | s->insn->data);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_ld64(DisasContext *s, DisasOps *o)
 {
     tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s),
target/s390x/tcg/insn-data.h.inc +3 -3
index 46a4a23d2a..00c8994345 100644
@@ -510,16 +510,16 @@
     D(0xc405, LHRL,    RIL_b, GIE, 0, ri2, new, r1_32, ld, 0, MO_BESW)
     D(0xc404, LGHRL,   RIL_b, GIE, 0, ri2, r1, 0, ld, 0, MO_BESW)
 /* LOAD HIGH */
-    D(0xe3ca, LFH,     RXY_a, HW,  0, a2, new, r1_32h, ld32u, 0, 0)
+    D(0xe3ca, LFH,     RXY_a, HW,  0, a2, new, r1_32h, ld, 0, MO_BEUL)
 /* LOAG HIGH AND TRAP */
     C(0xe3c8, LFHAT,   RXY_a, LAT, 0, m2_32u, r1, 0, lfhat, 0)
 /* LOAD LOGICAL */
     C(0xb916, LLGFR,   RRE,   Z,   0, r2_32u, 0, r1, mov2, 0)
-    D(0xe316, LLGF,    RXY_a, Z,   0, a2, r1, 0, ld32u, 0, 0)
+    D(0xe316, LLGF,    RXY_a, Z,   0, a2, r1, 0, ld, 0, MO_BEUL)
 /* LOAD LOGICAL AND TRAP */
     C(0xe39d, LLGFAT,  RXY_a, LAT, 0, a2, r1, 0, llgfat, 0)
 /* LOAD LOGICAL RELATIVE LONG */
-    D(0xc40e, LLGFRL,  RIL_b, GIE, 0, ri2, r1, 0, ld32u, 0, MO_ALIGN)
+    D(0xc40e, LLGFRL,  RIL_b, GIE, 0, ri2, r1, 0, ld, 0, MO_BEUL | MO_ALIGN)
 /* LOAD LOGICAL CHARACTER */
     C(0xb994, LLCR,    RRE,   EI,  0, r2_8u, 0, r1_32, mov2, 0)
     C(0xb984, LLGCR,   RRE,   EI,  0, r2_8u, 0, r1, mov2, 0)
Signature · 1 line
2.43.0
#19 lore raw

PATCH 7/14 target/s390x: Convert op_ld64 to op_ld

In reply to Richard Henderson
---
 target/s390x/tcg/translate.c     | 7 -------
 target/s390x/tcg/insn-data.h.inc | 6 +++---
 2 files changed, 3 insertions(+), 10 deletions(-)
target/s390x/tcg/translate.c +0 -7
index 4f1e8db780..34ee2d6087 100644
@@ -2755,13 +2755,6 @@ static DisasJumpType op_ld(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_ld64(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_qemu_ld_i64(o->out, o->in2, get_mem_index(s),
-                        MO_BEUQ | s->insn->data);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_lat(DisasContext *s, DisasOps *o)
 {
     TCGLabel *lab = gen_new_label();
target/s390x/tcg/insn-data.h.inc +3 -3
index 00c8994345..f72607e389 100644
@@ -422,7 +422,7 @@
     D(0xe358, LY,      RXY_a, LD,  0, a2, new, r1_32, ld, 0, MO_BESL)
     C(0xb904, LGR,     RRE,   Z,   0, r2_o, 0, r1, mov2, 0)
     C(0xb914, LGFR,    RRE,   Z,   0, r2_32s, 0, r1, mov2, 0)
-    D(0xe304, LG,      RXY_a, Z,   0, a2, r1, 0, ld64, 0, 0)
+    D(0xe304, LG,      RXY_a, Z,   0, a2, r1, 0, ld, 0, MO_BEUQ)
     D(0xe314, LGF,     RXY_a, Z,   0, a2, r1, 0, ld, 0, MO_BESL)
     F(0x2800, LDR,     RR_a,  Z,   0, f2, 0, f1, mov2, 0, IF_AFP1 | IF_AFP2)
     F(0x6800, LD,      RX_a,  Z,   0, m2_64, 0, f1, mov2, 0, IF_AFP1)
@@ -435,7 +435,7 @@
     C(0xc001, LGFI,    RIL_a, EI,  0, i2, 0, r1, mov2, 0)
 /* LOAD RELATIVE LONG */
     D(0xc40d, LRL,     RIL_b, GIE, 0, ri2, new, r1_32, ld, 0, MO_BESL | MO_ALIGN)
-    D(0xc408, LGRL,    RIL_b, GIE, 0, ri2, r1, 0, ld64, 0, MO_ALIGN)
+    D(0xc408, LGRL,    RIL_b, GIE, 0, ri2, r1, 0, ld, 0, MO_BEUQ | MO_ALIGN)
     D(0xc40c, LGFRL,   RIL_b, GIE, 0, ri2, r1, 0, ld, 0, MO_BESL | MO_ALIGN)
 /* LOAD ADDRESS */
     C(0x4100, LA,      RX_a,  Z,   0, a2, 0, r1, mov2, 0)
@@ -465,7 +465,7 @@
     C(0xb902, LTGR,    RRE,   Z,   0, r2_o, 0, r1, mov2, s64)
     C(0xb912, LTGFR,   RRE,   Z,   0, r2_32s, 0, r1, mov2, s64)
     D(0xe312, LT,      RXY_a, EI,  0, a2, new, r1_32, ld, s64, MO_BESL)
-    D(0xe302, LTG,     RXY_a, EI,  0, a2, r1, 0, ld64, s64, 0)
+    D(0xe302, LTG,     RXY_a, EI,  0, a2, r1, 0, ld, s64, MO_BEUQ)
     D(0xe332, LTGF,    RXY_a, GIE, 0, a2, r1, 0, ld, s64, MO_BESL)
     F(0xb302, LTEBR,   RRE,   Z,   0, e2, 0, cond_e1e2, mov2, f32, IF_BFP)
     F(0xb312, LTDBR,   RRE,   Z,   0, f2, 0, f1, mov2, f64, IF_BFP)
Signature · 1 line
2.43.0
#22 lore raw

PATCH 8/14 target/s390x: Convert op_st8 to op_st

In reply to Richard Henderson

Begin unifying store operations by storing MemOp in insn->data. Start with op_st8.

---
 target/s390x/tcg/translate.c     | 4 ++--
 target/s390x/tcg/insn-data.h.inc | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
target/s390x/tcg/translate.c +2 -2
index 34ee2d6087..feaada544a 100644
@@ -4342,9 +4342,9 @@ static DisasJumpType op_stfle(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_st8(DisasContext *s, DisasOps *o)
+static DisasJumpType op_st(DisasContext *s, DisasOps *o)
 {
-    tcg_gen_qemu_st_i64(o->in1, o->in2, get_mem_index(s), MO_UB);
+    tcg_gen_qemu_st_i64(o->in1, o->in2, get_mem_index(s), s->insn->data);
     return DISAS_NEXT;
 }
 
target/s390x/tcg/insn-data.h.inc +3 -3
index f72607e389..6fdd730985 100644
@@ -859,10 +859,10 @@
     D(0xc40f, STRL,    RIL_b, GIE, r1_o, ri2, 0, 0, st32, 0, MO_ALIGN)
     D(0xc40b, STGRL,   RIL_b, GIE, r1_o, ri2, 0, 0, st64, 0, MO_ALIGN)
 /* STORE CHARACTER */
-    C(0x4200, STC,     RX_a,  Z,   r1_o, a2, 0, 0, st8, 0)
-    C(0xe372, STCY,    RXY_a, LD,  r1_o, a2, 0, 0, st8, 0)
+    D(0x4200, STC,     RX_a,  Z,   r1_o, a2, 0, 0, st, 0, MO_UB)
+    D(0xe372, STCY,    RXY_a, LD,  r1_o, a2, 0, 0, st, 0, MO_UB)
 /* STORE CHARACTER HIGH */
-    C(0xe3c3, STCH,    RXY_a, HW,  r1_sr32, a2, 0, 0, st8, 0)
+    D(0xe3c3, STCH,    RXY_a, HW,  r1_sr32, a2, 0, 0, st, 0, MO_UB)
 /* STORE CHARACTERS UNDER MASK */
     D(0xbe00, STCM,    RS_b,  Z,   r1_o, a2, 0, 0, stcm, 0, 0)
     D(0xeb2d, STCMY,   RSY_b, LD,  r1_o, a2, 0, 0, stcm, 0, 0)
Signature · 1 line
2.43.0
Reviewed-by on v1 8/14
#24 lore raw

Re: [PATCH 08/14] target/s390x: Convert op_st8 to op_st

In reply to Richard Henderson
Quoted 8 lines · Richard Henderson

Begin unifying store operations by storing MemOp in insn->data. Start with op_st8.

---
  target/s390x/tcg/translate.c     | 4 ++--
  target/s390x/tcg/insn-data.h.inc | 6 +++---
  2 files changed, 5 insertions(+), 5 deletions(-)
#25 lore raw

PATCH 9/14 target/s390x: Convert op_st16 to op_st

In reply to Richard Henderson
---
 target/s390x/tcg/translate.c     | 6 ------
 target/s390x/tcg/insn-data.h.inc | 8 ++++----
 2 files changed, 4 insertions(+), 10 deletions(-)
target/s390x/tcg/translate.c +0 -6
index feaada544a..8339a7868c 100644
@@ -4348,12 +4348,6 @@ static DisasJumpType op_st(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_st16(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_qemu_st_i64(o->in1, o->in2, get_mem_index(s), MO_BEUW);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_st32(DisasContext *s, DisasOps *o)
 {
     tcg_gen_qemu_st_i64(o->in1, o->in2, get_mem_index(s),
target/s390x/tcg/insn-data.h.inc +4 -4
index 6fdd730985..ca495d1dd4 100644
@@ -868,12 +868,12 @@
     D(0xeb2d, STCMY,   RSY_b, LD,  r1_o, a2, 0, 0, stcm, 0, 0)
     D(0xeb2c, STCMH,   RSY_b, Z,   r1_o, a2, 0, 0, stcm, 0, 32)
 /* STORE HALFWORD */
-    C(0x4000, STH,     RX_a,  Z,   r1_o, a2, 0, 0, st16, 0)
-    C(0xe370, STHY,    RXY_a, LD,  r1_o, a2, 0, 0, st16, 0)
+    D(0x4000, STH,     RX_a,  Z,   r1_o, a2, 0, 0, st, 0, MO_BEUW)
+    D(0xe370, STHY,    RXY_a, LD,  r1_o, a2, 0, 0, st, 0, MO_BEUW)
 /* STORE HALFWORD HIGH */
-    C(0xe3c7, STHH,    RXY_a, HW,  r1_sr32, a2, 0, 0, st16, 0)
+    D(0xe3c7, STHH,    RXY_a, HW,  r1_sr32, a2, 0, 0, st, 0, MO_BEUW)
 /* STORE HALFWORD RELATIVE LONG */
-    C(0xc407, STHRL,   RIL_b, GIE, r1_o, ri2, 0, 0, st16, 0)
+    D(0xc407, STHRL,   RIL_b, GIE, r1_o, ri2, 0, 0, st, 0, MO_BEUW)
 /* STORE HIGH */
     D(0xe3cb, STFH,    RXY_a, HW,  r1_sr32, a2, 0, 0, st32, 0, 0)
 /* STORE ON CONDITION */
Signature · 1 line
2.43.0
#28 lore raw

PATCH 10/14 target/s390x: Convert op_st32 to op_st

In reply to Richard Henderson

Note that op_st32 already or'd in insn->data, with the only use being MO_ALIGN. We now put the entire MemOp in insn->data.

---
 target/s390x/tcg/translate.c     |  7 -------
 target/s390x/tcg/insn-data.h.inc | 12 ++++++------
 2 files changed, 6 insertions(+), 13 deletions(-)
target/s390x/tcg/translate.c +0 -7
index 8339a7868c..5cfa4d7d1a 100644
@@ -4348,13 +4348,6 @@ static DisasJumpType op_st(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_st32(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_qemu_st_i64(o->in1, o->in2, get_mem_index(s),
-                        MO_BEUL | s->insn->data);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_st64(DisasContext *s, DisasOps *o)
 {
     tcg_gen_qemu_st_i64(o->in1, o->in2, get_mem_index(s),
target/s390x/tcg/insn-data.h.inc +6 -6
index ca495d1dd4..54234ffb57 100644
@@ -848,15 +848,15 @@
     F(0xed15, SQDB,    RXE,   Z,   0, m2_64, new, f1, sqdb, 0, IF_BFP)
 
 /* STORE */
-    D(0x5000, ST,      RX_a,  Z,   r1_o, a2, 0, 0, st32, 0, 0)
-    D(0xe350, STY,     RXY_a, LD,  r1_o, a2, 0, 0, st32, 0, 0)
+    D(0x5000, ST,      RX_a,  Z,   r1_o, a2, 0, 0, st, 0, MO_BEUL)
+    D(0xe350, STY,     RXY_a, LD,  r1_o, a2, 0, 0, st, 0, MO_BEUL)
     D(0xe324, STG,     RXY_a, Z,   r1_o, a2, 0, 0, st64, 0, 0)
     E(0x6000, STD,     RX_a,  Z,   f1, a2, 0, 0, st64, 0, 0, IF_AFP1)
     E(0xed67, STDY,    RXY_a, LD,  f1, a2, 0, 0, st64, 0, 0, IF_AFP1)
-    E(0x7000, STE,     RX_a,  Z,   e1, a2, 0, 0, st32, 0, 0, IF_AFP1)
-    E(0xed66, STEY,    RXY_a, LD,  e1, a2, 0, 0, st32, 0, 0, IF_AFP1)
+    E(0x7000, STE,     RX_a,  Z,   e1, a2, 0, 0, st, 0, MO_BEUL, IF_AFP1)
+    E(0xed66, STEY,    RXY_a, LD,  e1, a2, 0, 0, st, 0, MO_BEUL, IF_AFP1)
 /* STORE RELATIVE LONG */
-    D(0xc40f, STRL,    RIL_b, GIE, r1_o, ri2, 0, 0, st32, 0, MO_ALIGN)
+    D(0xc40f, STRL,    RIL_b, GIE, r1_o, ri2, 0, 0, st, 0, MO_BEUL | MO_ALIGN)
     D(0xc40b, STGRL,   RIL_b, GIE, r1_o, ri2, 0, 0, st64, 0, MO_ALIGN)
 /* STORE CHARACTER */
     D(0x4200, STC,     RX_a,  Z,   r1_o, a2, 0, 0, st, 0, MO_UB)
@@ -875,7 +875,7 @@
 /* STORE HALFWORD RELATIVE LONG */
     D(0xc407, STHRL,   RIL_b, GIE, r1_o, ri2, 0, 0, st, 0, MO_BEUW)
 /* STORE HIGH */
-    D(0xe3cb, STFH,    RXY_a, HW,  r1_sr32, a2, 0, 0, st32, 0, 0)
+    D(0xe3cb, STFH,    RXY_a, HW,  r1_sr32, a2, 0, 0, st, 0, MO_BEUL)
 /* STORE ON CONDITION */
     D(0xebf3, STOC,    RSY_b, LOC, 0, 0, 0, 0, soc, 0, 0)
     D(0xebe3, STOCG,   RSY_b, LOC, 0, 0, 0, 0, soc, 0, 1)
Signature · 1 line
2.43.0
Reviewed-by on v1 10/14
#29 lore raw

Re: [PATCH 10/14] target/s390x: Convert op_st32 to op_st

Quoted 8 lines · Richard Henderson

Note that op_st32 already or'd in insn->data, with the only use being MO_ALIGN. We now put the entire MemOp in insn->data.

---
  target/s390x/tcg/translate.c     |  7 -------
  target/s390x/tcg/insn-data.h.inc | 12 ++++++------
  2 files changed, 6 insertions(+), 13 deletions(-)
Reviewed-by on v1 10/14
#30 lore raw

Re: [PATCH 10/14] target/s390x: Convert op_st32 to op_st

In reply to Richard Henderson
Quoted 8 lines · Richard Henderson

Note that op_st32 already or'd in insn->data, with the only use being MO_ALIGN. We now put the entire MemOp in insn->data.

---
  target/s390x/tcg/translate.c     |  7 -------
  target/s390x/tcg/insn-data.h.inc | 12 ++++++------
  2 files changed, 6 insertions(+), 13 deletions(-)
#31 lore raw

PATCH 11/14 target/s390x: Convert op_st64 to op_st

In reply to Richard Henderson
---
 target/s390x/tcg/translate.c     | 7 -------
 target/s390x/tcg/insn-data.h.inc | 8 ++++----
 2 files changed, 4 insertions(+), 11 deletions(-)
target/s390x/tcg/translate.c +0 -7
index 5cfa4d7d1a..61793a9e80 100644
@@ -4348,13 +4348,6 @@ static DisasJumpType op_st(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_st64(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_qemu_st_i64(o->in1, o->in2, get_mem_index(s),
-                        MO_BEUQ | s->insn->data);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_stam(DisasContext *s, DisasOps *o)
 {
     TCGv_i32 r1 = tcg_constant_i32(get_field(s, r1));
target/s390x/tcg/insn-data.h.inc +4 -4
index 54234ffb57..3611da1ef3 100644
@@ -850,14 +850,14 @@
 /* STORE */
     D(0x5000, ST,      RX_a,  Z,   r1_o, a2, 0, 0, st, 0, MO_BEUL)
     D(0xe350, STY,     RXY_a, LD,  r1_o, a2, 0, 0, st, 0, MO_BEUL)
-    D(0xe324, STG,     RXY_a, Z,   r1_o, a2, 0, 0, st64, 0, 0)
-    E(0x6000, STD,     RX_a,  Z,   f1, a2, 0, 0, st64, 0, 0, IF_AFP1)
-    E(0xed67, STDY,    RXY_a, LD,  f1, a2, 0, 0, st64, 0, 0, IF_AFP1)
+    D(0xe324, STG,     RXY_a, Z,   r1_o, a2, 0, 0, st, 0, MO_BEUQ)
+    E(0x6000, STD,     RX_a,  Z,   f1, a2, 0, 0, st, 0, MO_BEUQ, IF_AFP1)
+    E(0xed67, STDY,    RXY_a, LD,  f1, a2, 0, 0, st, 0, MO_BEUQ, IF_AFP1)
     E(0x7000, STE,     RX_a,  Z,   e1, a2, 0, 0, st, 0, MO_BEUL, IF_AFP1)
     E(0xed66, STEY,    RXY_a, LD,  e1, a2, 0, 0, st, 0, MO_BEUL, IF_AFP1)
 /* STORE RELATIVE LONG */
     D(0xc40f, STRL,    RIL_b, GIE, r1_o, ri2, 0, 0, st, 0, MO_BEUL | MO_ALIGN)
-    D(0xc40b, STGRL,   RIL_b, GIE, r1_o, ri2, 0, 0, st64, 0, MO_ALIGN)
+    D(0xc40b, STGRL,   RIL_b, GIE, r1_o, ri2, 0, 0, st, 0, MO_BEUQ | MO_ALIGN)
 /* STORE CHARACTER */
     D(0x4200, STC,     RX_a,  Z,   r1_o, a2, 0, 0, st, 0, MO_UB)
     D(0xe372, STCY,    RXY_a, LD,  r1_o, a2, 0, 0, st, 0, MO_UB)
Signature · 1 line
2.43.0
#34 lore raw

PATCH 12/14 target/s390x: Use op_ld for LOAD REVERSED

In reply to Richard Henderson

Use the MemOp parameter to op_ld to directly perform a little-endian load, rather than a separate byte reverse after the load.

---
 target/s390x/tcg/translate.c     | 7 -------
 target/s390x/tcg/insn-data.h.inc | 6 +++---
 2 files changed, 3 insertions(+), 10 deletions(-)
target/s390x/tcg/translate.c +0 -7
index 61793a9e80..7c1961567d 100644
@@ -5760,13 +5760,6 @@ static void in2_m2_16s(DisasContext *s, DisasOps *o)
 }
 #define SPEC_in2_m2_16s 0
 
-static void in2_m2_16u(DisasContext *s, DisasOps *o)
-{
-    in2_a2(s, o);
-    tcg_gen_qemu_ld_i64(o->in2, o->in2, get_mem_index(s), MO_BEUW);
-}
-#define SPEC_in2_m2_16u 0
-
 static void in2_m2_32s(DisasContext *s, DisasOps *o)
 {
     in2_a2(s, o);
target/s390x/tcg/insn-data.h.inc +3 -3
index 3611da1ef3..691f8222ab 100644
@@ -590,9 +590,9 @@
 /* LOAD REVERSED */
     C(0xb91f, LRVR,    RRE,   Z,   0, r2_32u, new, r1_32, rev32, 0)
     C(0xb90f, LRVGR,   RRE,   Z,   0, r2_o, r1, 0, rev64, 0)
-    C(0xe31f, LRVH,    RXY_a, Z,   0, m2_16u, new, r1_16, rev16, 0)
-    C(0xe31e, LRV,     RXY_a, Z,   0, m2_32u, new, r1_32, rev32, 0)
-    C(0xe30f, LRVG,    RXY_a, Z,   0, m2_64, r1, 0, rev64, 0)
+    D(0xe31f, LRVH,    RXY_a, Z,   0, a2, new, r1_16, ld, 0, MO_LEUW)
+    D(0xe31e, LRV,     RXY_a, Z,   0, a2, new, r1_32, ld, 0, MO_LEUL)
+    D(0xe30f, LRVG,    RXY_a, Z,   0, a2, r1, 0, ld, 0, MO_LEUQ)
 /* LOAD ZERO */
     F(0xb374, LZER,    RRE,   Z,   0, 0, 0, e1, zero, 0, IF_AFP1)
     F(0xb375, LZDR,    RRE,   Z,   0, 0, 0, f1, zero, 0, IF_AFP1)
Signature · 1 line
2.43.0
Reviewed-by on v1 12/14
#35 lore raw

Re: [PATCH 12/14] target/s390x: Use op_ld for LOAD REVERSED

Quoted 9 lines · Richard Henderson

Use the MemOp parameter to op_ld to directly perform a little-endian load, rather than a separate byte reverse after the load.

---
  target/s390x/tcg/translate.c     | 7 -------
  target/s390x/tcg/insn-data.h.inc | 6 +++---
  2 files changed, 3 insertions(+), 10 deletions(-)
Reviewed-by on v1 12/14
#36 lore raw

Re: [PATCH 12/14] target/s390x: Use op_ld for LOAD REVERSED

In reply to Richard Henderson
Quoted 9 lines · Richard Henderson

Use the MemOp parameter to op_ld to directly perform a little-endian load, rather than a separate byte reverse after the load.

---
  target/s390x/tcg/translate.c     | 7 -------
  target/s390x/tcg/insn-data.h.inc | 6 +++---
  2 files changed, 3 insertions(+), 10 deletions(-)
#37 lore raw

PATCH 13/14 target/s390x: Use op_st for STORE REVERSED

In reply to Richard Henderson

Use the MemOp parameter to op_st to directly perform a little-endian store, rather than a separate byte reverse before the store.

---
 target/s390x/tcg/translate.c     | 13 -------------
 target/s390x/tcg/insn-data.h.inc |  6 +++---
 2 files changed, 3 insertions(+), 16 deletions(-)
target/s390x/tcg/translate.c +0 -13
index 7c1961567d..09c5541615 100644
@@ -3713,12 +3713,6 @@ static DisasJumpType op_rosbg(DisasContext *s, DisasOps *o)
     return DISAS_NEXT;
 }
 
-static DisasJumpType op_rev16(DisasContext *s, DisasOps *o)
-{
-    tcg_gen_bswap16_i64(o->out, o->in2, TCG_BSWAP_IZ | TCG_BSWAP_OZ);
-    return DISAS_NEXT;
-}
-
 static DisasJumpType op_rev32(DisasContext *s, DisasOps *o)
 {
     tcg_gen_bswap32_i64(o->out, o->in2, TCG_BSWAP_IZ | TCG_BSWAP_OZ);
@@ -5543,13 +5537,6 @@ static void in2_r1_o(DisasContext *s, DisasOps *o)
 }
 #define SPEC_in2_r1_o 0
 
-static void in2_r1_16u(DisasContext *s, DisasOps *o)
-{
-    o->in2 = tcg_temp_new_i64();
-    tcg_gen_ext16u_i64(o->in2, regs[get_field(s, r1)]);
-}
-#define SPEC_in2_r1_16u 0
-
 static void in2_r1_32u(DisasContext *s, DisasOps *o)
 {
     o->in2 = tcg_temp_new_i64();
target/s390x/tcg/insn-data.h.inc +3 -3
index 691f8222ab..774a3cec36 100644
@@ -882,9 +882,9 @@
 /* STORE HIGH ON CONDITION */
     D(0xebe1, STOCFH,  RSY_b, LOC2, 0, 0, 0, 0, soc, 0, 2)
 /* STORE REVERSED */
-    C(0xe33f, STRVH,   RXY_a, Z,   la2, r1_16u, new, m1_16, rev16, 0)
-    C(0xe33e, STRV,    RXY_a, Z,   la2, r1_32u, new, m1_32, rev32, 0)
-    C(0xe32f, STRVG,   RXY_a, Z,   la2, r1_o, new, m1_64, rev64, 0)
+    D(0xe33f, STRVH,   RXY_a, Z,   r1_o, a2, 0, 0, st, 0, MO_LEUW)
+    D(0xe33e, STRV,    RXY_a, Z,   r1_o, a2, 0, 0, st, 0, MO_LEUL)
+    D(0xe32f, STRVG,   RXY_a, Z,   r1_o, a2, 0, 0, st, 0, MO_LEUQ)
 
 /* STORE CLOCK */
     F(0xb205, STCK,    S,     Z,   la2, 0, new, m1_64, stck, 0, IF_IO)
Signature · 1 line
2.43.0
Reviewed-by on v1 13/14
#38 lore raw

Re: [PATCH 13/14] target/s390x: Use op_st for STORE REVERSED

Quoted 9 lines · Richard Henderson

Use the MemOp parameter to op_st to directly perform a little-endian store, rather than a separate byte reverse before the store.

---
  target/s390x/tcg/translate.c     | 13 -------------
  target/s390x/tcg/insn-data.h.inc |  6 +++---
  2 files changed, 3 insertions(+), 16 deletions(-)
Reviewed-by on v1 13/14
#39 lore raw

Re: [PATCH 13/14] target/s390x: Use op_st for STORE REVERSED

In reply to Richard Henderson
Quoted 9 lines · Richard Henderson

Use the MemOp parameter to op_st to directly perform a little-endian store, rather than a separate byte reverse before the store.

---
  target/s390x/tcg/translate.c     | 13 -------------
  target/s390x/tcg/insn-data.h.inc |  6 +++---
  2 files changed, 3 insertions(+), 16 deletions(-)
#40 lore raw

PATCH 14/14 target/s390x: Simplify LRVR

In reply to Richard Henderson

If we drop TCG_BSWAP_IZ, we don't need to zero-extend r1 on input. Since the output gets passed to deposit in wout_r1_32, the high bits of the bswap output need not have any specific value, so we can drop TCG_BSWAP_OZ.

---
 target/s390x/tcg/translate.c     | 2 +-
 target/s390x/tcg/insn-data.h.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
target/s390x/tcg/translate.c +1 -1
index 09c5541615..07ec01232d 100644
@@ -3715,7 +3715,7 @@ static DisasJumpType op_rosbg(DisasContext *s, DisasOps *o)
 
 static DisasJumpType op_rev32(DisasContext *s, DisasOps *o)
 {
-    tcg_gen_bswap32_i64(o->out, o->in2, TCG_BSWAP_IZ | TCG_BSWAP_OZ);
+    tcg_gen_bswap32_i64(o->out, o->in2, 0);
     return DISAS_NEXT;
 }
 
target/s390x/tcg/insn-data.h.inc +1 -1
index 774a3cec36..0dbd433ce5 100644
@@ -588,7 +588,7 @@
     F(0xb340, LPXBR,   RRE,   Z,   x2h, x2l, new_P, x1_P, absf128, f128, IF_BFP)
     F(0xb370, LPDFR,   RRE,   FPSSH, 0, f2, new, f1, absf64, 0, IF_AFP1 | IF_AFP2)
 /* LOAD REVERSED */
-    C(0xb91f, LRVR,    RRE,   Z,   0, r2_32u, new, r1_32, rev32, 0)
+    C(0xb91f, LRVR,    RRE,   Z,   0, r2_o, new, r1_32, rev32, 0)
     C(0xb90f, LRVGR,   RRE,   Z,   0, r2_o, r1, 0, rev64, 0)
     D(0xe31f, LRVH,    RXY_a, Z,   0, a2, new, r1_16, ld, 0, MO_LEUW)
     D(0xe31e, LRV,     RXY_a, Z,   0, a2, new, r1_32, ld, 0, MO_LEUL)
Signature · 1 line
2.43.0
Reviewed-by on v1 14/14
#41 lore raw

Re: [PATCH 14/14] target/s390x: Simplify LRVR

Quoted 10 lines · Richard Henderson

If we drop TCG_BSWAP_IZ, we don't need to zero-extend r1 on input. Since the output gets passed to deposit in wout_r1_32, the high bits of the bswap output need not have any specific value, so we can drop TCG_BSWAP_OZ.

---
  target/s390x/tcg/translate.c     | 2 +-
  target/s390x/tcg/insn-data.h.inc | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by on v1 14/14
#42 lore raw

Re: [PATCH 14/14] target/s390x: Simplify LRVR

In reply to Richard Henderson
Quoted 10 lines · Richard Henderson

If we drop TCG_BSWAP_IZ, we don't need to zero-extend r1 on input. Since the output gets passed to deposit in wout_r1_32, the high bits of the bswap output need not have any specific value, so we can drop TCG_BSWAP_OZ.

---
  target/s390x/tcg/translate.c     | 2 +-
  target/s390x/tcg/insn-data.h.inc | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
#43 lore raw

PATCH v2 1/1 tests/tcg/s390x: Test LOAD and STORE REVERSED

In reply to Richard Henderson

Add a small test to prevent regressions.

---

v1 -> v2: CC: [email protected].
Check that upper bytes are not modified.

 tests/tcg/s390x/Makefile.target       |  1 +
 tests/tcg/s390x/load-store-reversed.c | 46 +++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 tests/tcg/s390x/load-store-reversed.c
tests/tcg/s390x/Makefile.target +1 -0
index 0ca030ded01..fe1fba3de2f 100644
@@ -50,6 +50,7 @@ TESTS+=cvb
 TESTS+=ts
 TESTS+=ex-smc
 TESTS+=divide-to-integer
+TESTS+=load-store-reversed
 
 cdsg: CFLAGS+=-pthread
 cdsg: LDFLAGS+=-pthread
tests/tcg/s390x/load-store-reversed.c new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
2.55.0
author Reviewed-by on v2 1/1
#44 lore raw

Re: [PATCH v2] tests/tcg/s390x: Test LOAD and STORE REVERSED

Quoted 5 lines · Ilya Leoshkevich

Add a small test to prevent regressions.

---

Quoted 7 lines

v1 -> v2: CC:[email protected].
Check that upper bytes are not modified.

  tests/tcg/s390x/Makefile.target       |  1 +
  tests/tcg/s390x/load-store-reversed.c | 46 +++++++++++++++++++++++++++
  2 files changed, 47 insertions(+)

create mode 100644 tests/tcg/s390x/load-store-reversed.c

r~