qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/4] softfloat: add float32_set_sign(), float32_


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 2/4] softfloat: add float32_set_sign(), float32_infinity, float64_half, float64_256 and float64_512.
Date: Sun, 20 Feb 2011 22:09:46 +0000

On 20 February 2011 21:52, Aurelien Jarno <address@hidden> wrote:
> On Fri, Feb 18, 2011 at 03:49:15PM +0100, Christophe Lyon wrote:

>> +#define float64_half make_float64(0x3fe0000000000000LL)
>> +#define float64_256 make_float64(0x4070000000000000LL)
>> +#define float64_512 make_float64(0x4080000000000000LL)
>>
>>  
>> /*----------------------------------------------------------------------------
>>  | The pattern for a default generated double-precision NaN.
>
> While it's probably a good idea to define the commonly used values in
> softfloat.h, I don't think we should have all the values used by the
> different targets here. Infinity, one, half, two probably have their
> place here, I don't think it's the case of 256 and 512. It should be
> better to defined them at the target level.

Are you happy with targets just doing make_float*() on a
bit pattern? I guess that's the most straightforward thing,
although at the moment the target-arm code seems to prefer
  float32 three = int32_to_float32(3, s);
I don't care very much personally as long as we're not doing
a runtime division to get a constant 0.5 :-)

Incidentally, if you're up for some target-mips cleanup:
target-mips/op_helper.c:#define FLOAT_ONE32 make_float32(0x3f8 << 20)

could be using float32_one instead. (ditto for float64).

> Also for consistency, I
> think it's better to define these value for all float size, or at least
> for all the common ones (32, 64, maybe 16).

I wouldn't bother with 16, only ARM uses that and only for
conversions to other formats.

-- PMM



reply via email to

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