diff mbox

Allow decimal floats for mingw-w64

Message ID 4C803F00.5080500@users.sourceforge.net
State New
Headers show

Commit Message

JonY Sept. 3, 2010, 12:19 a.m. UTC
On 9/3/2010 08:26, Dave Korn wrote:
> On 24/08/2010 16:06, Kai Tietz wrote:
>> 2010/8/24 JonY<jon_y@users.sourceforge.net>:
>>> Hi,
>>>
>>> Attached patch enables i?86-w64-mingw32 and x86_64-w64-mingw32 decimal float
>>> support with bid.
>>>
>>> Tested with x86_64-w64-mingw32. Is attached patch OK for trunk?
>>>
>>>
>>>
>>> 2010-08-24  Jonathan Yong<jon_y@users.sourceforge.net>
>>>
>>>         * configure.ac: Allow w64 targets to use bid decimal floats.
>>>         * configure: Regenerated.
>>>
>>>
>>
>> Patch is from my side ok. I added Dave to CC. Maybe he wants that it
>> gets added for cygwin, too?
>
>    I'm currently testing a build that I did with Uros' patch and manually
> configuring with '--enable-decimal-float' and it seems to be going pretty
> well, so yes please Jon, if you don't mind spinning another respin.
>

Spinning another respin? I thought --enable-decimal-float was ignored
for cygwin and mingw?

>    BTW, re Ralf's earlier point: for preference please actually /omit/ the
> diffs of the generated configure files altogether, we only need to see the
> change to the .ac file, because autoconf is very deterministic, and the actual
> configure file diffs often contain tons of uninformative noise from the
> expansions of all the macros and the changes in error line number reporting(*).
>

Yes, I was wondering about that. New patch attached, this time only
configure.ac and the new m4 file.

Comments

Kai Tietz Sept. 7, 2010, 8:51 a.m. UTC | #1
2010/9/3 JonY <jon_y@users.sourceforge.net>:
> On 9/3/2010 08:26, Dave Korn wrote:
>>
>> On 24/08/2010 16:06, Kai Tietz wrote:
>>>
>>> 2010/8/24 JonY<jon_y@users.sourceforge.net>:
>>>>
>>>> Hi,
>>>>
>>>> Attached patch enables i?86-w64-mingw32 and x86_64-w64-mingw32 decimal
>>>> float
>>>> support with bid.
>>>>
>>>> Tested with x86_64-w64-mingw32. Is attached patch OK for trunk?
>>>>
>>>>
>>>>
>>>> 2010-08-24  Jonathan Yong<jon_y@users.sourceforge.net>
>>>>
>>>>        * configure.ac: Allow w64 targets to use bid decimal floats.
>>>>        * configure: Regenerated.
>>>>
>>>>
>>>
>>> Patch is from my side ok. I added Dave to CC. Maybe he wants that it
>>> gets added for cygwin, too?
>>
>>   I'm currently testing a build that I did with Uros' patch and manually
>> configuring with '--enable-decimal-float' and it seems to be going pretty
>> well, so yes please Jon, if you don't mind spinning another respin.
>>
>
> Spinning another respin? I thought --enable-decimal-float was ignored
> for cygwin and mingw?
>
>>   BTW, re Ralf's earlier point: for preference please actually /omit/ the
>> diffs of the generated configure files altogether, we only need to see the
>> change to the .ac file, because autoconf is very deterministic, and the
>> actual
>> configure file diffs often contain tons of uninformative noise from the
>> expansions of all the macros and the changes in error line number
>> reporting(*).
>>
>
> Yes, I was wondering about that. New patch attached, this time only
> configure.ac and the new m4 file.
>

Hello,

Patch is ok. Thanks for reworking this but I would like that Paolo
takes a look on it, too.

Thanks,
Kai
H.J. Lu Sept. 7, 2010, 2:06 p.m. UTC | #2
On Tue, Sep 7, 2010 at 1:51 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2010/9/3 JonY <jon_y@users.sourceforge.net>:
>> On 9/3/2010 08:26, Dave Korn wrote:
>>>
>>> On 24/08/2010 16:06, Kai Tietz wrote:
>>>>
>>>> 2010/8/24 JonY<jon_y@users.sourceforge.net>:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Attached patch enables i?86-w64-mingw32 and x86_64-w64-mingw32 decimal
>>>>> float
>>>>> support with bid.
>>>>>
>>>>> Tested with x86_64-w64-mingw32. Is attached patch OK for trunk?
>>>>>
>>>>>
>>>>>
>>>>> 2010-08-24  Jonathan Yong<jon_y@users.sourceforge.net>
>>>>>
>>>>>        * configure.ac: Allow w64 targets to use bid decimal floats.
>>>>>        * configure: Regenerated.
>>>>>
>>>>>
>>>>
>>>> Patch is from my side ok. I added Dave to CC. Maybe he wants that it
>>>> gets added for cygwin, too?
>>>
>>>   I'm currently testing a build that I did with Uros' patch and manually
>>> configuring with '--enable-decimal-float' and it seems to be going pretty
>>> well, so yes please Jon, if you don't mind spinning another respin.
>>>
>>
>> Spinning another respin? I thought --enable-decimal-float was ignored
>> for cygwin and mingw?
>>
>>>   BTW, re Ralf's earlier point: for preference please actually /omit/ the
>>> diffs of the generated configure files altogether, we only need to see the
>>> change to the .ac file, because autoconf is very deterministic, and the
>>> actual
>>> configure file diffs often contain tons of uninformative noise from the
>>> expansions of all the macros and the changes in error line number
>>> reporting(*).
>>>
>>
>> Yes, I was wondering about that. New patch attached, this time only
>> configure.ac and the new m4 file.
>>
>
> Hello,
>
> Patch is ok. Thanks for reworking this but I would like that Paolo
> takes a look on it, too.
>

Does this patch apply to trunk?
JonY Sept. 7, 2010, 3:29 p.m. UTC | #3
On 9/7/2010 22:06, H.J. Lu wrote:
> On Tue, Sep 7, 2010 at 1:51 AM, Kai Tietz<ktietz70@googlemail.com>  wrote:
>> 2010/9/3 JonY<jon_y@users.sourceforge.net>:
>>> On 9/3/2010 08:26, Dave Korn wrote:
>>>>
>>>> On 24/08/2010 16:06, Kai Tietz wrote:
>>>>>
>>>>> 2010/8/24 JonY<jon_y@users.sourceforge.net>:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Attached patch enables i?86-w64-mingw32 and x86_64-w64-mingw32 decimal
>>>>>> float
>>>>>> support with bid.
>>>>>>
>>>>>> Tested with x86_64-w64-mingw32. Is attached patch OK for trunk?
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2010-08-24  Jonathan Yong<jon_y@users.sourceforge.net>
>>>>>>
>>>>>>         * configure.ac: Allow w64 targets to use bid decimal floats.
>>>>>>         * configure: Regenerated.
>>>>>>
>>>>>>
>>>>>
>>>>> Patch is from my side ok. I added Dave to CC. Maybe he wants that it
>>>>> gets added for cygwin, too?
>>>>
>>>>    I'm currently testing a build that I did with Uros' patch and manually
>>>> configuring with '--enable-decimal-float' and it seems to be going pretty
>>>> well, so yes please Jon, if you don't mind spinning another respin.
>>>>
>>>
>>> Spinning another respin? I thought --enable-decimal-float was ignored
>>> for cygwin and mingw?
>>>
>>>>    BTW, re Ralf's earlier point: for preference please actually /omit/ the
>>>> diffs of the generated configure files altogether, we only need to see the
>>>> change to the .ac file, because autoconf is very deterministic, and the
>>>> actual
>>>> configure file diffs often contain tons of uninformative noise from the
>>>> expansions of all the macros and the changes in error line number
>>>> reporting(*).
>>>>
>>>
>>> Yes, I was wondering about that. New patch attached, this time only
>>> configure.ac and the new m4 file.
>>>
>>
>> Hello,
>>
>> Patch is ok. Thanks for reworking this but I would like that Paolo
>> takes a look on it, too.
>>
>
> Does this patch apply to trunk?
>
>

Well, its supposed to be for gcc trunk.

I did make another patch without the autoreconf stuff added, did it get 
lost?
JonY Sept. 7, 2010, 3:56 p.m. UTC | #4
On 9/7/2010 23:57, H.J. Lu wrote:
> On Tue, Sep 7, 2010 at 8:29 AM, JonY<jon_y@users.sourceforge.net>  wrote:
>> On 9/7/2010 22:06, H.J. Lu wrote:
>>>
>>> On Tue, Sep 7, 2010 at 1:51 AM, Kai Tietz<ktietz70@googlemail.com>    wrote:
>>>>
>>>> 2010/9/3 JonY<jon_y@users.sourceforge.net>:
>>>>>
>>>>> On 9/3/2010 08:26, Dave Korn wrote:
>>>>>>
>>>>>> On 24/08/2010 16:06, Kai Tietz wrote:
>>>>>>>
>>>>>>> 2010/8/24 JonY<jon_y@users.sourceforge.net>:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Attached patch enables i?86-w64-mingw32 and x86_64-w64-mingw32
>>>>>>>> decimal
>>>>>>>> float
>>>>>>>> support with bid.
>>>>>>>>
>>>>>>>> Tested with x86_64-w64-mingw32. Is attached patch OK for trunk?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2010-08-24  Jonathan Yong<jon_y@users.sourceforge.net>
>>>>>>>>
>>>>>>>>         * configure.ac: Allow w64 targets to use bid decimal floats.
>>>>>>>>         * configure: Regenerated.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Patch is from my side ok. I added Dave to CC. Maybe he wants that it
>>>>>>> gets added for cygwin, too?
>>>>>>
>>>>>>    I'm currently testing a build that I did with Uros' patch and
>>>>>> manually
>>>>>> configuring with '--enable-decimal-float' and it seems to be going
>>>>>> pretty
>>>>>> well, so yes please Jon, if you don't mind spinning another respin.
>>>>>>
>>>>>
>>>>> Spinning another respin? I thought --enable-decimal-float was ignored
>>>>> for cygwin and mingw?
>>>>>
>>>>>>    BTW, re Ralf's earlier point: for preference please actually /omit/
>>>>>> the
>>>>>> diffs of the generated configure files altogether, we only need to see
>>>>>> the
>>>>>> change to the .ac file, because autoconf is very deterministic, and the
>>>>>> actual
>>>>>> configure file diffs often contain tons of uninformative noise from the
>>>>>> expansions of all the macros and the changes in error line number
>>>>>> reporting(*).
>>>>>>
>>>>>
>>>>> Yes, I was wondering about that. New patch attached, this time only
>>>>> configure.ac and the new m4 file.
>>>>>
>>>>
>>>> Hello,
>>>>
>>>> Patch is ok. Thanks for reworking this but I would like that Paolo
>>>> takes a look on it, too.
>>>>
>>>
>>> Does this patch apply to trunk?
>>>
>>>
>>
>> Well, its supposed to be for gcc trunk.
>>
>> I did make another patch without the autoreconf stuff added, did it get
>> lost?
>>
>
> Where is it? Have you tried it on today's trunk?
>
>

I seems somebody has already committed a somewhat related patch, I'll 
need to rework mine.
H.J. Lu Sept. 7, 2010, 3:57 p.m. UTC | #5
On Tue, Sep 7, 2010 at 8:29 AM, JonY <jon_y@users.sourceforge.net> wrote:
> On 9/7/2010 22:06, H.J. Lu wrote:
>>
>> On Tue, Sep 7, 2010 at 1:51 AM, Kai Tietz<ktietz70@googlemail.com>  wrote:
>>>
>>> 2010/9/3 JonY<jon_y@users.sourceforge.net>:
>>>>
>>>> On 9/3/2010 08:26, Dave Korn wrote:
>>>>>
>>>>> On 24/08/2010 16:06, Kai Tietz wrote:
>>>>>>
>>>>>> 2010/8/24 JonY<jon_y@users.sourceforge.net>:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Attached patch enables i?86-w64-mingw32 and x86_64-w64-mingw32
>>>>>>> decimal
>>>>>>> float
>>>>>>> support with bid.
>>>>>>>
>>>>>>> Tested with x86_64-w64-mingw32. Is attached patch OK for trunk?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 2010-08-24  Jonathan Yong<jon_y@users.sourceforge.net>
>>>>>>>
>>>>>>>        * configure.ac: Allow w64 targets to use bid decimal floats.
>>>>>>>        * configure: Regenerated.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Patch is from my side ok. I added Dave to CC. Maybe he wants that it
>>>>>> gets added for cygwin, too?
>>>>>
>>>>>   I'm currently testing a build that I did with Uros' patch and
>>>>> manually
>>>>> configuring with '--enable-decimal-float' and it seems to be going
>>>>> pretty
>>>>> well, so yes please Jon, if you don't mind spinning another respin.
>>>>>
>>>>
>>>> Spinning another respin? I thought --enable-decimal-float was ignored
>>>> for cygwin and mingw?
>>>>
>>>>>   BTW, re Ralf's earlier point: for preference please actually /omit/
>>>>> the
>>>>> diffs of the generated configure files altogether, we only need to see
>>>>> the
>>>>> change to the .ac file, because autoconf is very deterministic, and the
>>>>> actual
>>>>> configure file diffs often contain tons of uninformative noise from the
>>>>> expansions of all the macros and the changes in error line number
>>>>> reporting(*).
>>>>>
>>>>
>>>> Yes, I was wondering about that. New patch attached, this time only
>>>> configure.ac and the new m4 file.
>>>>
>>>
>>> Hello,
>>>
>>> Patch is ok. Thanks for reworking this but I would like that Paolo
>>> takes a look on it, too.
>>>
>>
>> Does this patch apply to trunk?
>>
>>
>
> Well, its supposed to be for gcc trunk.
>
> I did make another patch without the autoreconf stuff added, did it get
> lost?
>

Where is it? Have you tried it on today's trunk?
diff mbox

Patch

Index: config/dfp.m4
===================================================================
--- config/dfp.m4	(revision 0)
+++ config/dfp.m4	(revision 0)
@@ -0,0 +1,73 @@ 
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl AC_SUBSTs and defines enable_decimal_float depending on $target and
+dnl ENABLE_DECIMAL_BID_FORMAT and ENABLE_DECIMAL_FLOAT where appropriate.
+
+AC_DEFUN([GCC_DFP_TARGET],
+[
+  # Enable C extension for decimal float if target supports it.
+  AC_ARG_ENABLE(decimal-float,
+  [  --enable-decimal-float={no,yes,bid,dpd}
+                          enable decimal float extension to C.  Selecting 'bid'
+                          or 'dpd' choses which decimal floating point format
+                          to use],
+  [
+    case $enable_decimal_float in
+      yes | no | bid | dpd) ;;
+      *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
+  Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
+    esac
+  ],
+  [
+    case $target in
+      powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | \
+      i?86*-*-mingw* | x86_64*-*-mingw* | \
+      i?86*-*-cygwin*)
+        enable_decimal_float=yes
+        ;;
+      *)
+        AC_MSG_WARN(decimal float is not supported for this target, ignored)
+        enable_decimal_float=no
+        ;;
+    esac
+  ])
+
+  dfp=`if test $enable_decimal_float != no; then echo 1; else echo 0; fi`
+  AC_DEFINE_UNQUOTED(ENABLE_DECIMAL_FLOAT, $dfp,
+  [Define to 1 to enable decimal float extension to C.])
+  AC_MSG_CHECKING([for decimal floating point])
+  AC_MSG_RESULT($enable_decimal_float)
+
+  # x86's use BID format instead of DPD
+  case x$enable_decimal_float in
+    xyes)
+      case $target in
+        i?86*-*-linux* | x86_64*-*-linux* | \
+        i?86*-*-mingw* | x86_64*-*-mingw* | \
+        i?86*-*-cygwin*)
+    enable_decimal_float=bid
+    ;;
+        *)
+    enable_decimal_float=dpd
+    ;;
+      esac
+      ;;
+    xno)
+      # ENABLE_DECIMAL_FLOAT is set to 0. But we have to have proper
+      # dependency on libdecnumber.
+      enable_decimal_float=dpd
+      ;;
+  esac
+
+  bid=`if test $enable_decimal_float = bid; then echo 1; else echo 0; fi`
+  AC_DEFINE_UNQUOTED(ENABLE_DECIMAL_BID_FORMAT, $bid,
+  [Define to 1 to specify that we are using the BID decimal floating
+  point format instead of DPD])
+
+  AC_SUBST(enable_decimal_float)
+])
Index: libdecnumber/configure.ac
===================================================================
--- libdecnumber/configure.ac	(revision 163756)
+++ libdecnumber/configure.ac	(working copy)
@@ -72,46 +72,8 @@ 
 
 AC_CANONICAL_TARGET
 
-# Default decimal format
-# If you change the defaults here, be sure to change them in the GCC directory also
-AC_MSG_CHECKING([for decimal floating point])
-AC_ARG_ENABLE(decimal-float,
-[  --enable-decimal-float={no,yes,bid,dpd}
-			enable decimal float extension to C.  Selecting 'bid'
-			or 'dpd' choses which decimal floating point format
-			to use],
-[
-  case $enable_decimal_float in
-    yes | no | bid | dpd) ;;
-    *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
-Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
-  esac
-],
-[
-  case $target in
-    powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux*)
-      enable_decimal_float=yes
-      ;;
-    *)
-      enable_decimal_float=no
-      ;;
-  esac
-])
+GCC_DFP_TARGET
 
-# x86's use BID format instead of DPD
-# In theory --enable-decimal-float=no should not compile anything
-# For the sake of simplicity, just use the default format in this directory
-if test x$enable_decimal_float = xyes -o x$enable_decimal_float = xno; then
-  case $target in
-    i?86*-*-linux* | x86_64*-*-linux*)
-      enable_decimal_float=bid
-      ;;
-    *)
-      enable_decimal_float=dpd
-      ;;
-  esac
-fi
-
 # If BID is being used, additional objects should be linked in.
 if test x$enable_decimal_float = xbid; then
   ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(bid_OBJS)"
@@ -119,8 +81,6 @@ 
   ADDITIONAL_OBJS=
 fi
 
-AC_MSG_RESULT($enable_decimal_float)
-AC_SUBST(enable_decimal_float)
 AC_SUBST(ADDITIONAL_OBJS)
 
 AC_C_BIGENDIAN
Index: libgcc/configure.ac
===================================================================
--- libgcc/configure.ac	(revision 163756)
+++ libgcc/configure.ac	(working copy)
@@ -125,42 +125,8 @@ 
 decimal_float=$libgcc_cv_dfp
 AC_SUBST(decimal_float)
 
-AC_ARG_ENABLE(decimal-float,
-[  --enable-decimal-float={no,yes,bid,dpd}
-			enable decimal float extension to C.  Selecting 'bid'
-			or 'dpd' choses which decimal floating point format
-			to use],
-[
-  case $enable_decimal_float in
-    yes | no | bid | dpd) ;;
-    *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
-Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
-  esac
-],
-[
-  case $host in
-    powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux*)
-      enable_decimal_float=yes
-      ;;
-    *)
-      enable_decimal_float=no
-      ;;
-  esac
-])
+GCC_DFP_TARGET
 
-# x86's use BID format instead of DPD
-if test x$enable_decimal_float = xyes; then
-  case $host in
-    i?86*-*-linux* | x86_64*-*-linux*)
-      enable_decimal_float=bid
-      ;;
-    *)
-      enable_decimal_float=dpd
-      ;;
-  esac
-fi
-AC_SUBST(enable_decimal_float)
-
 # Check for fixed-point support.
 AC_CACHE_CHECK([whether fixed-point is supported], [libgcc_cv_fixed_point],
 	       [AC_COMPILE_IFELSE([_Sat _Fract x;], [libgcc_cv_fixed_point=yes],
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 163756)
+++ gcc/configure.ac	(working copy)
@@ -606,59 +606,8 @@ 
 [], [])
 
 # Enable C extension for decimal float if target supports it.
-AC_ARG_ENABLE(decimal-float,
-[  --enable-decimal-float={no,yes,bid,dpd}
-			enable decimal float extension to C.  Selecting 'bid'
-			or 'dpd' choses which decimal floating point format
-			to use],
-[
-  case $enable_decimal_float in
-    yes | no | bid | dpd) ;;
-    *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
-Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
-  esac
-],
-[
-  case $target in
-    powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux*)
-      enable_decimal_float=yes
-      ;;
-    *)
-      AC_MSG_WARN(decimal float is not supported for this target, ignored)
-      enable_decimal_float=no
-      ;;
-  esac
-])
+GCC_DFP_TARGET
 
-dfp=`if test $enable_decimal_float != no; then echo 1; else echo 0; fi`
-AC_DEFINE_UNQUOTED(ENABLE_DECIMAL_FLOAT, $dfp,
-[Define to 1 to enable decimal float extension to C.])
-
-# x86's use BID format instead of DPD
-case x$enable_decimal_float in
-  xyes)
-    case $target in
-      i?86*-*-linux* | x86_64*-*-linux*)
-	enable_decimal_float=bid
-	;;
-      *)
-	enable_decimal_float=dpd
-	;;
-    esac
-    ;;
-  xno)
-    # ENABLE_DECIMAL_FLOAT is set to 0. But we have to have proper
-    # dependency on libdecnumber.
-    enable_decimal_float=dpd
-    ;;
-esac
-AC_SUBST(enable_decimal_float)
-
-bid=`if test $enable_decimal_float = bid; then echo 1; else echo 0; fi`
-AC_DEFINE_UNQUOTED(ENABLE_DECIMAL_BID_FORMAT, $bid,
-[Define to 1 to specify that we are using the BID decimal floating
-point format instead of DPD])
-
 # Enable C extension for fixed-point arithmetic.
 AC_ARG_ENABLE(fixed-point,
 [  --enable-fixed-point    enable fixed-point arithmetic extension to C],