target-unicore32: remove cpu_halted()
PATCH 3/3 target-unicore32: mark a few helpers const + pure
In reply to Aurelien JarnoHelpers that do not trigger exceptions and do only access to the arguments can be declared as const + pure.
--- target-unicore32/helper.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
target-unicore32/helper.h +7 -7
@@ -29,9 +29,9 @@ DEF_HELPER_2(adc_cc, i32, i32, i32) DEF_HELPER_2(sub_cc, i32, i32, i32) DEF_HELPER_2(sbc_cc, i32, i32, i32) -DEF_HELPER_2(shl, i32, i32, i32) -DEF_HELPER_2(shr, i32, i32, i32) -DEF_HELPER_2(sar, i32, i32, i32) +DEF_HELPER_FLAGS_2(shl, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32) +DEF_HELPER_FLAGS_2(shr, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32) +DEF_HELPER_FLAGS_2(sar, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32) DEF_HELPER_2(shl_cc, i32, i32, i32) DEF_HELPER_2(shr_cc, i32, i32, i32)DEF_HELPER_2 (sar_cc, i32, i32, i32)
@@ -51,10 +51,10 @@ DEF_HELPER_2(ucf64_muls, f32, f32, f32) DEF_HELPER_2(ucf64_muld, f64, f64, f64) DEF_HELPER_2(ucf64_divs, f32, f32, f32) DEF_HELPER_2(ucf64_divd, f64, f64, f64) -DEF_HELPER_1(ucf64_negs, f32, f32) -DEF_HELPER_1(ucf64_negd, f64, f64) -DEF_HELPER_1(ucf64_abss, f32, f32) -DEF_HELPER_1(ucf64_absd, f64, f64) +DEF_HELPER_FLAGS_1(ucf64_negs, TCG_CALL_CONST | TCG_CALL_PURE, f32, f32) +DEF_HELPER_FLAGS_1(ucf64_negd, TCG_CALL_CONST | TCG_CALL_PURE, f64, f64) +DEF_HELPER_FLAGS_1(ucf64_abss, TCG_CALL_CONST | TCG_CALL_PURE, f32, f32) +DEF_HELPER_FLAGS_1(ucf64_absd, TCG_CALL_CONST | TCG_CALL_PURE, f64, f64) DEF_HELPER_3(ucf64_cmps, void, f32, f32, i32)DEF_HELPER_3 (ucf64_cmpd, void, f64, f64, i32)
Signature · 1 line
1.7.2.3
PATCH 1/3 target-unicore32: remove cpu_halted()
cpu_halted() has been removed on all targets in commit eda48c344f35e5bd511dea3e8be56fb08c19b399. Also remove it on unicore32.
--- target-unicore32/exec.h | 15 --------------- 1 files changed, 0 insertions(+), 15 deletions(-)
target-unicore32/exec.h +0 -15
@@ -32,19 +32,4 @@ static inline int cpu_has_work(CPUState *env) (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB); } -static inline int cpu_halted (CPUState *env) -{ -if (!env->halted) { -return 0 ; - } -/* An interrupt wakes the CPU even if the I and R ASR bits are -set. We use EXITTB to silently wake CPU without causing an -actual interrupt. */ -if (cpu_has_work (env)) { - env->halted =0 ; -return 0 ; - } -return EXCP_HALTED ; -} -#endif /* __UC32_EXEC_H__ */
Signature · 1 line
1.7.2.3
PATCH 2/3 target-unicore32: move FPU helpers to op_helper.c
This patch moves FPU helpers to op_helper.c, which has direct access to the env pointer. This means one less argument to pass, so a gain in speed.
--- target-unicore32/helper.c | 329 ------------------------------------------ target-unicore32/helper.h | 36 +++--- target-unicore32/op_helper.c | 329 ++++++++++++++++++++++++++++++++++++++++++ target-unicore32/translate.c | 28 ++-- 4 files changed, 361 insertions(+), 361 deletions(-)
target-unicore32/helper.c +0 -329
@@ -156,332 +156,3 @@ uint32_t HELPER(get_r29_banked)(CPUState *env, uint32_t mode)return 0 ; } -/* UniCore-F64 support. We follow the convention used for F64 instrunctions: -Single precition routines have a "s" suffix, double precision a -"d" suffix. */ - -/* Convert host exception flags to f64 form. */ -static inline int ucf64_exceptbits_from_host (int host_bits) -{ -int target_bits =0 ; - -if (host_bits & float_flag_invalid) { - target_bits |=UCF64_FPSCR_FLAG_INVALID ; - } -if (host_bits & float_flag_divbyzero) { - target_bits |=UCF64_FPSCR_FLAG_DIVZERO ; - } -if (host_bits & float_flag_overflow) { - target_bits |=UCF64_FPSCR_FLAG_OVERFLOW ; - } -if (host_bits & float_flag_underflow) { - target_bits |=UCF64_FPSCR_FLAG_UNDERFLOW ; - } -if (host_bits & float_flag_inexact) { - target_bits |=UCF64_FPSCR_FLAG_INEXACT ; - } -return target_bits; -} - -uint32_t HELPER (ucf64_get_fpscr )(CPUState *env) -{ -int i; -uint32_t fpscr; - - fpscr = (env->ucf64.xregs[UC32_UCF64_FPSCR ] &UCF64_FPSCR_MASK ); - i =get_float_exception_flags (&env->ucf64.fp_status); - fpscr |=ucf64_exceptbits_from_host (i); -return fpscr; -} - -/* Convert ucf64 exception flags to target form. */ -static inline int ucf64_exceptbits_to_host (int target_bits) -{ -int host_bits =0 ; - -if (target_bits &UCF64_FPSCR_FLAG_INVALID ) { - host_bits |= float_flag_invalid; - } -if (target_bits &UCF64_FPSCR_FLAG_DIVZERO ) { - host_bits |= float_flag_divbyzero; - } -if (target_bits &UCF64_FPSCR_FLAG_OVERFLOW ) { - host_bits |= float_flag_overflow; - } -if (target_bits &UCF64_FPSCR_FLAG_UNDERFLOW ) { - host_bits |= float_flag_underflow; - } -if (target_bits &UCF64_FPSCR_FLAG_INEXACT ) { - host_bits |= float_flag_inexact; - } -return host_bits; -} - -void HELPER (ucf64_set_fpscr )(CPUState *env,uint32_t val) -{ -int i; -uint32_t changed; - - changed = env->ucf64.xregs[UC32_UCF64_FPSCR ]; - env->ucf64.xregs[UC32_UCF64_FPSCR ] = (val &UCF64_FPSCR_MASK ); - - changed ^= val; -if (changed & (UCF64_FPSCR_RND_MASK )) { - i =UCF64_FPSCR_RND (val); -switch (i) { -case 0 : - i = float_round_nearest_even; -break ; -case 1 : - i = float_round_to_zero; -break ; -case 2 : - i = float_round_up; -break ; -case 3 : - i = float_round_down; -break ; -default :/* 100 and 101 not implement */ -cpu_abort (env,"Unsupported UniCore-F64 round mode" ); - } -set_float_rounding_mode (i, &env->ucf64.fp_status); - } - - i =ucf64_exceptbits_to_host (UCF64_FPSCR_TRAPEN (val)); -set_float_exception_flags (i, &env->ucf64.fp_status); -} - -float32 HELPER (ucf64_adds )(float32 a,float32 b,CPUState *env) -{ -return float32_add (a, b, &env->ucf64.fp_status); -} - -float64 HELPER (ucf64_addd )(float64 a,float64 b,CPUState *env) -{ -return float64_add (a, b, &env->ucf64.fp_status); -} - -float32 HELPER (ucf64_subs )(float32 a,float32 b,CPUState *env) -{ -return float32_sub (a, b, &env->ucf64.fp_status); -} - -float64 HELPER (ucf64_subd )(float64 a,float64 b,CPUState *env) -{ -return float64_sub (a, b, &env->ucf64.fp_status); -} - -float32 HELPER (ucf64_muls )(float32 a,float32 b,CPUState *env) -{ -return float32_mul (a, b, &env->ucf64.fp_status); -} - -float64 HELPER (ucf64_muld )(float64 a,float64 b,CPUState *env) -{ -return float64_mul (a, b, &env->ucf64.fp_status); -} - -float32 HELPER (ucf64_divs )(float32 a,float32 b,CPUState *env) -{ -return float32_div (a, b, &env->ucf64.fp_status); -} - -float64 HELPER (ucf64_divd )(float64 a,float64 b,CPUState *env) -{ -return float64_div (a, b, &env->ucf64.fp_status); -} - -float32 HELPER (ucf64_negs )(float32 a) -{ -return float32_chs (a); -} - -float64 HELPER (ucf64_negd )(float64 a) -{ -return float64_chs (a); -} - -float32 HELPER (ucf64_abss )(float32 a) -{ -return float32_abs (a); -} - -float64 HELPER (ucf64_absd )(float64 a) -{ -return float64_abs (a); -} - -/* XXX: check quiet/signaling case */ -void HELPER (ucf64_cmps )(float32 a,float32 b,uint32_t c,CPUState *env) -{ -int flag; - flag =float32_compare_quiet (a, b, &env->ucf64.fp_status); - env->CF =0 ; -switch (c &0x7 ) { -case 0 :/* F */ -break ; -case 1 :/* UN */ -if (flag ==2 ) { - env->CF =1 ; - } -break ; -case 2 :/* EQ */ -if (flag ==0 ) { - env->CF =1 ; - } -break ; -case 3 :/* UEQ */ -if ((flag ==0 ) || (flag ==2 )) { - env->CF =1 ; - } -break ; -case 4 :/* OLT */ -if (flag ==-1 ) { - env->CF =1 ; - } -break ; -case 5 :/* ULT */ -if ((flag ==-1 ) || (flag ==2 )) { - env->CF =1 ; - } -break ; -case 6 :/* OLE */ -if ((flag ==-1 ) || (flag ==0 )) { - env->CF =1 ; - } -break ; -case 7 :/* ULE */ -if (flag !=1 ) { - env->CF =1 ; - } -break ; - } - env->ucf64.xregs[UC32_UCF64_FPSCR ] = (env->CF <<29 ) - | (env->ucf64.xregs[UC32_UCF64_FPSCR ] &0x0fffffff ); -} - -void HELPER (ucf64_cmpd )(float64 a,float64 b,uint32_t c,CPUState *env) -{ -int flag; - flag =float64_compare_quiet (a, b, &env->ucf64.fp_status); - env->CF =0 ; -switch (c &0x7 ) { -case 0 :/* F */ -break ; -case 1 :/* UN */ -if (flag ==2 ) { - env->CF =1 ; - } -break ; -case 2 :/* EQ */ -if (flag ==0 ) { - env->CF =1 ; - } -break ; -case 3 :/* UEQ */ -if ((flag ==0 ) || (flag ==2 )) { - env->CF =1 ; - } -break ; -case 4 :/* OLT */ -if (flag ==-1 ) { - env->CF =1 ; - } -break ; -case 5 :/* ULT */ -if ((flag ==-1 ) || (flag ==2 )) { - env->CF =1 ; - } -break ; -case 6 :/* OLE */ -if ((flag ==-1 ) || (flag ==0 )) { - env->CF =1 ; - } -break ; -case 7 :/* ULE */ -if (flag !=1 ) { - env->CF =1 ; - } -break ; - } - env->ucf64.xregs[UC32_UCF64_FPSCR ] = (env->CF <<29 ) - | (env->ucf64.xregs[UC32_UCF64_FPSCR ] &0x0fffffff ); -} - -/* Helper routines to perform bitwise copies between float and int. */ -static inline float32 ucf64_itos (uint32_t i) -{ -union { -uint32_t i; -float32 s; - } v; - - v.i = i; -return v.s; -} - -static inline uint32_t ucf64_stoi (float32 s) -{ -union { -uint32_t i; -float32 s; - } v; - - v.s = s; -return v.i; -} - -static inline float64 ucf64_itod (uint64_t i) -{ -union { -uint64_t i; -float64 d; - } v; - - v.i = i; -return v.d; -} - -static inline uint64_t ucf64_dtoi (float64 d) -{ -union { -uint64_t i; -float64 d; - } v; - - v.d = d; -return v.i; -} - -/* Integer to float conversion. */ -float32 HELPER (ucf64_si2sf )(float32 x,CPUState *env) -{ -return int32_to_float32 (ucf64_stoi (x), &env->ucf64.fp_status); -} - -float64 HELPER (ucf64_si2df )(float32 x,CPUState *env) -{ -return int32_to_float64 (ucf64_stoi (x), &env->ucf64.fp_status); -} - -/* Float to integer conversion. */ -float32 HELPER (ucf64_sf2si )(float32 x,CPUState *env) -{ -return ucf64_itos (float32_to_int32 (x, &env->ucf64.fp_status)); -} - -float32 HELPER (ucf64_df2si )(float64 x,CPUState *env) -{ -return ucf64_itos (float64_to_int32 (x, &env->ucf64.fp_status)); -} - -/* floating point conversion */ -float64 HELPER (ucf64_sf2df )(float32 x,CPUState *env) -{ -return float32_to_float64 (x, &env->ucf64.fp_status); -} - -float32 HELPER (ucf64_df2sf )(float64 x,CPUState *env) -{ -return float64_to_float32 (x, &env->ucf64.fp_status); -}
target-unicore32/helper.h +18 -18
@@ -40,31 +40,31 @@ DEF_HELPER_2(ror_cc, i32, i32, i32) DEF_HELPER_2(get_r29_banked, i32, env, i32) DEF_HELPER_3(set_r29_banked, void, env, i32, i32) -DEF_HELPER_1(ucf64_get_fpscr, i32, env) -DEF_HELPER_2(ucf64_set_fpscr, void, env, i32) +DEF_HELPER_0(ucf64_get_fpscr, i32) +DEF_HELPER_1(ucf64_set_fpscr, void, i32) -DEF_HELPER_3(ucf64_adds, f32, f32, f32, env) -DEF_HELPER_3(ucf64_addd, f64, f64, f64, env) -DEF_HELPER_3(ucf64_subs, f32, f32, f32, env) -DEF_HELPER_3(ucf64_subd, f64, f64, f64, env) -DEF_HELPER_3(ucf64_muls, f32, f32, f32, env) -DEF_HELPER_3(ucf64_muld, f64, f64, f64, env) -DEF_HELPER_3(ucf64_divs, f32, f32, f32, env) -DEF_HELPER_3(ucf64_divd, f64, f64, f64, env) +DEF_HELPER_2(ucf64_adds, f32, f32, f32) +DEF_HELPER_2(ucf64_addd, f64, f64, f64) +DEF_HELPER_2(ucf64_subs, f32, f32, f32) +DEF_HELPER_2(ucf64_subd, f64, f64, f64) +DEF_HELPER_2(ucf64_muls, f32, f32, f32) +DEF_HELPER_2(ucf64_muld, f64, f64, f64) +DEF_HELPER_2(ucf64_divs, f32, f32, f32) +DEF_HELPER_2(ucf64_divd, f64, f64, f64) DEF_HELPER_1(ucf64_negs, f32, f32) DEF_HELPER_1(ucf64_negd, f64, f64) DEF_HELPER_1(ucf64_abss, f32, f32) DEF_HELPER_1(ucf64_absd, f64, f64) -DEF_HELPER_4(ucf64_cmps, void, f32, f32, i32, env) -DEF_HELPER_4(ucf64_cmpd, void, f64, f64, i32, env) +DEF_HELPER_3(ucf64_cmps, void, f32, f32, i32) +DEF_HELPER_3(ucf64_cmpd, void, f64, f64, i32) -DEF_HELPER_2(ucf64_sf2df, f64, f32, env) -DEF_HELPER_2(ucf64_df2sf, f32, f64, env) +DEF_HELPER_1(ucf64_sf2df, f64, f32) +DEF_HELPER_1(ucf64_df2sf, f32, f64) -DEF_HELPER_2(ucf64_si2sf, f32, f32, env) -DEF_HELPER_2(ucf64_si2df, f64, f32, env) +DEF_HELPER_1(ucf64_si2sf, f32, f32) +DEF_HELPER_1(ucf64_si2df, f64, f32) -DEF_HELPER_2(ucf64_sf2si, f32, f32, env) -DEF_HELPER_2(ucf64_df2si, f32, f64, env) +DEF_HELPER_1(ucf64_sf2si, f32, f32) +DEF_HELPER_1(ucf64_df2si, f32, f64)#include "def-helper.h"
target-unicore32/op_helper.c +329 -0
332 lines not on this page · raw message
target-unicore32/translate.c +14 -14
@@ -790,12 +790,12 @@ static void do_ucf64_trans(CPUState *env, DisasContext *s, uint32_t insn)if (UCOP_SET (24 )) {/* CFF */ tmp =new_tmp (); -gen_helper_ucf64_get_fpscr (tmp, cpu_env); +gen_helper_ucf64_get_fpscr (tmp);store_reg (s,UCOP_REG_D , tmp); }else {/* CTF */ tmp =load_reg (s,UCOP_REG_D ); -gen_helper_ucf64_set_fpscr (cpu_env, tmp); +gen_helper_ucf64_set_fpscr (tmp);dead_tmp (tmp);gen_lookup_tb (s); }
@@ -829,11 +829,11 @@ static void do_ucf64_trans(CPUState *env, DisasContext *s, uint32_t insn)if (UCOP_SET (26 )) {tcg_gen_ld_i64 (cpu_F0d, cpu_env,ucf64_reg_offset (UCOP_REG_N ));tcg_gen_ld_i64 (cpu_F1d, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -gen_helper_ucf64_cmpd (cpu_F0d, cpu_F1d, tmp, cpu_env); +gen_helper_ucf64_cmpd (cpu_F0d, cpu_F1d, tmp); }else {tcg_gen_ld_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_N ));tcg_gen_ld_i32 (cpu_F1s, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -gen_helper_ucf64_cmps (cpu_F0s, cpu_F1s, tmp, cpu_env); +gen_helper_ucf64_cmps (cpu_F0s, cpu_F1s, tmp); }dead_tmp (tmp);return ;
@@ -855,12 +855,12 @@ static void do_ucf64_fcvt(CPUState *env, DisasContext *s, uint32_t insn)switch (UCOP_UCF64_FMT ) {case 1 /* d */ :tcg_gen_ld_i64 (cpu_F0d, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -gen_helper_ucf64_df2sf (cpu_F0s, cpu_F0d, cpu_env); +gen_helper_ucf64_df2sf (cpu_F0s, cpu_F0d);tcg_gen_st_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_D ));break ;case 2 /* w */ :tcg_gen_ld_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -gen_helper_ucf64_si2sf (cpu_F0s, cpu_F0s, cpu_env); +gen_helper_ucf64_si2sf (cpu_F0s, cpu_F0s);tcg_gen_st_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_D ));break ;default /* s */ :
@@ -872,12 +872,12 @@ static void do_ucf64_fcvt(CPUState *env, DisasContext *s, uint32_t insn)switch (UCOP_UCF64_FMT ) {case 0 /* s */ :tcg_gen_ld_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -gen_helper_ucf64_sf2df (cpu_F0d, cpu_F0s, cpu_env); +gen_helper_ucf64_sf2df (cpu_F0d, cpu_F0s);tcg_gen_st_i64 (cpu_F0d, cpu_env,ucf64_reg_offset (UCOP_REG_D ));break ;case 2 /* w */ :tcg_gen_ld_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -gen_helper_ucf64_si2df (cpu_F0d, cpu_F0s, cpu_env); +gen_helper_ucf64_si2df (cpu_F0d, cpu_F0s);tcg_gen_st_i64 (cpu_F0d, cpu_env,ucf64_reg_offset (UCOP_REG_D ));break ;default /* d */ :
@@ -889,12 +889,12 @@ static void do_ucf64_fcvt(CPUState *env, DisasContext *s, uint32_t insn)switch (UCOP_UCF64_FMT ) {case 0 /* s */ :tcg_gen_ld_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -gen_helper_ucf64_sf2si (cpu_F0s, cpu_F0s, cpu_env); +gen_helper_ucf64_sf2si (cpu_F0s, cpu_F0s);tcg_gen_st_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_D ));break ;case 1 /* d */ :tcg_gen_ld_i64 (cpu_F0d, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -gen_helper_ucf64_df2si (cpu_F0s, cpu_F0d, cpu_env); +gen_helper_ucf64_df2si (cpu_F0s, cpu_F0d);tcg_gen_st_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_D ));break ;default /* w */ :
@@ -921,11 +921,11 @@ static void do_ucf64_fcmp(CPUState *env, DisasContext *s, uint32_t insn)if (UCOP_SET (24 )) {tcg_gen_ld_i64 (cpu_F0d, cpu_env,ucf64_reg_offset (UCOP_REG_N ));tcg_gen_ld_i64 (cpu_F1d, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -/* gen_helper_ucf64_cmpd(cpu_F0d, cpu_F1d, cpu_env); */ +/* gen_helper_ucf64_cmpd(cpu_F0d, cpu_F1d); */ }else {tcg_gen_ld_i32 (cpu_F0s, cpu_env,ucf64_reg_offset (UCOP_REG_N ));tcg_gen_ld_i32 (cpu_F1s, cpu_env,ucf64_reg_offset (UCOP_REG_M )); -/* gen_helper_ucf64_cmps(cpu_F0s, cpu_F1s, cpu_env); */ +/* gen_helper_ucf64_cmps(cpu_F0s, cpu_F1s); */ } }
@@ -965,7 +965,7 @@ static void do_ucf64_fcmp(CPUState *env, DisasContext *s, uint32_t insn)tcg_gen_ld_i32 (cpu_F1s, cpu_env, \ucf64_reg_offset (UCOP_REG_M )); \ gen_helper_ucf64_##name##s(cpu_F0s, \ - cpu_F0s, cpu_F1s, cpu_env); \ + cpu_F0s, cpu_F1s); \ tcg_gen_st_i32(cpu_F0s, cpu_env, \ ucf64_reg_offset(UCOP_REG_D)); \ break; \
@@ -975,7 +975,7 @@ static void do_ucf64_fcmp(CPUState *env, DisasContext *s, uint32_t insn)tcg_gen_ld_i64 (cpu_F1d, cpu_env, \ucf64_reg_offset (UCOP_REG_M )); \ gen_helper_ucf64_##name##d(cpu_F0d, \ - cpu_F0d, cpu_F1d, cpu_env); \ + cpu_F0d, cpu_F1d); \ tcg_gen_st_i64(cpu_F0d, cpu_env, \ ucf64_reg_offset(UCOP_REG_D)); \ break; \
Signature · 1 line
1.7.2.3
Guan Xuetao
AppliedApplied.
Thanks.
Guan Xuetao
Quoted 42 lines
-----Original Message-----
From: Aurelien Jarno [mailto:[email protected]]
Sent: Wednesday, April 13, 2011 6:31 AM
To: [email protected]
Cc: Aurelien Jarno; Guan Xuetao
Subject: [PATCH 1/3] target-unicore32: removecpu_halted()
cpu_halted()has been removed on all targets in commiteda48c344f35e5bd511dea3e8be56fb08c19b399. Also remove it on unicore32.Cc Guan Xuetao <[email protected]>Signed-off-by Aurelien Jarno <[email protected]>--- target-unicore32/exec.h | 15 --------------- 1 files changed, 0 insertions(+), 15 deletions(-)target-unicore32/exec.h +0
-16@@ -32,19 +32,4 @@ static inline int cpu_has_work(CPUState *env) (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB); } -static inline int cpu_halted (CPUState *env) -{ -if (!env->halted) { -return 0 ; - } -/* An interrupt wakes the CPU even if the I and R ASR bits are -set. We use EXITTB to silently wake CPU without causing an -actual interrupt. */ -if (cpu_has_work (env)) { - env->halted =0 ; -return 0 ; - } -return EXCP_HALTED ; -} -#endif /* __UC32_EXEC_H__ */ --1.7.2.3
Guan Xuetao
AppliedRe: [Qemu-devel] [PATCH 3/3] target-unicore32: mark a few helpers const + pure
In reply to Aurelien JarnoApplied, thanks.
Guan
Quoted 50 lines
-----Original Message-----
From: Aurelien Jarno [mailto:[email protected]]
Sent: Wednesday, April 13, 2011 6:31 AM
To: [email protected]
Cc: Aurelien Jarno; Guan Xuetao
Subject: [PATCH 3/3] target-unicore32: mark a few helpers const + pureHelpers that do not trigger exceptions and do only access to the arguments can be declared as const + pure.
Cc Guan Xuetao <[email protected]>Signed-off-by Aurelien Jarno <[email protected]>--- target-unicore32/helper.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)target-unicore32/helper.h +7
-8@@ -29,9 +29,9 @@ DEF_HELPER_2(adc_cc, i32, i32, i32) DEF_HELPER_2(sub_cc, i32, i32, i32) DEF_HELPER_2(sbc_cc, i32, i32, i32) -DEF_HELPER_2(shl, i32, i32, i32) -DEF_HELPER_2(shr, i32, i32, i32) -DEF_HELPER_2(sar, i32, i32, i32) +DEF_HELPER_FLAGS_2(shl, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32) +DEF_HELPER_FLAGS_2(shr, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32) +DEF_HELPER_FLAGS_2(sar, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32) DEF_HELPER_2(shl_cc, i32, i32, i32) DEF_HELPER_2(shr_cc, i32, i32, i32)DEF_HELPER_2 (sar_cc, i32, i32, i32)@@ -51,10 +51,10 @@ DEF_HELPER_2(ucf64_muls, f32, f32, f32) DEF_HELPER_2(ucf64_muld, f64, f64, f64) DEF_HELPER_2(ucf64_divs, f32, f32, f32) DEF_HELPER_2(ucf64_divd, f64, f64, f64) -DEF_HELPER_1(ucf64_negs, f32, f32) -DEF_HELPER_1(ucf64_negd, f64, f64) -DEF_HELPER_1(ucf64_abss, f32, f32) -DEF_HELPER_1(ucf64_absd, f64, f64) +DEF_HELPER_FLAGS_1(ucf64_negs, TCG_CALL_CONST | TCG_CALL_PURE, f32, f32) +DEF_HELPER_FLAGS_1(ucf64_negd, TCG_CALL_CONST | TCG_CALL_PURE, f64, f64) +DEF_HELPER_FLAGS_1(ucf64_abss, TCG_CALL_CONST | TCG_CALL_PURE, f32, f32) +DEF_HELPER_FLAGS_1(ucf64_absd, TCG_CALL_CONST | TCG_CALL_PURE, f64, f64) DEF_HELPER_3(ucf64_cmps, void, f32, f32, i32)DEF_HELPER_3 (ucf64_cmpd, void, f64, f64, i32) --1.7.2.3