This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix conversion return types
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 01 Nov 2007 10:18:49 +0000
- Subject: fix conversion return types
A customer pointed out that the return types of the various float -> unsigned
long long conversion functions in libgcc were wrong, being signed. That doesn't
make a practical difference because such objects are not extended to a longer
type by ABIs. I suppose some insane 128 bit cpu would go wrong though :)
This patch fixes the return types to match the documentation. booted and tested
on i686-pc-linux-gnu, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
2007-11-01 Nathan Sidwell <nathan@codesourcery.com>
* libgcc2.c (__fixunstfDI, __fixunsxfDI, __fixunsdfDI,
__fixunssfDI): Make return type unsigned.
* libgcc2.h (__fixunstfDI, __fixunsxfDI, __fixunsdfDI,
__fixunssfDI): Make return type unsigned.
Index: libgcc2.c
===================================================================
--- libgcc2.c (revision 129580)
+++ libgcc2.c (working copy)
@@ -1184,7 +1184,7 @@ __ucmpdi2 (DWtype a, DWtype b)
#endif
#if defined(L_fixunstfdi) && LIBGCC2_HAS_TF_MODE
-DWtype
+UDWtype
__fixunstfDI (TFtype a)
{
if (a < 0)
@@ -1220,7 +1220,7 @@ __fixtfdi (TFtype a)
#endif
#if defined(L_fixunsxfdi) && LIBGCC2_HAS_XF_MODE
-DWtype
+UDWtype
__fixunsxfDI (XFtype a)
{
if (a < 0)
@@ -1256,7 +1256,7 @@ __fixxfdi (XFtype a)
#endif
#if defined(L_fixunsdfdi) && LIBGCC2_HAS_DF_MODE
-DWtype
+UDWtype
__fixunsdfDI (DFtype a)
{
/* Get high part of result. The division here will just moves the radix
@@ -1285,7 +1285,7 @@ __fixdfdi (DFtype a)
#endif
#if defined(L_fixunssfdi) && LIBGCC2_HAS_SF_MODE
-DWtype
+UDWtype
__fixunssfDI (SFtype a)
{
#if LIBGCC2_HAS_DF_MODE
Index: libgcc2.h
===================================================================
--- libgcc2.h (revision 129580)
+++ libgcc2.h (working copy)
@@ -375,7 +375,7 @@ extern DWtype __fixsfdi (SFtype);
extern SFtype __floatdisf (DWtype);
extern SFtype __floatundisf (UDWtype);
extern UWtype __fixunssfSI (SFtype);
-extern DWtype __fixunssfDI (SFtype);
+extern UDWtype __fixunssfDI (SFtype);
extern SFtype __powisf2 (SFtype, int);
extern SCtype __divsc3 (SFtype, SFtype, SFtype, SFtype);
extern SCtype __mulsc3 (SFtype, SFtype, SFtype, SFtype);
@@ -385,7 +385,7 @@ extern DWtype __fixdfdi (DFtype);
extern DFtype __floatdidf (DWtype);
extern DFtype __floatundidf (UDWtype);
extern UWtype __fixunsdfSI (DFtype);
-extern DWtype __fixunsdfDI (DFtype);
+extern UDWtype __fixunsdfDI (DFtype);
extern DFtype __powidf2 (DFtype, int);
extern DCtype __divdc3 (DFtype, DFtype, DFtype, DFtype);
extern DCtype __muldc3 (DFtype, DFtype, DFtype, DFtype);
@@ -393,7 +393,7 @@ extern DCtype __muldc3 (DFtype, DFtype,
#if LIBGCC2_HAS_XF_MODE
extern DWtype __fixxfdi (XFtype);
-extern DWtype __fixunsxfDI (XFtype);
+extern UDWtype __fixunsxfDI (XFtype);
extern XFtype __floatdixf (DWtype);
extern XFtype __floatundixf (UDWtype);
extern UWtype __fixunsxfSI (XFtype);
@@ -403,7 +403,7 @@ extern XCtype __mulxc3 (XFtype, XFtype,
#endif
#if LIBGCC2_HAS_TF_MODE
-extern DWtype __fixunstfDI (TFtype);
+extern UDWtype __fixunstfDI (TFtype);
extern DWtype __fixtfdi (TFtype);
extern TFtype __floatditf (DWtype);
extern TFtype __floatunditf (UDWtype);