summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-29 20:27:41 +0000
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-29 20:27:41 +0000
commit2675096e48d1ef9f42f2c53228aa8056a0bfa353 (patch)
treed407fcd3b280b3bac4ca0e3402c1ca361e758548
parent339496f1c781c9119990172651d6b8fbe6258e68 (diff)
downloadgcc-2675096e48d1ef9f42f2c53228aa8056a0bfa353.tar.gz
gcc/
* Makefile.in (USER_H): Remove decfloat.h. * ginclude/decfloat.h: Delete, moving contents to ... * ginclude/float.h: Add support for decimal floating point, guarded by __STDC_WANT_DEC_FP__. gcc/testsuite/ * gcc.dg/dfp/dec-eval-method.c: Replace decfloat.h with float.h. * gcc.dg/dfp/decfloat-constants.c: Ditto. * gcc.dg/dfp/convert-dfp.c: Ditto. * gcc.dg/dfp/convert-int-saturate.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121308 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/Makefile.in3
-rw-r--r--gcc/ginclude/decfloat.h108
-rw-r--r--gcc/ginclude/float.h81
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/dfp/convert-dfp.c3
-rw-r--r--gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c3
-rw-r--r--gcc/testsuite/gcc.dg/dfp/dec-eval-method.c4
-rw-r--r--gcc/testsuite/gcc.dg/dfp/decfloat-constants.c9
9 files changed, 106 insertions, 119 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 63c8aa81c6b..3cf0452b2a9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-29 Janis Johnson <janis187@us.ibm.com>
+
+ * Makefile.in (USER_H): Remove decfloat.h.
+ * ginclude/decfloat.h: Delete, moving contents to ...
+ * ginclude/float.h: Add support for decimal floating point,
+ guarded by __STDC_WANT_DEC_FP__.
+
2007-01-29 Mike Stump <mrs@apple.com>
* doc/gccint.texi (Top): Rename Loop Representation to Loop
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index dff21734a59..b569b36dc00 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -302,8 +302,7 @@ INSTALL_HEADERS_DIR = @build_install_headers_dir@
# Header files that are made available under the same name
# to programs compiled with GCC.
-USER_H = $(srcdir)/ginclude/decfloat.h \
- $(srcdir)/ginclude/float.h \
+USER_H = $(srcdir)/ginclude/float.h \
$(srcdir)/ginclude/iso646.h \
$(srcdir)/ginclude/stdarg.h \
$(srcdir)/ginclude/stdbool.h \
diff --git a/gcc/ginclude/decfloat.h b/gcc/ginclude/decfloat.h
deleted file mode 100644
index 03e0a7bf2e8..00000000000
--- a/gcc/ginclude/decfloat.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC 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.
-
-GCC 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 GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
-
-/* As a special exception, if you include this header file into source
- files compiled by GCC, this header 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. */
-
-/*
- * Draft C Extension to support decimal floating-pointing arithmetic:
- * Characteristics of decimal floating types <decfloat.h>
- */
-
-#ifndef _DECFLOAT_H___
-#define _DECFLOAT_H___
-
-/* Number of base-FLT_RADIX digits in the significand, p. */
-#undef DEC32_MANT_DIG
-#undef DEC64_MANT_DIG
-#undef DEC128_MANT_DIG
-#define DEC32_MANT_DIG __DEC32_MANT_DIG__
-#define DEC64_MANT_DIG __DEC64_MANT_DIG__
-#define DEC128_MANT_DIG __DEC128_MANT_DIG__
-
-/* Minimum exponent. */
-#undef DEC32_MIN_EXP
-#undef DEC64_MIN_EXP
-#undef DEC128_MIN_EXP
-#define DEC32_MIN_EXP __DEC32_MIN_EXP__
-#define DEC64_MIN_EXP __DEC64_MIN_EXP__
-#define DEC128_MIN_EXP __DEC128_MIN_EXP__
-
-/* Maximum exponent. */
-#undef DEC32_MAX_EXP
-#undef DEC64_MAX_EXP
-#undef DEC128_MAX_EXP
-#define DEC32_MAX_EXP __DEC32_MAX_EXP__
-#define DEC64_MAX_EXP __DEC64_MAX_EXP__
-#define DEC128_MAX_EXP __DEC128_MAX_EXP__
-
-/* Maximum representable finite decimal floating-point number
- (there are 6, 15, and 33 9s after the decimal points respectively). */
-#undef DEC32_MAX
-#undef DEC64_MAX
-#undef DEC128_MAX
-#define DEC32_MAX __DEC32_MAX__
-#define DEC64_MAX __DEC64_MAX__
-#define DEC128_MAX __DEC128_MAX__
-
-/* The difference between 1 and the least value greater than 1 that is
- representable in the given floating point type. */
-#undef DEC32_EPSILON
-#undef DEC64_EPSILON
-#undef DEC128_EPSILON
-#define DEC32_EPSILON __DEC32_EPSILON__
-#define DEC64_EPSILON __DEC64_EPSILON__
-#define DEC128_EPSILON __DEC128_EPSILON__
-
-/* Minimum normalized positive floating-point number. */
-#undef DEC32_MIN
-#undef DEC64_MIN
-#undef DEC128_MIN
-#define DEC32_MIN __DEC32_MIN__
-#define DEC64_MIN __DEC64_MIN__
-#define DEC128_MIN __DEC128_MIN__
-
-/* Minimum denormalized positive floating-point number. */
-#undef DEC32_DEN
-#undef DEC64_DEN
-#undef DEC128_DEN
-#define DEC32_DEN __DEC32_DEN__
-#define DEC64_DEN __DEC64_DEN__
-#define DEC128_DEN __DEC128_DEN__
-
-/* The floating-point expression evaluation method.
- -1 indeterminate
- 0 evaluate all operations and constants just to the range and
- precision of the type
- 1 evaluate operations and constants of type _Decimal32
- and _Decimal64 to the range and precision of the _Decimal64
- type, evaluate _Decimal128 operations and constants to the
- range and precision of the _Decimal128 type;
- 2 evaluate all operations and constants to the range and
- precision of the _Decimal128 type.
-*/
-
-#undef DECFLT_EVAL_METHOD
-#define DECFLT_EVAL_METHOD __DECFLT_EVAL_METHOD__
-
-#endif /* _DECFLOAT_H___ */
diff --git a/gcc/ginclude/float.h b/gcc/ginclude/float.h
index 3cdf7c82886..1e16e8884d7 100644
--- a/gcc/ginclude/float.h
+++ b/gcc/ginclude/float.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
This file is part of GCC.
@@ -159,4 +159,83 @@ Boston, MA 02110-1301, USA. */
#define DECIMAL_DIG __DECIMAL_DIG__
#endif /* C99 */
+
+#if __STDC_WANT_DEC_FP__ == 1
+/* Draft Technical Report 24732, extension for decimal floating-point
+ arithmetic: Characteristic of decimal floating types <float.h>. */
+
+/* Number of base-FLT_RADIX digits in the significand, p. */
+#undef DEC32_MANT_DIG
+#undef DEC64_MANT_DIG
+#undef DEC128_MANT_DIG
+#define DEC32_MANT_DIG __DEC32_MANT_DIG__
+#define DEC64_MANT_DIG __DEC64_MANT_DIG__
+#define DEC128_MANT_DIG __DEC128_MANT_DIG__
+
+/* Minimum exponent. */
+#undef DEC32_MIN_EXP
+#undef DEC64_MIN_EXP
+#undef DEC128_MIN_EXP
+#define DEC32_MIN_EXP __DEC32_MIN_EXP__
+#define DEC64_MIN_EXP __DEC64_MIN_EXP__
+#define DEC128_MIN_EXP __DEC128_MIN_EXP__
+
+/* Maximum exponent. */
+#undef DEC32_MAX_EXP
+#undef DEC64_MAX_EXP
+#undef DEC128_MAX_EXP
+#define DEC32_MAX_EXP __DEC32_MAX_EXP__
+#define DEC64_MAX_EXP __DEC64_MAX_EXP__
+#define DEC128_MAX_EXP __DEC128_MAX_EXP__
+
+/* Maximum representable finite decimal floating-point number
+ (there are 6, 15, and 33 9s after the decimal points respectively). */
+#undef DEC32_MAX
+#undef DEC64_MAX
+#undef DEC128_MAX
+#define DEC32_MAX __DEC32_MAX__
+#define DEC64_MAX __DEC64_MAX__
+#define DEC128_MAX __DEC128_MAX__
+
+/* The difference between 1 and the least value greater than 1 that is
+ representable in the given floating point type. */
+#undef DEC32_EPSILON
+#undef DEC64_EPSILON
+#undef DEC128_EPSILON
+#define DEC32_EPSILON __DEC32_EPSILON__
+#define DEC64_EPSILON __DEC64_EPSILON__
+#define DEC128_EPSILON __DEC128_EPSILON__
+
+/* Minimum normalized positive floating-point number. */
+#undef DEC32_MIN
+#undef DEC64_MIN
+#undef DEC128_MIN
+#define DEC32_MIN __DEC32_MIN__
+#define DEC64_MIN __DEC64_MIN__
+#define DEC128_MIN __DEC128_MIN__
+
+/* Minimum denormalized positive floating-point number. */
+#undef DEC32_DEN
+#undef DEC64_DEN
+#undef DEC128_DEN
+#define DEC32_DEN __DEC32_DEN__
+#define DEC64_DEN __DEC64_DEN__
+#define DEC128_DEN __DEC128_DEN__
+
+/* The floating-point expression evaluation method.
+ -1 indeterminate
+ 0 evaluate all operations and constants just to the range and
+ precision of the type
+ 1 evaluate operations and constants of type _Decimal32
+ and _Decimal64 to the range and precision of the _Decimal64
+ type, evaluate _Decimal128 operations and constants to the
+ range and precision of the _Decimal128 type;
+ 2 evaluate all operations and constants to the range and
+ precision of the _Decimal128 type. */
+
+#undef DECFLT_EVAL_METHOD
+#define DECFLT_EVAL_METHOD __DECFLT_EVAL_METHOD__
+
+#endif /* __STDC_WANT_DEC_FP__ == 1 */
+
#endif /* _FLOAT_H___ */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 41f6dd82307..7403bf96851 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-29 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/dfp/dec-eval-method.c: Replace decfloat.h with float.h.
+ * gcc.dg/dfp/decfloat-constants.c: Ditto.
+ * gcc.dg/dfp/convert-dfp.c: Ditto.
+ * gcc.dg/dfp/convert-int-saturate.c: Ditto.
+
2007-01-29 Josh Conner <jconner@apple.com>
* gcc.target/powerpc/altivec-24.c: New test.
diff --git a/gcc/testsuite/gcc.dg/dfp/convert-dfp.c b/gcc/testsuite/gcc.dg/dfp/convert-dfp.c
index bafe0894b63..5afdcf0b7a2 100644
--- a/gcc/testsuite/gcc.dg/dfp/convert-dfp.c
+++ b/gcc/testsuite/gcc.dg/dfp/convert-dfp.c
@@ -6,7 +6,8 @@
Test various conversions involving decimal floating types. */
-#include <decfloat.h>
+#define __STDC_WANT_DEC_FP__ 1
+#include <float.h>
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c b/gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c
index 9aeb1d70c6e..aeaa4655ac4 100644
--- a/gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c
+++ b/gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c
@@ -4,7 +4,8 @@
C99 6.3.1.4(1a) New.
Test integer saturation. */
-#include <decfloat.h>
+#define __STDC_WANT_DEC_FP__ 1
+#include <float.h>
#include <limits.h>
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/dfp/dec-eval-method.c b/gcc/testsuite/gcc.dg/dfp/dec-eval-method.c
index e1ccbb794c0..070a4033e02 100644
--- a/gcc/testsuite/gcc.dg/dfp/dec-eval-method.c
+++ b/gcc/testsuite/gcc.dg/dfp/dec-eval-method.c
@@ -1,11 +1,11 @@
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
-/* N1107 4: Characteristics of decimal floating types <decfloat.h>.
+/* N1107 4: Characteristics of decimal floating types <float.h>.
C99 5.2.4.2.2a[2] (New).
Verify that __DEC_EVAL_METHOD__ is defined; it will be used to define
- DEC_EVAL_METHOD in <decfloat.h>. */
+ DEC_EVAL_METHOD in <float.h>. */
int i;
#ifndef __DEC_EVAL_METHOD__
diff --git a/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c b/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c
index 62461e6cfaf..4980c6532a9 100644
--- a/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c
+++ b/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c
@@ -1,13 +1,14 @@
/* { dg-options "-std=gnu99" } */
-/* N1150 4: Characteristics of decimal floating types <decfloat.h>.
+/* N1150 4: Characteristics of decimal floating types <float.h>.
C99 5.2.4.2.2a[3]: New.
Verify constants about range of decimal float and three components of
- decimal float defined in decfloat.h. */
+ decimal float defined in float.h. */
-/* Make sure we are exporting the right values to decfloat.h. */
-#include <decfloat.h>
+/* Make sure we are exporting the right values to float.h. */
+#define __STDC_WANT_DEC_FP__ 1
+#include <float.h>
extern void abort (void);