This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: Fix fp-bit.c and support fp for linux/mips.


config/fp-bit.c has been broken ever since "tconfig.h" is included. The
problem is before, US_SOFTWARE_GOFAST was defined/undefined by the
generated fp-bit.c/dp-bit.c, but now it alays gets defined when
"tconfig.h" includes config/gofast.h even if US_SOFTWARE_GOFAST is
undefined on purpose in the generated fp-bit.c/dp-bit.c. This patch
seems to work for Linux/mips and Irix 6.5.

BTW, usi_to_float should be defined only if US_SOFTWARE_GOFAST is
not defined.


H.J.
---
2001-07-20  H.J. Lu <hjl@gnu.org>

	* config/mips/t-linux: New.

	* config.gcc: Add mips/t-linux to tmake_file.

	* config/fp-bit.c (usi_to_float): Defined only if
	US_SOFTWARE_GOFAST is not defined.

	* config/gofast.h (US_SOFTWARE_GOFAST): Removed.

--- gcc/config.gcc.fp	Fri Jul 20 09:16:49 2001
+++ gcc/config.gcc	Fri Jul 20 10:23:10 2001
@@ -2198,7 +2198,7 @@ mips*-*-linux*)				# Linux MIPS, either 
 	       mips*el-*)  tm_file="elfos.h mips/elfl.h mips/linux.h" ;;
 	       *)	  tm_file="elfos.h mips/elf.h mips/linux.h" ;;
 	esac
-	tmake_file="t-slibgcc-elf-ver t-linux"
+	tmake_file="t-slibgcc-elf-ver t-linux mips/t-linux"
 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
 	gnu_ld=yes
 	gas=yes
--- gcc/config/fp-bit.c.fp	Mon Jul  2 21:02:22 2001
+++ gcc/config/fp-bit.c	Fri Jul 20 11:01:00 2001
@@ -1168,6 +1168,8 @@ si_to_float (SItype arg_a)
 }
 #endif /* L_si_to_sf || L_si_to_df */
 
+#ifndef US_SOFTWARE_GOFAST
+
 #if defined(L_usi_to_sf) || defined(L_usi_to_df)
 FLO_type
 usi_to_float (USItype arg_a)
@@ -1199,6 +1201,8 @@ usi_to_float (USItype arg_a)
   return pack_d (&in);
 }
 #endif
+
+#endif /* ! US_SOFTWARE_GOFAST */
 
 #if defined(L_sf_to_si) || defined(L_df_to_si)
 SItype
--- gcc/config/gofast.h.fp	Thu Sep  9 00:07:41 1999
+++ gcc/config/gofast.h	Fri Jul 20 11:14:55 2001
@@ -18,9 +18,6 @@ along with GNU CC; see the file COPYING.
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-/* This is used by fp-bit.c.  */
-#define US_SOFTWARE_GOFAST
-
 /* The US Software GOFAST library requires special optabs support.
    There is no negation libcall, and several others have names different
    from gcc.  This file consolidates the support in one place.
--- gcc/config/mips/t-linux.fp	Fri Jul 20 10:23:10 2001
+++ gcc/config/mips/t-linux	Fri Jul 20 10:23:10 2001
@@ -0,0 +1,20 @@
+# We want fine grained libraries, so use the new code to build the
+# floating point emulation libraries.
+FPBIT = fp-bit.c
+DPBIT = dp-bit.c
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+	echo '#ifdef __MIPSEL__' > dp-bit.c
+	echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c
+	echo '#endif' >> dp-bit.c
+	echo '#undef US_SOFTWARE_GOFAST' >> dp-bit.c
+	echo '#undef FLOAT' >> dp-bit.c
+	cat $(srcdir)/config/fp-bit.c >> dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+	echo '#ifdef __MIPSEL__' > fp-bit.c
+	echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c
+	echo '#endif' >> fp-bit.c
+	echo '#undef US_SOFTWARE_GOFAST' >> fp-bit.c
+	echo '#define FLOAT' >> fp-bit.c
+	cat $(srcdir)/config/fp-bit.c >> fp-bit.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]