qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 25/72] softfloat: Rearrange FloatParts64


From: Alex Bennée
Subject: Re: [PATCH 25/72] softfloat: Rearrange FloatParts64
Date: Wed, 12 May 2021 12:08:56 +0100
User-agent: mu4e 1.5.13; emacs 28.0.50

Richard Henderson <richard.henderson@linaro.org> writes:

> On 5/11/21 8:57 AM, Alex Bennée wrote:
>>> +    union {
>>> +        /* Routines that know the structure may reference the singular 
>>> name. */
>>> +        uint64_t frac;
>>> +        /*
>>> +         * Routines expanded with multiple structures reference "hi" and 
>>> "lo".
>>> +         * In this structure, the one word is both highest and lowest.
>>> +         */
>>> +        uint64_t frac_hi;
>>> +        uint64_t frac_lo;
>> This confuses me. Is this because it could be frac_hi or frac_lo at
>> the
>> "top" of the structure because of endian issues?
>
> Nothing about endianness.  There is exactly one element, so it is both
> the "first" and "last", both "high" and "low".
>
> Generic code will examine the "high" word when looking at overflow and
> things related, and the "low" word when doing rounding.
>
> This anonymous union gives the same element 3 different names.

Right, that makes things clearer. How about:

  Routines expanded with multiple structures reference "hi" and "lo"
  depending on the operation. In the case of FloatParts64 they are both
  the same word but aliased here to make the code easier to follow.

?

Either way have a:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée



reply via email to

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