OSDN Git Service

PR c/12148
authorbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Jan 2004 03:55:43 +0000 (03:55 +0000)
committerbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Jan 2004 03:55:43 +0000 (03:55 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75703 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m68k/fpgnulib.c

index d5c0f6d..a79c36e 100644 (file)
@@ -1,3 +1,10 @@
+2004-01-12  Markus F.X.J. Oberhumer  <markus@oberhumer.com>
+
+       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.
+
 2004-01-11  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * pa.c: Don't include obstack.h.
index 0559b62..5368559 100644 (file)
 #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;
 }