From d14b3e09b21a297fddc62c0c7839156022079d05 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 27 Aug 2012 10:43:38 -0700 Subject: [PATCH] target-s390: Convert STSI Signed-off-by: Richard Henderson --- 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(-) diff --git a/target-s390x/helper.h b/target-s390x/helper.h index 3d7472eba0..f2eaef45fa 100644 --- a/target-s390x/helper.h +++ b/target-s390x/helper.h @@ -89,7 +89,7 @@ DEF_HELPER_FLAGS_2(sckc, TCG_CALL_NO_RWG, void, env, i64) DEF_HELPER_FLAGS_1(stckc, TCG_CALL_NO_RWG, i64, env) DEF_HELPER_FLAGS_2(spt, TCG_CALL_NO_RWG, void, env, i64) DEF_HELPER_FLAGS_1(stpt, TCG_CALL_NO_RWG, 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 a389f1503e..5de3256be9 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 409df4f7f8..60e6538fbf 100644 --- a/target-s390x/misc_helper.c +++ b/target-s390x/misc_helper.c @@ -200,8 +200,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 491f8fd6b6..6f1f799d2d 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);