4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-15 11:00:04 +08:00
Jeff Johnston 3a767b69fd 2003-09-09 Jeff Johnston <jjohnstn@redhat.com>
* libc/machine/powerpc/fix64.h: Fix typo for _simdldcheck
        prototype.
        * libc/machine/powerpc/simdldtoa.c: Remove prototype for
        _simdldcheck().  Also add unsigned cast for index variable in
        for loop using sizeof operators.
        * libc/machine/powerpc/strtoufix32.c: Remove unused variable.
        * libc/machine/powerpc/strtosfix64.c: Fix call to _simdldcheck.
        * libc/machine/powerpc/strtoufix64.c (_strtoufix64_r): Ditto
        plus fix shift calculation for determining if there is a
        carry from word2.
2003-09-09 22:53:27 +00:00

81 lines
1.6 KiB
C

#ifndef _FIX64_H_
#define _FIX64_H_
#include <ieeefp.h>
#include <math.h>
#include <float.h>
#include <errno.h>
#include <sys/config.h>
#ifdef __IEEE_LITTLE_ENDIAN
#define IEEE_8087
#endif
#ifdef __IEEE_BIG_ENDIAN
#define IEEE_MC68k
#endif
#ifdef __Z8000__
#define Just_16
#endif
#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1
Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
#endif
union long_double_union
{
long double ld;
__uint32_t i[4];
};
typedef union long_double_union LONG_DOUBLE_UNION;
extern void _simdstrtold (char *, char **, LONG_DOUBLE_UNION *);
extern int _simdldcheck (LONG_DOUBLE_UNION *);
#define SIMD_LDBL_MANT_DIG 113
#ifdef IEEE_8087
# define word0(x) (x.i[3])
# define word1(x) (x.i[2])
# define word2(x) (x.i[1])
# define word3(x) (x.i[0])
#else /* !IEEE_8087 */
# define word0(x) (x.i[0])
# define word1(x) (x.i[1])
# define word2(x) (x.i[2])
# define word3(x) (x.i[3])
#endif /* !IEEE_8087 */
#undef Exp_shift
#define Exp_shift 16
#undef Exp_mask
#define Exp_mask ((__uint32_t)0x7fff0000L)
#undef Exp_msk1
#define Exp_msk1 ((__uint32_t)0x00010000L)
#undef Bias
#define Bias 16383
#undef Ebits
#define Ebits 15
#undef Sign_bit
#define Sign_bit ((__uint32_t)0x80000000L)
#define init(x) {}
union fix64_union
{
__uint64_t ll;
__uint32_t j[2];
};
#ifdef __LITTLE_ENDIAN__
# define hiword(y) (y.j[1])
# define loword(y) (y.j[0])
#else /* __BIG_ENDIAN__ */
# define hiword(y) (y.j[0])
# define loword(y) (y.j[1])
#endif /* __BIG_ENDIAN__ */
#endif /* _FIX64_H_ */