[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
- Re: [PATCH 26/72] softfloat: Convert float128_silence_nan to parts, (continued)
- [PATCH 31/72] softfloat: Move sf_canonicalize to softfloat-parts.c.inc, Richard Henderson, 2021/05/07
- [PATCH 18/72] softfloat: Use pointers with unpack_raw, Richard Henderson, 2021/05/07
- [PATCH 24/72] softfloat: Use pointers with parts_silence_nan, Richard Henderson, 2021/05/07
- [PATCH 27/72] softfloat: Convert float128_default_nan to parts, Richard Henderson, 2021/05/07
- [PATCH 28/72] softfloat: Move return_nan to softfloat-parts.c.inc, Richard Henderson, 2021/05/07