[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/12] ARM: Return correct result for float-to-i
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 07/12] ARM: Return correct result for float-to-integer conversion of NaN |
Date: |
Mon, 29 Nov 2010 16:49:24 +0000 |
On 29 November 2010 16:38, Nathan Froyd <address@hidden> wrote:
>> +static int float32_is_any_nan(float32 x)
>> +{
>> + return ((float32_val(x) & ~(1 << 31)) > 0x7f800000UL);
>> +}
>> +
>> +static int float64_is_any_nan(float64 x)
>> +{
>> + return ((float64_val(x) & ~(1ULL << 63)) > 0x7ff0000000000000ULL);
>> +}
>
> Why not just use:
>
> static int float32_is_any_nan(float32 x)
> {
> return float32_is_nan(x) || float32_is_signaling_nan(x);
> }
>
> and likewise for the 64-bit case?
That was what my first-pass patches did, but I
rewrote them this way because it seemed more
straightforward to just test for "is this a NaN" rather
than calling two other functions which each test for
"is this some subset of NaN space".
I suppose you could argue that softfloat ought to
have _is_nan() [with the semantics you'd expect
from the function name, not the ones it currently has!],
_is_signalling_nan() and _is_quiet_nan() functions
built in, but it doesn't...
-- PMM
- [Qemu-devel] [PATCH 08/12] ARM: Return correct result for single<->double conversion of NaN, (continued)
[Qemu-devel] [PATCH 01/12] target-arm: Add support for PKHxx in thumb2, Peter Maydell, 2010/11/23
[Qemu-devel] [PATCH 07/12] ARM: Return correct result for float-to-integer conversion of NaN, Peter Maydell, 2010/11/23
[Qemu-devel] [PATCH 03/12] target-arm: Handle 'smc' as an undefined instruction, Peter Maydell, 2010/11/23