public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39031]  New: HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h>
@ 2009-01-30  0:04 tydeman at tybor dot com
  2009-01-30  0:06 ` [Bug c/39031] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tydeman at tybor dot com @ 2009-01-30  0:04 UTC (permalink / raw)
  To: gcc-bugs

The Decimal Floating Point (DFP) Technical Report (TR) added DFP versions
of HUGE_VAL to <math.h>.  They are missing in (at least) gcc 4.3.2-7.

/* DFP TR 24732 == WG14 / N1176, N1312 */
#define __STDC_WANT_DEC_FP__    /* Tell implementation that we want Decimal FP
*/
#include <math.h>               /* HUGE_VAL_D* */

_Decimal32 d32 = HUGE_VAL_D32;
_Decimal64 d64 = HUGE_VAL_D64;
_Decimal128 d128 = HUGE_VAL_D128;

gets:
test1.c:5: warning: ISO C does not support decimal floating point
test1.c:5: error: 'HUGE_VAL_D32' undeclared here (not in a function)
test1.c:6: warning: ISO C does not support decimal floating point
test1.c:6: error: 'HUGE_VAL_D64' undeclared here (not in a function)
test1.c:7: warning: ISO C does not support decimal floating point
test1.c:7: error: 'HUGE_VAL_D128' undeclared here (not in a function)

Janis asked to be CCed on DFP bugs.


-- 
           Summary: HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from
                    <math.h>
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tydeman at tybor dot com
  GCC host triplet: 4.3.2
GCC target triplet: 4.3.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39031


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

* [Bug c/39031] HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h>
  2009-01-30  0:04 [Bug c/39031] New: HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h> tydeman at tybor dot com
@ 2009-01-30  0:06 ` pinskia at gcc dot gnu dot org
  2009-01-30  0:26 ` janis at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-30  0:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-01-30 00:05 -------
IIRC math.h is controlled by the glibc project and really this is a bug in
glibc and not GCC.  GCC officially only implements the freestanding C library. 
It is better to report it to the glibc project about this problem.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39031


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

* [Bug c/39031] HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h>
  2009-01-30  0:04 [Bug c/39031] New: HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h> tydeman at tybor dot com
  2009-01-30  0:06 ` [Bug c/39031] " pinskia at gcc dot gnu dot org
@ 2009-01-30  0:26 ` janis at gcc dot gnu dot org
  2009-01-30 20:57 ` janis at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-01-30  0:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from janis at gcc dot gnu dot org  2009-01-30 00:25 -------
Andrew is correct, math.h is not provided by GCC.

TR 24732 is not supported by GLIBC and probably won't be until it is
incorporated into a C standard.  Meanwhile it is in a branch of the EGLIBC
project, but I understand that it is difficult to build so I'm not sure how you
could use it for testing.

To avoid "warning: ISO C does not support decimal floating point" compile with
-std=gnu99.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39031


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

* [Bug c/39031] HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h>
  2009-01-30  0:04 [Bug c/39031] New: HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h> tydeman at tybor dot com
  2009-01-30  0:06 ` [Bug c/39031] " pinskia at gcc dot gnu dot org
  2009-01-30  0:26 ` janis at gcc dot gnu dot org
@ 2009-01-30 20:57 ` janis at gcc dot gnu dot org
  2009-02-05 19:29 ` rsa at us dot ibm dot com
  2009-02-05 19:33 ` rsa at us dot ibm dot com
  4 siblings, 0 replies; 6+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-01-30 20:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from janis at gcc dot gnu dot org  2009-01-30 20:57 -------
Ryan, would you please provide information about the status of C library
decimal float support for powerpc*-linux and s390-linux?

HJ, would you please provide information about the status of C library decimal
float support for x86*-linux?

Any suggestions for how Fred can test the C library support?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39031


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

* [Bug c/39031] HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h>
  2009-01-30  0:04 [Bug c/39031] New: HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h> tydeman at tybor dot com
                   ` (2 preceding siblings ...)
  2009-01-30 20:57 ` janis at gcc dot gnu dot org
@ 2009-02-05 19:29 ` rsa at us dot ibm dot com
  2009-02-05 19:33 ` rsa at us dot ibm dot com
  4 siblings, 0 replies; 6+ messages in thread
From: rsa at us dot ibm dot com @ 2009-02-05 19:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rsa at us dot ibm dot com  2009-02-05 19:28 -------
This situation is a little bit muddy.

The position of the GLIBC maintainer is that requirements of the DFP Technical
Report will NEVER be added to GLIBC proper.

There is indeed currently a EGLIBC branch that is hosting a 'dfp' add-on which
will build a powerpc version of libdfp.  Libdfp provides math.h.

Ultimately libdfp will be a standalone library and math.h will be provided via
a #include_next header file forwarding mechanism.

When you compile your app you will indicate where the math.h is located that
provides dfp prototypes: -I /usr/include/dfp/math.h

/* /usr/include/dfp/math.h */
/* dfp specific additions and definitions.  */
#include_next <math.h>

In the meantime you can look use the eglibc dfp branch at:

eglibc/dfp/sysdeps/dfp/math/math.h

I hope to have a prototype standalone libdfp very soon.  Unfortunately I don't
have the time to do the libbid backend work to support x86.  I believe there's
currently a wrapper layer to allow it to be inserted into libdfp as a valid
backend but someone else needs to help integrate and test that.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39031


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

* [Bug c/39031] HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h>
  2009-01-30  0:04 [Bug c/39031] New: HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h> tydeman at tybor dot com
                   ` (3 preceding siblings ...)
  2009-02-05 19:29 ` rsa at us dot ibm dot com
@ 2009-02-05 19:33 ` rsa at us dot ibm dot com
  4 siblings, 0 replies; 6+ messages in thread
From: rsa at us dot ibm dot com @ 2009-02-05 19:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rsa at us dot ibm dot com  2009-02-05 19:32 -------
>From the libdfp math.h:

#if __STDC_WANT_DEC_FP__
# define DEC_INFINITY>---__builtin_infd32()
# define DEC_NAN>>-------(0.0DF * DEC_INFINITY)
# define HUGE_VAL_D64>--__builtin_infd64()
# define HUGE_VAL_D64   (9.999999999999999E384DD + 1.E384dd) */
# define HUGE_VAL_D32>--HUGE_VAL_D64
# define HUGE_VAL_D128>-HUGE_VAL_D64


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39031


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

end of thread, other threads:[~2009-02-05 19:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-30  0:04 [Bug c/39031] New: HUGE_VAL_D32, HUGE_VAL_D64, HUGE_VAL_D128 missing from <math.h> tydeman at tybor dot com
2009-01-30  0:06 ` [Bug c/39031] " pinskia at gcc dot gnu dot org
2009-01-30  0:26 ` janis at gcc dot gnu dot org
2009-01-30 20:57 ` janis at gcc dot gnu dot org
2009-02-05 19:29 ` rsa at us dot ibm dot com
2009-02-05 19:33 ` rsa at us dot ibm dot com

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).