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]

[patch soft-fp] Fixes for soft-fp


Hi,

My name is Fredrik Unger, and I am a member of a team porting the GCC to the NEC SX series. ( http://en.wikipedia.org/wiki/SX_architecture )

http://code.google.com/p/sx-gcc/

With under 1000 failures of the testsuite we have been looking at fp-bit and soft-fp lately.
Current test results are available here :
http://source.tree.se/sx/sx-gcc/testrun/


I moved to soft-fp from our initial fp-bit version due to undefined references to routines like floattisf in the
gcc.dg/torture/fp-int-convert-timode.c test.


Our port currently based on 4.2.2 as it was new when the port started.

In moving to soft-fp for our platform I had to use some of the gcc trunk soft-fp sources[1]. In doing so I found 4 bugs in 3 files that had to be corrected before the soft-fp compiled and run for us. (the double.h bug is also in the libc sources)

soft-fp 4.2.2 does not differ from trunk except the files [1] difference + a small addition to soft-fp.h

There is a discrepancy between gcc trunk and libc as for example
floatuntisf.c is only in gcc and not in the libc.
I have used the cvsweb interface to look that up, and if that is not
displaying the up to date information I could be wrong.

I have included a patch for the affected sources.
The patch affects files in gcc/config/soft-fp (trunk)

At the same time I would like to ask if soft-fp is the future for GCC.
The http://gcc.gnu.org/wiki/Software_floating_point page suggests that it is, but as http://sourceware.org/cgi-bin/cvsweb.cgi/libc/soft-fp/?cvsroot=glibc
has not shown any development the last 17 months we were not sure.


For configuration we used :
softfp_float_modes := sf df tf
softfp_int_modes := si di ti
softfp_extensions := dftf sftf
softfp_truncations := tfdf tfsf
softfp_machine_header:= sx/sfp-machine.h
softfp_exclude_libgcc2 := y

To get all cases of conversions for ti/tf included. The t-softfp would otherwise have to be adapted to make sure all conversions are created. Ex. sfti conversion has to be built even if sf float mode is not built.


Thank you,


Fredrik Unger


[1] files added to 4.2.2 from trunk. ? floattisf.c ? floatuntidf.c ? floatuntitf.c ? fixunssfti.c ? fixsfti.c ? fixunsdfti.c ? fixdfti.c ? floatuntisf.c ? fixunstfti.c ? floattidf.c ? fixtfti.c ? floattitf.c
Index: double.h
===================================================================
--- double.h	(revision 141)
+++ double.h	(working copy)
@@ -203,13 +203,13 @@
 
 #define FP_UNPACK_SEMIRAW_D(X,val)	\
   do {					\
-    _FP_UNPACK_RAW_2(1,X,val);		\
+    _FP_UNPACK_RAW_1(D,X,val);		\
     _FP_UNPACK_SEMIRAW(D,1,X);		\
   } while (0)
 
 #define FP_UNPACK_SEMIRAW_DP(X,val)	\
   do {					\
-    _FP_UNPACK_RAW_2_P(1,X,val);	\
+    _FP_UNPACK_RAW_1_P(D,X,val);	\
     _FP_UNPACK_SEMIRAW(D,1,X);		\
   } while (0)
 
--- floatuntisf.c.1	2008-11-25 09:41:06.000000000 +0100
+++ floatuntisf.c	2008-11-19 14:34:47.000000000 +0100
@@ -31,7 +31,7 @@
 #include "soft-fp.h"
 #include "single.h"
 
-SFtype __floatundisf(UTItype i)
+SFtype __floatuntisf(UTItype i)
 {
   FP_DECL_EX;
   FP_DECL_S(A);
--- fixdfti.c.1	2008-11-25 09:41:08.000000000 +0100
+++ fixdfti.c	2008-11-19 14:10:50.000000000 +0100
@@ -31,7 +31,7 @@
 #include "soft-fp.h"
 #include "double.h"
 
-TItype __fixdfti(TFtype a)
+TItype __fixdfti(DFtype a)
 {
   FP_DECL_EX;
   FP_DECL_D(A);

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