Patchwork [113/147] target-s390: Convert STSI

login
register
mail settings
Submitter Richard Henderson
Date Sept. 28, 2012, 12:48 a.m.
Message ID <1348793322-27572-1-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/187636/
State New
Headers show

Comments

Richard Henderson - Sept. 28, 2012, 12:48 a.m.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-s390x/helper.h      |  2 +-
 target-s390x/insn-data.def |  2 ++
 target-s390x/misc_helper.c |  4 ++--
 target-s390x/translate.c   | 24 ++++++++++--------------
 4 files changed, 15 insertions(+), 17 deletions(-)

Patch

diff --git a/target-s390x/helper.h b/target-s390x/helper.h
index 4ba81af..55eaeea 100644
--- a/target-s390x/helper.h
+++ b/target-s390x/helper.h
@@ -91,7 +91,7 @@  DEF_HELPER_FLAGS_2(sckc, TCG_CALL_CONST, void, env, i64)
 DEF_HELPER_FLAGS_1(stckc, TCG_CALL_CONST, i64, env)
 DEF_HELPER_FLAGS_2(spt, TCG_CALL_CONST, void, env, i64)
 DEF_HELPER_FLAGS_1(stpt, TCG_CALL_CONST, i64, env)
-DEF_HELPER_4(stsi, i32, env, i64, i32, i32)
+DEF_HELPER_4(stsi, i32, env, i64, i64, i64)
 DEF_HELPER_4(lctl, void, env, i32, i64, i32)
 DEF_HELPER_4(lctlg, void, env, i32, i64, i32)
 DEF_HELPER_4(stctl, void, env, i32, i64, i32)
diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def
index a389f15..5de3256 100644
--- a/target-s390x/insn-data.def
+++ b/target-s390x/insn-data.def
@@ -680,6 +680,8 @@ 
     C(0xb209, STPT,    S,     Z,   la2, 0, new, m1_64, stpt, 0)
 /* STORE PREFIX */
     C(0xb211, STPX,    S,     Z,   la2, 0, new, m1_32, stpx, 0)
+/* STORE SYSTEM INFORMATION */
+    C(0xb27d, STSI,    S,     Z,   0, a2, 0, 0, stsi, 0)
 /* STORE THEN AND SYSTEM MASK */
     C(0xac00, STNSM,   SI,    Z,   la1, 0, 0, 0, stnosm, 0)
 /* STORE THEN OR SYSTEM MASK */
diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c
index cf4ae62..b24e3d1 100644
--- a/target-s390x/misc_helper.c
+++ b/target-s390x/misc_helper.c
@@ -247,8 +247,8 @@  uint64_t HELPER(stpt)(CPUS390XState *env)
 }
 
 /* Store System Information */
-uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint32_t r0,
-                      uint32_t r1)
+uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0,
+                      uint64_t r0, uint64_t r1)
 {
     int cc = 0;
     int sel1, sel2;
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index b29e2ea..2bb6ac1 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -1023,7 +1023,7 @@  static void disas_b2(CPUS390XState *env, DisasContext *s, int op,
 {
 #ifndef CONFIG_USER_ONLY
     TCGv_i64 tmp, tmp2, tmp3;
-    TCGv_i32 tmp32_1, tmp32_2;
+    TCGv_i32 tmp32_1;
     int r1, r2;
     int r3, d2, b2;
 
@@ -1033,19 +1033,6 @@  static void disas_b2(CPUS390XState *env, DisasContext *s, int op,
     LOG_DISAS("disas_b2: op 0x%x r1 %d r2 %d\n", op, r1, r2);
 
     switch (op) {
-    case 0x7d: /* STSI     D2,(B2)     [S] */
-        check_privileged(s);
-        decode_rs(s, insn, &r1, &r3, &b2, &d2);
-        tmp = get_address(s, 0, b2, d2);
-        tmp32_1 = load_reg32(0);
-        tmp32_2 = load_reg32(1);
-        potential_page_fault(s);
-        gen_helper_stsi(cc_op, cpu_env, tmp, tmp32_1, tmp32_2);
-        set_cc_static(s);
-        tcg_temp_free_i64(tmp);
-        tcg_temp_free_i32(tmp32_1);
-        tcg_temp_free_i32(tmp32_2);
-        break;
     case 0xb1: /* STFL     D2(B2)     [S] */
         /* Store Facility List (CPU features) at 200 */
         check_privileged(s);
@@ -2895,6 +2882,15 @@  static ExitStatus op_stpt(DisasContext *s, DisasOps *o)
     return NO_EXIT;
 }
 
+static ExitStatus op_stsi(DisasContext *s, DisasOps *o)
+{
+    check_privileged(s);
+    potential_page_fault(s);
+    gen_helper_stsi(cc_op, cpu_env, o->in2, regs[0], regs[1]);
+    set_cc_static(s);
+    return NO_EXIT;
+}
+
 static ExitStatus op_spx(DisasContext *s, DisasOps *o)
 {
     check_privileged(s);