OSDN Git Service

* config/m68k/m68k.c (override_options): Don't override
authorschwab <schwab@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 3 Jun 2007 14:32:43 +0000 (14:32 +0000)
committerschwab <schwab@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 3 Jun 2007 14:32:43 +0000 (14:32 +0000)
REAL_MODE_FORMAT.
* config/m68k/m68k-modes.def (SF, DF): Define to use
motorola_single_format and motorola_double_format, resp.
* real.c (motorola_single_format): Renamed from
coldfire_single_format.
(motorola_double_format): Renamed from coldfire_double_format.
(encode_ieee_extended): Generate a proper canonical NaN image
respecting canonical_nan_lsbs_set.
(ieee_extended_motorola_format): Set canonical_nan_lsbs_set to
true.
* real.h: Adjust declarations.

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

gcc/ChangeLog
gcc/config/m68k/m68k-modes.def
gcc/config/m68k/m68k.c
gcc/real.c
gcc/real.h

index c1b2d93..a336afc 100644 (file)
@@ -1,3 +1,18 @@
+2007-06-03  Andreas Schwab  <schwab@suse.de>
+
+       * config/m68k/m68k.c (override_options): Don't override
+       REAL_MODE_FORMAT.
+       * config/m68k/m68k-modes.def (SF, DF): Define to use
+       motorola_single_format and motorola_double_format, resp.
+       * real.c (motorola_single_format): Renamed from
+       coldfire_single_format.
+       (motorola_double_format): Renamed from coldfire_double_format.
+       (encode_ieee_extended): Generate a proper canonical NaN image
+       respecting canonical_nan_lsbs_set.
+       (ieee_extended_motorola_format): Set canonical_nan_lsbs_set to
+       true.
+       * real.h: Adjust declarations.
+
 2007-06-03  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        PR target/32163
index e6f782f..d600446 100644 (file)
@@ -1,5 +1,5 @@
 /* M68k extra machine modes. 
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -18,5 +18,9 @@ along with GCC; see the file COPYING.  If not, write to
 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+/* These differ in the representation of the canonical NaN.  */
+RESET_FLOAT_FORMAT (SF, motorola_single_format);
+RESET_FLOAT_FORMAT (DF, motorola_double_format);
+
 /* 80-bit floating point (IEEE extended, in a 96-bit field) */
 FRACTIONAL_FLOAT_MODE (XF, 80, 12, ieee_extended_motorola_format);
index 7001e29..1ce7042 100644 (file)
@@ -1,6 +1,6 @@
 /* Subroutines for insn-output.c for Motorola 68000 family.
    Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2003, 2004, 2005, 2006
+   2001, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -541,12 +541,6 @@ override_options (void)
              : (m68k_cpu_flags & FL_COLDFIRE) != 0 ? FPUTYPE_COLDFIRE
              : FPUTYPE_68881);
 
-  if (TARGET_COLDFIRE_FPU)
-    {
-      REAL_MODE_FORMAT (SFmode) = &coldfire_single_format;
-      REAL_MODE_FORMAT (DFmode) = &coldfire_double_format;
-    }
-
   /* Sanity check to ensure that msep-data and mid-sahred-library are not
    * both specified together.  Doing so simply doesn't make sense.
    */
index 867fdc7..9a84329 100644 (file)
@@ -1,6 +1,6 @@
 /* real.c - software floating point emulation.
    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
    Contributed by Stephen L. Moshier (moshier@world.std.com).
    Re-written by Richard Henderson <rth@redhat.com>
 
@@ -2774,7 +2774,7 @@ const struct real_format mips_single_format =
     true
   };
 
-const struct real_format coldfire_single_format =
+const struct real_format motorola_single_format =
   {
     encode_ieee_single,
     decode_ieee_single,
@@ -3019,7 +3019,7 @@ const struct real_format mips_double_format =
     true
   };
 
-const struct real_format coldfire_double_format =
+const struct real_format motorola_double_format =
   {
     encode_ieee_double,
     decode_ieee_double,
@@ -3082,7 +3082,15 @@ encode_ieee_extended (const struct real_format *fmt, long *buf,
       if (fmt->has_nans)
        {
          image_hi |= 32767;
-         if (HOST_BITS_PER_LONG == 32)
+         if (r->canonical)
+           {
+             if (fmt->canonical_nan_lsbs_set)
+               {
+                 sig_hi = (1 << 30) - 1;
+                 sig_lo = 0xffffffff;
+               }
+           }
+         else if (HOST_BITS_PER_LONG == 32)
            {
              sig_hi = r->sig[SIGSZ-1];
              sig_lo = r->sig[SIGSZ-2];
@@ -3364,7 +3372,7 @@ const struct real_format ieee_extended_motorola_format =
     true,
     true,
     true,
-    false
+    true
   };
 
 const struct real_format ieee_extended_intel_96_format =
index f050daf..ec5a207 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of floating-point access for GNU compiler.
    Copyright (C) 1989, 1991, 1994, 1996, 1997, 1998, 1999,
-   2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -254,10 +254,10 @@ extern unsigned int real_hash (const REAL_VALUE_TYPE *);
 /* Target formats defined in real.c.  */
 extern const struct real_format ieee_single_format;
 extern const struct real_format mips_single_format;
-extern const struct real_format coldfire_single_format;
+extern const struct real_format motorola_single_format;
 extern const struct real_format ieee_double_format;
 extern const struct real_format mips_double_format;
-extern const struct real_format coldfire_double_format;
+extern const struct real_format motorola_double_format;
 extern const struct real_format ieee_extended_motorola_format;
 extern const struct real_format ieee_extended_intel_96_format;
 extern const struct real_format ieee_extended_intel_96_round_53_format;