public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: V3 PATCH: Fix PR3988
@ 2001-08-14 15:15 Mark Mitchell
  2001-08-14 16:03 ` Benjamin Kosnik
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Mitchell @ 2001-08-14 15:15 UTC (permalink / raw)
  To: Franz Sirl, Gabriel Dos Reis; +Cc: gcc-patches, libstdc++

--On Wednesday, August 15, 2001 12:00:04 AM +0200 Franz Sirl
> Well, a patch for config/os/gnu-linux/bits/os_defines.h or a solution
> like  the 386 one that Mark did?
>

I think the CPU-specific way is better, in general.  I think that David
asked me about doing that way, originally, and I chickened out; either
way does get the job done.

If most of the systems on PowerPC do this the same way, it makes
sense to use the CPU-specific way.  I'd prefer not to change existing
configurations, though, if we can help it; there's no need to introduce
risk on AIX, for example, if things already work correctly there.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: V3 PATCH: Fix PR3988
  2001-08-14 15:15 V3 PATCH: Fix PR3988 Mark Mitchell
@ 2001-08-14 16:03 ` Benjamin Kosnik
  0 siblings, 0 replies; 7+ messages in thread
From: Benjamin Kosnik @ 2001-08-14 16:03 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Franz Sirl, Gabriel Dos Reis, gcc-patches, libstdc++

> > Well, a patch for config/os/gnu-linux/bits/os_defines.h or a solution
> > like  the 386 one that Mark did?

Please try to keep this cpu-specific stuff out of os-specific headers. 

> I think the CPU-specific way is better, in general.  I think that David
> asked me about doing that way, originally, and I chickened out; either
> way does get the job done.

Only, putting the cpu-stuff in config/cpu actually makes sense. This 
avoids confusion, and makes future maintenance enjoyable.

> If most of the systems on PowerPC do this the same way, it makes
> sense to use the CPU-specific way.  I'd prefer not to change existing
> configurations, though, if we can help it; there's no need to introduce
> risk on AIX, for example, if things already work correctly there.

Please do this correctly on the trunk, at least.

-benjamin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: V3 PATCH: Fix PR3988
  2001-08-14 14:53   ` Gabriel Dos Reis
@ 2001-08-14 14:59     ` Franz Sirl
  0 siblings, 0 replies; 7+ messages in thread
From: Franz Sirl @ 2001-08-14 14:59 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: Mark Mitchell, gcc-patches, libstdc++

On Tuesday 14 August 2001 23:53, Gabriel Dos Reis wrote:
> Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
> | On Tuesday 14 August 2001 00:24, Mark Mitchell wrote:
> | > The new limits stuff was accidentally thinking that the x86 had a long
> | > double type with 128 bits of precision, when really the precision is
> | > 80 bits.  Here's the fix.
> | >
> | > Tested on i686-pc-linux-gnu, installed on the branch and on the
> | > mainline.
> |
> | Hmm, don't we need the same stuff for powerpc too? AFAIK long double ==
> | double still on PPC, so __glibcpp_long_double_bits has to be set to 64.
> | This happens for powerpc64 (in config/os/gnu-linux/bits/os_defines.h),
> | but not for powerpc.
>
> Would you mind to provide a patch that defines the correct size?

Well, a patch for config/os/gnu-linux/bits/os_defines.h or a solution like 
the 386 one that Mark did?

Franz.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: V3 PATCH: Fix PR3988
@ 2001-08-14 14:59 Mark Mitchell
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Mitchell @ 2001-08-14 14:59 UTC (permalink / raw)
  To: Franz Sirl, gcc-patches, libstdc++

--On Tuesday, August 14, 2001 11:47:02 PM +0200 Franz Sirl 
<Franz.Sirl-kernel@lauterbach.com> wrote:

> On Tuesday 14 August 2001 00:24, Mark Mitchell wrote:
>> The new limits stuff was accidentally thinking that the x86 had a long
>> double type with 128 bits of precision, when really the precision is
>> 80 bits.  Here's the fix.
>>
>> Tested on i686-pc-linux-gnu, installed on the branch and on the
>> mainline.
>
> Hmm, don't we need the same stuff for powerpc too? AFAIK long double ==
> double

That's entirely possible.  We can accept a patch for this, even very late
in the process.

Thanks,

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: V3 PATCH: Fix PR3988
       [not found] ` <200108142147.XAA20070@mayo.cmla.ens-cachan.fr>
@ 2001-08-14 14:53   ` Gabriel Dos Reis
  2001-08-14 14:59     ` Franz Sirl
  0 siblings, 1 reply; 7+ messages in thread
From: Gabriel Dos Reis @ 2001-08-14 14:53 UTC (permalink / raw)
  To: Franz Sirl; +Cc: Mark Mitchell, gcc-patches, libstdc++

Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:

| On Tuesday 14 August 2001 00:24, Mark Mitchell wrote:
| > The new limits stuff was accidentally thinking that the x86 had a long
| > double type with 128 bits of precision, when really the precision is
| > 80 bits.  Here's the fix.
| >
| > Tested on i686-pc-linux-gnu, installed on the branch and on the
| > mainline.
| 
| Hmm, don't we need the same stuff for powerpc too? AFAIK long double == 
| double still on PPC, so __glibcpp_long_double_bits has to be set to 64. This 
| happens for powerpc64 (in config/os/gnu-linux/bits/os_defines.h), but not for 
| powerpc.

Would you mind to provide a patch that defines the correct size?

Thanks,

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: V3 PATCH: Fix PR3988
  2001-08-13 15:24 Mark Mitchell
@ 2001-08-14 14:46 ` Franz Sirl
       [not found] ` <200108142147.XAA20070@mayo.cmla.ens-cachan.fr>
  1 sibling, 0 replies; 7+ messages in thread
From: Franz Sirl @ 2001-08-14 14:46 UTC (permalink / raw)
  To: Mark Mitchell, gcc-patches, libstdc++

On Tuesday 14 August 2001 00:24, Mark Mitchell wrote:
> The new limits stuff was accidentally thinking that the x86 had a long
> double type with 128 bits of precision, when really the precision is
> 80 bits.  Here's the fix.
>
> Tested on i686-pc-linux-gnu, installed on the branch and on the
> mainline.

Hmm, don't we need the same stuff for powerpc too? AFAIK long double == 
double still on PPC, so __glibcpp_long_double_bits has to be set to 64. This 
happens for powerpc64 (in config/os/gnu-linux/bits/os_defines.h), but not for 
powerpc.

Franz.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* V3 PATCH: Fix PR3988
@ 2001-08-13 15:24 Mark Mitchell
  2001-08-14 14:46 ` Franz Sirl
       [not found] ` <200108142147.XAA20070@mayo.cmla.ens-cachan.fr>
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Mitchell @ 2001-08-13 15:24 UTC (permalink / raw)
  To: gcc-patches, libstdc++

The new limits stuff was accidentally thinking that the x86 had a long
double type with 128 bits of precision, when really the precision is
80 bits.  Here's the fix.

Tested on i686-pc-linux-gnu, installed on the branch and on the
mainline.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-08-13  Mark Mitchell  <mark@codesourcery.com>

	* configure.in (LIMITS_INC_SRCDIR): New variable.
	* configure.target (LIMITSH): New variable.
	* porting.texi: Discuss numeric limits.
	* config/cpu/generic/bits/limits.h: New file.
	* config/cpu/i386/bits/limits.h: New file.
	* include/Makefile.am: Install bits/limits.h.
	* include/bits/c++config: Include bits/limits.h.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.54.2.9
diff -c -p -r1.54.2.9 configure.in
*** configure.in	2001/07/26 07:52:19	1.54.2.9
--- configure.in	2001/08/13 22:17:10
*************** fi
*** 224,231 ****
--- 224,233 ----
  # Propagate the target-specific source directories through the build chain.
  OS_INC_SRCDIR=$os_include_dir/bits
  ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
+ LIMITS_INC_SRCDIR=$LIMITSH/bits
  AC_SUBST(OS_INC_SRCDIR)
  AC_SUBST(ATOMICITY_INC_SRCDIR)
+ AC_SUBST(LIMITS_INC_SRCDIR)
  
  # Set up cross-compile flags
  AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
Index: configure.target
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.target,v
retrieving revision 1.14.2.7
diff -c -p -r1.14.2.7 configure.target
*** configure.target	2001/07/26 05:01:52	1.14.2.7
--- configure.target	2001/08/13 22:17:10
*************** case "${target}" in
*** 125,127 ****
--- 125,140 ----
       ATOMICITYH=$cpu_include_dir
       ;;
  esac
+ 
+ # Set LIMITSH to the directory where the configuration-dependent
+ # limits.h can be found.
+ # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
+ 
+ case "${target}" in
+    i?86-*-*)
+      LIMITSH=config/cpu/i386
+      ;;
+    *)
+      LIMITSH=config/cpu/generic
+      ;;
+ esac
Index: porting.texi
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/porting.texi,v
retrieving revision 1.4.4.3
diff -c -p -r1.4.4.3 porting.texi
*** porting.texi	2001/06/12 23:10:00	1.4.4.3
--- porting.texi	2001/08/13 22:17:10
*************** Here are the primary steps required to p
*** 74,79 ****
--- 74,80 ----
  * Operating system::    Configuring for your operating system.
  * Character types::     Implementing character classification.
  * Thread safety::       Implementing atomic operations.
+ * Numeric limits::	Implementing numeric limits.
  * Libtool::             Using libtool.
  * GNU Free Documentation License:: How you can copy and share this manual.
  @end menu
*************** __atomic_add (_Atomic_word* __mem, int _
*** 435,440 ****
--- 436,466 ----
    *__mem += __val;
  @}
  @end example
+ 
+ @c ---------------------------------------------------------------------
+ @c Numeric limits
+ @c ---------------------------------------------------------------------
+ 
+ @node Numeric limits
+ @chapter Numeric limits
+ 
+ The C++ library requires information about the fundamental data types,
+ such as the minimum and maximum representable values of each type.
+ You can define each of these values individually, but it is usually
+ easiest just to indicate how many bits are used in each of the data
+ types and let the library do the rest.  For information about the
+ macros to define, see the top of @file{include/bits/std_limits.h}.
+ 
+ If you need to define any macros, you can do so in
+ @file{os_defines.h}.  However, if all operating systems for your CPU
+ are likely to use the same values, you can provide a CPU-specific file
+ instead so that you do not have to provide the same definitions for
+ each operating system.  To take that approach, create a new file
+ called @file{limits.h} in your CPU configuration directory (e.g.,
+ @file{config/cpu/i386/bits}) and then modify @file{configure.target}
+ so that @code{LIMITSH} is set to the CPU directory (e.g.,
+ @file{config/cpu/i386}).  Note that @code{LIMITSH} should not include
+ the @samp{bits} part of the directory name.
  
  @c ---------------------------------------------------------------------
  @c Libtool
Index: config/cpu/generic/bits/limits.h
===================================================================
RCS file: limits.h
diff -N limits.h
*** /dev/null	Tue May  5 13:32:27 1998
--- limits.h	Mon Aug 13 15:17:10 2001
***************
*** 0 ****
--- 1,40 ----
+ // Copyright (C) 2001 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library.  This library is free
+ // software; you can redistribute it and/or modify it under the
+ // terms of the GNU General Public License as published by the
+ // Free Software Foundation; either version 2, or (at your option)
+ // any later version.
+ 
+ // This library is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ 
+ // You should have received a copy of the GNU General Public License along
+ // with this library; see the file COPYING.  If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+ 
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction.  Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License.  This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+ 
+ #ifndef _GLIBCPP_CPU_LIMITS
+ #define _GLIBCPP_CPU_LIMITS 1
+ 
+ // Nothing is defined in the generic file.  In that way, we fall back
+ // on the defaults in std_limits.h.
+ 
+ // If you need to override these defaults, you can either use a
+ // CPU-specific version (in which case you must modify
+ // configure.target) or you must add the overrides to your
+ // os_defines.h.  In general, if all systems for your CPU use the
+ // same values, it is best to use a cpu-specific configuration file.
+ 
+ #endif
Index: config/cpu/i386/bits/limits.h
===================================================================
RCS file: limits.h
diff -N limits.h
*** /dev/null	Tue May  5 13:32:27 1998
--- limits.h	Mon Aug 13 15:17:10 2001
***************
*** 0 ****
--- 1,33 ----
+ // Copyright (C) 2001 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library.  This library is free
+ // software; you can redistribute it and/or modify it under the
+ // terms of the GNU General Public License as published by the
+ // Free Software Foundation; either version 2, or (at your option)
+ // any later version.
+ 
+ // This library is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ 
+ // You should have received a copy of the GNU General Public License along
+ // with this library; see the file COPYING.  If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+ 
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction.  Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License.  This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+ 
+ #ifndef _GLIBCPP_CPU_LIMITS
+ #define _GLIBCPP_CPU_LIMITS 1
+ 
+ #define __glibcpp_long_double_bits 80
+ 
+ #endif
Index: include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.1.6.2
diff -c -p -r1.1.6.2 Makefile.am
*** Makefile.am	2001/08/11 18:12:17	1.1.6.2
--- Makefile.am	2001/08/13 22:17:11
*************** target_headers = \
*** 284,290 ****
  	${target_srcdir}/ctype_inline.h \
  	${target_srcdir}/ctype_noninline.h \
  	${target_srcdir}/os_defines.h \
! 	${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h
  
  thread_builddir = ./${target_alias}/bits
  thread_headers = \
--- 284,291 ----
  	${target_srcdir}/ctype_inline.h \
  	${target_srcdir}/ctype_noninline.h \
  	${target_srcdir}/os_defines.h \
! 	${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
! 	${glibcpp_srcdir}/@LIMITS_INC_SRCDIR@/limits.h
  
  thread_builddir = ./${target_alias}/bits
  thread_headers = \
Index: include/bits/c++config
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/c++config,v
retrieving revision 1.8.6.58
diff -c -p -r1.8.6.58 c++config
*** c++config	2001/08/13 07:16:14	1.8.6.58
--- c++config	2001/08/13 22:17:11
***************
*** 32,37 ****
--- 32,39 ----
  
  // Pick up any OS-specific definitions.
  #include <bits/os_defines.h>
+ // And any CPU-specific definitions.
+ #include <bits/limits.h>
  
  // The current version of the C++ library in compressed ISO date format.
  #define __GLIBCPP__ 20010813

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-08-14 16:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-14 15:15 V3 PATCH: Fix PR3988 Mark Mitchell
2001-08-14 16:03 ` Benjamin Kosnik
  -- strict thread matches above, loose matches on Subject: below --
2001-08-14 14:59 Mark Mitchell
2001-08-13 15:24 Mark Mitchell
2001-08-14 14:46 ` Franz Sirl
     [not found] ` <200108142147.XAA20070@mayo.cmla.ens-cachan.fr>
2001-08-14 14:53   ` Gabriel Dos Reis
2001-08-14 14:59     ` Franz Sirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).