qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/5] tcg: don't build cpu-exec.o, op_helper.o, o


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 5/5] tcg: don't build cpu-exec.o, op_helper.o, or fpu/softloat.o when TCG disabled
Date: Sat, 3 Sep 2011 00:26:54 +0100

On 2 September 2011 22:48, Anthony Liguori <address@hidden> wrote:

> diff --git a/target-i386/helper.c b/target-i386/helper.c
> index 5df40d4..793e467 100644
> --- a/target-i386/helper.c
> +++ b/target-i386/helper.c
> @@ -32,6 +32,24 @@
>
>  //#define DEBUG_MMU
>
> +void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f)
> +{
> +    CPU_LDoubleU temp;
> +
> +    temp.d = f;
> +    *pmant = temp.l.lower;
> +    *pexp = temp.l.upper;
> +}
> +
> +floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper)
> +{
> +    CPU_LDoubleU temp;
> +
> +    temp.l.upper = upper;
> +    temp.l.lower = mant;
> +    return temp.d;
> +}
> +
>  /* NOTE: must be called outside the CPU execute loop */
>  void cpu_reset(CPUX86State *env)
>  {
> diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
> index 7d90ea7..59ddf44 100644
> --- a/target-i386/op_helper.c
> +++ b/target-i386/op_helper.c
> @@ -4694,24 +4694,6 @@ void helper_fxrstor(target_ulong ptr, int data64)
>     }
>  }
>
> -void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f)
> -{
> -    CPU_LDoubleU temp;
> -
> -    temp.d = f;
> -    *pmant = temp.l.lower;
> -    *pexp = temp.l.upper;
> -}
> -
> -floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper)
> -{
> -    CPU_LDoubleU temp;
> -
> -    temp.l.upper = upper;
> -    temp.l.lower = mant;
> -    return temp.d;
> -}
> -
>  #ifdef TARGET_X86_64
>
>  //#define DEBUG_MULDIV

If we're moving these two functions we should just move them into
target-i386/machine.c and mark them static. They're both only
called once each from that file, so there's no need for them to
be global functions. Or we could just roll them into get_fpreg()
and put_fpreg().

(I suspect their current placement is historical from when
target-i386 still supported two different flavours of double,
one for softfloat and one for softfloat-native.)

[Tangent, but spotted this in target-i386/machine.c:
union x86_longdouble {
    uint64_t mant;
    uint16_t exp;
};

...looks very suspicious that this is a union and not a struct...]

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]