[patch libgcc]: Fix float128 soft-float for mingw targets
Kai Tietz
ktietz70@googlemail.com
Thu Mar 1 09:02:00 GMT 2012
2012/2/27 Joseph S. Myers <joseph@codesourcery.com>:
> On Mon, 27 Feb 2012, Kai Tietz wrote:
>
>> 2012-02-28 Kai Tietz <ktietz@redhat.com>
>>
>> * soft-fp/soft-fp.h (_FP_STRUCT_LAYOUT): If not defined,
>> define it as empty macro.
>> * soft-fp/quad.h: Mark bitfield-structures by _FP_STRUCT_LAYOUT.
>> * soft-fp/extended.h: Likewise.
>> * soft-fp/single.h: Likewise.
>> * soft-fp/double.h: Likewise.
>
> Thanks. This looks fine to me, modulo ChangeLog and comment wording and
> copyright year updates. I'd propose to commit it in a few days' time with
> those fixed unless anyone sees any problems with it.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
Thanks, I adjusted ChangeLog, comment, and added the copyright year.
It would be kind, if somebody could apply this patch to glibc's
repository as I don't have commit access to it. I can do the applying
to gcc's tree, if patch is ok-ed.
ChangeLog glibc
2012-03-01 Kai Tietz <ktietz@redhat.com>
* soft-fp/soft-fp.h (_FP_STRUCT_LAYOUT): New macro.
Adjusted copyright year.
* soft-fp/quad.h (_FP_UNION_Q): Mark bitfield-struct
part by _FP_STRUCT_LAYOUT.
Adjusted copyright year.
* soft-fp/extended.h: Likewise.
* soft-fp/single.h (_FP_UNION_S): Likewise.
* soft-fp/double.h (_FP_UNION_D): Likewise.
Thanks in advance,
Kai
Index: soft-fp/extended.h
===================================================================
--- soft-fp/extended.h (revision 184686)
+++ 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).
@@ -64,7 +64,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 +263,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 184686)
+++ 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),
@@ -58,7 +58,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 184686)
+++ 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),
@@ -68,7 +68,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 +167,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 184686)
+++ 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),
@@ -67,7 +67,7 @@
union _FP_UNION_Q
{
TFtype flt;
- struct
+ struct _FP_STRUCT_LAYOUT
{
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned sign : 1;
@@ -171,10 +171,11 @@
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 184686)
+++ 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, 2012
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com),
@@ -85,6 +85,13 @@
#define FP_EX_DENORM 0
#endif
+/* By _FP_STRUCT_LAYOUT you can specify to be used struct-layout
+ variant. This is required for mingw targets, which are using
+ a specific struct-layout with differences in consecutive bit-fields. */
+#ifndef _FP_STRUCT_LAYOUT
+#define _FP_STRUCT_LAYOUT
+#endif
+
#ifdef _FP_DECL_EX
#define FP_DECL_EX \
int _fex = 0; \
More information about the Libc-alpha
mailing list