diff options
author | Markus F.X.J. Oberhumer <markus@oberhumer.com> | 2004-01-12 03:55:43 +0000 |
---|---|---|
committer | Bernardo Innocenti <bernie@gcc.gnu.org> | 2004-01-12 04:55:43 +0100 |
commit | 48568ec72b76246c3cf964b52fbe91fa018511e7 (patch) | |
tree | 8fdb709f78ef4f79c2fcc8f4f819dda5431b9bc1 /gcc/config/m68k/fpgnulib.c | |
parent | 124c9423a1f0326dcda66539ed507f6078157061 (diff) | |
download | gcc-48568ec72b76246c3cf964b52fbe91fa018511e7.zip gcc-48568ec72b76246c3cf964b52fbe91fa018511e7.tar.gz gcc-48568ec72b76246c3cf964b52fbe91fa018511e7.tar.bz2 |
re PR target/12148 (longstanding m68k libgcc.a bug when using ` -mshort')
PR c/12148
* config/m68k/fpgnulib.c: Fix `-mshort' bugs: Use `long' instead of
`int' in a number of places to make sure we always have a SImode
and not a HImode. Add a 'L' suffix to a number of constants.
From-SVN: r75703
Diffstat (limited to 'gcc/config/m68k/fpgnulib.c')
-rw-r--r-- | gcc/config/m68k/fpgnulib.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/gcc/config/m68k/fpgnulib.c b/gcc/config/m68k/fpgnulib.c index 0559b62..5368559 100644 --- a/gcc/config/m68k/fpgnulib.c +++ b/gcc/config/m68k/fpgnulib.c @@ -59,24 +59,24 @@ #define PACK(s,e,m) ((s) | ((e) << 23L) | (m)) /* the following deal with IEEE double-precision numbers */ -#define EXCESSD 1022 +#define EXCESSD 1022L #define HIDDEND (1L << 20L) #define EXPDBITS 11 -#define EXPDMASK 0x7FF +#define EXPDMASK 0x7FFL #define EXPD(fp) (((fp.l.upper) >> 20L) & 0x7FFL) #define SIGND(fp) ((fp.l.upper) & SIGNBIT) #define MANTD(fp) (((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) | \ (fp.l.lower >> 22)) -#define MANTDMASK 0xFFFFF /* mask of upper part */ +#define MANTDMASK 0xFFFFFL /* mask of upper part */ /* the following deal with IEEE extended-precision numbers */ -#define EXCESSX 16382 +#define EXCESSX 16382L #define HIDDENX (1L << 31L) #define EXPXBITS 15 #define EXPXMASK 0x7FFF #define EXPX(fp) (((fp.l.upper) >> 16) & EXPXMASK) #define SIGNX(fp) ((fp.l.upper) & SIGNBIT) -#define MANTXMASK 0x7FFFFFFF /* mask of upper part */ +#define MANTXMASK 0x7FFFFFFFL /* mask of upper part */ union double_long { @@ -107,7 +107,7 @@ union long_double_long /* convert int to double */ double -__floatsidf (int a1) +__floatsidf (long a1) { long sign = 0, exp = 31 + EXCESSD; union double_long dl; @@ -130,13 +130,13 @@ __floatsidf (int a1) } } - while (a1 < 0x1000000) + while (a1 < 0x1000000L) { a1 <<= 4; exp -= 4; } - while (a1 < 0x40000000) + while (a1 < 0x40000000L) { a1 <<= 1; exp--; @@ -153,7 +153,7 @@ __floatsidf (int a1) /* convert int to float */ float -__floatsisf (int l) +__floatsisf (long l) { double foo = __floatsidf (l); return foo; @@ -208,7 +208,7 @@ __truncdfsf2 (double a1) mant >>= 1; /* did the round overflow? */ - if (mant & 0xFF000000) + if (mant & 0xFF000000L) { mant >>= 1; exp++; @@ -222,7 +222,7 @@ __truncdfsf2 (double a1) } /* convert double to int */ -int +long __fixdfsi (double a1) { register union double_long dl1; @@ -240,7 +240,7 @@ __fixdfsi (double a1) if (exp > 0) { /* Return largest integer. */ - return SIGND (dl1) ? 0x80000000 : 0x7fffffff; + return SIGND (dl1) ? 0x80000000L : 0x7fffffffL; } if (exp <= -32) @@ -254,7 +254,7 @@ __fixdfsi (double a1) } /* convert float to int */ -int +long __fixsfsi (float a1) { double foo = a1; @@ -268,12 +268,12 @@ __fixsfsi (float a1) We assume all numbers are normalized, don't do any rounding, etc. */ /* Prototypes for the above in case we use them. */ -double __floatsidf (int); -float __floatsisf (int); +double __floatsidf (long); +float __floatsisf (long); double __extendsfdf2 (float); float __truncdfsf2 (double); -int __fixdfsi (double); -int __fixsfsi (float); +long __fixdfsi (double); +long __fixsfsi (float); /* convert double to long double */ long double @@ -351,17 +351,17 @@ __truncxfsf2 (long double ld) /* convert an int to a long double */ long double -__floatsixf (int l) +__floatsixf (long l) { double foo = __floatsidf (l); return foo; } /* convert a long double to an int */ -int +long __fixxfsi (long double ld) { - int foo = __fixdfsi ((double) ld); + long foo = __fixdfsi ((double) ld); return foo; } |