qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [V2 PATCH 11/18] softfloat: Fix float64_to_uint32


From: Peter Maydell
Subject: Re: [Qemu-devel] [V2 PATCH 11/18] softfloat: Fix float64_to_uint32
Date: Wed, 11 Dec 2013 19:53:38 +0000

On 11 December 2013 19:16, Tom Musta <address@hidden> wrote:
>  uint32 float64_to_uint32( float64 a STATUS_PARAM )
>  {
> -    int64_t v;
> +    uint64_t v;
>      uint32 res;
>
> -    v = float64_to_int64(a STATUS_VAR);
> -    if (v < 0) {
> -        res = 0;
> -        float_raise( float_flag_invalid STATUS_VAR);
> -    } else if (v > 0xffffffff) {
> +    v = float64_to_uint64(a STATUS_VAR);
> +    if (v > 0xffffffff) {
>          res = 0xffffffff;
> +        STATUS(float_exception_flags) &= ~float_flag_inexact;

The IEEE exception flags are cumulative (ie never get cleared
except by guest program explicit request); this change means
that if a previous operation raised the inexact flag you've just
lost that.

thanks
-- PMM



reply via email to

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