From patchwork Thu Mar 1 18:11:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 144084 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]) by ozlabs.org (Postfix) with SMTP id B717DB6EEA for ; Fri, 2 Mar 2012 05:11:32 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331230294; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Received-SPF:Received:MIME-Version:Received:Received:In-Reply-To: References:Date:Message-ID:Subject:From:To:Cc:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=c7DshZRoVqorjjfrQ4lk 3TNckRI=; b=JoXvnKNPDeIMMav/lqmMOTlVd+lBqZ9n07SPpUYB8ooyfuisCtEN cWL6drPvvyMNJQIgCJS/ivBDm6ZI/M0bYqMQirndS3PF1c7PLUfTPjAL5ygvzP1A v1dw0sTSIbsZh1C5Q6WrMjvnJ3DWmvx8w0dDzJBYPCKOFbPpGaFtf1o= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received-SPF:Authentication-Results:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=XNgT+bjCaNIzFGt/19BNa/7/LiSy/b8uHP16jzJ6iASLcxhj5GxffGVzkKIBgm GX1QvBoPxQZW0Vnj8HEKSKdyvhvpM99tdgtboKkPYsJRdNuExggQCh7efI2IN9SA bq6KJGo7gbukxLoHU6xeRv/e8kNIaNN+0surjWHt45flg=; Received: (qmail 17433 invoked by alias); 1 Mar 2012 18:11:27 -0000 Received: (qmail 17415 invoked by uid 22791); 1 Mar 2012 18:11:23 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-tul01m020-f175.google.com (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Mar 2012 18:11:07 +0000 Received: by obqv19 with SMTP id v19so1067812obq.20 for ; Thu, 01 Mar 2012 10:11:06 -0800 (PST) Received-SPF: pass (google.com: domain of ktietz70@googlemail.com designates 10.182.72.69 as permitted sender) client-ip=10.182.72.69; Authentication-Results: mr.google.com; spf=pass (google.com: domain of ktietz70@googlemail.com designates 10.182.72.69 as permitted sender) smtp.mail=ktietz70@googlemail.com; dkim=pass header.i=ktietz70@googlemail.com Received: from mr.google.com ([10.182.72.69]) by 10.182.72.69 with SMTP id b5mr2251252obv.77.1330625466716 (num_hops = 1); Thu, 01 Mar 2012 10:11:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.72.69 with SMTP id b5mr1970844obv.77.1330625466650; Thu, 01 Mar 2012 10:11:06 -0800 (PST) Received: by 10.182.33.103 with HTTP; Thu, 1 Mar 2012 10:11:06 -0800 (PST) In-Reply-To: References: Date: Thu, 1 Mar 2012 19:11:06 +0100 Message-ID: Subject: Re: [patch libgcc]: Fix float128 soft-float for mingw targets From: Kai Tietz To: "Joseph S. Myers" Cc: GCC Patches , Richard Henderson X-IsSubscribed: yes 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 Hello, Thanks and sorry for the troubles I caused. Next time I will prepare patches for it against glibc's developer repository. As I understand the README file in soft-fp, just those files affected by my patch need to be merged from glibc. As the mingw targets are using by defaul ms-struct layout, the following patch is required to fix floating-point-software-emulation failures caused by difference in handling consecutive bitfields with different types. ChangeLog 2012-03-01 Kai Tietz * soft-fp/extended.h: Imported from glibc upstream. * soft-fp/float.h: Likewise. * soft-fp/single.h: Likewise * soft-fp/double.h: Likewise * soft-fp/soft-fp.h: Likewise. Ok for apply ? Regards, Kai Index: soft-fp/extended.h =================================================================== --- soft-fp/extended.h (revision 184753) +++ soft-fp/extended.h (working copy) @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Extended Precision. - Copyright (C) 1999,2006,2007 Free Software Foundation, Inc. + Copyright (C) 1999,2006,2007,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek (jj@ultra.linux.cz). @@ -24,9 +24,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + License along with the GNU C Library; if not, see + . */ #if _FP_W_TYPE_SIZE < 32 #error "Here's a nickel, kid. Go buy yourself a real computer." @@ -64,7 +63,7 @@ union _FP_UNION_E { XFtype flt; - struct + struct _FP_STRUCT_LAYOUT { #if __BYTE_ORDER == __BIG_ENDIAN unsigned long pad1 : _FP_W_TYPE_SIZE; @@ -263,7 +262,7 @@ union _FP_UNION_E { XFtype flt; - struct { + struct _FP_STRUCT_LAYOUT { #if __BYTE_ORDER == __BIG_ENDIAN _FP_W_TYPE pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E); unsigned sign : 1; Index: soft-fp/single.h =================================================================== --- soft-fp/single.h (revision 184753) +++ soft-fp/single.h (working copy) @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Single Precision. - Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -27,9 +27,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + License along with the GNU C Library; if not, see + . */ #if _FP_W_TYPE_SIZE < 32 #error "Here's a nickel kid. Go buy yourself a real computer." @@ -58,7 +57,7 @@ union _FP_UNION_S { SFtype flt; - struct { + struct _FP_STRUCT_LAYOUT { #if __BYTE_ORDER == __BIG_ENDIAN unsigned sign : 1; unsigned exp : _FP_EXPBITS_S; Index: soft-fp/double.h =================================================================== --- soft-fp/double.h (revision 184753) +++ soft-fp/double.h (working copy) @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Double Precision - Copyright (C) 1997, 1998, 1999, 2006, 2007, 2008, 2009 + Copyright (C) 1997, 1998, 1999, 2006, 2007, 2008, 2009, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), @@ -28,9 +28,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + License along with the GNU C Library; if not, see + . */ #if _FP_W_TYPE_SIZE < 32 #error "Here's a nickel kid. Go buy yourself a real computer." @@ -68,7 +67,7 @@ union _FP_UNION_D { DFtype flt; - struct { + struct _FP_STRUCT_LAYOUT { #if __BYTE_ORDER == __BIG_ENDIAN unsigned sign : 1; unsigned exp : _FP_EXPBITS_D; @@ -167,7 +166,7 @@ union _FP_UNION_D { DFtype flt; - struct { + struct _FP_STRUCT_LAYOUT { #if __BYTE_ORDER == __BIG_ENDIAN unsigned sign : 1; unsigned exp : _FP_EXPBITS_D; Index: soft-fp/quad.h =================================================================== --- soft-fp/quad.h (revision 184753) +++ soft-fp/quad.h (working copy) @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Quad Precision. - Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006,2007,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -27,9 +27,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + License along with the GNU C Library; if not, see + . */ #if _FP_W_TYPE_SIZE < 32 #error "Here's a nickel, kid. Go buy yourself a real computer." @@ -67,7 +66,7 @@ union _FP_UNION_Q { TFtype flt; - struct + struct _FP_STRUCT_LAYOUT { #if __BYTE_ORDER == __BIG_ENDIAN unsigned sign : 1; @@ -171,10 +170,10 @@ union _FP_UNION_Q { TFtype flt /* __attribute__((mode(TF))) */ ; - struct { + struct _FP_STRUCT_LAYOUT { _FP_W_TYPE a, b; } longs; - struct { + struct _FP_STRUCT_LAYOUT { #if __BYTE_ORDER == __BIG_ENDIAN unsigned sign : 1; unsigned exp : _FP_EXPBITS_Q; Index: soft-fp/soft-fp.h =================================================================== --- soft-fp/soft-fp.h (revision 184753) +++ soft-fp/soft-fp.h (working copy) @@ -1,5 +1,5 @@ /* Software floating-point emulation. - Copyright (C) 1997,1998,1999,2000,2002,2003,2005,2006 + Copyright (C) 1997,1998,1999,2000,2002,2003,2005,2006,2007,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), @@ -27,9 +27,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + License along with the GNU C Library; if not, see + . */ #ifndef SOFT_FP_H #define SOFT_FP_H @@ -85,6 +84,16 @@ #define FP_EX_DENORM 0 #endif +/* _FP_STRUCT_LAYOUT may be defined as an attribute to determine the + struct layout variant used for structures where bit-fields are used + to access specific parts of binary floating-point numbers. This is + required for systems where the default ABI uses struct layout with + differences in how consecutive bit-fields are laid out from the + default expected by soft-fp. */ +#ifndef _FP_STRUCT_LAYOUT +#define _FP_STRUCT_LAYOUT +#endif + #ifdef _FP_DECL_EX #define FP_DECL_EX \ int _fex = 0; \