diff options
Diffstat (limited to 'target-cris')
| -rw-r--r-- | target-cris/helper.c | 1 | ||||
| -rw-r--r-- | target-cris/op_helper.c | 17 | ||||
| -rw-r--r-- | target-cris/translate.c | 41 | ||||
| -rw-r--r-- | target-cris/translate_v10.c | 2 |
4 files changed, 9 insertions, 52 deletions
diff --git a/target-cris/helper.c b/target-cris/helper.c index 4092d279ba..e8b8261fe9 100644 --- a/target-cris/helper.c +++ b/target-cris/helper.c @@ -21,6 +21,7 @@ #include "cpu.h" #include "mmu.h" #include "qemu/host-utils.h" +#include "exec/cpu_ldst.h" //#define CRIS_HELPER_DEBUG diff --git a/target-cris/op_helper.c b/target-cris/op_helper.c index a9bd742d3b..5c0c14d992 100644 --- a/target-cris/op_helper.c +++ b/target-cris/op_helper.c @@ -22,6 +22,7 @@ #include "mmu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h" +#include "exec/cpu_ldst.h" //#define CRIS_OP_HELPER_DEBUG @@ -35,22 +36,6 @@ #endif #if !defined(CONFIG_USER_ONLY) -#include "exec/softmmu_exec.h" - -#define MMUSUFFIX _mmu - -#define SHIFT 0 -#include "exec/softmmu_template.h" - -#define SHIFT 1 -#include "exec/softmmu_template.h" - -#define SHIFT 2 -#include "exec/softmmu_template.h" - -#define SHIFT 3 -#include "exec/softmmu_template.h" - /* Try to fill the TLB and return an exception if error. If retaddr is NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ diff --git a/target-cris/translate.c b/target-cris/translate.c index 90fe0a24b5..ab0e47962b 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -28,6 +28,7 @@ #include "tcg-op.h" #include "exec/helper-proto.h" #include "mmu.h" +#include "exec/cpu_ldst.h" #include "crisv32-decode.h" #include "exec/helper-gen.h" @@ -159,39 +160,9 @@ static int preg_sizes[] = { }; #define t_gen_mov_TN_env(tn, member) \ - _t_gen_mov_TN_env((tn), offsetof(CPUCRISState, member)) + tcg_gen_ld_tl(tn, cpu_env, offsetof(CPUCRISState, member)) #define t_gen_mov_env_TN(member, tn) \ - _t_gen_mov_env_TN(offsetof(CPUCRISState, member), (tn)) - -static inline void t_gen_mov_TN_reg(TCGv tn, int r) -{ - if (r < 0 || r > 15) { - fprintf(stderr, "wrong register read $r%d\n", r); - } - tcg_gen_mov_tl(tn, cpu_R[r]); -} -static inline void t_gen_mov_reg_TN(int r, TCGv tn) -{ - if (r < 0 || r > 15) { - fprintf(stderr, "wrong register write $r%d\n", r); - } - tcg_gen_mov_tl(cpu_R[r], tn); -} - -static inline void _t_gen_mov_TN_env(TCGv tn, int offset) -{ - if (offset > sizeof(CPUCRISState)) { - fprintf(stderr, "wrong load from env from off=%d\n", offset); - } - tcg_gen_ld_tl(tn, cpu_env, offset); -} -static inline void _t_gen_mov_env_TN(int offset, TCGv tn) -{ - if (offset > sizeof(CPUCRISState)) { - fprintf(stderr, "wrong store to env at off=%d\n", offset); - } - tcg_gen_st_tl(tn, cpu_env, offset); -} + tcg_gen_st_tl(tn, cpu_env, offsetof(CPUCRISState, member)) static inline void t_gen_mov_TN_preg(TCGv tn, int r) { @@ -1811,7 +1782,7 @@ static int dec_swap_r(CPUCRISState *env, DisasContext *dc) cris_cc_mask(dc, CC_MASK_NZ); t0 = tcg_temp_new(); - t_gen_mov_TN_reg(t0, dc->op1); + tcg_gen_mov_tl(t0, cpu_R[dc->op1]); if (dc->op2 & 8) { tcg_gen_not_tl(t0, t0); } @@ -2119,7 +2090,7 @@ static int dec_move_rp(CPUCRISState *env, DisasContext *dc) t[0] = tcg_temp_new(); if (dc->op2 == PR_CCS) { cris_evaluate_flags(dc); - t_gen_mov_TN_reg(t[0], dc->op1); + tcg_gen_mov_tl(t[0], cpu_R[dc->op1]); if (dc->tb_flags & U_FLAG) { t[1] = tcg_temp_new(); /* User space is not allowed to touch all flags. */ @@ -2129,7 +2100,7 @@ static int dec_move_rp(CPUCRISState *env, DisasContext *dc) tcg_temp_free(t[1]); } } else { - t_gen_mov_TN_reg(t[0], dc->op1); + tcg_gen_mov_tl(t[0], cpu_R[dc->op1]); } t_gen_mov_preg_TN(dc, dc->op2, t[0]); diff --git a/target-cris/translate_v10.c b/target-cris/translate_v10.c index 2ad2b142a9..efb3639a06 100644 --- a/target-cris/translate_v10.c +++ b/target-cris/translate_v10.c @@ -516,7 +516,7 @@ static void dec10_reg_swap(DisasContext *dc) cris_cc_mask(dc, CC_MASK_NZVC); t0 = tcg_temp_new(); - t_gen_mov_TN_reg(t0, dc->src); + tcg_gen_mov_tl(t0, cpu_R[dc->src]); if (dc->dst & 8) tcg_gen_not_tl(t0, t0); if (dc->dst & 4) |