From 3617f86ba87a0f54b74dbaed0d92da13beb14e45 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 7 Jan 2014 17:19:14 +0000 Subject: target-arm: A64: Add floating-point<->fixed-point instructions This patch adds emulation for the instruction group labeled "Floating-point <-> fixed-point conversions" in the ARM ARM. Namely this includes the instructions SCVTF, UCVTF, FCVTZS, FCVTZU (scalar, fixed-point). Signed-off-by: Alexander Graf [WN: Commit message tweak, rebased, updated to new infrastructure. Applied bug fixes from Michael Matz and Janne Grunau.] Signed-off-by: Will Newton [PMM: significant cleanup] Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target-arm/helper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'target-arm/helper.c') diff --git a/target-arm/helper.c b/target-arm/helper.c index dcf6aa4712..2e76d0b093 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -4035,6 +4035,19 @@ VFP_CONV_FIX_A64(uq, s, 32, 64, uint64) #undef VFP_CONV_FIX_FLOAT #undef VFP_CONV_FLOAT_FIX_ROUND +/* Set the current fp rounding mode and return the old one. + * The argument is a softfloat float_round_ value. + */ +uint32_t HELPER(set_rmode)(uint32_t rmode, CPUARMState *env) +{ + float_status *fp_status = &env->vfp.fp_status; + + uint32_t prev_rmode = get_float_rounding_mode(fp_status); + set_float_rounding_mode(rmode, fp_status); + + return prev_rmode; +} + /* Half precision conversions. */ static float32 do_fcvt_f16_to_f32(uint32_t a, CPUARMState *env, float_status *s) { -- cgit 1.4.1