[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] temp-floating-point: Use float32_to_t and t_to_
From: |
Chen Gang |
Subject: |
Re: [Qemu-devel] [PATCH] temp-floating-point: Use float32_to_t and t_to_float32 for the input register value |
Date: |
Mon, 5 Oct 2015 19:54:31 +0800 |
> On 5 October 2015 at 12:21, Chen Gang <address@hidden> wrote:
>> +static float32 t_to_float32 (uint32_t a)
>> +{
>> + CPU_FloatU r;
>> + r.l = a;
>> + return r.f;
>> +}
>
> This appears to be reimplementing make_float32().
>
OK, thanks.
>> +
>> +static uint32_t float32_to_t(float32 a)
>> +{
>> + CPU_FloatU r;
>> + r.f = a;
>> + return r.l;
>> +}
>
> And this is just float32_val().
>
OK, thanks.
>> uint64_t helper_fsingle_add1(CPUTLGState *env, uint64_t rsrc, uint64_t rsrcb)
>> {
>> - FPUTLGState *fpu = &env->fpu;
>> - return fsingle_calc(fpu, int64_to_float32(rsrc, &FP_STATUS),
>> - int64_to_float32(rsrcb, &FP_STATUS),
>> - float32_add);
>> + return fsingle_calc(&env->fpu, t_to_float32((uint32_t)rsrc),
>> + t_to_float32((uint32_t)rsrcb), float32_add);
>> }
>
> Why is the helper for a single-precision operation taking a 64-bit
> argument anyway?
>
Oh, the register are uint64_t, so I guess the input register value are 64-bit,
too.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed