[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/10] target-arm/helper.c: For float-int conver
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 10/10] target-arm/helper.c: For float-int conversion helpers pass ints as ints |
Date: |
Fri, 1 Apr 2011 21:25:44 +0300 |
On Fri, Apr 1, 2011 at 5:30 PM, Peter Maydell <address@hidden> wrote:
> Correct the argument and return types for the float<->int conversion helper
> functions so that integer arguments and return values are declared as
> uint32_t/uint64_t, not float32/float64. This allows us to remove the
> hand-rolled functions which were doing bitwise copies between the types
> via unions.
>
> Signed-off-by: Peter Maydell <address@hidden>
> Reviewed-by: Nathan Froyd <address@hidden>
> ---
> target-arm/helper.c | 155
> ++++++++++++++++++--------------------------------
> target-arm/helpers.h | 60 ++++++++++----------
> 2 files changed, 85 insertions(+), 130 deletions(-)
>
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index 78f3d39..6788a4c 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -2486,135 +2486,90 @@ DO_VFP_cmp(s, float32)
> DO_VFP_cmp(d, float64)
> #undef DO_VFP_cmp
>
> -/* Helper routines to perform bitwise copies between float and int. */
> -static inline float32 vfp_itos(uint32_t i)
> -{
> - union {
> - uint32_t i;
> - float32 s;
> - } v;
> -
> - v.i = i;
> - return v.s;
> -}
> -
> -static inline uint32_t vfp_stoi(float32 s)
> -{
> - union {
> - uint32_t i;
> - float32 s;
> - } v;
> -
> - v.s = s;
> - return v.i;
> -}
> -
> -static inline float64 vfp_itod(uint64_t i)
> -{
> - union {
> - uint64_t i;
> - float64 d;
> - } v;
> -
> - v.i = i;
> - return v.d;
> -}
> -
> -static inline uint64_t vfp_dtoi(float64 d)
> -{
> - union {
> - uint64_t i;
> - float64 d;
> - } v;
> -
> - v.d = d;
> - return v.i;
> -}
> -
> /* Integer to float conversion. */
> -float32 VFP_HELPER(uito, s)(float32 x, CPUState *env)
> +float32 VFP_HELPER(uito, s)(uint32_t x, CPUState *env)
If you moved these functions to op_helper.c, passing env would not be
needed anymore.
Another possible optimization is that maybe the softfloat functions
could be used directly as helpers if type of fp_status could be
changed to something that can be passed in a register, like uint32_t.
This would be useful for most targets.
- [Qemu-devel] [PATCH 00/10] [PULL] ARM Neon fixes, Peter Maydell, 2011/04/01
- [Qemu-devel] [PATCH 09/10] target-arm: Don't leak TCG temp for UNDEFs in Neon load/store space, Peter Maydell, 2011/04/01
- [Qemu-devel] [PATCH 02/10] target-arm/neon_helper.c: Use make_float32/float32_val macros, Peter Maydell, 2011/04/01
- [Qemu-devel] [PATCH 06/10] softfloat: Add float*_min() and float*_max() functions, Peter Maydell, 2011/04/01
- [Qemu-devel] [PATCH 07/10] target-arm: Use new softfloat min/max functions for VMAX, VMIN, Peter Maydell, 2011/04/01
- [Qemu-devel] [PATCH 10/10] target-arm/helper.c: For float-int conversion helpers pass ints as ints, Peter Maydell, 2011/04/01
- Re: [Qemu-devel] [PATCH 10/10] target-arm/helper.c: For float-int conversion helpers pass ints as ints,
Blue Swirl <=
- [Qemu-devel] [PATCH 04/10] target-arm: Fix VCLE.F32 #0, VCLT.F32 #0 NaN handling, Peter Maydell, 2011/04/01
- [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status, Peter Maydell, 2011/04/01
- Re: [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status, Blue Swirl, 2011/04/01
- Re: [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status, Peter Maydell, 2011/04/01
- Re: [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status, Blue Swirl, 2011/04/03
- Re: [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status, Peter Maydell, 2011/04/03
- Re: [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status, Blue Swirl, 2011/04/03
- Re: [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status, Peter Maydell, 2011/04/03
- Re: [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status, Blue Swirl, 2011/04/03
- Re: [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status, Aurelien Jarno, 2011/04/03