From patchwork Thu Jan 30 14:56:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 315381 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 11EA42C00CE for ; Fri, 31 Jan 2014 01:57:10 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=tXU5M2otrxMKottywFGGVe2g8qWU8emZMpyjKhpZvWjHKiopPw18P VNIFD+taZbAX6CpQw3I5Nzi7vTcWmn0fzm8JnxL28NKrdRJ/Ifg2jv1wcjkU9ciH jYAiz8KG0gko5rU06QmGER/HKsoewwgY1eZRIXFmG8GLBnF2lh9t74= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=RcAGBCb8cXKgpneKCHBZ21sBhus=; b=R4iwoQQb4KKmp3B5XLFW 6Tf9QtzTVtlRbjJyuOweO6zs/DUwEPcsaZfNqlJuIw1wvzkShkM/duZ+wIK5Yw1n NRODI5uv6dfzTSUAZHIvrKYh24s9HsXzZVx8cVAsaOmC4i1AUrLZ5S/nKTkknok6 49WfCHn98fpsKZbK30f7DYg= Received: (qmail 16901 invoked by alias); 30 Jan 2014 14:57:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 16891 invoked by uid 89); 30 Jan 2014 14:57:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp14.uk.ibm.com Received: from e06smtp14.uk.ibm.com (HELO e06smtp14.uk.ibm.com) (195.75.94.110) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 30 Jan 2014 14:57:00 +0000 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 Jan 2014 14:56:56 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 30 Jan 2014 14:56:54 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id C6A941B08070 for ; Thu, 30 Jan 2014 14:56:22 +0000 (GMT) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s0UEufu663963258 for ; Thu, 30 Jan 2014 14:56:41 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s0UEuraZ011863 for ; Thu, 30 Jan 2014 07:56:53 -0700 Received: from bart (dyn-9-152-212-89.boeblingen.de.ibm.com [9.152.212.89]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id s0UEuqNu011825 for ; Thu, 30 Jan 2014 07:56:52 -0700 Received: by bart (sSMTP sendmail emulation); Thu, 30 Jan 2014 15:56:51 +0100 Date: Thu, 30 Jan 2014 15:56:51 +0100 From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [PATCH] S/390: Use the libgcc fp2int routine also in the biarch build Message-ID: <20140130145651.GA30217@bart> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14013014-1948-0000-0000-000007A12B87 X-IsSubscribed: yes 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 * 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 --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 . */ +#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 . */ +#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 . */ +#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 . */ +#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 . */ +#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 . */ +#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__ */