target/s390x: translation loop conversion
cover target/s390x: translation loop conversion
PATCH 1/3 target/s390x: convert to DisasJumpType
The only non-trivial modification is the use of DISAS_TOO_MANY in the same way is used by the generic translation loop.
--- target/s390x/translate.c | 1267 +++++++++++++++++++++++----------------------- 1 file changed, 632 insertions(+), 635 deletions(-)
target/s390x/translate.c +632 -635
@@ -42,6 +42,7 @@#include "exec/helper-gen.h" #include "trace-tcg.h" +#include "exec/translator.h" #include "exec/log.h"
@@ -73,9 +74,6 @@ typedef struct { } u; } DisasCompare; -/* is_jmp field values */ -#define DISAS_EXCP DISAS_TARGET_0 -#ifdef DEBUG_INLINE_BRANCHES static uint64_t inline_branch_hit[CC_OP_MAX ];static uint64_t inline_branch_miss[CC_OP_MAX ];
@@ -1087,26 +1085,24 @@ typedef struct {#define SPEC_r2_f128 16/* Return values from translate_one, indicating the state of the TB. */ -typedef enum { -/* Continue the TB. */ -NO_EXIT , -/* We have emitted one or more goto_tb. No fixup required. */ -EXIT_GOTO_TB , -/* We are not using a goto_tb (for whatever reason), but have updated -the PC (for whatever reason), so there's no need to do it again on -exiting the TB. */ -EXIT_PC_UPDATED , -/* We have updated the PC and CC values. */ -EXIT_PC_CC_UPDATED , -/* We are exiting the TB, but have neither emitted a goto_tb, nor -updated the PC for the next instruction to be executed. */ -EXIT_PC_STALE , -/* We are exiting the TB to the main loop. */ -EXIT_PC_STALE_NOCHAIN , -/* We are ending the TB with a noreturn function call, e.g. longjmp. -No following code will be executed. */ -EXIT_NORETURN , -}ExitStatus ; + +/* We are not using a goto_tb (for whatever reason), but have updated +the PC (for whatever reason), so there's no need to do it again on +exiting the TB. */ +#define DISAS_PC_UPDATED DISAS_TARGET_0 + +/* We have emitted one or more goto_tb. No fixup required. */ +#define DISAS_GOTO_TB DISAS_TARGET_1 + +/* We have updated the PC and CC values. */ +#define DISAS_PC_CC_UPDATED DISAS_TARGET_2 + +/* We are exiting the TB, but have neither emitted a goto_tb, nor +updated the PC for the next instruction to be executed. */ +#define DISAS_PC_STALE DISAS_TARGET_3 + +/* We are exiting the TB to the main loop. */ +#define DISAS_PC_STALE_NOCHAIN DISAS_TARGET_4struct DisasInsn {unsigned opc:16 ;
@@ -1121,7 +1117,7 @@ struct DisasInsn {void (*help_prep)(DisasContext *,DisasFields *,DisasOps *);void (*help_wout)(DisasContext *,DisasFields *,DisasOps *);void (*help_cout)(DisasContext *,DisasOps *); -ExitStatus (*help_op)(DisasContext *,DisasOps *); +DisasJumpType (*help_op)(DisasContext *,DisasOps *);uint64_t data; };
@@ -1143,11 +1139,11 @@ static void help_l2_shift(DisasContext *s, DisasFields *f, } } -static ExitStatus help_goto_direct (DisasContext *s,uint64_t dest) +static DisasJumpType help_goto_direct (DisasContext *s,uint64_t dest) {if (dest == s->next_pc) {per_branch (s, true); -return NO_EXIT ; +return DISAS_NEXT ; }if (use_goto_tb (s, dest)) {update_cc_op (s);
@@ -1155,31 +1151,31 @@ static ExitStatus help_goto_direct(DisasContext *s, uint64_t dest)tcg_gen_goto_tb (0 );tcg_gen_movi_i64 (psw_addr, dest);tcg_gen_exit_tb ((uintptr_t )s->tb); -return EXIT_GOTO_TB ; +return DISAS_GOTO_TB ; }else {tcg_gen_movi_i64 (psw_addr, dest);per_branch (s, false); -return EXIT_PC_UPDATED ; +return DISAS_PC_UPDATED ; } } -static ExitStatus help_branch (DisasContext *s,DisasCompare *c, -bool is_imm,int imm,TCGv_i64 cdest) +static DisasJumpType help_branch (DisasContext *s,DisasCompare *c, +bool is_imm,int imm,TCGv_i64 cdest) { -ExitStatus ret; +DisasJumpType ret;uint64_t dest = s->pc +2 * imm;TCGLabel *lab;/* Take care of the special cases first. */ if (c->cond ==TCG_COND_NEVER ) { - ret =NO_EXIT ; + ret =DISAS_NEXT ; goto egress; }if (is_imm) {if (dest == s->next_pc) {/* Branch to next. */ per_branch (s, true); - ret =NO_EXIT ; + ret =DISAS_NEXT ; goto egress; }if (c->cond ==TCG_COND_ALWAYS ) {
@@ -1189,13 +1185,13 @@ static ExitStatus help_branch(DisasContext *s, DisasCompare *c, }else {if (!cdest) {/* E.g. bcr %r0 -> no branch. */ - ret =NO_EXIT ; + ret =DISAS_NEXT ; goto egress; }if (c->cond ==TCG_COND_ALWAYS ) {tcg_gen_mov_i64 (psw_addr, cdest);per_branch (s, false); - ret =EXIT_PC_UPDATED ; + ret =DISAS_PC_UPDATED ; goto egress; } }
@@ -1224,7 +1220,7 @@ static ExitStatus help_branch(DisasContext *s, DisasCompare *c,tcg_gen_movi_i64 (psw_addr, dest);tcg_gen_exit_tb ((uintptr_t )s->tb +1 ); - ret =EXIT_GOTO_TB ; + ret =DISAS_GOTO_TB ; }else {/* Fallthru can use goto_tb, but taken branch cannot. */ /* Store taken branch destination before the brcond. This
@@ -1252,7 +1248,7 @@ static ExitStatus help_branch(DisasContext *s, DisasCompare *c,tcg_gen_movi_i64 (psw_addr, dest); }per_breaking_event (s); - ret =EXIT_PC_UPDATED ; + ret =DISAS_PC_UPDATED ; } }else {/* Fallthru cannot use goto_tb. This by itself is vanishingly rare.
@@ -1286,7 +1282,7 @@ static ExitStatus help_branch(DisasContext *s, DisasCompare *c, }tcg_temp_free_i64 (next); - ret =EXIT_PC_UPDATED ; + ret =DISAS_PC_UPDATED ; } egress:
@@ -1298,7 +1294,7 @@ static ExitStatus help_branch(DisasContext *s, DisasCompare *c,/* The operations. These perform the bulk of the work for any insn, usually after the operands have been loaded and output initialized. */ -static ExitStatus op_abs (DisasContext *s,DisasOps *o) +static DisasJumpType op_abs (DisasContext *s,DisasOps *o) {TCGv_i64 z, n; z =tcg_const_i64 (0 );
@@ -1307,35 +1303,35 @@ static ExitStatus op_abs(DisasContext *s, DisasOps *o)tcg_gen_movcond_i64 (TCG_COND_LT , o->out, o->in2, z, n, o->in2);tcg_temp_free_i64 (n);tcg_temp_free_i64 (z); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_absf32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_absf32 (DisasContext *s,DisasOps *o) {tcg_gen_andi_i64 (o->out, o->in2,0x7fffffffull ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_absf64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_absf64 (DisasContext *s,DisasOps *o) {tcg_gen_andi_i64 (o->out, o->in2,0x7fffffffffffffffull ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_absf128 (DisasContext *s,DisasOps *o) +static DisasJumpType op_absf128 (DisasContext *s,DisasOps *o) {tcg_gen_andi_i64 (o->out, o->in1,0x7fffffffffffffffull );tcg_gen_mov_i64 (o->out2, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_add (DisasContext *s,DisasOps *o) +static DisasJumpType op_add (DisasContext *s,DisasOps *o) {tcg_gen_add_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_addc (DisasContext *s,DisasOps *o) +static DisasJumpType op_addc (DisasContext *s,DisasOps *o) {DisasCompare cmp;TCGv_i64 carry;
@@ -1359,10 +1355,10 @@ static ExitStatus op_addc(DisasContext *s, DisasOps *o)tcg_gen_add_i64 (o->out, o->out, carry);tcg_temp_free_i64 (carry); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_asi (DisasContext *s,DisasOps *o) +static DisasJumpType op_asi (DisasContext *s,DisasOps *o) { o->in1 =tcg_temp_new_i64 ();
@@ -1380,35 +1376,35 @@ static ExitStatus op_asi(DisasContext *s, DisasOps *o)if (!s390_has_feat (S390_FEAT_STFLE_45 )) {tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s), s->insn->data); } -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_aeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_aeb (DisasContext *s,DisasOps *o) {gen_helper_aeb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_adb (DisasContext *s,DisasOps *o) +static DisasJumpType op_adb (DisasContext *s,DisasOps *o) {gen_helper_adb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_axb (DisasContext *s,DisasOps *o) +static DisasJumpType op_axb (DisasContext *s,DisasOps *o) {gen_helper_axb (o->out, cpu_env, o->out, o->out2, o->in1, o->in2);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_and (DisasContext *s,DisasOps *o) +static DisasJumpType op_and (DisasContext *s,DisasOps *o) {tcg_gen_and_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_andi (DisasContext *s,DisasOps *o) +static DisasJumpType op_andi (DisasContext *s,DisasOps *o) {int shift = s->insn->data &0xff ;int size = s->insn->data >>8 ;
@@ -1422,10 +1418,10 @@ static ExitStatus op_andi(DisasContext *s, DisasOps *o)/* Produce the CC from only the bits manipulated. */ tcg_gen_andi_i64 (cc_dst, o->out, mask);set_cc_nz_u64 (s, cc_dst); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ni (DisasContext *s,DisasOps *o) +static DisasJumpType op_ni (DisasContext *s,DisasOps *o) { o->in1 =tcg_temp_new_i64 ();
@@ -1443,28 +1439,28 @@ static ExitStatus op_ni(DisasContext *s, DisasOps *o)if (!s390_has_feat (S390_FEAT_INTERLOCKED_ACCESS_2 )) {tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s), s->insn->data); } -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_bas (DisasContext *s,DisasOps *o) +static DisasJumpType op_bas (DisasContext *s,DisasOps *o) {tcg_gen_movi_i64 (o->out,pc_to_link_info (s, s->next_pc));if (o->in2) {tcg_gen_mov_i64 (psw_addr, o->in2);per_branch (s, false); -return EXIT_PC_UPDATED ; +return DISAS_PC_UPDATED ; }else { -return NO_EXIT ; +return DISAS_NEXT ; } } -static ExitStatus op_basi (DisasContext *s,DisasOps *o) +static DisasJumpType op_basi (DisasContext *s,DisasOps *o) {tcg_gen_movi_i64 (o->out,pc_to_link_info (s, s->next_pc));return help_goto_direct (s, s->pc +2 *get_field (s->fields, i2)); } -static ExitStatus op_bc (DisasContext *s,DisasOps *o) +static DisasJumpType op_bc (DisasContext *s,DisasOps *o) {int m1 =get_field (s->fields, m1);bool is_imm =have_field (s->fields, i2);
@@ -1483,14 +1479,14 @@ static ExitStatus op_bc(DisasContext *s, DisasOps *o)/* FIXME: perform checkpoint-synchronisation */ tcg_gen_mb (TCG_MO_ALL |TCG_BAR_SC ); } -return NO_EXIT ; +return DISAS_NEXT ; }disas_jcc (s, &c, m1);return help_branch (s, &c, is_imm, imm, o->in2); } -static ExitStatus op_bct32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_bct32 (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);bool is_imm =have_field (s->fields, i2);
@@ -1514,7 +1510,7 @@ static ExitStatus op_bct32(DisasContext *s, DisasOps *o)return help_branch (s, &c, is_imm, imm, o->in2); } -static ExitStatus op_bcth (DisasContext *s,DisasOps *o) +static DisasJumpType op_bcth (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int imm =get_field (s->fields, i2);
@@ -1538,7 +1534,7 @@ static ExitStatus op_bcth(DisasContext *s, DisasOps *o)return help_branch (s, &c,1 , imm, o->in2); } -static ExitStatus op_bct64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_bct64 (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);bool is_imm =have_field (s->fields, i2);
@@ -1557,7 +1553,7 @@ static ExitStatus op_bct64(DisasContext *s, DisasOps *o)return help_branch (s, &c, is_imm, imm, o->in2); } -static ExitStatus op_bx32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_bx32 (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -1583,7 +1579,7 @@ static ExitStatus op_bx32(DisasContext *s, DisasOps *o)return help_branch (s, &c, is_imm, imm, o->in2); } -static ExitStatus op_bx64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_bx64 (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -1609,7 +1605,7 @@ static ExitStatus op_bx64(DisasContext *s, DisasOps *o)return help_branch (s, &c, is_imm, imm, o->in2); } -static ExitStatus op_cj (DisasContext *s,DisasOps *o) +static DisasJumpType op_cj (DisasContext *s,DisasOps *o) {int imm, m3 =get_field (s->fields, m3);bool is_imm;
@@ -1635,186 +1631,186 @@ static ExitStatus op_cj(DisasContext *s, DisasOps *o)return help_branch (s, &c, is_imm, imm, o->out); } -static ExitStatus op_ceb (DisasContext *s,DisasOps *o) +static DisasJumpType op_ceb (DisasContext *s,DisasOps *o) {gen_helper_ceb (cc_op, cpu_env, o->in1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cdb (DisasContext *s,DisasOps *o) {gen_helper_cdb (cc_op, cpu_env, o->in1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cxb (DisasContext *s,DisasOps *o) {gen_helper_cxb (cc_op, cpu_env, o->out, o->out2, o->in1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cfeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cfeb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cfeb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f32 (s, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cfdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cfdb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cfdb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f64 (s, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cfxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cfxb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cfxb (o->out, cpu_env, o->in1, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f128 (s, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cgeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cgeb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cgeb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f32 (s, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cgdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cgdb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cgdb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f64 (s, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cgxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cgxb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cgxb (o->out, cpu_env, o->in1, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f128 (s, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clfeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_clfeb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_clfeb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f32 (s, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clfdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_clfdb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_clfdb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f64 (s, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clfxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_clfxb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_clfxb (o->out, cpu_env, o->in1, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f128 (s, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clgeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_clgeb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_clgeb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f32 (s, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clgdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_clgdb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_clgdb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f64 (s, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clgxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_clgxb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_clgxb (o->out, cpu_env, o->in1, o->in2, m3);tcg_temp_free_i32 (m3);gen_set_cc_nz_f128 (s, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cegb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cegb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cegb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cdgb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cdgb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cdgb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cxgb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cxgb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cxgb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_celgb (DisasContext *s,DisasOps *o) +static DisasJumpType op_celgb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_celgb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cdlgb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cdlgb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cdlgb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cxlgb (DisasContext *s,DisasOps *o) +static DisasJumpType op_cxlgb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_cxlgb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cksm (DisasContext *s,DisasOps *o) +static DisasJumpType op_cksm (DisasContext *s,DisasOps *o) {int r2 =get_field (s->fields, r2);TCGv_i64 len =tcg_temp_new_i64 ();
@@ -1827,10 +1823,10 @@ static ExitStatus op_cksm(DisasContext *s, DisasOps *o)tcg_gen_sub_i64 (regs[r2 +1 ], regs[r2 +1 ], len);tcg_temp_free_i64 (len); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clc (DisasContext *s,DisasOps *o) +static DisasJumpType op_clc (DisasContext *s,DisasOps *o) {int l =get_field (s->fields, l1);TCGv_i32 vl;
@@ -1857,13 +1853,13 @@ static ExitStatus op_clc(DisasContext *s, DisasOps *o)gen_helper_clc (cc_op, cpu_env, vl, o->addr1, o->in2);tcg_temp_free_i32 (vl);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; }gen_op_update2_cc_i64 (s,CC_OP_LTUGTU_64 , cc_src, cc_dst); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clcl (DisasContext *s,DisasOps *o) +static DisasJumpType op_clcl (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r2 =get_field (s->fields, r2);
@@ -1872,7 +1868,7 @@ static ExitStatus op_clcl(DisasContext *s, DisasOps *o)/* r1 and r2 must be even. */ if (r1 &1 || r2 &1 ) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } t1 =tcg_const_i32 (r1);
@@ -1881,10 +1877,10 @@ static ExitStatus op_clcl(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t1);tcg_temp_free_i32 (t2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clcle (DisasContext *s,DisasOps *o) +static DisasJumpType op_clcle (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -1893,7 +1889,7 @@ static ExitStatus op_clcle(DisasContext *s, DisasOps *o)/* r1 and r3 must be even. */ if (r1 &1 || r3 &1 ) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } t1 =tcg_const_i32 (r1);
@@ -1902,10 +1898,10 @@ static ExitStatus op_clcle(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t1);tcg_temp_free_i32 (t3);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clclu (DisasContext *s,DisasOps *o) +static DisasJumpType op_clclu (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -1914,7 +1910,7 @@ static ExitStatus op_clclu(DisasContext *s, DisasOps *o)/* r1 and r3 must be even. */ if (r1 &1 || r3 &1 ) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } t1 =tcg_const_i32 (r1);
@@ -1923,10 +1919,10 @@ static ExitStatus op_clclu(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t1);tcg_temp_free_i32 (t3);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clm (DisasContext *s,DisasOps *o) +static DisasJumpType op_clm (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));TCGv_i32 t1 =tcg_temp_new_i32 ();
@@ -1935,28 +1931,28 @@ static ExitStatus op_clm(DisasContext *s, DisasOps *o)set_cc_static (s);tcg_temp_free_i32 (t1);tcg_temp_free_i32 (m3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_clst (DisasContext *s,DisasOps *o) +static DisasJumpType op_clst (DisasContext *s,DisasOps *o) {gen_helper_clst (o->in1, cpu_env, regs[0 ], o->in1, o->in2);set_cc_static (s);return_low128 (o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cps (DisasContext *s,DisasOps *o) +static DisasJumpType op_cps (DisasContext *s,DisasOps *o) {TCGv_i64 t =tcg_temp_new_i64 ();tcg_gen_andi_i64 (t, o->in1,0x8000000000000000ull );tcg_gen_andi_i64 (o->out, o->in2,0x7fffffffffffffffull );tcg_gen_or_i64 (o->out, o->out, t);tcg_temp_free_i64 (t); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cs (DisasContext *s,DisasOps *o) +static DisasJumpType op_cs (DisasContext *s,DisasOps *o) {int d2 =get_field (s->fields, d2);int b2 =get_field (s->fields, b2);
@@ -1978,10 +1974,10 @@ static ExitStatus op_cs(DisasContext *s, DisasOps *o)tcg_temp_free_i64 (cc);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cdsg (DisasContext *s,DisasOps *o) +static DisasJumpType op_cdsg (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -2004,10 +2000,10 @@ static ExitStatus op_cdsg(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t_r3);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_csst (DisasContext *s,DisasOps *o) +static DisasJumpType op_csst (DisasContext *s,DisasOps *o) {int r3 =get_field (s->fields, r3);TCGv_i32 t_r3 =tcg_const_i32 (r3);
@@ -2020,11 +2016,11 @@ static ExitStatus op_csst(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t_r3);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_csp (DisasContext *s,DisasOps *o) +static DisasJumpType op_csp (DisasContext *s,DisasOps *o) {TCGMemOp mop = s->insn->data;TCGv_i64 addr, old, cc;
@@ -2065,11 +2061,11 @@ static ExitStatus op_csp(DisasContext *s, DisasOps *o)gen_helper_purge (cpu_env);gen_set_label (lab); - return NO_EXIT; + return DISAS_NEXT; }#endif -static ExitStatus op_cvd (DisasContext *s,DisasOps *o) +static DisasJumpType op_cvd (DisasContext *s,DisasOps *o) {TCGv_i64 t1 =tcg_temp_new_i64 ();TCGv_i32 t2 =tcg_temp_new_i32 ();
@@ -2078,10 +2074,10 @@ static ExitStatus op_cvd(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t2);tcg_gen_qemu_st64 (t1, o->in2,get_mem_index (s));tcg_temp_free_i64 (t1); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ct (DisasContext *s,DisasOps *o) +static DisasJumpType op_ct (DisasContext *s,DisasOps *o) {int m3 =get_field (s->fields, m3);TCGLabel *lab =gen_new_label ();
@@ -2097,10 +2093,10 @@ static ExitStatus op_ct(DisasContext *s, DisasOps *o)gen_trap (s);gen_set_label (lab); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_cuXX (DisasContext *s,DisasOps *o) +static DisasJumpType op_cuXX (DisasContext *s,DisasOps *o) {int m3 =get_field (s->fields, m3);int r1 =get_field (s->fields, r1);
@@ -2110,7 +2106,7 @@ static ExitStatus op_cuXX(DisasContext *s, DisasOps *o)/* R1 and R2 must both be even. */ if ((r1 | r2) &1 ) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; }if (!s390_has_feat (S390_FEAT_ETF3_ENH )) { m3 =0 ;
@@ -2147,11 +2143,11 @@ static ExitStatus op_cuXX(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (tr2);tcg_temp_free_i32 (chk);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_diag (DisasContext *s,DisasOps *o) +static DisasJumpType op_diag (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));
@@ -2163,78 +2159,78 @@ static ExitStatus op_diag(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (func_code);tcg_temp_free_i32 (r3);tcg_temp_free_i32 (r1); -return NO_EXIT ; +return DISAS_NEXT ; }#endif -static ExitStatus op_divs32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_divs32 (DisasContext *s,DisasOps *o) {gen_helper_divs32 (o->out2, cpu_env, o->in1, o->in2);return_low128 (o->out); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_divu32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_divu32 (DisasContext *s,DisasOps *o) {gen_helper_divu32 (o->out2, cpu_env, o->in1, o->in2);return_low128 (o->out); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_divs64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_divs64 (DisasContext *s,DisasOps *o) {gen_helper_divs64 (o->out2, cpu_env, o->in1, o->in2);return_low128 (o->out); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_divu64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_divu64 (DisasContext *s,DisasOps *o) {gen_helper_divu64 (o->out2, cpu_env, o->out, o->out2, o->in2);return_low128 (o->out); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_deb (DisasContext *s,DisasOps *o) +static DisasJumpType op_deb (DisasContext *s,DisasOps *o) {gen_helper_deb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ddb (DisasContext *s,DisasOps *o) +static DisasJumpType op_ddb (DisasContext *s,DisasOps *o) {gen_helper_ddb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_dxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_dxb (DisasContext *s,DisasOps *o) {gen_helper_dxb (o->out, cpu_env, o->out, o->out2, o->in1, o->in2);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ear (DisasContext *s,DisasOps *o) +static DisasJumpType op_ear (DisasContext *s,DisasOps *o) {int r2 =get_field (s->fields, r2); tcg_gen_ld32u_i64(o->out, cpu_env, offsetof(CPUS390XState, aregs[r2])); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ecag (DisasContext *s,DisasOps *o) +static DisasJumpType op_ecag (DisasContext *s,DisasOps *o) {/* No cache information provided. */ tcg_gen_movi_i64 (o->out,-1 ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_efpc (DisasContext *s,DisasOps *o) +static DisasJumpType op_efpc (DisasContext *s,DisasOps *o) {tcg_gen_ld32u_i64 (o->out, cpu_env, offsetof(CPUS390XState , fpc)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_epsw (DisasContext *s,DisasOps *o) +static DisasJumpType op_epsw (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r2 =get_field (s->fields, r2);
@@ -2249,10 +2245,10 @@ static ExitStatus op_epsw(DisasContext *s, DisasOps *o) }tcg_temp_free_i64 (t); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ex (DisasContext *s,DisasOps *o) +static DisasJumpType op_ex (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);TCGv_i32 ilen;
@@ -2261,7 +2257,7 @@ static ExitStatus op_ex(DisasContext *s, DisasOps *o)/* Nested EXECUTE is not allowed. */ if (unlikely (s->ex_value)) {gen_program_exception (s,PGM_EXECUTE ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; }update_psw_addr (s);
@@ -2281,35 +2277,35 @@ static ExitStatus op_ex(DisasContext *s, DisasOps *o)tcg_temp_free_i64 (v1); } -return EXIT_PC_CC_UPDATED ; +return DISAS_PC_CC_UPDATED ; } -static ExitStatus op_fieb (DisasContext *s,DisasOps *o) +static DisasJumpType op_fieb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_fieb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_fidb (DisasContext *s,DisasOps *o) +static DisasJumpType op_fidb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_fidb (o->out, cpu_env, o->in2, m3);tcg_temp_free_i32 (m3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_fixb (DisasContext *s,DisasOps *o) +static DisasJumpType op_fixb (DisasContext *s,DisasOps *o) {TCGv_i32 m3 =tcg_const_i32 (get_field (s->fields, m3));gen_helper_fixb (o->out, cpu_env, o->in1, o->in2, m3);return_low128 (o->out2);tcg_temp_free_i32 (m3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_flogr (DisasContext *s,DisasOps *o) +static DisasJumpType op_flogr (DisasContext *s,DisasOps *o) {/* We'll use the original input for cc computation, since we get to compare that against 0, which ought to be better than comparing
@@ -2326,10 +2322,10 @@ static ExitStatus op_flogr(DisasContext *s, DisasOps *o)tcg_gen_movi_i64 (o->out2,0x8000000000000000ull );tcg_gen_shr_i64 (o->out2, o->out2, o->out);tcg_gen_andc_i64 (o->out2, cc_dst, o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_icm (DisasContext *s,DisasOps *o) +static DisasJumpType op_icm (DisasContext *s,DisasOps *o) {int m3 =get_field (s->fields, m3);int pos, len, base = s->insn->data;
@@ -2386,18 +2382,18 @@ static ExitStatus op_icm(DisasContext *s, DisasOps *o)tcg_gen_movi_i64 (tmp, ccm);gen_op_update2_cc_i64 (s,CC_OP_ICM , tmp, o->out);tcg_temp_free_i64 (tmp); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_insi (DisasContext *s,DisasOps *o) +static DisasJumpType op_insi (DisasContext *s,DisasOps *o) {int shift = s->insn->data &0xff ;int size = s->insn->data >>8 ;tcg_gen_deposit_i64 (o->out, o->in1, o->in2, shift, size); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ipm (DisasContext *s,DisasOps *o) +static DisasJumpType op_ipm (DisasContext *s,DisasOps *o) {TCGv_i64 t1;
@@ -2413,11 +2409,11 @@ static ExitStatus op_ipm(DisasContext *s, DisasOps *o)tcg_gen_shli_i64 (t1, t1,28 );tcg_gen_or_i64 (o->out, o->out, t1);tcg_temp_free_i64 (t1); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_idte (DisasContext *s,DisasOps *o) +static DisasJumpType op_idte (DisasContext *s,DisasOps *o) {TCGv_i32 m4;
@@ -2429,10 +2425,10 @@ static ExitStatus op_idte(DisasContext *s, DisasOps *o) }gen_helper_idte (cpu_env, o->in1, o->in2, m4);tcg_temp_free_i32 (m4); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ipte (DisasContext *s,DisasOps *o) +static DisasJumpType op_ipte (DisasContext *s,DisasOps *o) {TCGv_i32 m4;
@@ -2444,18 +2440,18 @@ static ExitStatus op_ipte(DisasContext *s, DisasOps *o) }gen_helper_ipte (cpu_env, o->in1, o->in2, m4);tcg_temp_free_i32 (m4); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_iske (DisasContext *s,DisasOps *o) +static DisasJumpType op_iske (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_iske (o->out, cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; }#endif -static ExitStatus op_msa (DisasContext *s,DisasOps *o) +static DisasJumpType op_msa (DisasContext *s,DisasOps *o) {int r1 =have_field (s->fields, r1) ?get_field (s->fields, r1) :0 ;int r2 =have_field (s->fields, r2) ?get_field (s->fields, r2) :0 ;
@@ -2466,7 +2462,7 @@ static ExitStatus op_msa(DisasContext *s, DisasOps *o)case S390_FEAT_TYPE_KMCTR :if (r3 &1 || !r3) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; }/* FALL THROUGH */ case S390_FEAT_TYPE_PPNO :
@@ -2476,7 +2472,7 @@ static ExitStatus op_msa(DisasContext *s, DisasOps *o)case S390_FEAT_TYPE_KM :if (r1 &1 || !r1) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; }/* FALL THROUGH */ case S390_FEAT_TYPE_KMAC :
@@ -2484,7 +2480,7 @@ static ExitStatus op_msa(DisasContext *s, DisasOps *o)case S390_FEAT_TYPE_KLMD :if (r2 &1 || !r2) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; }/* FALL THROUGH */ case S390_FEAT_TYPE_PCKMO :
@@ -2504,31 +2500,31 @@ static ExitStatus op_msa(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t_r2);tcg_temp_free_i32 (t_r3);tcg_temp_free_i32 (type); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_keb (DisasContext *s,DisasOps *o) +static DisasJumpType op_keb (DisasContext *s,DisasOps *o) {gen_helper_keb (cc_op, cpu_env, o->in1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_kdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_kdb (DisasContext *s,DisasOps *o) {gen_helper_kdb (cc_op, cpu_env, o->in1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_kxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_kxb (DisasContext *s,DisasOps *o) {gen_helper_kxb (cc_op, cpu_env, o->out, o->out2, o->in1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_laa (DisasContext *s,DisasOps *o) +static DisasJumpType op_laa (DisasContext *s,DisasOps *o) {/* The real output is indeed the original value in memory; recompute the addition for the computation of CC. */
@@ -2536,10 +2532,10 @@ static ExitStatus op_laa(DisasContext *s, DisasOps *o) s->insn->data | MO_ALIGN);/* However, we need to recompute the addition for setting CC. */ tcg_gen_add_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lan (DisasContext *s,DisasOps *o) +static DisasJumpType op_lan (DisasContext *s,DisasOps *o) {/* The real output is indeed the original value in memory; recompute the addition for the computation of CC. */
@@ -2547,10 +2543,10 @@ static ExitStatus op_lan(DisasContext *s, DisasOps *o) s->insn->data | MO_ALIGN);/* However, we need to recompute the operation for setting CC. */ tcg_gen_and_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lao (DisasContext *s,DisasOps *o) +static DisasJumpType op_lao (DisasContext *s,DisasOps *o) {/* The real output is indeed the original value in memory; recompute the addition for the computation of CC. */
@@ -2558,10 +2554,10 @@ static ExitStatus op_lao(DisasContext *s, DisasOps *o) s->insn->data | MO_ALIGN);/* However, we need to recompute the operation for setting CC. */ tcg_gen_or_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lax (DisasContext *s,DisasOps *o) +static DisasJumpType op_lax (DisasContext *s,DisasOps *o) {/* The real output is indeed the original value in memory; recompute the addition for the computation of CC. */
@@ -2569,96 +2565,96 @@ static ExitStatus op_lax(DisasContext *s, DisasOps *o) s->insn->data | MO_ALIGN);/* However, we need to recompute the operation for setting CC. */ tcg_gen_xor_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ldeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_ldeb (DisasContext *s,DisasOps *o) {gen_helper_ldeb (o->out, cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ledb (DisasContext *s,DisasOps *o) +static DisasJumpType op_ledb (DisasContext *s,DisasOps *o) {gen_helper_ledb (o->out, cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ldxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_ldxb (DisasContext *s,DisasOps *o) {gen_helper_ldxb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lexb (DisasContext *s,DisasOps *o) +static DisasJumpType op_lexb (DisasContext *s,DisasOps *o) {gen_helper_lexb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lxdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_lxdb (DisasContext *s,DisasOps *o) {gen_helper_lxdb (o->out, cpu_env, o->in2);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lxeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_lxeb (DisasContext *s,DisasOps *o) {gen_helper_lxeb (o->out, cpu_env, o->in2);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_llgt (DisasContext *s,DisasOps *o) +static DisasJumpType op_llgt (DisasContext *s,DisasOps *o) {tcg_gen_andi_i64 (o->out, o->in2,0x7fffffff ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ld8s (DisasContext *s,DisasOps *o) +static DisasJumpType op_ld8s (DisasContext *s,DisasOps *o) {tcg_gen_qemu_ld8s (o->out, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ld8u (DisasContext *s,DisasOps *o) +static DisasJumpType op_ld8u (DisasContext *s,DisasOps *o) {tcg_gen_qemu_ld8u (o->out, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ld16s (DisasContext *s,DisasOps *o) +static DisasJumpType op_ld16s (DisasContext *s,DisasOps *o) {tcg_gen_qemu_ld16s (o->out, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ld16u (DisasContext *s,DisasOps *o) +static DisasJumpType op_ld16u (DisasContext *s,DisasOps *o) {tcg_gen_qemu_ld16u (o->out, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ld32s (DisasContext *s,DisasOps *o) +static DisasJumpType op_ld32s (DisasContext *s,DisasOps *o) {tcg_gen_qemu_ld32s (o->out, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ld32u (DisasContext *s,DisasOps *o) +static DisasJumpType op_ld32u (DisasContext *s,DisasOps *o) {tcg_gen_qemu_ld32u (o->out, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ld64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_ld64 (DisasContext *s,DisasOps *o) {tcg_gen_qemu_ld64 (o->out, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lat (DisasContext *s,DisasOps *o) +static DisasJumpType op_lat (DisasContext *s,DisasOps *o) {TCGLabel *lab =gen_new_label ();store_reg32_i64 (get_field (s->fields, r1), o->in2);
@@ -2666,10 +2662,10 @@ static ExitStatus op_lat(DisasContext *s, DisasOps *o)tcg_gen_brcondi_i64 (TCG_COND_NE , o->in2,0 , lab);gen_trap (s);gen_set_label (lab); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lgat (DisasContext *s,DisasOps *o) +static DisasJumpType op_lgat (DisasContext *s,DisasOps *o) {TCGLabel *lab =gen_new_label ();tcg_gen_qemu_ld64 (o->out, o->in2,get_mem_index (s));
@@ -2677,10 +2673,10 @@ static ExitStatus op_lgat(DisasContext *s, DisasOps *o)tcg_gen_brcondi_i64 (TCG_COND_NE , o->out,0 , lab);gen_trap (s);gen_set_label (lab); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lfhat (DisasContext *s,DisasOps *o) +static DisasJumpType op_lfhat (DisasContext *s,DisasOps *o) {TCGLabel *lab =gen_new_label ();store_reg32h_i64 (get_field (s->fields, r1), o->in2);
@@ -2688,10 +2684,10 @@ static ExitStatus op_lfhat(DisasContext *s, DisasOps *o)tcg_gen_brcondi_i64 (TCG_COND_NE , o->in2,0 , lab);gen_trap (s);gen_set_label (lab); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_llgfat (DisasContext *s,DisasOps *o) +static DisasJumpType op_llgfat (DisasContext *s,DisasOps *o) {TCGLabel *lab =gen_new_label ();tcg_gen_qemu_ld32u (o->out, o->in2,get_mem_index (s));
@@ -2699,10 +2695,10 @@ static ExitStatus op_llgfat(DisasContext *s, DisasOps *o)tcg_gen_brcondi_i64 (TCG_COND_NE , o->out,0 , lab);gen_trap (s);gen_set_label (lab); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_llgtat (DisasContext *s,DisasOps *o) +static DisasJumpType op_llgtat (DisasContext *s,DisasOps *o) {TCGLabel *lab =gen_new_label ();tcg_gen_andi_i64 (o->out, o->in2,0x7fffffff );
@@ -2710,10 +2706,10 @@ static ExitStatus op_llgtat(DisasContext *s, DisasOps *o)tcg_gen_brcondi_i64 (TCG_COND_NE , o->out,0 , lab);gen_trap (s);gen_set_label (lab); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_loc (DisasContext *s,DisasOps *o) +static DisasJumpType op_loc (DisasContext *s,DisasOps *o) {DisasCompare c;
@@ -2740,11 +2736,11 @@ static ExitStatus op_loc(DisasContext *s, DisasOps *o)tcg_temp_free_i64 (z); } -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_lctl (DisasContext *s,DisasOps *o) +static DisasJumpType op_lctl (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));
@@ -2753,10 +2749,10 @@ static ExitStatus op_lctl(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (r1);tcg_temp_free_i32 (r3);/* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ -return EXIT_PC_STALE_NOCHAIN ; +return DISAS_PC_STALE_NOCHAIN ; } -static ExitStatus op_lctlg (DisasContext *s,DisasOps *o) +static DisasJumpType 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));
@@ -2765,26 +2761,26 @@ static ExitStatus op_lctlg(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (r1);tcg_temp_free_i32 (r3);/* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ -return EXIT_PC_STALE_NOCHAIN ; +return DISAS_PC_STALE_NOCHAIN ; } -static ExitStatus op_lra (DisasContext *s,DisasOps *o) +static DisasJumpType op_lra (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_lra (o->out, cpu_env, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lpp (DisasContext *s,DisasOps *o) +static DisasJumpType op_lpp (DisasContext *s,DisasOps *o) {check_privileged (s);tcg_gen_st_i64 (o->in2, cpu_env, offsetof(CPUS390XState , pp)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lpsw (DisasContext *s,DisasOps *o) +static DisasJumpType op_lpsw (DisasContext *s,DisasOps *o) {TCGv_i64 t1, t2;
@@ -2801,10 +2797,10 @@ static ExitStatus op_lpsw(DisasContext *s, DisasOps *o)gen_helper_load_psw (cpu_env, t1, t2);tcg_temp_free_i64 (t1);tcg_temp_free_i64 (t2); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } -static ExitStatus op_lpswe (DisasContext *s,DisasOps *o) +static DisasJumpType op_lpswe (DisasContext *s,DisasOps *o) {TCGv_i64 t1, t2;
@@ -2819,21 +2815,21 @@ static ExitStatus op_lpswe(DisasContext *s, DisasOps *o)gen_helper_load_psw (cpu_env, t1, t2);tcg_temp_free_i64 (t1);tcg_temp_free_i64 (t2); - return EXIT_NORETURN; + return DISAS_NORETURN; }#endif -static ExitStatus op_lam (DisasContext *s,DisasOps *o) +static DisasJumpType op_lam (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));gen_helper_lam (cpu_env, r1, o->in2, r3);tcg_temp_free_i32 (r1);tcg_temp_free_i32 (r3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lm32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_lm32 (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -2845,7 +2841,7 @@ static ExitStatus op_lm32(DisasContext *s, DisasOps *o)tcg_gen_qemu_ld32u (t1, o->in2,get_mem_index (s));store_reg32_i64 (r1, t1);tcg_temp_free (t1); -return NO_EXIT ; +return DISAS_NEXT ; }/* First load the values of the first and last registers to trigger
@@ -2861,7 +2857,7 @@ static ExitStatus op_lm32(DisasContext *s, DisasOps *o)if (((r1 +1 ) &15 ) == r3) {tcg_temp_free (t2);tcg_temp_free (t1); -return NO_EXIT ; +return DISAS_NEXT ; }/* Then load the remaining registers. Page fault can't occur. */
@@ -2876,10 +2872,10 @@ static ExitStatus op_lm32(DisasContext *s, DisasOps *o)tcg_temp_free (t2);tcg_temp_free (t1); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lmh (DisasContext *s,DisasOps *o) +static DisasJumpType op_lmh (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -2891,7 +2887,7 @@ static ExitStatus op_lmh(DisasContext *s, DisasOps *o)tcg_gen_qemu_ld32u (t1, o->in2,get_mem_index (s));store_reg32h_i64 (r1, t1);tcg_temp_free (t1); -return NO_EXIT ; +return DISAS_NEXT ; }/* First load the values of the first and last registers to trigger
@@ -2907,7 +2903,7 @@ static ExitStatus op_lmh(DisasContext *s, DisasOps *o)if (((r1 +1 ) &15 ) == r3) {tcg_temp_free (t2);tcg_temp_free (t1); -return NO_EXIT ; +return DISAS_NEXT ; }/* Then load the remaining registers. Page fault can't occur. */
@@ -2922,10 +2918,10 @@ static ExitStatus op_lmh(DisasContext *s, DisasOps *o)tcg_temp_free (t2);tcg_temp_free (t1); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lm64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_lm64 (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -2934,7 +2930,7 @@ static ExitStatus op_lm64(DisasContext *s, DisasOps *o)/* Only one register to read. */ if (unlikely (r1 == r3)) {tcg_gen_qemu_ld64 (regs[r1], o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; }/* First load the values of the first and last registers to trigger
@@ -2950,7 +2946,7 @@ static ExitStatus op_lm64(DisasContext *s, DisasOps *o)/* Only two registers to read. */ if (((r1 +1 ) &15 ) == r3) {tcg_temp_free (t1); -return NO_EXIT ; +return DISAS_NEXT ; }/* Then load the remaining registers. Page fault can't occur. */
@@ -2963,10 +2959,10 @@ static ExitStatus op_lm64(DisasContext *s, DisasOps *o) }tcg_temp_free (t1); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lpd (DisasContext *s,DisasOps *o) +static DisasJumpType op_lpd (DisasContext *s,DisasOps *o) {TCGv_i64 a1, a2;TCGMemOp mop = s->insn->data;
@@ -2976,7 +2972,7 @@ static ExitStatus op_lpd(DisasContext *s, DisasOps *o)update_psw_addr (s);update_cc_op (s);gen_exception (EXCP_ATOMIC ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; }/* In a serial context, perform the two loads ... */
@@ -2989,10 +2985,10 @@ static ExitStatus op_lpd(DisasContext *s, DisasOps *o)/* ... and indicate that we performed them while interlocked. */ gen_op_movi_cc (s,0 ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lpq (DisasContext *s,DisasOps *o) +static DisasJumpType op_lpq (DisasContext *s,DisasOps *o) {if (tb_cflags (s->tb) &CF_PARALLEL ) {gen_helper_lpq_parallel (o->out, cpu_env, o->in2);
@@ -3000,41 +2996,41 @@ static ExitStatus op_lpq(DisasContext *s, DisasOps *o)gen_helper_lpq (o->out, cpu_env, o->in2); }return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_lura (DisasContext *s,DisasOps *o) +static DisasJumpType op_lura (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_lura (o->out, cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_lurag (DisasContext *s,DisasOps *o) +static DisasJumpType op_lurag (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_lurag (o->out, cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; }#endif -static ExitStatus op_lzrb (DisasContext *s,DisasOps *o) +static DisasJumpType op_lzrb (DisasContext *s,DisasOps *o) {tcg_gen_andi_i64 (o->out, o->in2,-256 ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mov2 (DisasContext *s,DisasOps *o) +static DisasJumpType op_mov2 (DisasContext *s,DisasOps *o) { o->out = o->in2; o->g_out = o->g_in2; o->in2 =NULL ; o->g_in2 = false; -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mov2e (DisasContext *s,DisasOps *o) +static DisasJumpType op_mov2e (DisasContext *s,DisasOps *o) {int b2 =get_field (s->fields, b2);TCGv ar1 =tcg_temp_new_i64 ();
@@ -3066,10 +3062,10 @@ static ExitStatus op_mov2e(DisasContext *s, DisasOps *o) tcg_gen_st32_i64(ar1, cpu_env, offsetof(CPUS390XState, aregs[1]));tcg_temp_free_i64 (ar1); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_movx (DisasContext *s,DisasOps *o) +static DisasJumpType op_movx (DisasContext *s,DisasOps *o) { o->out = o->in1; o->out2 = o->in2;
@@ -3078,26 +3074,26 @@ static ExitStatus op_movx(DisasContext *s, DisasOps *o) o->in1 =NULL ; o->in2 =NULL ; o->g_in1 = o->g_in2 = false; -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvc (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvc (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_mvc (cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvcin (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvcin (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_mvcin (cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvcl (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvcl (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r2 =get_field (s->fields, r2);
@@ -3106,7 +3102,7 @@ static ExitStatus op_mvcl(DisasContext *s, DisasOps *o)/* r1 and r2 must be even. */ if (r1 &1 || r2 &1 ) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } t1 =tcg_const_i32 (r1);
@@ -3115,10 +3111,10 @@ static ExitStatus op_mvcl(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t1);tcg_temp_free_i32 (t2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvcle (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvcle (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -3127,7 +3123,7 @@ static ExitStatus op_mvcle(DisasContext *s, DisasOps *o)/* r1 and r3 must be even. */ if (r1 &1 || r3 &1 ) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } t1 =tcg_const_i32 (r1);
@@ -3136,10 +3132,10 @@ static ExitStatus op_mvcle(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t1);tcg_temp_free_i32 (t3);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvclu (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvclu (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -3148,7 +3144,7 @@ static ExitStatus op_mvclu(DisasContext *s, DisasOps *o)/* r1 and r3 must be even. */ if (r1 &1 || r3 &1 ) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } t1 =tcg_const_i32 (r1);
@@ -3157,151 +3153,151 @@ static ExitStatus op_mvclu(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t1);tcg_temp_free_i32 (t3);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvcos (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvcos (DisasContext *s,DisasOps *o) {int r3 =get_field (s->fields, r3);gen_helper_mvcos (cc_op, cpu_env, o->addr1, o->in2, regs[r3]);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_mvcp (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvcp (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, l1);check_privileged (s);gen_helper_mvcp (cc_op, cpu_env, regs[r1], o->addr1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvcs (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvcs (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, l1);check_privileged (s);gen_helper_mvcs (cc_op, cpu_env, regs[r1], o->addr1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; }#endif -static ExitStatus op_mvn (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvn (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_mvn (cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvo (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvo (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_mvo (cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvpg (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvpg (DisasContext *s,DisasOps *o) {gen_helper_mvpg (cc_op, cpu_env, regs[0 ], o->in1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvst (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvst (DisasContext *s,DisasOps *o) {gen_helper_mvst (o->in1, cpu_env, regs[0 ], o->in1, o->in2);set_cc_static (s);return_low128 (o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mvz (DisasContext *s,DisasOps *o) +static DisasJumpType op_mvz (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_mvz (cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mul (DisasContext *s,DisasOps *o) +static DisasJumpType op_mul (DisasContext *s,DisasOps *o) {tcg_gen_mul_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mul128 (DisasContext *s,DisasOps *o) +static DisasJumpType op_mul128 (DisasContext *s,DisasOps *o) {tcg_gen_mulu2_i64 (o->out2, o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_meeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_meeb (DisasContext *s,DisasOps *o) {gen_helper_meeb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mdeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_mdeb (DisasContext *s,DisasOps *o) {gen_helper_mdeb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_mdb (DisasContext *s,DisasOps *o) {gen_helper_mdb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_mxb (DisasContext *s,DisasOps *o) {gen_helper_mxb (o->out, cpu_env, o->out, o->out2, o->in1, o->in2);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mxdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_mxdb (DisasContext *s,DisasOps *o) {gen_helper_mxdb (o->out, cpu_env, o->out, o->out2, o->in2);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_maeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_maeb (DisasContext *s,DisasOps *o) {TCGv_i64 r3 =load_freg32_i64 (get_field (s->fields, r3));gen_helper_maeb (o->out, cpu_env, o->in1, o->in2, r3);tcg_temp_free_i64 (r3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_madb (DisasContext *s,DisasOps *o) +static DisasJumpType op_madb (DisasContext *s,DisasOps *o) {int r3 =get_field (s->fields, r3);gen_helper_madb (o->out, cpu_env, o->in1, o->in2, fregs[r3]); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_mseb (DisasContext *s,DisasOps *o) +static DisasJumpType op_mseb (DisasContext *s,DisasOps *o) {TCGv_i64 r3 =load_freg32_i64 (get_field (s->fields, r3));gen_helper_mseb (o->out, cpu_env, o->in1, o->in2, r3);tcg_temp_free_i64 (r3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_msdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_msdb (DisasContext *s,DisasOps *o) {int r3 =get_field (s->fields, r3);gen_helper_msdb (o->out, cpu_env, o->in1, o->in2, fregs[r3]); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_nabs (DisasContext *s,DisasOps *o) +static DisasJumpType op_nabs (DisasContext *s,DisasOps *o) {TCGv_i64 z, n; z =tcg_const_i64 (0 );
@@ -3310,78 +3306,78 @@ static ExitStatus op_nabs(DisasContext *s, DisasOps *o)tcg_gen_movcond_i64 (TCG_COND_GE , o->out, o->in2, z, n, o->in2);tcg_temp_free_i64 (n);tcg_temp_free_i64 (z); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_nabsf32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_nabsf32 (DisasContext *s,DisasOps *o) {tcg_gen_ori_i64 (o->out, o->in2,0x80000000ull ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_nabsf64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_nabsf64 (DisasContext *s,DisasOps *o) {tcg_gen_ori_i64 (o->out, o->in2,0x8000000000000000ull ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_nabsf128 (DisasContext *s,DisasOps *o) +static DisasJumpType op_nabsf128 (DisasContext *s,DisasOps *o) {tcg_gen_ori_i64 (o->out, o->in1,0x8000000000000000ull );tcg_gen_mov_i64 (o->out2, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_nc (DisasContext *s,DisasOps *o) +static DisasJumpType op_nc (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_nc (cc_op, cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_neg (DisasContext *s,DisasOps *o) +static DisasJumpType op_neg (DisasContext *s,DisasOps *o) {tcg_gen_neg_i64 (o->out, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_negf32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_negf32 (DisasContext *s,DisasOps *o) {tcg_gen_xori_i64 (o->out, o->in2,0x80000000ull ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_negf64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_negf64 (DisasContext *s,DisasOps *o) {tcg_gen_xori_i64 (o->out, o->in2,0x8000000000000000ull ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_negf128 (DisasContext *s,DisasOps *o) +static DisasJumpType op_negf128 (DisasContext *s,DisasOps *o) {tcg_gen_xori_i64 (o->out, o->in1,0x8000000000000000ull );tcg_gen_mov_i64 (o->out2, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_oc (DisasContext *s,DisasOps *o) +static DisasJumpType op_oc (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_oc (cc_op, cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_or (DisasContext *s,DisasOps *o) +static DisasJumpType op_or (DisasContext *s,DisasOps *o) {tcg_gen_or_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ori (DisasContext *s,DisasOps *o) +static DisasJumpType op_ori (DisasContext *s,DisasOps *o) {int shift = s->insn->data &0xff ;int size = s->insn->data >>8 ;
@@ -3394,10 +3390,10 @@ static ExitStatus op_ori(DisasContext *s, DisasOps *o)/* Produce the CC from only the bits manipulated. */ tcg_gen_andi_i64 (cc_dst, o->out, mask);set_cc_nz_u64 (s, cc_dst); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_oi (DisasContext *s,DisasOps *o) +static DisasJumpType op_oi (DisasContext *s,DisasOps *o) { o->in1 =tcg_temp_new_i64 ();
@@ -3415,18 +3411,18 @@ static ExitStatus op_oi(DisasContext *s, DisasOps *o)if (!s390_has_feat (S390_FEAT_INTERLOCKED_ACCESS_2 )) {tcg_gen_qemu_st_tl (o->out, o->addr1,get_mem_index (s), s->insn->data); } -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_pack (DisasContext *s,DisasOps *o) +static DisasJumpType op_pack (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_pack (cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_pka (DisasContext *s,DisasOps *o) +static DisasJumpType op_pka (DisasContext *s,DisasOps *o) {int l2 =get_field (s->fields, l2) +1 ;TCGv_i32 l;
@@ -3434,15 +3430,15 @@ static ExitStatus op_pka(DisasContext *s, DisasOps *o)/* The length must not exceed 32 bytes. */ if (l2 >32 ) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } l =tcg_const_i32 (l2);gen_helper_pka (cpu_env, o->addr1, o->in2, l);tcg_temp_free_i32 (l); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_pku (DisasContext *s,DisasOps *o) +static DisasJumpType op_pku (DisasContext *s,DisasOps *o) {int l2 =get_field (s->fields, l2) +1 ;TCGv_i32 l;
@@ -3450,30 +3446,30 @@ static ExitStatus op_pku(DisasContext *s, DisasOps *o)/* The length must be even and should not exceed 64 bytes. */ if ((l2 &1 ) || (l2 >64 )) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } l =tcg_const_i32 (l2);gen_helper_pku (cpu_env, o->addr1, o->in2, l);tcg_temp_free_i32 (l); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_popcnt (DisasContext *s,DisasOps *o) +static DisasJumpType op_popcnt (DisasContext *s,DisasOps *o) {gen_helper_popcnt (o->out, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_ptlb (DisasContext *s,DisasOps *o) +static DisasJumpType op_ptlb (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_ptlb (cpu_env); -return NO_EXIT ; +return DISAS_NEXT ; }#endif -static ExitStatus op_risbg (DisasContext *s,DisasOps *o) +static DisasJumpType op_risbg (DisasContext *s,DisasOps *o) {int i3 =get_field (s->fields, i3);int i4 =get_field (s->fields, i4);
@@ -3531,7 +3527,7 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)/* In some cases we can implement this with extract. */ if (imask ==0 && pos ==0 && len >0 && len <= rot) {tcg_gen_extract_i64 (o->out, o->in2,64 - rot, len); -return NO_EXIT ; +return DISAS_NEXT ; }/* In some cases we can implement this with deposit. */
@@ -3560,10 +3556,10 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)tcg_gen_andi_i64 (o->out, o->out, imask);tcg_gen_or_i64 (o->out, o->out, o->in2); } -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_rosbg (DisasContext *s,DisasOps *o) +static DisasJumpType op_rosbg (DisasContext *s,DisasOps *o) {int i3 =get_field (s->fields, i3);int i4 =get_field (s->fields, i4);
@@ -3613,28 +3609,28 @@ static ExitStatus op_rosbg(DisasContext *s, DisasOps *o)/* Set the CC. */ tcg_gen_andi_i64 (cc_dst, o->out, mask);set_cc_nz_u64 (s, cc_dst); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_rev16 (DisasContext *s,DisasOps *o) +static DisasJumpType op_rev16 (DisasContext *s,DisasOps *o) {tcg_gen_bswap16_i64 (o->out, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_rev32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_rev32 (DisasContext *s,DisasOps *o) {tcg_gen_bswap32_i64 (o->out, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_rev64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_rev64 (DisasContext *s,DisasOps *o) {tcg_gen_bswap64_i64 (o->out, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_rll32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_rll32 (DisasContext *s,DisasOps *o) {TCGv_i32 t1 =tcg_temp_new_i32 ();TCGv_i32 t2 =tcg_temp_new_i32 ();
@@ -3646,34 +3642,34 @@ static ExitStatus op_rll32(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t1);tcg_temp_free_i32 (t2);tcg_temp_free_i32 (to); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_rll64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_rll64 (DisasContext *s,DisasOps *o) {tcg_gen_rotl_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_rrbe (DisasContext *s,DisasOps *o) +static DisasJumpType op_rrbe (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_rrbe (cc_op, cpu_env, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sacf (DisasContext *s,DisasOps *o) +static DisasJumpType op_sacf (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_sacf (cpu_env, o->in2);/* Addressing mode has changed, so end the block. */ -return EXIT_PC_STALE ; +return DISAS_PC_STALE ; }#endif -static ExitStatus op_sam (DisasContext *s,DisasOps *o) +static DisasJumpType op_sam (DisasContext *s,DisasOps *o) {int sam = s->insn->data;TCGv_i64 tsam;
@@ -3696,7 +3692,7 @@ static ExitStatus op_sam(DisasContext *s, DisasOps *o)documents that Bad Things Happen two bytes before the end. */ if (s->pc & ~mask) {gen_program_exception (s,PGM_SPECIFICATION ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } s->next_pc &= mask;
@@ -3705,64 +3701,64 @@ static ExitStatus op_sam(DisasContext *s, DisasOps *o)tcg_temp_free_i64 (tsam);/* Always exit the TB, since we (may have) changed execution mode. */ -return EXIT_PC_STALE ; +return DISAS_PC_STALE ; } -static ExitStatus op_sar (DisasContext *s,DisasOps *o) +static DisasJumpType op_sar (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1); tcg_gen_st32_i64(o->in2, cpu_env, offsetof(CPUS390XState, aregs[r1])); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_seb (DisasContext *s,DisasOps *o) +static DisasJumpType op_seb (DisasContext *s,DisasOps *o) {gen_helper_seb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_sdb (DisasContext *s,DisasOps *o) {gen_helper_sdb (o->out, cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_sxb (DisasContext *s,DisasOps *o) {gen_helper_sxb (o->out, cpu_env, o->out, o->out2, o->in1, o->in2);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sqeb (DisasContext *s,DisasOps *o) +static DisasJumpType op_sqeb (DisasContext *s,DisasOps *o) {gen_helper_sqeb (o->out, cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sqdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_sqdb (DisasContext *s,DisasOps *o) {gen_helper_sqdb (o->out, cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sqxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_sqxb (DisasContext *s,DisasOps *o) {gen_helper_sqxb (o->out, cpu_env, o->in1, o->in2);return_low128 (o->out2); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_servc (DisasContext *s,DisasOps *o) +static DisasJumpType op_servc (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_servc (cc_op, cpu_env, o->in2, o->in1);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sigp (DisasContext *s,DisasOps *o) +static DisasJumpType op_sigp (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));
@@ -3771,11 +3767,11 @@ static ExitStatus op_sigp(DisasContext *s, DisasOps *o)set_cc_static (s);tcg_temp_free_i32 (r1);tcg_temp_free_i32 (r3); - return NO_EXIT; + return DISAS_NEXT; }#endif -static ExitStatus op_soc (DisasContext *s,DisasOps *o) +static DisasJumpType op_soc (DisasContext *s,DisasOps *o) {DisasCompare c;TCGv_i64 a, h;
@@ -3817,10 +3813,10 @@ static ExitStatus op_soc(DisasContext *s, DisasOps *o)tcg_temp_free_i64 (a);gen_set_label (lab); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sla (DisasContext *s,DisasOps *o) +static DisasJumpType op_sla (DisasContext *s,DisasOps *o) {uint64_t sign =1ull << s->insn->data;enum cc_op cco = s->insn->data ==31 ?CC_OP_SLA_32 :CC_OP_SLA_64 ;
@@ -3831,40 +3827,40 @@ static ExitStatus op_sla(DisasContext *s, DisasOps *o)tcg_gen_andi_i64 (o->out, o->out, ~sign);tcg_gen_andi_i64 (o->in1, o->in1, sign);tcg_gen_or_i64 (o->out, o->out, o->in1); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sll (DisasContext *s,DisasOps *o) +static DisasJumpType op_sll (DisasContext *s,DisasOps *o) {tcg_gen_shl_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sra (DisasContext *s,DisasOps *o) +static DisasJumpType op_sra (DisasContext *s,DisasOps *o) {tcg_gen_sar_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_srl (DisasContext *s,DisasOps *o) +static DisasJumpType op_srl (DisasContext *s,DisasOps *o) {tcg_gen_shr_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sfpc (DisasContext *s,DisasOps *o) +static DisasJumpType op_sfpc (DisasContext *s,DisasOps *o) {gen_helper_sfpc (cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sfas (DisasContext *s,DisasOps *o) +static DisasJumpType op_sfas (DisasContext *s,DisasOps *o) {gen_helper_sfas (cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_srnm (DisasContext *s,DisasOps *o) +static DisasJumpType op_srnm (DisasContext *s,DisasOps *o) {int b2 =get_field (s->fields, b2);int d2 =get_field (s->fields, d2);
@@ -3901,10 +3897,10 @@ static ExitStatus op_srnm(DisasContext *s, DisasOps *o)/* Then install the new FPC to set the rounding mode in fpu_status. */ gen_helper_sfpc (cpu_env, t2);tcg_temp_free_i64 (t2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_spm (DisasContext *s,DisasOps *o) +static DisasJumpType op_spm (DisasContext *s,DisasOps *o) {tcg_gen_extrl_i64_i32 (cc_op, o->in1);tcg_gen_extract_i32 (cc_op, cc_op,28 ,2 );
@@ -3912,10 +3908,10 @@ static ExitStatus op_spm(DisasContext *s, DisasOps *o)tcg_gen_shri_i64 (o->in1, o->in1,24 );tcg_gen_deposit_i64 (psw_mask, psw_mask, o->in1,PSW_SHIFT_MASK_PM ,4 ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ectg (DisasContext *s,DisasOps *o) +static DisasJumpType op_ectg (DisasContext *s,DisasOps *o) {int b1 =get_field (s->fields, b1);int d1 =get_field (s->fields, d1);
@@ -3942,49 +3938,49 @@ static ExitStatus op_ectg(DisasContext *s, DisasOps *o)tcg_gen_mov_i64 (regs[1 ], o->in2);tcg_temp_free_i64 (tmp); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_spka (DisasContext *s,DisasOps *o) +static DisasJumpType op_spka (DisasContext *s,DisasOps *o) {check_privileged (s);tcg_gen_shri_i64 (o->in2, o->in2,4 );tcg_gen_deposit_i64 (psw_mask, psw_mask, o->in2,PSW_SHIFT_KEY ,4 ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sske (DisasContext *s,DisasOps *o) +static DisasJumpType op_sske (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_sske (cpu_env, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ssm (DisasContext *s,DisasOps *o) +static DisasJumpType op_ssm (DisasContext *s,DisasOps *o) {check_privileged (s);tcg_gen_deposit_i64 (psw_mask, psw_mask, o->in2,56 ,8 );/* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ -return EXIT_PC_STALE_NOCHAIN ; +return DISAS_PC_STALE_NOCHAIN ; } -static ExitStatus op_stap (DisasContext *s,DisasOps *o) +static DisasJumpType op_stap (DisasContext *s,DisasOps *o) {check_privileged (s);tcg_gen_ld32u_i64 (o->out, cpu_env, offsetof(CPUS390XState , core_id)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stck (DisasContext *s,DisasOps *o) +static DisasJumpType op_stck (DisasContext *s,DisasOps *o) {gen_helper_stck (o->out, cpu_env);/* ??? We don't implement clock states. */ gen_op_movi_cc (s,0 ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stcke (DisasContext *s,DisasOps *o) +static DisasJumpType op_stcke (DisasContext *s,DisasOps *o) {TCGv_i64 c1 =tcg_temp_new_i64 ();TCGv_i64 c2 =tcg_temp_new_i64 ();
@@ -4008,31 +4004,31 @@ static ExitStatus op_stcke(DisasContext *s, DisasOps *o)tcg_temp_free_i64 (todpr);/* ??? We don't implement clock states. */ gen_op_movi_cc (s,0 ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sckc (DisasContext *s,DisasOps *o) +static DisasJumpType op_sckc (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_sckc (cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sckpf (DisasContext *s,DisasOps *o) +static DisasJumpType op_sckpf (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_sckpf (cpu_env, regs[0 ]); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stckc (DisasContext *s,DisasOps *o) +static DisasJumpType op_stckc (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_stckc (o->out, cpu_env); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stctg (DisasContext *s,DisasOps *o) +static DisasJumpType 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));
@@ -4040,10 +4036,10 @@ static ExitStatus op_stctg(DisasContext *s, DisasOps *o)gen_helper_stctg (cpu_env, r1, o->in2, r3);tcg_temp_free_i32 (r1);tcg_temp_free_i32 (r3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stctl (DisasContext *s,DisasOps *o) +static DisasJumpType op_stctl (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));
@@ -4051,187 +4047,187 @@ static ExitStatus op_stctl(DisasContext *s, DisasOps *o)gen_helper_stctl (cpu_env, r1, o->in2, r3);tcg_temp_free_i32 (r1);tcg_temp_free_i32 (r3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stidp (DisasContext *s,DisasOps *o) +static DisasJumpType op_stidp (DisasContext *s,DisasOps *o) {check_privileged (s);tcg_gen_ld_i64 (o->out, cpu_env, offsetof(CPUS390XState , cpuid));tcg_gen_qemu_st_i64 (o->out, o->addr1,get_mem_index (s),MO_TEQ |MO_ALIGN ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_spt (DisasContext *s,DisasOps *o) +static DisasJumpType op_spt (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_spt (cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stfl (DisasContext *s,DisasOps *o) +static DisasJumpType op_stfl (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_stfl (cpu_env); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stpt (DisasContext *s,DisasOps *o) +static DisasJumpType op_stpt (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_stpt (o->out, cpu_env); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stsi (DisasContext *s,DisasOps *o) +static DisasJumpType op_stsi (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_stsi (cc_op, cpu_env, o->in2, regs[0 ], regs[1 ]);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_spx (DisasContext *s,DisasOps *o) +static DisasJumpType op_spx (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_spx (cpu_env, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_xsch (DisasContext *s,DisasOps *o) +static DisasJumpType op_xsch (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_xsch (cpu_env, regs[1 ]);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_csch (DisasContext *s,DisasOps *o) +static DisasJumpType op_csch (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_csch (cpu_env, regs[1 ]);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_hsch (DisasContext *s,DisasOps *o) +static DisasJumpType op_hsch (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_hsch (cpu_env, regs[1 ]);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_msch (DisasContext *s,DisasOps *o) +static DisasJumpType op_msch (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_msch (cpu_env, regs[1 ], o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_rchp (DisasContext *s,DisasOps *o) +static DisasJumpType op_rchp (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_rchp (cpu_env, regs[1 ]);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_rsch (DisasContext *s,DisasOps *o) +static DisasJumpType op_rsch (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_rsch (cpu_env, regs[1 ]);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sal (DisasContext *s,DisasOps *o) +static DisasJumpType op_sal (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_sal (cpu_env, regs[1 ]); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_schm (DisasContext *s,DisasOps *o) +static DisasJumpType op_schm (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_schm (cpu_env, regs[1 ], regs[2 ], o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_siga (DisasContext *s,DisasOps *o) +static DisasJumpType op_siga (DisasContext *s,DisasOps *o) {check_privileged (s);/* From KVM code: Not provided, set CC = 3 for subchannel not operational */ gen_op_movi_cc (s,3 ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stcps (DisasContext *s,DisasOps *o) +static DisasJumpType op_stcps (DisasContext *s,DisasOps *o) {check_privileged (s);/* The instruction is suppressed if not provided. */ -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_ssch (DisasContext *s,DisasOps *o) +static DisasJumpType op_ssch (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_ssch (cpu_env, regs[1 ], o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stsch (DisasContext *s,DisasOps *o) +static DisasJumpType op_stsch (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_stsch (cpu_env, regs[1 ], o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stcrw (DisasContext *s,DisasOps *o) +static DisasJumpType op_stcrw (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_stcrw (cpu_env, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_tpi (DisasContext *s,DisasOps *o) +static DisasJumpType op_tpi (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_tpi (cc_op, cpu_env, o->addr1);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_tsch (DisasContext *s,DisasOps *o) +static DisasJumpType op_tsch (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_tsch (cpu_env, regs[1 ], o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_chsc (DisasContext *s,DisasOps *o) +static DisasJumpType op_chsc (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_chsc (cpu_env, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stpx (DisasContext *s,DisasOps *o) +static DisasJumpType op_stpx (DisasContext *s,DisasOps *o) {check_privileged (s);tcg_gen_ld_i64 (o->out, cpu_env, offsetof(CPUS390XState , psa));tcg_gen_andi_i64 (o->out, o->out,0x7fffe000 ); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stnosm (DisasContext *s,DisasOps *o) +static DisasJumpType op_stnosm (DisasContext *s,DisasOps *o) {uint64_t i2 =get_field (s->fields, i2);TCGv_i64 t;
@@ -4254,66 +4250,66 @@ static ExitStatus op_stnosm(DisasContext *s, DisasOps *o) }/* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ -return EXIT_PC_STALE_NOCHAIN ; +return DISAS_PC_STALE_NOCHAIN ; } -static ExitStatus op_stura (DisasContext *s,DisasOps *o) +static DisasJumpType op_stura (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_stura (cpu_env, o->in2, o->in1); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sturg (DisasContext *s,DisasOps *o) +static DisasJumpType op_sturg (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_sturg (cpu_env, o->in2, o->in1); -return NO_EXIT ; +return DISAS_NEXT ; }#endif -static ExitStatus op_stfle (DisasContext *s,DisasOps *o) +static DisasJumpType op_stfle (DisasContext *s,DisasOps *o) {gen_helper_stfle (cc_op, cpu_env, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_st8 (DisasContext *s,DisasOps *o) +static DisasJumpType op_st8 (DisasContext *s,DisasOps *o) {tcg_gen_qemu_st8 (o->in1, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_st16 (DisasContext *s,DisasOps *o) +static DisasJumpType op_st16 (DisasContext *s,DisasOps *o) {tcg_gen_qemu_st16 (o->in1, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_st32 (DisasContext *s,DisasOps *o) +static DisasJumpType op_st32 (DisasContext *s,DisasOps *o) {tcg_gen_qemu_st32 (o->in1, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_st64 (DisasContext *s,DisasOps *o) +static DisasJumpType op_st64 (DisasContext *s,DisasOps *o) {tcg_gen_qemu_st64 (o->in1, o->in2,get_mem_index (s)); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stam (DisasContext *s,DisasOps *o) +static DisasJumpType op_stam (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));gen_helper_stam (cpu_env, r1, o->in2, r3);tcg_temp_free_i32 (r1);tcg_temp_free_i32 (r3); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stcm (DisasContext *s,DisasOps *o) +static DisasJumpType op_stcm (DisasContext *s,DisasOps *o) {int m3 =get_field (s->fields, m3);int pos, base = s->insn->data;
@@ -4359,10 +4355,10 @@ static ExitStatus op_stcm(DisasContext *s, DisasOps *o)break ; }tcg_temp_free_i64 (tmp); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stm (DisasContext *s,DisasOps *o) +static DisasJumpType op_stm (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -4383,10 +4379,10 @@ static ExitStatus op_stm(DisasContext *s, DisasOps *o) }tcg_temp_free_i64 (tsize); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stmh (DisasContext *s,DisasOps *o) +static DisasJumpType op_stmh (DisasContext *s,DisasOps *o) {int r1 =get_field (s->fields, r1);int r3 =get_field (s->fields, r3);
@@ -4407,20 +4403,20 @@ static ExitStatus op_stmh(DisasContext *s, DisasOps *o)tcg_temp_free_i64 (t);tcg_temp_free_i64 (t4);tcg_temp_free_i64 (t32); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_stpq (DisasContext *s,DisasOps *o) +static DisasJumpType op_stpq (DisasContext *s,DisasOps *o) {if (tb_cflags (s->tb) &CF_PARALLEL ) {gen_helper_stpq_parallel (cpu_env, o->in2, o->out2, o->out); }else {gen_helper_stpq (cpu_env, o->in2, o->out2, o->out); } -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_srst (DisasContext *s,DisasOps *o) +static DisasJumpType op_srst (DisasContext *s,DisasOps *o) {TCGv_i32 r1 =tcg_const_i32 (get_field (s->fields, r1));TCGv_i32 r2 =tcg_const_i32 (get_field (s->fields, r2));
@@ -4430,10 +4426,10 @@ static ExitStatus op_srst(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (r1);tcg_temp_free_i32 (r2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_srstu (DisasContext *s,DisasOps *o) +static DisasJumpType op_srstu (DisasContext *s,DisasOps *o) {TCGv_i32 r1 =tcg_const_i32 (get_field (s->fields, r1));TCGv_i32 r2 =tcg_const_i32 (get_field (s->fields, r2));
@@ -4443,16 +4439,16 @@ static ExitStatus op_srstu(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (r1);tcg_temp_free_i32 (r2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_sub (DisasContext *s,DisasOps *o) +static DisasJumpType op_sub (DisasContext *s,DisasOps *o) {tcg_gen_sub_i64 (o->out, o->in1, o->in2); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_subb (DisasContext *s,DisasOps *o) +static DisasJumpType op_subb (DisasContext *s,DisasOps *o) {DisasCompare cmp;TCGv_i64 borrow;
@@ -4475,10 +4471,10 @@ static ExitStatus op_subb(DisasContext *s, DisasOps *o)tcg_gen_sub_i64 (o->out, o->out, borrow);tcg_temp_free_i64 (borrow); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_svc (DisasContext *s,DisasOps *o) +static DisasJumpType op_svc (DisasContext *s,DisasOps *o) {TCGv_i32 t;
@@ -4494,104 +4490,104 @@ static ExitStatus op_svc(DisasContext *s, DisasOps *o)tcg_temp_free_i32 (t);gen_exception (EXCP_SVC ); -return EXIT_NORETURN ; +return DISAS_NORETURN ; } -static ExitStatus op_tam (DisasContext *s,DisasOps *o) +static DisasJumpType op_tam (DisasContext *s,DisasOps *o) {int cc =0 ; cc |= (s->tb->flags &FLAG_MASK_64 ) ?2 :0 ; cc |= (s->tb->flags &FLAG_MASK_32 ) ?1 :0 ;gen_op_movi_cc (s, cc); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_tceb (DisasContext *s,DisasOps *o) +static DisasJumpType op_tceb (DisasContext *s,DisasOps *o) {gen_helper_tceb (cc_op, cpu_env, o->in1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_tcdb (DisasContext *s,DisasOps *o) +static DisasJumpType op_tcdb (DisasContext *s,DisasOps *o) {gen_helper_tcdb (cc_op, cpu_env, o->in1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_tcxb (DisasContext *s,DisasOps *o) +static DisasJumpType op_tcxb (DisasContext *s,DisasOps *o) {gen_helper_tcxb (cc_op, cpu_env, o->out, o->out2, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; }#ifndef CONFIG_USER_ONLY -static ExitStatus op_testblock (DisasContext *s,DisasOps *o) +static DisasJumpType op_testblock (DisasContext *s,DisasOps *o) {check_privileged (s);gen_helper_testblock (cc_op, cpu_env, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_tprot (DisasContext *s,DisasOps *o) +static DisasJumpType op_tprot (DisasContext *s,DisasOps *o) {gen_helper_tprot (cc_op, cpu_env, o->addr1, o->in2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; }#endif -static ExitStatus op_tp (DisasContext *s,DisasOps *o) +static DisasJumpType op_tp (DisasContext *s,DisasOps *o) {TCGv_i32 l1 =tcg_const_i32 (get_field (s->fields, l1) +1 );gen_helper_tp (cc_op, cpu_env, o->addr1, l1);tcg_temp_free_i32 (l1);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_tr (DisasContext *s,DisasOps *o) +static DisasJumpType op_tr (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_tr (cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_tre (DisasContext *s,DisasOps *o) +static DisasJumpType op_tre (DisasContext *s,DisasOps *o) {gen_helper_tre (o->out, cpu_env, o->out, o->out2, o->in2);return_low128 (o->out2);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_trt (DisasContext *s,DisasOps *o) +static DisasJumpType op_trt (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_trt (cc_op, cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; } -static ExitStatus op_trtr (DisasContext *s,DisasOps *o) +static DisasJumpType op_trtr (DisasContext *s,DisasOps *o) {TCGv_i32 l =tcg_const_i32 (get_field (s->fields, l1));gen_helper_trtr (cc_op, cpu_env, l, o->addr1, o->in2);tcg_temp_free_i32 (l);set_cc_static (s); -return NO_EXIT ; +return DISAS_NEXT ; }
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
Re: [Qemu-devel] [PATCH 1/3] target/s390x: convert to DisasJumpType
target/s390x/translate.c void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) · line 6193
Quoted 12 lines
switch (status) {target/s390x/translate.c +5
-4-case EXIT_GOTO_TB : -case EXIT_NORETURN : +case DISAS_GOTO_TB : +case DISAS_NORETURN :break ; -case EXIT_PC_STALE : -case EXIT_PC_STALE_NOCHAIN : +case DISAS_TOO_MANY : +case DISAS_PC_STALE : +case DISAS_PC_STALE_NOCHAIN :update_psw_addr (&dc);
Not sure if this is really the right thing to do for DISAS_TOO_MANY but it seems to work for now :)
Quoted 8 lines
/* FALLTHRU */target/s390x/translate.c +1
-1-case EXIT_PC_UPDATED : +case DISAS_PC_UPDATED :/* Next TB starts off with CC_OP_DYNAMIC, so make sure the cc op type is in env */ update_cc_op (&dc);/* FALLTHRU */
target/s390x/translate.c void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) · line 6207
Quoted 10 lines
target/s390x/translate.c +2
-2-case EXIT_PC_CC_UPDATED : +case DISAS_PC_CC_UPDATED :/* Exit the TB, either by raising a debug exception or by return. */ if (do_debug) {gen_exception (EXCP_DEBUG ); - }else if (use_exit_tb (&dc) || status ==EXIT_PC_STALE_NOCHAIN ) { + }else if (use_exit_tb (&dc) || status ==DISAS_PC_STALE_NOCHAIN ) {tcg_gen_exit_tb (0 ); }else {tcg_gen_lookup_and_goto_ptr ();
Signature · 3 lines
Thanks, David / dhildenb
Re: [Qemu-devel] [PATCH 1/3] target/s390x: convert to DisasJumpType
In reply to Emilio G. CotaQuoted 7 lines · Emilio G. Cota
The only non-trivial modification is the use of
DISAS_TOO_MANYin the same way is used by the generic translation loop.Signed-off-by Emilio G. Cota <[email protected]>--- target/s390x/translate.c | 1267 +++++++++++++++++++++++----------------------- 1 file changed, 632 insertions(+), 635 deletions(-)
r~
PATCH 2/3 target/s390x: convert to DisasContextBase
In reply to Emilio G. CotaNotes:
- Kept ctx.pc and ctx.next_pc; it would be very confusing to have ctx.base.pc_next and ctx.next_pc ! Instead, just updated ctx.base.pc_next where relevant.
- Did not convert num_insns and is_jmp, since the corresponding code will go away in the next patch.
- Avoided a checkpatch error in use_exit_tb.
--- target/s390x/translate.c | 85 ++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 42 deletions(-)
target/s390x/translate.c +43 -42
@@ -52,14 +52,13 @@ typedef struct DisasInsn DisasInsn;typedef struct DisasFields DisasFields ;struct DisasContext { -struct TranslationBlock *tb; +DisasContextBase base;const DisasInsn *insn;DisasFields *fields;uint64_t ex_value;uint64_t pc, next_pc;uint32_t ilen;enum cc_op cc_op; -bool singlestep_enabled; };/* Information carried about a condition to be evaluated. */
@@ -81,8 +80,8 @@ static uint64_t inline_branch_miss[CC_OP_MAX];static uint64_t pc_to_link_info (DisasContext *s,uint64_t pc) { -if (!(s->tb->flags &FLAG_MASK_64 )) { -if (s->tb->flags &FLAG_MASK_32 ) { +if (!(s->base.tb->flags &FLAG_MASK_64 )) { +if (s->base.tb->flags &FLAG_MASK_32 ) {return pc |0x80000000 ; } }
@@ -196,7 +195,7 @@ static void per_branch(DisasContext *s, bool to_next)#ifndef CONFIG_USER_ONLY tcg_gen_movi_i64 (gbea, s->pc); -if (s->tb->flags &FLAG_MASK_PER ) { +if (s->base.tb->flags &FLAG_MASK_PER ) {TCGv_i64 next_pc = to_next ?tcg_const_i64 (s->next_pc) : psw_addr;gen_helper_per_branch (cpu_env, gbea, next_pc);if (to_next) {
@@ -210,7 +209,7 @@ static void per_branch_cond(DisasContext *s, TCGCond cond, TCGv_i64 arg1, TCGv_i64 arg2) {#ifndef CONFIG_USER_ONLY -if (s->tb->flags &FLAG_MASK_PER ) { +if (s->base.tb->flags &FLAG_MASK_PER ) {TCGLabel *lab =gen_new_label ();tcg_gen_brcond_i64 (tcg_invert_cond (cond), arg1, arg2, lab);
@@ -250,7 +249,7 @@ static inline uint64_t ld_code4(CPUS390XState *env, uint64_t pc)static int get_mem_index (DisasContext *s) { -switch (s->tb->flags &FLAG_MASK_ASC ) { +switch (s->base.tb->flags &FLAG_MASK_ASC ) {case PSW_ASC_PRIMARY >>FLAG_MASK_PSW_SHIFT :return 0 ;case PSW_ASC_SECONDARY >>FLAG_MASK_PSW_SHIFT :
@@ -315,7 +314,7 @@ static inline void gen_trap(DisasContext *s)#ifndef CONFIG_USER_ONLY static void check_privileged (DisasContext *s) { -if (s->tb->flags &FLAG_MASK_PSTATE ) { +if (s->base.tb->flags &FLAG_MASK_PSTATE ) {gen_program_exception (s,PGM_PRIVILEGED ); } }
@@ -324,7 +323,7 @@ static void check_privileged(DisasContext *s)static TCGv_i64 get_address (DisasContext *s,int x2,int b2,int d2) {TCGv_i64 tmp =tcg_temp_new_i64 (); -bool need_31 = !(s->tb->flags &FLAG_MASK_64 ); +bool need_31 = !(s->base.tb->flags &FLAG_MASK_64 );/* Note that d2 is limited to 20 bits, signed. If we crop negative displacements early we create larger immedate addends. */
@@ -537,9 +536,9 @@ static void gen_op_calc_cc(DisasContext *s)static bool use_exit_tb (DisasContext *s) { -return (s->singlestep_enabled || - (tb_cflags (s->tb) &CF_LAST_IO ) || - (s->tb->flags &FLAG_MASK_PER )); +return s->base.singlestep_enabled || + (tb_cflags (s->base.tb) &CF_LAST_IO ) || + (s->base.tb->flags &FLAG_MASK_PER ); }static bool use_goto_tb (DisasContext *s,uint64_t dest)
@@ -548,7 +547,7 @@ static bool use_goto_tb(DisasContext *s, uint64_t dest)return false; }#ifndef CONFIG_USER_ONLY -return (dest &TARGET_PAGE_MASK ) == (s->tb->pc &TARGET_PAGE_MASK ) || +return (dest &TARGET_PAGE_MASK ) == (s->base.tb->pc &TARGET_PAGE_MASK ) || (dest &TARGET_PAGE_MASK ) == (s->pc &TARGET_PAGE_MASK );#else return true;
@@ -1150,7 +1149,7 @@ static DisasJumpType help_goto_direct(DisasContext *s, uint64_t dest)per_breaking_event (s);tcg_gen_goto_tb (0 );tcg_gen_movi_i64 (psw_addr, dest); -tcg_gen_exit_tb ((uintptr_t )s->tb); +tcg_gen_exit_tb ((uintptr_t )s->base.tb);return DISAS_GOTO_TB ; }else {tcg_gen_movi_i64 (psw_addr, dest);
@@ -1211,14 +1210,14 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c,/* Branch not taken. */ tcg_gen_goto_tb (0 );tcg_gen_movi_i64 (psw_addr, s->next_pc); -tcg_gen_exit_tb ((uintptr_t )s->tb +0 ); +tcg_gen_exit_tb ((uintptr_t )s->base.tb +0 );/* Branch taken. */ gen_set_label (lab);per_breaking_event (s);tcg_gen_goto_tb (1 );tcg_gen_movi_i64 (psw_addr, dest); -tcg_gen_exit_tb ((uintptr_t )s->tb +1 ); +tcg_gen_exit_tb ((uintptr_t )s->base.tb +1 ); ret =DISAS_GOTO_TB ; }else {
@@ -1241,7 +1240,7 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c,update_cc_op (s);tcg_gen_goto_tb (0 );tcg_gen_movi_i64 (psw_addr, s->next_pc); -tcg_gen_exit_tb ((uintptr_t )s->tb +0 ); +tcg_gen_exit_tb ((uintptr_t )s->base.tb +0 );gen_set_label (lab);if (is_imm) {
@@ -1990,7 +1989,7 @@ static DisasJumpType op_cdsg(DisasContext *s, DisasOps *o) addr =get_address (s,0 , b2, d2); t_r1 =tcg_const_i32 (r1); t_r3 =tcg_const_i32 (r3); -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {gen_helper_cdsg_parallel (cpu_env, addr, t_r1, t_r3); }else {gen_helper_cdsg (cpu_env, addr, t_r1, t_r3);
@@ -2008,7 +2007,7 @@ static DisasJumpType op_csst(DisasContext *s, DisasOps *o)int r3 =get_field (s->fields, r3);TCGv_i32 t_r3 =tcg_const_i32 (r3); -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {gen_helper_csst_parallel (cc_op, cpu_env, t_r3, o->in1, o->in2); }else {gen_helper_csst (cc_op, cpu_env, t_r3, o->in1, o->in2);
@@ -2968,7 +2967,7 @@ static DisasJumpType op_lpd(DisasContext *s, DisasOps *o)TCGMemOp mop = s->insn->data;/* In a parallel context, stop the world and single step. */ -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {update_psw_addr (s);update_cc_op (s);gen_exception (EXCP_ATOMIC );
@@ -2990,7 +2989,7 @@ static DisasJumpType op_lpd(DisasContext *s, DisasOps *o)static DisasJumpType op_lpq (DisasContext *s,DisasOps *o) { -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {gen_helper_lpq_parallel (o->out, cpu_env, o->in2); }else {gen_helper_lpq (o->out, cpu_env, o->in2);
@@ -3040,7 +3039,7 @@ static DisasJumpType op_mov2e(DisasContext *s, DisasOps *o) o->in2 =NULL ; o->g_in2 = false; -switch (s->tb->flags &FLAG_MASK_ASC ) { +switch (s->base.tb->flags &FLAG_MASK_ASC ) {case PSW_ASC_PRIMARY >>FLAG_MASK_PSW_SHIFT :tcg_gen_movi_i64 (ar1,0 );break ;
@@ -4408,7 +4407,7 @@ static DisasJumpType op_stmh(DisasContext *s, DisasOps *o)static DisasJumpType op_stpq (DisasContext *s,DisasOps *o) { -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {gen_helper_stpq_parallel (cpu_env, o->in2, o->out2, o->out); }else {gen_helper_stpq (cpu_env, o->in2, o->out2, o->out);
@@ -4497,8 +4496,8 @@ static DisasJumpType op_tam(DisasContext *s, DisasOps *o) {int cc =0 ; - cc |= (s->tb->flags &FLAG_MASK_64 ) ?2 :0 ; - cc |= (s->tb->flags &FLAG_MASK_32 ) ?1 :0 ; + cc |= (s->base.tb->flags &FLAG_MASK_64 ) ?2 :0 ; + cc |= (s->base.tb->flags &FLAG_MASK_32 ) ?1 :0 ;gen_op_movi_cc (s, cc);return DISAS_NEXT ; }
@@ -5998,7 +5997,7 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s) }#ifndef CONFIG_USER_ONLY -if (s->tb->flags &FLAG_MASK_PER ) { +if (s->base.tb->flags &FLAG_MASK_PER ) {TCGv_i64 addr =tcg_const_i64 (s->pc);gen_helper_per_ifetch (cpu_env, addr);tcg_temp_free_i64 (addr);
@@ -6093,7 +6092,7 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s) }#ifndef CONFIG_USER_ONLY -if (s->tb->flags &FLAG_MASK_PER ) { +if (s->base.tb->flags &FLAG_MASK_PER ) {/* An exception might be triggered, save PSW if not already done. */ if (ret ==DISAS_NEXT || ret ==DISAS_PC_STALE ) {tcg_gen_movi_i64 (psw_addr, s->next_pc);
@@ -6113,26 +6112,26 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) {CPUS390XState *env = cs->env_ptr;DisasContext dc; -target_ulong pc_start;uint64_t next_page_start;int num_insns, max_insns;DisasJumpType status;bool do_debug; - pc_start = tb->pc; - + dc.base.pc_first = tb->pc;/* 31-bit mode */ if (!(tb->flags &FLAG_MASK_64 )) { - pc_start &=0x7fffffff ; + dc.base.pc_first &=0x7fffffff ; } + dc.base.pc_next = dc.base.pc_first; + dc.base.tb = tb; + dc.base.singlestep_enabled = cs->singlestep_enabled; - dc.tb = tb; - dc.pc = pc_start; + dc.pc = dc.base.pc_first; dc.cc_op =CC_OP_DYNAMIC ; - dc.ex_value = tb->cs_base; - do_debug = dc.singlestep_enabled = cs->singlestep_enabled; + dc.ex_value = dc.base.tb->cs_base; + do_debug = cs->singlestep_enabled; - next_page_start = (pc_start &TARGET_PAGE_MASK ) +TARGET_PAGE_SIZE ; + next_page_start = (dc.base.pc_first &TARGET_PAGE_MASK ) +TARGET_PAGE_SIZE ; num_insns =0 ; max_insns =tb_cflags (tb) &CF_COUNT_MASK ;
@@ -6149,7 +6148,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)tcg_gen_insn_start (dc.pc, dc.cc_op); num_insns++; -if (unlikely (cpu_breakpoint_test (cs, dc.pc,BP_ANY ))) { +if (unlikely (cpu_breakpoint_test (cs, dc.base.pc_next,BP_ANY ))) { status =DISAS_PC_STALE ; do_debug = true;/* The address covered by the breakpoint must be included in
@@ -6157,6 +6156,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)properly cleared -- thus we increment the PC here so that the logic setting tb->size below does the right thing. */ dc.pc +=2 ; + dc.base.pc_next +=2 ;break ; }
@@ -6165,6 +6165,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) } status =translate_one (env, &dc); + dc.base.pc_next = dc.pc;/* If we reach a page boundary, are single stepping, or exhaust instruction count, stop generation. */
@@ -6173,7 +6174,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) || tcg_op_buf_full() || num_insns >= max_insns || singlestep - || cs->singlestep_enabled + || dc.base.singlestep_enabled || dc.ex_value)) { status =DISAS_TOO_MANY ; }
@@ -6213,19 +6214,19 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)gen_tb_end (tb, num_insns); - tb->size = dc.pc - pc_start; + tb->size = dc.pc - dc.base.pc_first; tb->icount = num_insns;#if defined(S390X_DEBUG_DISAS )if (qemu_loglevel_mask (CPU_LOG_TB_IN_ASM ) - &&qemu_log_in_addr_range (pc_start)) { + &&qemu_log_in_addr_range (dc.base.pc_first)) {qemu_log_lock ();if (unlikely (dc.ex_value)) {/* ??? Unfortunately log_target_disas can't use host memory. */ qemu_log ("IN: EXECUTE %016" PRIx64"\n" , dc.ex_value); }else { -qemu_log ("IN: %s\n" ,lookup_symbol (pc_start)); -log_target_disas (cs, pc_start, dc.pc - pc_start); +qemu_log ("IN: %s\n" ,lookup_symbol (dc.base.pc_first)); +log_target_disas (cs, dc.base.pc_first, dc.pc - dc.base.pc_first);qemu_log ("\n" ); }qemu_log_unlock ();
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 2/3] target/s390x: convert to DisasContextBase
Quoted 5 lines · Emilio G. Cota
Notes:
- Kept ctx.pc and ctx.next_pc; it would be very confusing to have ctx.base.pc_next and ctx.next_pc ! Instead, just updated ctx.base.pc_next where relevant.
So we now have
ctx.pc
-> same as ctx.base.pc_next
-> points at the untranslated / currently being translated pc
ctx.next_pc
-> points at the next pc during translation
-> initialized to to s->pc + ilen
-> if there is a branch, it is changed to branch target
ctx.base.pc_first -> "first guest instruction in this TB" ctx.base.pc_next -> "next guest instruction in this TB"
ctx.next_pc is only valid during translate_one(), after that the value is synced back to ctx.pc. (and you sync it back to dc.base.pc_next). It is actually a temporary variable to determine the pc to executed after next_pc.
So what about the following:
1. Drop ctx.pc and use ctx.base.pc_next instead
2. Rename ctx.next_pc to ctx.pc_tmp and add a comment like
/*
* During translate_one(), pc_tmp is used to determine the instruction
* to be executed after base.pc_next - e.g. next sequential instruction
* or a branch target.
*/
Quoted 275 lines
- Did not convert
num_insnsandis_jmp, since the corresponding code will go away in the next patch.- Avoided a checkpatch error in
use_exit_tb.Signed-off-by Emilio G. Cota <[email protected]>--- target/s390x/translate.c | 85 ++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 42 deletions(-)target/s390x/translate.c +1
-2@@ -52,14 +52,13 @@ typedef struct DisasInsn DisasInsn;typedef struct DisasFields DisasFields ;struct DisasContext { -struct TranslationBlock *tb; +DisasContextBase base;const DisasInsn *insn;DisasFields *fields;uint64_t ex_value;uint64_t pc, next_pc;uint32_t ilen;enum cc_op cc_op; -bool singlestep_enabled; };/* Information carried about a condition to be evaluated. */
target/s390x/translate.c +35
-35@@ -81,8 +80,8 @@ static uint64_t inline_branch_miss[CC_OP_MAX];static uint64_t pc_to_link_info (DisasContext *s,uint64_t pc) { -if (!(s->tb->flags &FLAG_MASK_64 )) { -if (s->tb->flags &FLAG_MASK_32 ) { +if (!(s->base.tb->flags &FLAG_MASK_64 )) { +if (s->base.tb->flags &FLAG_MASK_32 ) {return pc |0x80000000 ; } }@@ -196,7 +195,7 @@ static void per_branch(DisasContext *s, bool to_next)#ifndef CONFIG_USER_ONLY tcg_gen_movi_i64 (gbea, s->pc); -if (s->tb->flags &FLAG_MASK_PER ) { +if (s->base.tb->flags &FLAG_MASK_PER ) {TCGv_i64 next_pc = to_next ?tcg_const_i64 (s->next_pc) : psw_addr;gen_helper_per_branch (cpu_env, gbea, next_pc);if (to_next) {@@ -210,7 +209,7 @@ static void per_branch_cond(DisasContext *s, TCGCond cond, TCGv_i64 arg1, TCGv_i64 arg2) {#ifndef CONFIG_USER_ONLY -if (s->tb->flags &FLAG_MASK_PER ) { +if (s->base.tb->flags &FLAG_MASK_PER ) {TCGLabel *lab =gen_new_label ();tcg_gen_brcond_i64 (tcg_invert_cond (cond), arg1, arg2, lab);@@ -250,7 +249,7 @@ static inline uint64_t ld_code4(CPUS390XState *env, uint64_t pc)static int get_mem_index (DisasContext *s) { -switch (s->tb->flags &FLAG_MASK_ASC ) { +switch (s->base.tb->flags &FLAG_MASK_ASC ) {case PSW_ASC_PRIMARY >>FLAG_MASK_PSW_SHIFT :return 0 ;case PSW_ASC_SECONDARY >>FLAG_MASK_PSW_SHIFT :@@ -315,7 +314,7 @@ static inline void gen_trap(DisasContext *s)#ifndef CONFIG_USER_ONLY static void check_privileged (DisasContext *s) { -if (s->tb->flags &FLAG_MASK_PSTATE ) { +if (s->base.tb->flags &FLAG_MASK_PSTATE ) {gen_program_exception (s,PGM_PRIVILEGED ); } }@@ -324,7 +323,7 @@ static void check_privileged(DisasContext *s)static TCGv_i64 get_address (DisasContext *s,int x2,int b2,int d2) {TCGv_i64 tmp =tcg_temp_new_i64 (); -bool need_31 = !(s->tb->flags &FLAG_MASK_64 ); +bool need_31 = !(s->base.tb->flags &FLAG_MASK_64 );/* Note that d2 is limited to 20 bits, signed. If we crop negative displacements early we create larger immedate addends. */ @@ -537,9 +536,9 @@ static void gen_op_calc_cc(DisasContext *s)static bool use_exit_tb (DisasContext *s) { -return (s->singlestep_enabled || - (tb_cflags (s->tb) &CF_LAST_IO ) || - (s->tb->flags &FLAG_MASK_PER )); +return s->base.singlestep_enabled || + (tb_cflags (s->base.tb) &CF_LAST_IO ) || + (s->base.tb->flags &FLAG_MASK_PER ); }static bool use_goto_tb (DisasContext *s,uint64_t dest)@@ -548,7 +547,7 @@ static bool use_goto_tb(DisasContext *s, uint64_t dest)return false; }#ifndef CONFIG_USER_ONLY -return (dest &TARGET_PAGE_MASK ) == (s->tb->pc &TARGET_PAGE_MASK ) || +return (dest &TARGET_PAGE_MASK ) == (s->base.tb->pc &TARGET_PAGE_MASK ) || (dest &TARGET_PAGE_MASK ) == (s->pc &TARGET_PAGE_MASK );#else return true;@@ -1150,7 +1149,7 @@ static DisasJumpType help_goto_direct(DisasContext *s, uint64_t dest)per_breaking_event (s);tcg_gen_goto_tb (0 );tcg_gen_movi_i64 (psw_addr, dest); -tcg_gen_exit_tb ((uintptr_t )s->tb); +tcg_gen_exit_tb ((uintptr_t )s->base.tb);return DISAS_GOTO_TB ; }else {tcg_gen_movi_i64 (psw_addr, dest);@@ -1211,14 +1210,14 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c,/* Branch not taken. */ tcg_gen_goto_tb (0 );tcg_gen_movi_i64 (psw_addr, s->next_pc); -tcg_gen_exit_tb ((uintptr_t )s->tb +0 ); +tcg_gen_exit_tb ((uintptr_t )s->base.tb +0 );/* Branch taken. */ gen_set_label (lab);per_breaking_event (s);tcg_gen_goto_tb (1 );tcg_gen_movi_i64 (psw_addr, dest); -tcg_gen_exit_tb ((uintptr_t )s->tb +1 ); +tcg_gen_exit_tb ((uintptr_t )s->base.tb +1 ); ret =DISAS_GOTO_TB ; }else {@@ -1241,7 +1240,7 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c,update_cc_op (s);tcg_gen_goto_tb (0 );tcg_gen_movi_i64 (psw_addr, s->next_pc); -tcg_gen_exit_tb ((uintptr_t )s->tb +0 ); +tcg_gen_exit_tb ((uintptr_t )s->base.tb +0 );gen_set_label (lab);if (is_imm) {@@ -1990,7 +1989,7 @@ static DisasJumpType op_cdsg(DisasContext *s, DisasOps *o) addr =get_address (s,0 , b2, d2); t_r1 =tcg_const_i32 (r1); t_r3 =tcg_const_i32 (r3); -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {gen_helper_cdsg_parallel (cpu_env, addr, t_r1, t_r3); }else {gen_helper_cdsg (cpu_env, addr, t_r1, t_r3);@@ -2008,7 +2007,7 @@ static DisasJumpType op_csst(DisasContext *s, DisasOps *o)int r3 =get_field (s->fields, r3);TCGv_i32 t_r3 =tcg_const_i32 (r3); -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {gen_helper_csst_parallel (cc_op, cpu_env, t_r3, o->in1, o->in2); }else {gen_helper_csst (cc_op, cpu_env, t_r3, o->in1, o->in2);@@ -2968,7 +2967,7 @@ static DisasJumpType op_lpd(DisasContext *s, DisasOps *o)TCGMemOp mop = s->insn->data;/* In a parallel context, stop the world and single step. */ -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {update_psw_addr (s);update_cc_op (s);gen_exception (EXCP_ATOMIC );@@ -2990,7 +2989,7 @@ static DisasJumpType op_lpd(DisasContext *s, DisasOps *o)static DisasJumpType op_lpq (DisasContext *s,DisasOps *o) { -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {gen_helper_lpq_parallel (o->out, cpu_env, o->in2); }else {gen_helper_lpq (o->out, cpu_env, o->in2);@@ -3040,7 +3039,7 @@ static DisasJumpType op_mov2e(DisasContext *s, DisasOps *o) o->in2 =NULL ; o->g_in2 = false; -switch (s->tb->flags &FLAG_MASK_ASC ) { +switch (s->base.tb->flags &FLAG_MASK_ASC ) {case PSW_ASC_PRIMARY >>FLAG_MASK_PSW_SHIFT :tcg_gen_movi_i64 (ar1,0 );break ;@@ -4408,7 +4407,7 @@ static DisasJumpType op_stmh(DisasContext *s, DisasOps *o)static DisasJumpType op_stpq (DisasContext *s,DisasOps *o) { -if (tb_cflags (s->tb) &CF_PARALLEL ) { +if (tb_cflags (s->base.tb) &CF_PARALLEL ) {gen_helper_stpq_parallel (cpu_env, o->in2, o->out2, o->out); }else {gen_helper_stpq (cpu_env, o->in2, o->out2, o->out);@@ -4497,8 +4496,8 @@ static DisasJumpType op_tam(DisasContext *s, DisasOps *o) {int cc =0 ; - cc |= (s->tb->flags &FLAG_MASK_64 ) ?2 :0 ; - cc |= (s->tb->flags &FLAG_MASK_32 ) ?1 :0 ; + cc |= (s->base.tb->flags &FLAG_MASK_64 ) ?2 :0 ; + cc |= (s->base.tb->flags &FLAG_MASK_32 ) ?1 :0 ;gen_op_movi_cc (s, cc);return DISAS_NEXT ; }@@ -5998,7 +5997,7 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s) }#ifndef CONFIG_USER_ONLY -if (s->tb->flags &FLAG_MASK_PER ) { +if (s->base.tb->flags &FLAG_MASK_PER ) {TCGv_i64 addr =tcg_const_i64 (s->pc);gen_helper_per_ifetch (cpu_env, addr);tcg_temp_free_i64 (addr);@@ -6093,7 +6092,7 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s) }#ifndef CONFIG_USER_ONLY -if (s->tb->flags &FLAG_MASK_PER ) { +if (s->base.tb->flags &FLAG_MASK_PER ) {/* An exception might be triggered, save PSW if not already done. */ if (ret ==DISAS_NEXT || ret ==DISAS_PC_STALE ) {tcg_gen_movi_i64 (psw_addr, s->next_pc);@@ -6113,26 +6112,26 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) {CPUS390XState *env = cs->env_ptr;DisasContext dc; -target_ulong pc_start;uint64_t next_page_start;int num_insns, max_insns;DisasJumpType status;bool do_debug; - pc_start = tb->pc; - + dc.base.pc_first = tb->pc;/* 31-bit mode */ if (!(tb->flags &FLAG_MASK_64 )) { - pc_start &=0x7fffffff ; + dc.base.pc_first &=0x7fffffff ; } + dc.base.pc_next = dc.base.pc_first; + dc.base.tb = tb; + dc.base.singlestep_enabled = cs->singlestep_enabled; - dc.tb = tb; - dc.pc = pc_start; + dc.pc = dc.base.pc_first; dc.cc_op =CC_OP_DYNAMIC ; - dc.ex_value = tb->cs_base; - do_debug = dc.singlestep_enabled = cs->singlestep_enabled; + dc.ex_value = dc.base.tb->cs_base; + do_debug = cs->singlestep_enabled; - next_page_start = (pc_start &TARGET_PAGE_MASK ) +TARGET_PAGE_SIZE ; + next_page_start = (dc.base.pc_first &TARGET_PAGE_MASK ) +TARGET_PAGE_SIZE ; num_insns =0 ; max_insns =tb_cflags (tb) &CF_COUNT_MASK ;@@ -6149,7 +6148,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)tcg_gen_insn_start (dc.pc, dc.cc_op); num_insns++; -if (unlikely (cpu_breakpoint_test (cs, dc.pc,BP_ANY ))) { +if (unlikely (cpu_breakpoint_test (cs, dc.base.pc_next,BP_ANY ))) { status =DISAS_PC_STALE ; do_debug = true;/* The address covered by the breakpoint must be included in
target/s390x/translate.c void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) · line 6159
Quoted 4 lines
target/s390x/translate.c +1
-0@@ -6157,6 +6156,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)properly cleared -- thus we increment the PC here so that the logic setting tb->size below does the right thing. */ dc.pc +=2 ; + dc.base.pc_next +=2 ;
I don't like that it is updated here directly
target/s390x/translate.c void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) · line 6168
Quoted 8 lines
target/s390x/translate.c +1
-0break ; }@@ -6165,6 +6165,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) } status =translate_one (env, &dc); + dc.base.pc_next = dc.pc;
but synced back here
Let's just try to get rid of duplicate variables.
Signature · 3 lines
Thanks, David / dhildenb
PATCH 3/3 target/s390x: convert to TranslatorOps
In reply to Emilio G. Cota--- target/s390x/translate.c | 170 ++++++++++++++++++++++++----------------------- 1 file changed, 86 insertions(+), 84 deletions(-)
target/s390x/translate.c +86 -84
@@ -55,10 +55,12 @@ struct DisasContext {DisasContextBase base;const DisasInsn *insn;DisasFields *fields; +uint64_t next_page_start;uint64_t ex_value;uint64_t pc, next_pc;uint32_t ilen;enum cc_op cc_op; +bool do_debug; };/* Information carried about a condition to be evaluated. */
@@ -6108,101 +6110,92 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s)return ret; } -void gen_intermediate_code (CPUState *cs,struct TranslationBlock *tb) +static int s390x_tr_init_disas_context (DisasContextBase *dcbase, +CPUState *cs,int max_insns) { -CPUS390XState *env = cs->env_ptr; -DisasContext dc; -uint64_t next_page_start; -int num_insns, max_insns; -DisasJumpType status; -bool do_debug; +DisasContext *s =container_of (dcbase, DisasContext, base); - dc.base.pc_first = tb->pc;/* 31-bit mode */ -if (!(tb->flags &FLAG_MASK_64 )) { - dc.base.pc_first &=0x7fffffff ; +if (!(s->base.tb->flags &FLAG_MASK_64 )) { + s->base.pc_first &=0x7fffffff ; + s->base.pc_next = s->base.pc_first; } - dc.base.pc_next = dc.base.pc_first; - dc.base.tb = tb; - dc.base.singlestep_enabled = cs->singlestep_enabled; - dc.pc = dc.base.pc_first; - dc.cc_op =CC_OP_DYNAMIC ; - dc.ex_value = dc.base.tb->cs_base; - do_debug = cs->singlestep_enabled; + s->pc = s->base.pc_first; + s->cc_op =CC_OP_DYNAMIC ; + s->ex_value = s->base.tb->cs_base; + s->do_debug = s->base.singlestep_enabled; + s->next_page_start = (s->base.pc_first &TARGET_PAGE_MASK ) + +TARGET_PAGE_SIZE ; - next_page_start = (dc.base.pc_first &TARGET_PAGE_MASK ) +TARGET_PAGE_SIZE ; +return max_insns; +} - num_insns =0 ; - max_insns =tb_cflags (tb) &CF_COUNT_MASK ; -if (max_insns ==0 ) { - max_insns =CF_COUNT_MASK ; - } -if (max_insns >TCG_MAX_INSNS ) { - max_insns =TCG_MAX_INSNS ; - } +static void s390x_tr_tb_start (DisasContextBase *db,CPUState *cs) +{ +} -gen_tb_start (tb); +static void s390x_tr_insn_start (DisasContextBase *dcbase,CPUState *cs) +{ +DisasContext *s =container_of (dcbase, DisasContext, base); -do { -tcg_gen_insn_start (dc.pc, dc.cc_op); - num_insns++; +tcg_gen_insn_start (s->pc, s->cc_op); +} -if (unlikely (cpu_breakpoint_test (cs, dc.base.pc_next,BP_ANY ))) { - status =DISAS_PC_STALE ; - do_debug = true; -/* The address covered by the breakpoint must be included in -[tb->pc, tb->pc + tb->size) in order to for it to be -properly cleared -- thus we increment the PC here so that -the logic setting tb->size below does the right thing. */ - dc.pc +=2 ; - dc.base.pc_next +=2 ; -break ; - } +static bool s390x_tr_breakpoint_check (DisasContextBase *dcbase,CPUState *cs, +const CPUBreakpoint *bp) +{ +DisasContext *s =container_of (dcbase, DisasContext, base); -if (num_insns == max_insns && (tb_cflags (tb) &CF_LAST_IO )) { -gen_io_start (); - } + s->base.is_jmp =DISAS_PC_STALE ; + s->do_debug = true; +/* The address covered by the breakpoint must be included in +[tb->pc, tb->pc + tb->size) in order to for it to be +properly cleared -- thus we increment the PC here so that +the logic setting tb->size below does the right thing. */ + s->pc +=2 ; + s->base.pc_next +=2 ; +return true; +} - status =translate_one (env, &dc); - dc.base.pc_next = dc.pc; - -/* If we reach a page boundary, are single stepping, -or exhaust instruction count, stop generation. */ -if (status ==DISAS_NEXT - && (dc.pc >= next_page_start - ||tcg_op_buf_full () - || num_insns >= max_insns - || singlestep - || dc.base.singlestep_enabled - || dc.ex_value)) { - status =DISAS_TOO_MANY ; - } - }while (status ==DISAS_NEXT ); +static void s390x_tr_translate_insn (DisasContextBase *dcbase,CPUState *cs) +{ +CPUS390XState *env = cs->env_ptr; +DisasContext *s =container_of (dcbase, DisasContext, base); + + s->base.is_jmp =translate_one (env, s); + s->base.pc_next = s->pc; -if (tb_cflags (tb) &CF_LAST_IO ) { -gen_io_end (); +if (s->base.is_jmp ==DISAS_NEXT + && (s->pc >= s->next_page_start + || s->ex_value)) { + s->base.is_jmp =DISAS_TOO_MANY ; } +} -switch (status) { +static void s390x_tr_tb_stop (DisasContextBase *dcbase,CPUState *cs) +{ +DisasContext *s =container_of (dcbase, DisasContext, base); + +switch (s->base.is_jmp) {case DISAS_GOTO_TB :case DISAS_NORETURN :break ;case DISAS_TOO_MANY :case DISAS_PC_STALE :case DISAS_PC_STALE_NOCHAIN : -update_psw_addr (&dc); +update_psw_addr (s);/* FALLTHRU */ case DISAS_PC_UPDATED :/* Next TB starts off with CC_OP_DYNAMIC, so make sure the cc op type is in env */ -update_cc_op (&dc); +update_cc_op (s);/* FALLTHRU */ case DISAS_PC_CC_UPDATED :/* Exit the TB, either by raising a debug exception or by return. */ -if (do_debug) { +if (s->do_debug) {gen_exception (EXCP_DEBUG ); - }else if (use_exit_tb (&dc) || status ==DISAS_PC_STALE_NOCHAIN ) { + }else if (use_exit_tb (s) || s->base.is_jmp ==DISAS_PC_STALE_NOCHAIN ) {tcg_gen_exit_tb (0 ); }else {tcg_gen_lookup_and_goto_ptr ();
@@ -6211,27 +6204,36 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)default :g_assert_not_reached (); } +} -gen_tb_end (tb, num_insns); - - tb->size = dc.pc - dc.base.pc_first; - tb->icount = num_insns; +static void s390x_tr_disas_log (const DisasContextBase *dcbase,CPUState *cs) +{ +DisasContext *s =container_of (dcbase, DisasContext, base); -#if defined(S390X_DEBUG_DISAS ) -if (qemu_loglevel_mask (CPU_LOG_TB_IN_ASM ) - &&qemu_log_in_addr_range (dc.base.pc_first)) { -qemu_log_lock (); -if (unlikely (dc.ex_value)) { -/* ??? Unfortunately log_target_disas can't use host memory. */ -qemu_log ("IN: EXECUTE %016" PRIx64"\n" , dc.ex_value); - }else { -qemu_log ("IN: %s\n" ,lookup_symbol (dc.base.pc_first)); -log_target_disas (cs, dc.base.pc_first, dc.pc - dc.base.pc_first); -qemu_log ("\n" ); - } -qemu_log_unlock (); +if (unlikely (s->ex_value)) { +/* ??? Unfortunately log_target_disas can't use host memory. */ +qemu_log ("IN: EXECUTE %016" PRIx64, s->ex_value); + }else { +qemu_log ("IN: %s\n" ,lookup_symbol (s->base.pc_first)); +log_target_disas (cs, s->base.pc_first, s->base.tb->size); } -#endif +} + +static const TranslatorOps s390x_tr_ops = { + .init_disas_context = s390x_tr_init_disas_context, + .tb_start = s390x_tr_tb_start, + .insn_start = s390x_tr_insn_start, + .breakpoint_check = s390x_tr_breakpoint_check, + .translate_insn = s390x_tr_translate_insn, + .tb_stop = s390x_tr_tb_stop, + .disas_log = s390x_tr_disas_log, +}; + +void gen_intermediate_code (CPUState *cs,TranslationBlock *tb) +{ +DisasContext dc; + +translator_loop (&s390x_tr_ops, &dc.base, cs, tb); } void restore_state_to_opc(CPUS390XState *env, TranslationBlock *tb,
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 3/3] target/s390x: convert to TranslatorOps
On 17.02.2018 00:40, Emilio G. Cota wrote:
Can you keep DisasContext named dc instead of s? Avoids unnecessary changes. (e.g. s390x_tr_tb_stop()). And also matches what e.g. i386 does in their code.
Quoted 50 lines
Signed-off-by Emilio G. Cota <[email protected]>--- target/s390x/translate.c | 170 ++++++++++++++++++++++++----------------------- 1 file changed, 86 insertions(+), 84 deletions(-)target/s390x/translate.c +8
-13@@ -55,10 +55,12 @@ struct DisasContext {DisasContextBase base;const DisasInsn *insn;DisasFields *fields; +uint64_t next_page_start;uint64_t ex_value;uint64_t pc, next_pc;uint32_t ilen;enum cc_op cc_op; +bool do_debug; };/* Information carried about a condition to be evaluated. */ @@ -6108,101 +6110,92 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s)return ret; } -void gen_intermediate_code (CPUState *cs,struct TranslationBlock *tb) +static int s390x_tr_init_disas_context (DisasContextBase *dcbase, +CPUState *cs,int max_insns) { -CPUS390XState *env = cs->env_ptr; -DisasContext dc; -uint64_t next_page_start; -int num_insns, max_insns; -DisasJumpType status; -bool do_debug; +DisasContext *s =container_of (dcbase, DisasContext, base); - dc.base.pc_first = tb->pc;/* 31-bit mode */ -if (!(tb->flags &FLAG_MASK_64 )) { - dc.base.pc_first &=0x7fffffff ; +if (!(s->base.tb->flags &FLAG_MASK_64 )) { + s->base.pc_first &=0x7fffffff ; + s->base.pc_next = s->base.pc_first; } - dc.base.pc_next = dc.base.pc_first; - dc.base.tb = tb; - dc.base.singlestep_enabled = cs->singlestep_enabled;
target/s390x/translate.c static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s) · line 6129
Quoted 10 lines
target/s390x/translate.c +6
-4- dc.pc = dc.base.pc_first; - dc.cc_op =CC_OP_DYNAMIC ; - dc.ex_value = dc.base.tb->cs_base; - do_debug = cs->singlestep_enabled; + s->pc = s->base.pc_first; + s->cc_op =CC_OP_DYNAMIC ; + s->ex_value = s->base.tb->cs_base; + s->do_debug = s->base.singlestep_enabled; + s->next_page_start = (s->base.pc_first &TARGET_PAGE_MASK ) + +TARGET_PAGE_SIZE ;
Does it really make sense to store this pre calculation? Can't you simply do that in ops->translate_insn?
target/s390x/translate.c static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s) · line 6151
Quoted 10 lines
target/s390x/translate.c +6
-3+static bool s390x_tr_breakpoint_check (DisasContextBase *dcbase,CPUState *cs, +const CPUBreakpoint *bp) +{ +DisasContext *s =container_of (dcbase, DisasContext, base); -if (num_insns == max_insns && (tb_cflags (tb) &CF_LAST_IO )) { -gen_io_start (); - } + s->base.is_jmp =DISAS_PC_STALE ; + s->do_debug = true;
Can we drop s->do_debug and instead use DISAS_TOO_MANY like the other architectures? (if I understood that part correctly :) )
Quoted 9 lines
target/s390x/translate.c +8
-0+/* The address covered by the breakpoint must be included in +[tb->pc, tb->pc + tb->size) in order to for it to be +properly cleared -- thus we increment the PC here so that +the logic setting tb->size below does the right thing. */ + s->pc +=2 ; + s->base.pc_next +=2 ; +return true; +}
Signature · 3 lines
Thanks, David / dhildenb
Quoted 7 lines · Emilio G. Cota
Tested with the "Moon Buggy" image:
http://www.qemu-advent-calendar.org/2014/#day-22Thanks,
Emilio
This also passes kvm-unit-tests and and fedora27 boots fine.
Signature · 3 lines
Thanks, David / dhildenb