diff mbox

S/390: Use the libgcc fp2int routine also in the biarch build

Message ID 20140130145651.GA30217@bart
State New
Headers show

Commit Message

Andreas Krebbel Jan. 30, 2014, 2:56 p.m. UTC
Hi,

we implement some of the IEEE float to int conversions in libgcc.
These have only been included for a native s390 32 bit build but not
for the biarch -m31 variant.

Fixed with the attached patch.

I'll commit the patch after a few days waiting for comments.

Bye,

-Andreas-


2014-01-30  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* config.host: Include t-floattodi also for s390x.
	* config/s390/32/_fixdfdi.c: Omit in 64 bit mode.
	* config/s390/32/_fixsfdi.c: Likewise.
	* config/s390/32/_fixtfdi.c: Likewise.
	* config/s390/32/_fixunsdfdi.c: Likewise.
	* config/s390/32/_fixunssfdi.c: Likewise.
	* config/s390/32/_fixunstfdi.c: Likewise.
diff mbox

Patch

diff --git a/libgcc/config.host b/libgcc/config.host
index 65f6b0f..472c05c 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1008,7 +1008,7 @@  s390-*-linux*)
 	md_unwind_header=s390/linux-unwind.h
 	;;
 s390x-*-linux*)
-	tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux"
+	tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux s390/32/t-floattodi"
 	md_unwind_header=s390/linux-unwind.h
 	;;
 s390x-ibm-tpf*)
diff --git a/libgcc/config/s390/32/_fixdfdi.c b/libgcc/config/s390/32/_fixdfdi.c
index 7178c01..c55a5a1 100644
--- a/libgcc/config/s390/32/_fixdfdi.c
+++ b/libgcc/config/s390/32/_fixdfdi.c
@@ -24,6 +24,8 @@  a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#ifndef __s390x__
+
 #define EXPD(fp)	(((fp.l.upper) >> 20) & 0x7FF)
 #define EXCESSD		1022
 #define SIGNBIT		0x80000000
@@ -106,3 +108,4 @@  __fixdfdi (double a1)
 
     return (SIGND (dl1) ? -l : l);
 }
+#endif /* !__s390x__ */
diff --git a/libgcc/config/s390/32/_fixsfdi.c b/libgcc/config/s390/32/_fixsfdi.c
index cea3b84..725ae5b 100644
--- a/libgcc/config/s390/32/_fixsfdi.c
+++ b/libgcc/config/s390/32/_fixsfdi.c
@@ -24,6 +24,8 @@  a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#ifndef __s390x__
+
 #define EXP(fp)         (((fp.l) >> 23) & 0xFF)
 #define EXCESS          126
 #define SIGNBIT         0x80000000
@@ -102,3 +104,4 @@  __fixsfdi (float a1)
 
     return (SIGN (fl1) ? -l : l);
 }
+#endif /* !__s390x__ */
diff --git a/libgcc/config/s390/32/_fixtfdi.c b/libgcc/config/s390/32/_fixtfdi.c
index d17c516..f531972 100644
--- a/libgcc/config/s390/32/_fixtfdi.c
+++ b/libgcc/config/s390/32/_fixtfdi.c
@@ -24,6 +24,8 @@  a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#ifndef __s390x__
+
 #define EXPD(fp)	   (((fp.l.i[0]) >> 16) & 0x7FFF)
 #define EXPONENT_BIAS	   16383
 #define MANTISSA_BITS      112
@@ -111,3 +113,4 @@  __fixtfdi (long double a1)
 
     return SIGND (dl1) ? -(l >> -exp) : l >> -exp;
 }
+#endif /* !__s390x__ */
diff --git a/libgcc/config/s390/32/_fixunsdfdi.c b/libgcc/config/s390/32/_fixunsdfdi.c
index 4179b3f..64d95e6 100644
--- a/libgcc/config/s390/32/_fixunsdfdi.c
+++ b/libgcc/config/s390/32/_fixunsdfdi.c
@@ -24,6 +24,8 @@  a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#ifndef __s390x__
+
 #define EXPD(fp)	(((fp.l.upper) >> 20) & 0x7FF)
 #define EXCESSD		1022
 #define SIGNBIT		0x80000000
@@ -104,3 +106,4 @@  __fixunsdfdi (double a1)
 
     return l;
 }
+#endif /* !__s390x__ */
diff --git a/libgcc/config/s390/32/_fixunssfdi.c b/libgcc/config/s390/32/_fixunssfdi.c
index 9dd3154..99bbe42 100644
--- a/libgcc/config/s390/32/_fixunssfdi.c
+++ b/libgcc/config/s390/32/_fixunssfdi.c
@@ -24,6 +24,8 @@  a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#ifndef __s390x__
+
 #define EXP(fp)         (((fp.l) >> 23) & 0xFF)
 #define EXCESS          126
 #define SIGNBIT         0x80000000
@@ -100,3 +102,4 @@  __fixunssfdi (float a1)
 
     return l;
 }
+#endif /* !__s390x__ */
diff --git a/libgcc/config/s390/32/_fixunstfdi.c b/libgcc/config/s390/32/_fixunstfdi.c
index 00c22bf..a09ab08 100644
--- a/libgcc/config/s390/32/_fixunstfdi.c
+++ b/libgcc/config/s390/32/_fixunstfdi.c
@@ -24,6 +24,8 @@  a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#ifndef __s390x__
+
 #define EXPD(fp)	   (((fp.l.i[0]) >> 16) & 0x7FFF)
 #define EXPONENT_BIAS	   16383
 #define MANTISSA_BITS      112
@@ -109,3 +111,5 @@  __fixunstfdi (long double a1)
 
     return l >> -exp;
 }
+
+#endif /* !__s390x__ */