Signed-off-by: Richard Henderson <r...@twiddle.net> --- target-s390x/insn-data.def | 2 ++ target-s390x/translate.c | 75 ++++++++++++++-------------------------------- 2 files changed, 25 insertions(+), 52 deletions(-)
diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index 92dbf26..ed28d2d 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -484,6 +484,7 @@ C(0x8300, DIAG, RX_a, Z, 0, 0, 0, 0, diag, 0) /* LOAD CONTROL */ C(0xb700, LCTL, RS_a, Z, 0, a2, 0, 0, lctl, 0) + C(0xeb2f, LCTLG, RSY_a, Z, 0, a2, 0, 0, lctlg, 0) /* LOAD PSW */ C(0x8200, LPSW, S, Z, 0, a2, 0, 0, lpsw, 0) /* LOAD REAL ADDRESS */ @@ -504,6 +505,7 @@ C(0xae00, SIGP, RS_a, Z, r3_o, a2, 0, 0, sigp, 0) /* STORE CONTROL */ C(0xb600, STCTL, RS_a, Z, 0, a2, 0, 0, stctl, 0) + C(0xeb25, STCTG, RSY_a, Z, 0, a2, 0, 0, stctg, 0) /* STORE THEN AND SYSTEM MASK */ C(0xac00, STNSM, SI, Z, la1, 0, new, m1_8, stnsm, 0) /* STORE THEN OR SYSTEM MASK */ diff --git a/target-s390x/translate.c b/target-s390x/translate.c index 7a912ca..9277081 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -1070,47 +1070,6 @@ static void disas_e3(DisasContext* s, int op, int r1, int x2, int b2, int d2) tcg_temp_free_i64(addr); } -static void disas_eb(DisasContext *s, int op, int r1, int r3, int b2, int d2) -{ - TCGv_i64 tmp; - TCGv_i32 tmp32_1, tmp32_2; - - LOG_DISAS("disas_eb: op 0x%x r1 %d r3 %d b2 %d d2 0x%x\n", - op, r1, r3, b2, d2); - switch (op) { -#ifndef CONFIG_USER_ONLY - case 0x2f: /* LCTLG R1,R3,D2(B2) [RSE] */ - /* Load Control */ - check_privileged(s); - tmp = get_address(s, 0, b2, d2); - tmp32_1 = tcg_const_i32(r1); - tmp32_2 = tcg_const_i32(r3); - potential_page_fault(s); - gen_helper_lctlg(cpu_env, tmp32_1, tmp, tmp32_2); - tcg_temp_free_i64(tmp); - tcg_temp_free_i32(tmp32_1); - tcg_temp_free_i32(tmp32_2); - break; - case 0x25: /* STCTG R1,R3,D2(B2) [RSE] */ - /* Store Control */ - check_privileged(s); - tmp = get_address(s, 0, b2, d2); - tmp32_1 = tcg_const_i32(r1); - tmp32_2 = tcg_const_i32(r3); - potential_page_fault(s); - gen_helper_stctg(cpu_env, tmp32_1, tmp, tmp32_2); - tcg_temp_free_i64(tmp); - tcg_temp_free_i32(tmp32_1); - tcg_temp_free_i32(tmp32_2); - break; -#endif - default: - LOG_DISAS("illegal eb operation 0x%x\n", op); - gen_illegal_opcode(s); - break; - } -} - static void disas_ed(DisasContext *s, int op, int r1, int x2, int b2, int d2, int r1b) { @@ -1961,17 +1920,6 @@ static void disas_s390_insn(DisasContext *s) | ((insn << 4) & 0xff000)) << 12)) >> 12; disas_e3(s, op, r1, x2, b2, d2 ); break; - case 0xeb: - insn = ld_code6(s->pc); - debug_insn(insn); - op = insn & 0xff; - r1 = (insn >> 36) & 0xf; - r3 = (insn >> 32) & 0xf; - b2 = (insn >> 28) & 0xf; - d2 = ((int)((((insn >> 16) & 0xfff) - | ((insn << 4) & 0xff000)) << 12)) >> 12; - disas_eb(s, op, r1, r3, b2, d2); - break; case 0xed: insn = ld_code6(s->pc); debug_insn(insn); @@ -2768,6 +2716,17 @@ static ExitStatus op_lctl(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_lctlg(DisasContext *s, DisasOps *o) +{ + TCGv_i32 r1 = tcg_const_i32(get_field(s->fields, r1)); + TCGv_i32 r3 = tcg_const_i32(get_field(s->fields, r3)); + check_privileged(s); + potential_page_fault(s); + gen_helper_lctlg(cpu_env, r1, o->in2, r3); + tcg_temp_free_i32(r1); + tcg_temp_free_i32(r3); + return NO_EXIT; +} static ExitStatus op_lra(DisasContext *s, DisasOps *o) { check_privileged(s); @@ -3085,6 +3044,18 @@ static ExitStatus op_stctl(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_stctg(DisasContext *s, DisasOps *o) +{ + TCGv_i32 r1 = tcg_const_i32(get_field(s->fields, r1)); + TCGv_i32 r3 = tcg_const_i32(get_field(s->fields, r3)); + check_privileged(s); + potential_page_fault(s); + gen_helper_stctg(cpu_env, r1, o->in2, r3); + tcg_temp_free_i32(r1); + tcg_temp_free_i32(r3); + return NO_EXIT; +} + static ExitStatus op_stnsm(DisasContext *s, DisasOps *o) { uint64_t i2 = get_field(s->fields, i2); -- 1.7.11.4