Commit c239529e7f4d8f9adfaae7aeb6d73632868d3acd
1 parent
5cc1d1e6
Free constant temporaries.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4670 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
20 additions
and
2 deletions
target-mips/translate.c
| ... | ... | @@ -425,6 +425,24 @@ enum { |
| 425 | 425 | /* global register indices */ |
| 426 | 426 | static TCGv cpu_env, current_tc_gprs, current_tc_hi, cpu_T[2]; |
| 427 | 427 | |
| 428 | +static inline void tcg_gen_helper_0_1i(void *func, TCGv arg) | |
| 429 | +{ | |
| 430 | + TCGv t = tcg_const_i32(arg); | |
| 431 | + | |
| 432 | + tcg_gen_helper_0_1(func, t); | |
| 433 | + tcg_temp_free(t); | |
| 434 | +} | |
| 435 | + | |
| 436 | +static inline void tcg_gen_helper_0_2ii(void *func, TCGv arg1, TCGv arg2) | |
| 437 | +{ | |
| 438 | + TCGv t1 = tcg_const_i32(arg1); | |
| 439 | + TCGv t2 = tcg_const_i32(arg2); | |
| 440 | + | |
| 441 | + tcg_gen_helper_0_2(func, t1, t2); | |
| 442 | + tcg_temp_free(t1); | |
| 443 | + tcg_temp_free(t2); | |
| 444 | +} | |
| 445 | + | |
| 428 | 446 | typedef struct DisasContext { |
| 429 | 447 | struct TranslationBlock *tb; |
| 430 | 448 | target_ulong pc, saved_pc; |
| ... | ... | @@ -797,7 +815,7 @@ static always_inline void |
| 797 | 815 | generate_exception_err (DisasContext *ctx, int excp, int err) |
| 798 | 816 | { |
| 799 | 817 | save_cpu_state(ctx, 1); |
| 800 | - tcg_gen_helper_0_2(do_raise_exception_err, tcg_const_i32(excp), tcg_const_i32(err)); | |
| 818 | + tcg_gen_helper_0_2ii(do_raise_exception_err, excp, err); | |
| 801 | 819 | tcg_gen_helper_0_0(do_interrupt_restart); |
| 802 | 820 | tcg_gen_exit_tb(0); |
| 803 | 821 | } |
| ... | ... | @@ -806,7 +824,7 @@ static always_inline void |
| 806 | 824 | generate_exception (DisasContext *ctx, int excp) |
| 807 | 825 | { |
| 808 | 826 | save_cpu_state(ctx, 1); |
| 809 | - tcg_gen_helper_0_1(do_raise_exception, tcg_const_i32(excp)); | |
| 827 | + tcg_gen_helper_0_1i(do_raise_exception, excp); | |
| 810 | 828 | tcg_gen_helper_0_0(do_interrupt_restart); |
| 811 | 829 | tcg_gen_exit_tb(0); |
| 812 | 830 | } | ... | ... |