On Fri, Apr 1, 2011 at 5:30 PM, Peter Maydell <peter.mayd...@linaro.org> wrote: > Make the Neon helper routines use the correct FP status from > the CPUEnv rather than using a dummy static one. This means > they will correctly handle denormals and NaNs and will set > FPSCR exception bits properly. > > Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> > --- > target-arm/helpers.h | 22 +++++++++++----------- > target-arm/neon_helper.c | 21 ++++++++++----------- > target-arm/translate.c | 42 ++++++++++++++++++++++-------------------- > 3 files changed, 43 insertions(+), 42 deletions(-) > > diff --git a/target-arm/helpers.h b/target-arm/helpers.h > index bd6977c..e2260b6 100644 > --- a/target-arm/helpers.h > +++ b/target-arm/helpers.h > @@ -350,17 +350,17 @@ DEF_HELPER_2(neon_qneg_s8, i32, env, i32) > DEF_HELPER_2(neon_qneg_s16, i32, env, i32) > DEF_HELPER_2(neon_qneg_s32, i32, env, i32) > > -DEF_HELPER_2(neon_min_f32, i32, i32, i32) > -DEF_HELPER_2(neon_max_f32, i32, i32, i32) > -DEF_HELPER_2(neon_abd_f32, i32, i32, i32) > -DEF_HELPER_2(neon_add_f32, i32, i32, i32) > -DEF_HELPER_2(neon_sub_f32, i32, i32, i32) > -DEF_HELPER_2(neon_mul_f32, i32, i32, i32) > -DEF_HELPER_2(neon_ceq_f32, i32, i32, i32) > -DEF_HELPER_2(neon_cge_f32, i32, i32, i32) > -DEF_HELPER_2(neon_cgt_f32, i32, i32, i32) > -DEF_HELPER_2(neon_acge_f32, i32, i32, i32) > -DEF_HELPER_2(neon_acgt_f32, i32, i32, i32) > +DEF_HELPER_3(neon_min_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_max_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_abd_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_add_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_sub_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_mul_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_ceq_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_cge_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_cgt_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_acge_f32, i32, env, i32, i32) > +DEF_HELPER_3(neon_acgt_f32, i32, env, i32, i32) > > /* iwmmxt_helper.c */ > DEF_HELPER_2(iwmmxt_maddsq, i64, i64, i64) > diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c > index 002a9c1..97bc1e6 100644 > --- a/target-arm/neon_helper.c > +++ b/target-arm/neon_helper.c > @@ -18,8 +18,7 @@ > > #define SET_QC() env->vfp.xregs[ARM_VFP_FPSCR] = CPSR_Q > > -static float_status neon_float_status; > -#define NFS &neon_float_status > +#define NFS (&env->vfp.standard_fp_status) > > /* Helper routines to perform bitwise copies between float and int. */ > static inline float32 vfp_itos(uint32_t i) > @@ -1794,21 +1793,21 @@ uint32_t HELPER(neon_qneg_s32)(CPUState *env, > uint32_t x) > } > > /* NEON Float helpers. */ > -uint32_t HELPER(neon_min_f32)(uint32_t a, uint32_t b) > +uint32_t HELPER(neon_min_f32)(CPUState *env, uint32_t a, uint32_t b)
I didn't check, but if neon_helper.c is compiled like op_helper.c, passing env should not be needed. If that is not the case, the functions could be moved to op_helper.c.