From: Ulrich Drepper Date: Wed, 4 Jun 1997 19:04:28 +0000 (+0000) Subject: Change GCC's HUGE_VAL{,F,L} to use DI and SI mode integers instead of X-Git-Tag: upstream/2.30~10627^2~3581 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d901ee0d08f38a6285eb2642c7df156a03b16072;p=external%2Fglibc.git Change GCC's HUGE_VAL{,F,L} to use DI and SI mode integers instead of bytes. Fix value of HUGE_VALL. --- diff --git a/sysdeps/m68k/huge_val.h b/sysdeps/m68k/huge_val.h index 8d45aae..c71454e 100644 --- a/sysdeps/m68k/huge_val.h +++ b/sysdeps/m68k/huge_val.h @@ -26,15 +26,19 @@ /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ -#define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } - -#define __huge_val_t union { unsigned char __c[8]; double __d; } #ifdef __GNUC__ -#define HUGE_VAL (__extension__ \ - ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d) -#else /* Not GCC. */ -static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; + +#define HUGE_VAL \ + (__extension__ \ + ((union { unsigned long long __l; double __d; }) \ + { __l: 0x7ff0000000000000ULL }).__d) + +#else /* not GCC */ + +static union { unsigned char __c[8]; double __d; } __huge_val = + { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; #define HUGE_VAL (__huge_val.__d) + #endif /* GCC. */ @@ -42,27 +46,28 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; #ifdef __USE_ISOC9X -#define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } +#ifdef __GNUC__ -#define __huge_valf_t union { unsigned char __c[4]; float __f; } -#ifdef __GNUC__ -#define HUGE_VALF (__extension__ \ - ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f) -#else /* Not GCC. */ -static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; -#define HUGE_VALF (__huge_valf.__f) -#endif /* GCC. */ +#define HUGE_VALF \ + (__extension__ \ + ((union { unsigned long __l; float __f; }) \ + { __l: 0x7f800000UL }).__f) +#define HUGE_VALL \ + (__extension__ \ + ((union { unsigned long __l[3]; long double __ld; }) \ + { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld) -#define __HUGE_VALL_bytes { 0x7f, 0xff, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +#else /* not GCC */ -#define __huge_vall_t union { unsigned char __c[12]; long double __ld; } -#ifdef __GNUC__ -#define HUGE_VALL (__extension__ \ - ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld) -#else /* Not GCC. */ -static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes }; +static union { unsigned char __c[4]; float __f; } __huge_valf = + { { 0x7f, 0x80, 0, 0 } }; +#define HUGE_VALF (__huge_valf.__f) + +static union { unsigned char __c[12]; long double __ld; } __huge_vall = + { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } }; #define HUGE_VALL (__huge_vall.__ld) + #endif /* GCC. */ #endif /* __USE_ISOC9X. */