[PATCH v2 07/17] stdio-common: Add scanf long double data for Intel/Motorola 80-bit format
Maciej W. Rozycki
macro@redhat.com
Tue Mar 25 10:23:14 GMT 2025
On Wed, 5 Mar 2025, Andreas Schwab wrote:
> >> +#undef compare_real
> >> +#define compare_real(x, y) \
> >> +({ \
> >> + union \
> >> + { \
> >> + type_t v; \
> >> + uint32_t i[3]; \
> >> + } \
> >> + ux = { .v = x }, uy = { .v = y }; \
> >> + static_assert (sizeof (ux.v) == sizeof (ux.i), "type_t size check"); \
> >> + (ux.i[0] == uy.i[0] && ux.i[1] == uy.i[1] \
> >> + && (ux.i[2] & 0xffff) == (uy.i[2] & 0xffff)); \
> >
> > I don't think this is correct for the big-endian (m68k) case, where the
> > sign and exponent are at the start (big end) of the first word, not the
> > little end of the last word.
>
> We already have ieee_long_double_shape_type, just use it.
Done in v3, thanks for the hint.
Maciej
More information about the Libc-alpha
mailing list