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]
Other format: [Raw text]

Re: [PATCH] SPU float format: Round towards zero


Joseph S. Myers wrote:
> On Sat, 9 Aug 2008, Ulrich Weigand wrote:
> 
> > +float _floatdisf (long long x)
> 
> > +float _floatundisf (unsigned long long x)
> 
> I'd have expected a double underscore in both those names, to match 
> libgcc2.c.

Huh.  You're right, of course.  I guess I must have mixed up the
libgcc file names (one underscore) and function names (two underscores).

Anyway, below is another version of the patch with correct names.

Thanks,
Ulrich


ChangeLog:

	* config/spu/float_disf.c: New file.
	* config/spu/float_unsdisf.c: New file.
	* config/spu/t-elf (LIB2FUNCS_STATIC_EXTRA): Add them.
	(LIB2FUNCS_EXCLUDE): Define.

diff -urNp -x .svn gcc-head-orig/gcc/config/spu/float_disf.c gcc-head/gcc/config/spu/float_disf.c
--- gcc-head-orig/gcc/config/spu/float_disf.c	1970-01-01 01:00:00.000000000 +0100
+++ gcc-head/gcc/config/spu/float_disf.c	2008-08-08 14:34:24.000000000 +0200
@@ -0,0 +1,30 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+  
+   This file 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 of the License, or (at your option)
+   any later version.
+  
+   This file 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 this file; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+/* As a special exception, if you link this library with files compiled with
+   GCC to produce an executable, this does not cause the resulting executable
+   to be covered by the GNU General Public License.  The exception does not
+   however invalidate any other reasons why the executable file might be covered
+   by the GNU General Public License. */
+
+float __floatdisf (long long x)
+{
+  /* The SPU back-end now generates inline code for this conversion.
+     This file is solely used to provide the __floatdisf functions
+     for objects generated with prior versions of GCC.  */
+  return x;
+}
diff -urNp -x .svn gcc-head-orig/gcc/config/spu/float_unsdisf.c gcc-head/gcc/config/spu/float_unsdisf.c
--- gcc-head-orig/gcc/config/spu/float_unsdisf.c	1970-01-01 01:00:00.000000000 +0100
+++ gcc-head/gcc/config/spu/float_unsdisf.c	2008-08-08 18:13:57.000000000 +0200
@@ -0,0 +1,30 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+  
+   This file 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 of the License, or (at your option)
+   any later version.
+  
+   This file 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 this file; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+/* As a special exception, if you link this library with files compiled with
+   GCC to produce an executable, this does not cause the resulting executable
+   to be covered by the GNU General Public License.  The exception does not
+   however invalidate any other reasons why the executable file might be covered
+   by the GNU General Public License. */
+
+float __floatundisf (unsigned long long x)
+{
+  /* The SPU back-end now generates inline code for this conversion.
+     This file is solely used to provide the __floatundisf function
+     for objects generated with prior versions of GCC.  */
+  return x;
+}
diff -urNp -x .svn gcc-head-orig/gcc/config/spu/t-spu-elf gcc-head/gcc/config/spu/t-spu-elf
--- gcc-head-orig/gcc/config/spu/t-spu-elf	2008-08-09 14:42:12.000000000 +0200
+++ gcc-head/gcc/config/spu/t-spu-elf	2008-08-08 18:14:09.000000000 +0200
@@ -21,8 +21,15 @@ CROSS_LIBGCC1 =
 
 TARGET_LIBGCC2_CFLAGS = -fPIC -mwarn-reloc -D__IN_LIBGCC2
 
+# We exclude those because the libgcc2.c default versions do not support
+# the SPU single-precision format (round towards zero).  We provide our
+# own versions below.
+LIB2FUNCS_EXCLUDE = _floatdisf _floatundisf
+
 LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/spu/float_unssidf.c \
 			 $(srcdir)/config/spu/float_unsdidf.c \
+			 $(srcdir)/config/spu/float_unsdisf.c \
+			 $(srcdir)/config/spu/float_disf.c \
 			 $(srcdir)/config/spu/mfc_tag_table.c \
 			 $(srcdir)/config/spu/mfc_tag_reserve.c \
 			 $(srcdir)/config/spu/mfc_tag_release.c \


-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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