[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v3 16/27] target/arm/vfp_helper: Extract vfp_set_fpscr
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-arm] [PATCH v3 16/27] target/arm/vfp_helper: Extract vfp_set_fpscr_from_host() |
Date: |
Mon, 1 Jul 2019 15:25:05 +0200 |
The vfp_set_fpscr() helper contains code specific to the host
floating point implementation (here the SoftFloat library).
Extract this code to vfp_set_fpscr_from_host().
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
target/arm/vfp_helper.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c
index b19a395b67..838f7d25fd 100644
--- a/target/arm/vfp_helper.c
+++ b/target/arm/vfp_helper.c
@@ -81,6 +81,18 @@ static inline int vfp_exceptbits_to_host(int target_bits)
return host_bits;
}
+static uint32_t vfp_get_fpscr_from_host(CPUARMState *env)
+{
+ uint32_t i;
+
+ i = get_float_exception_flags(&env->vfp.fp_status);
+ i |= get_float_exception_flags(&env->vfp.standard_fp_status);
+ /* FZ16 does not generate an input denormal exception. */
+ i |= (get_float_exception_flags(&env->vfp.fp_status_f16)
+ & ~float_flag_input_denormal);
+ return vfp_exceptbits_from_host(i);
+}
+
static void vfp_set_fpscr_to_host(CPUARMState *env, uint32_t val)
{
int i;
@@ -141,12 +153,7 @@ uint32_t HELPER(vfp_get_fpscr)(CPUARMState *env)
| (env->vfp.vec_len << 16)
| (env->vfp.vec_stride << 20);
- i = get_float_exception_flags(&env->vfp.fp_status);
- i |= get_float_exception_flags(&env->vfp.standard_fp_status);
- /* FZ16 does not generate an input denormal exception. */
- i |= (get_float_exception_flags(&env->vfp.fp_status_f16)
- & ~float_flag_input_denormal);
- fpscr |= vfp_exceptbits_from_host(i);
+ fpscr |= vfp_get_fpscr_from_host(env);
i = env->vfp.qc[0] | env->vfp.qc[1] | env->vfp.qc[2] | env->vfp.qc[3];
fpscr |= i ? FPCR_QC : 0;
--
2.20.1
- [Qemu-arm] [PATCH v3 13/27] target/arm: Move debug routines to debug_helper.c, (continued)
- [Qemu-arm] [PATCH v3 13/27] target/arm: Move debug routines to debug_helper.c, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [PATCH v3 15/27] target/arm/vfp_helper: Extract vfp_set_fpscr_to_host(), Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [PATCH v3 19/27] target/arm: Restrict PSCI to TCG, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [PATCH v3 20/27] target/arm: Declare arm_log_exception() function publicly, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [PATCH v3 17/27] target/arm/vfp_helper: Restrict the SoftFloat use to TCG, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [PATCH v3 18/27] target/arm: Restrict semi-hosting to TCG, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [PATCH v3 16/27] target/arm/vfp_helper: Extract vfp_set_fpscr_from_host(),
Philippe Mathieu-Daudé <=
- [Qemu-arm] [PATCH v3 21/27] target/arm: Declare some M-profile functions publicly, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [RFC PATCH v3 23/27] target/arm: Restrict pre-ARMv7 cpus to TCG, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [RFC PATCH v3 24/27] target/arm: Do not build pre-ARMv7 cpus when using KVM, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [RFC PATCH v3 25/27] target/arm: Restrict R and M profiles to TCG, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [RFC PATCH v3 26/27] target/arm: Do not build A/M-profile cpus when using KVM, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [PATCH v3 22/27] target/arm/helper: Move M profile routines to m_helper.c, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-arm] [PATCH v3 27/27] target/arm: Do not build TCG objects when TCG is off, Philippe Mathieu-Daudé, 2019/07/01
- Re: [Qemu-arm] [PATCH v3 00/27] Support disabling TCG on ARM, Peter Maydell, 2019/07/01