From: Oleg Endo Date: Sun, 3 Nov 2019 12:09:26 +0000 (+0000) Subject: re PR libgcc/78804 ([RX] -m64bit-doubles does not work) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da5c1bbe973db144cc1d297ad49b519a870ab0ba;p=gcc.git re PR libgcc/78804 ([RX] -m64bit-doubles does not work) libgcc/ PR libgcc/78804 * fp-bit.h: Remove FLOAT_BIT_ORDER_MISMATCH. * fp-bit.c (pack_d, unpack_d): Remove special cases for FLOAT_BIT_ORDER_MISMATCH. * config/arc/t-arc: Remove FLOAT_BIT_ORDER_MISMATCH. From-SVN: r277752 --- diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 4a855cbeefd..806d048f5d1 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2019-11-03 Oleg Endo + + PR libgcc/78804 + * fp-bit.h: Remove FLOAT_BIT_ORDER_MISMATCH. + * fp-bit.c (pack_d, unpack_d): Remove special cases for + FLOAT_BIT_ORDER_MISMATCH. + * config/arc/t-arc: Remove FLOAT_BIT_ORDER_MISMATCH. + 2019-11-01 Jim Wilson * config/riscv/t-softfp32 (softfp_extra): Add FP divide routines diff --git a/libgcc/config/arc/t-arc b/libgcc/config/arc/t-arc index 7b0956cf68d..9e1b1307a58 100644 --- a/libgcc/config/arc/t-arc +++ b/libgcc/config/arc/t-arc @@ -46,7 +46,6 @@ LIB2ADD = fp-bit.c dp-bit.c dp-bit.c: $(srcdir)/fp-bit.c echo '#ifndef __big_endian__' > dp-bit.c - echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c echo '#endif' >> dp-bit.c echo '#include "fp-bit.h"' >> dp-bit.c echo '#include "config/arc/dp-hack.h"' >> dp-bit.c @@ -55,7 +54,6 @@ dp-bit.c: $(srcdir)/fp-bit.c fp-bit.c: $(srcdir)/fp-bit.c echo '#define FLOAT' > fp-bit.c echo '#ifndef __big_endian__' >> fp-bit.c - echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c echo '#endif' >> fp-bit.c echo '#include "config/arc/fp-hack.h"' >> fp-bit.c cat $(srcdir)/fp-bit.c >> fp-bit.c diff --git a/libgcc/fp-bit.c b/libgcc/fp-bit.c index a9cc3c0bff3..658f42c8e7c 100644 --- a/libgcc/fp-bit.c +++ b/libgcc/fp-bit.c @@ -316,12 +316,7 @@ pack_d (const fp_number_type *src) /* We previously used bitfields to store the number, but this doesn't handle little/big endian systems conveniently, so use shifts and masks */ -#ifdef FLOAT_BIT_ORDER_MISMATCH - dst.bits.fraction = fraction; - dst.bits.exp = exp; - dst.bits.sign = sign; -#else -# if defined TFLOAT && defined HALFFRACBITS +#if defined TFLOAT && defined HALFFRACBITS { halffractype high, low, unity; int lowsign, lowexp; @@ -394,11 +389,10 @@ pack_d (const fp_number_type *src) } dst.value_raw = ((fractype) high << HALFSHIFT) | low; } -# else +#else dst.value_raw = fraction & ((((fractype)1) << FRACBITS) - (fractype)1); dst.value_raw |= ((fractype) (exp & ((1 << EXPBITS) - 1))) << FRACBITS; dst.value_raw |= ((fractype) (sign & 1)) << (FRACBITS | EXPBITS); -# endif #endif #if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT) @@ -450,12 +444,7 @@ unpack_d (FLO_union_type * src, fp_number_type * dst) src = &swapped; #endif -#ifdef FLOAT_BIT_ORDER_MISMATCH - fraction = src->bits.fraction; - exp = src->bits.exp; - sign = src->bits.sign; -#else -# if defined TFLOAT && defined HALFFRACBITS +#if defined TFLOAT && defined HALFFRACBITS { halffractype high, low; @@ -498,11 +487,10 @@ unpack_d (FLO_union_type * src, fp_number_type * dst) } } } -# else +#else fraction = src->value_raw & ((((fractype)1) << FRACBITS) - 1); exp = ((int)(src->value_raw >> FRACBITS)) & ((1 << EXPBITS) - 1); sign = ((int)(src->value_raw >> (FRACBITS + EXPBITS))) & 1; -# endif #endif dst->sign = sign; diff --git a/libgcc/fp-bit.h b/libgcc/fp-bit.h index 5c2b3dfa971..de679bdbf37 100644 --- a/libgcc/fp-bit.h +++ b/libgcc/fp-bit.h @@ -128,10 +128,6 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); #define NO_DI_MODE #endif -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -#define FLOAT_BIT_ORDER_MISMATCH -#endif - #if __BYTE_ORDER__ != __FLOAT_WORD_ORDER__ #define FLOAT_WORD_ORDER_MISMATCH #endif @@ -354,16 +350,6 @@ typedef union # endif #endif -#ifdef FLOAT_BIT_ORDER_MISMATCH - struct - { - fractype fraction:FRACBITS __attribute__ ((packed)); - unsigned int exp:EXPBITS __attribute__ ((packed)); - unsigned int sign:1 __attribute__ ((packed)); - } - bits; -#endif - #ifdef _DEBUG_BITFLOAT struct {