aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-05 08:38:44 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-05 08:38:44 +0000
commitc239529e7f4d8f9adfaae7aeb6d73632868d3acd (patch)
treebac8cc53146d7842e62db150f663c6fd6e79f704
parent5cc1d1e628f37424f2c96c585477aaf79ce0d9cc (diff)
Free constant temporaries.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4670 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--target-mips/translate.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/target-mips/translate.c b/target-mips/translate.c
index beb7cf6d85..f0dc14d828 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -425,6 +425,24 @@ enum {
/* global register indices */
static TCGv cpu_env, current_tc_gprs, current_tc_hi, cpu_T[2];
+static inline void tcg_gen_helper_0_1i(void *func, TCGv arg)
+{
+ TCGv t = tcg_const_i32(arg);
+
+ tcg_gen_helper_0_1(func, t);
+ tcg_temp_free(t);
+}
+
+static inline void tcg_gen_helper_0_2ii(void *func, TCGv arg1, TCGv arg2)
+{
+ TCGv t1 = tcg_const_i32(arg1);
+ TCGv t2 = tcg_const_i32(arg2);
+
+ tcg_gen_helper_0_2(func, t1, t2);
+ tcg_temp_free(t1);
+ tcg_temp_free(t2);
+}
+
typedef struct DisasContext {
struct TranslationBlock *tb;
target_ulong pc, saved_pc;
@@ -797,7 +815,7 @@ static always_inline void
generate_exception_err (DisasContext *ctx, int excp, int err)
{
save_cpu_state(ctx, 1);
- tcg_gen_helper_0_2(do_raise_exception_err, tcg_const_i32(excp), tcg_const_i32(err));
+ tcg_gen_helper_0_2ii(do_raise_exception_err, excp, err);
tcg_gen_helper_0_0(do_interrupt_restart);
tcg_gen_exit_tb(0);
}
@@ -806,7 +824,7 @@ static always_inline void
generate_exception (DisasContext *ctx, int excp)
{
save_cpu_state(ctx, 1);
- tcg_gen_helper_0_1(do_raise_exception, tcg_const_i32(excp));
+ tcg_gen_helper_0_1i(do_raise_exception, excp);
tcg_gen_helper_0_0(do_interrupt_restart);
tcg_gen_exit_tb(0);
}