summary refs log tree commit diff stats
path: root/target-arm/helper.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2014-01-07 17:19:14 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-01-07 19:18:08 +0000
commit3617f86ba87a0f54b74dbaed0d92da13beb14e45 (patch)
tree630541a4309080ec811d9d97580d6df61548694c /target-arm/helper.c
parent8fe2a36f33f44e9d1333c851762ac463ad528233 (diff)
downloadfocaccia-qemu-3617f86ba87a0f54b74dbaed0d92da13beb14e45.tar.gz
focaccia-qemu-3617f86ba87a0f54b74dbaed0d92da13beb14e45.zip
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 <agraf@suse.de>
[WN: Commit message tweak, rebased, updated to new infrastructure.
 Applied bug fixes from Michael Matz and Janne Grunau.]
Signed-off-by: Will Newton <will.newton@linaro.org>
[PMM: significant cleanup]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-arm/helper.c')
-rw-r--r--target-arm/helper.c13
1 files changed, 13 insertions, 0 deletions
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)
 {