aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Dall <ian@sibyl.beware.dropbear.id.au>2002-08-01 21:21:52 +0000
committerRichard Henderson <rth@gcc.gnu.org>2002-08-01 14:21:52 -0700
commitac14c7257656be55f39322df3cdebea5ae22be3a (patch)
tree81d7d9afc536c5288382782250fe8d2d9e7a7176
parent170727320274e08e7ee320ee3bf68304799879d5 (diff)
downloadgcc-ac14c7257656be55f39322df3cdebea5ae22be3a.zip
gcc-ac14c7257656be55f39322df3cdebea5ae22be3a.tar.gz
gcc-ac14c7257656be55f39322df3cdebea5ae22be3a.tar.bz2
ns32k.h (TARGET_IEEE_COMPARE): Correct earlier patch.
* config/ns32k/ns32k.h (TARGET_IEEE_COMPARE): Correct earlier patch. (RETURN_ADDR_RTX): Cannot determine return address for FRAME > 0 when there is no frame pointer. (INITIAL_FRAME_POINTER_OFFSET): Count stack space for saved fp registers properly. * config/ns32k/__unorddf2.c: New file. * config/ns32k/__unordsf2.c: New file. * config/ns32k/t-ns32k: New file. * config.gcc (ns32k-*-netbsd*): Use it. From-SVN: r55949
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config.gcc2
-rw-r--r--gcc/config/ns32k/__unorddf2.c34
-rw-r--r--gcc/config/ns32k/__unordsf2.c34
-rw-r--r--gcc/config/ns32k/ns32k.h10
-rw-r--r--gcc/config/ns32k/t-ns32k4
6 files changed, 89 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9ffaab6..99e8404 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2002-08-01 Ian Dall <ian@sibyl.beware.dropbear.id.au>
+
+ * config/ns32k/ns32k.h (TARGET_IEEE_COMPARE): Correct earlier patch.
+ (RETURN_ADDR_RTX): Cannot determine return address for FRAME > 0
+ when there is no frame pointer.
+ (INITIAL_FRAME_POINTER_OFFSET): Count stack space for saved fp
+ registers properly.
+ * config/ns32k/__unorddf2.c: New file.
+ * config/ns32k/__unordsf2.c: New file.
+ * config/ns32k/t-ns32k: New file.
+ * config.gcc (ns32k-*-netbsd*): Use it.
+
2002-08-01 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.h (SPU_CONST_OFFSET_OK): Change to 0xff.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index f8d0176..9540a0d 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1970,7 +1970,7 @@ ns32k-*-netbsdelf*)
ns32k-*-netbsd*)
tm_file="${tm_file} netbsd.h netbsd-aout.h ns32k/netbsd.h"
# On NetBSD, the headers are already okay, except for math.h.
- tmake_file=t-netbsd
+ tmake_file="t-netbsd ns32k/t-ns32k"
use_collect2=yes
;;
pdp11-*-bsd)
diff --git a/gcc/config/ns32k/__unorddf2.c b/gcc/config/ns32k/__unorddf2.c
new file mode 100644
index 0000000..aa82aaa
--- /dev/null
+++ b/gcc/config/ns32k/__unorddf2.c
@@ -0,0 +1,34 @@
+/* Lightweight function to test for ieee unordered comparison
+ Copyright (C) 2002
+ Free Software Foundation, Inc.
+ Contributed by Ian Dall <ian@beware.dropbear.id.au>
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+# define ISNAN(x) ( \
+ { \
+ union u { double d; unsigned int i[2]; } *t = (union u *)&(x); \
+ ((t->i[1] & 0x7ff00000) == 0x7ff00000) && \
+ (t->i[0] != 0 || (t->i[1] & 0xfffff) != 0); \
+ })
+
+int __unorddf2 (double, double);
+int __unorddf2 (double a, double b)
+{
+ return ISNAN(a) || ISNAN(b);
+}
diff --git a/gcc/config/ns32k/__unordsf2.c b/gcc/config/ns32k/__unordsf2.c
new file mode 100644
index 0000000..3f0e0b2
--- /dev/null
+++ b/gcc/config/ns32k/__unordsf2.c
@@ -0,0 +1,34 @@
+/* Lightweight function to test for ieee unordered comparison
+ Copyright (C) 2002
+ Free Software Foundation, Inc.
+ Contributed by Ian Dall <ian@beware.dropbear.id.au>
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+# define ISNAN(x) ( \
+ { \
+ union u { float f; unsigned int i; } *t = (union u *)&(x); \
+ ((t->i & 0x7f800000) == 0x7f800000) && \
+ ((t->i & 0x7fffff) != 0); \
+ })
+
+int __unordsf2 ( float, float);
+int __unordsf2 ( float a, float b)
+{
+ return ISNAN(a) || ISNAN(b);
+}
diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h
index 6f4cc5f..2b7727e 100644
--- a/gcc/config/ns32k/ns32k.h
+++ b/gcc/config/ns32k/ns32k.h
@@ -129,7 +129,7 @@ extern int target_flags;
/* Compile using bitfield insns. */
#define TARGET_BITFIELD ((target_flags & MASK_NO_BITFIELD) == 0)
-#define TARGET_IEEE_FP (target_flags & MASK_IEEE_COMPARE)
+#define TARGET_IEEE_COMPARE (target_flags & MASK_IEEE_COMPARE)
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
@@ -578,7 +578,8 @@ enum reg_class
After the prologue, RA is at 4(fp) in the current frame. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
- (gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, (FRAME), GEN_INT(4))))
+ ((COUNT> 0 && flag_omit_frame_pointer)? NULL_RTX \
+ : gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, (FRAME), GEN_INT(4))))
/* A C expression whose value is an integer giving the offset, in
bytes, from the value of the stack pointer register to the top of
@@ -743,12 +744,9 @@ enum reg_class
{ \
int regno; \
int offset = -4; \
- for (regno = 0; regno < L1_REGNUM; regno++) \
+ for (regno = 0; regno < FRAME_POINTER_REGNUM; regno++) \
if (regs_ever_live[regno] && ! call_used_regs[regno]) \
offset += 4; \
- for (; regno < FRAME_POINTER_REGNUM; regno++) \
- if (regs_ever_live[regno] && ! call_used_regs[regno]) \
- offset += 8; \
if (flag_pic && current_function_uses_pic_offset_table) \
offset += 4; \
(DEPTH) = (offset + get_frame_size () \
diff --git a/gcc/config/ns32k/t-ns32k b/gcc/config/ns32k/t-ns32k
new file mode 100644
index 0000000..a8b6329
--- /dev/null
+++ b/gcc/config/ns32k/t-ns32k
@@ -0,0 +1,4 @@
+# We want fine grained libraries, so use the new code to build the
+# floating point emulation libraries.
+LIB2FUNCS_EXTRA = $(srcdir)/config/ns32k/__unorddf2.c \
+ $(srcdir)/config/ns32k/__unordsf2.c