Richard Henderson <richard.hender...@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.ben...@linaro.org>

-- 
Alex Bennée

Reply via email to