This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[libstdc++] preliminary headers supporting decimal float in C++


Here are my current libstdc++ headers implementing ISO/IEC TR 24733,
the extension to support decimal floating-point arithmetic in C++.
It's not complete.  There are several problems I know about and
undoubtedly more that I don't yet know about.

Should <decimal> go in with the standard headers or in ext?

So far my patch installs the new header files whether the target
supports decimal floating-point arithmetic or not.  Should I move the
configuration checks from the gcc directory to the top level and use
those to determine whether to install these files?

The TR defines, within each of the classes decimal32, decimal64, and
decimal128, the following conversion:

  // 3.2.[234].4 conversion to integral type:
  operator long long() const;

Apparently there's a way to implement this if one knows enough about
C++, but providing this implicit conversion from a decimal float type to
long long allows further implicit conversions from long long to other
types, including float, double, and long double, which are not supposed
to be allowed.  Furthermore, a conversion from a decimal float type to a
generic float type that goes through long long truncates the fractional
part of the value which is rather surprising.  This version of the patch
leaves out that conversion and provides a set of functions to convert to
long long, which made testing the rest of the functionality much easier.
Any suggestions for how to do with using the current (not C++0x)
standard?  Or is it OK to require the use of C++0x functionality with
this extension?

Section 4.2 of the TR says that implementations can support decimal
floating-point literals as a conforming extension.  My patch does that
by adding a constructor that takes as argument a scalar DFP type.

I've got lots of tests (not included here) but no documentation.  I'll
follow the recommendations in
http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html.

What else have I missed?

2009-09-28  Janis Johnson  <janis187@us.ibm.com>

	* Makefile.am: Install two new files.
	* std/decimal: New file.
	* bits/decimal.h: New file.

Index: libstdc++-v3/include/Makefile.am
===================================================================
--- libstdc++-v3/include/Makefile.am	(revision 152247)
+++ libstdc++-v3/include/Makefile.am	(working copy)
@@ -34,6 +34,7 @@ std_headers = \
 	${std_srcdir}/chrono \
 	${std_srcdir}/complex \
 	${std_srcdir}/condition_variable \
+	${std_srcdir}/decimal \
 	${std_srcdir}/deque \
 	${std_srcdir}/forward_list \
 	${std_srcdir}/fstream \
@@ -91,6 +92,7 @@ bits_headers = \
 	${bits_srcdir}/codecvt.h \
 	${bits_srcdir}/concept_check.h \
 	${bits_srcdir}/cpp_type_traits.h \
+	${bits_srcdir}/decimal.h \
 	${bits_srcdir}/deque.tcc \
 	${bits_srcdir}/forward_list.h \
 	${bits_srcdir}/forward_list.tcc \
Index: libstdc++-v3/include/std/decimal
===================================================================
--- libstdc++-v3/include/std/decimal	(revision 0)
+++ libstdc++-v3/include/std/decimal	(revision 0)
@@ -0,0 +1,461 @@
+// Classes and inlines for the C++ decimal classes.
+
+// Copyright (C) 2009 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 3, 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file decimal
+ *  This is a Standard C++ Library header.
+ */
+
+// ISO/IEC TR 24733 
+// Written by Janis Johnson <janis187@us.ibm.com>
+
+#ifndef _GLIBCXX_DECIMAL
+#define _GLIBCXX_DECIMAL 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+_GLIBCXX_BEGIN_NAMESPACE(decimal)
+
+  class decimal32;
+  class decimal64;
+  class decimal128;
+
+  // ISO/IEC TR 24733  3.2.5  Initialization from coefficient and exponent.
+  static decimal32 make_decimal32 (long long coeff, int exponent);
+  static decimal32 make_decimal32 (unsigned long long coeff, int exponent);
+  static decimal64 make_decimal64 (long long coeff, int exponent);
+  static decimal64 make_decimal64 (unsigned long long coeff, int exponent);
+  static decimal128 make_decimal128 (long long coeff, int exponent);
+  static decimal128 make_decimal128 (unsigned long long coeff, int exponent);
+
+  // Extension: Conversion to integral type.
+  long long decimal32_to_long_long (decimal32 d);
+  long long decimal64_to_long_long (decimal64 d);
+  long long decimal128_to_long_long (decimal128 d);
+  long long decimal_to_long_long (decimal32 d);
+  long long decimal_to_long_long (decimal64 d);
+  long long decimal_to_long_long (decimal128 d);
+
+  // ISO/IEC TR 24733  3.2.6  Conversion to generic floating-point type.
+  float decimal32_to_float (decimal32 d);
+  float decimal64_to_float (decimal64 d);
+  float decimal128_to_float (decimal128 d);
+  float decimal_to_float (decimal32 d);
+  float decimal_to_float (decimal64 d);
+  float decimal_to_float (decimal128 d);
+
+  double decimal32_to_double (decimal32 d);
+  double decimal64_to_double (decimal64 d);
+  double decimal128_to_double (decimal128 d);
+  double decimal_to_double (decimal32 d);
+  double decimal_to_double (decimal64 d);
+  double decimal_to_double (decimal128 d);
+
+  long double decimal32_to_long_double (decimal32 d);
+  long double decimal64_to_long_double (decimal64 d);
+  long double decimal128_to_long_double (decimal128 d);
+  long double decimal_to_long_double (decimal32 d);
+  long double decimal_to_long_double (decimal64 d);
+  long double decimal_to_long_double (decimal128 d);
+
+  // ISO/IEC TR 24733  3.2.7  Unary arithmetic operators.
+  decimal32  operator+ (decimal32 rhs);
+  decimal64  operator+ (decimal64 rhs);
+  decimal128 operator+ (decimal128 rhs);
+  decimal32  operator- (decimal32 rhs);
+  decimal64  operator- (decimal64 rhs);
+  decimal128 operator- (decimal128 rhs);
+
+  // ISO/IEC TR 24733  3.2.8  Binary arithmetic operators.
+#define _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(_Op, _T1, _T2, _T3)	\
+  _T1 operator _Op (_T2 lhs, _T3 rhs);
+#define _DECLARE_DECIMAL_BINARY_OP_WITH_INT(_Op, _Tp)			\
+  _Tp operator _Op (_Tp lhs, int rhs);					\
+  _Tp operator _Op (_Tp lhs, unsigned int rhs);				\
+  _Tp operator _Op (_Tp lhs, long rhs);					\
+  _Tp operator _Op (_Tp lhs, unsigned long rhs);			\
+  _Tp operator _Op (_Tp lhs, long long rhs);				\
+  _Tp operator _Op (_Tp lhs, unsigned long long rhs);			\
+  _Tp operator _Op (int lhs, _Tp rhs);					\
+  _Tp operator _Op (unsigned int lhs, _Tp rhs);				\
+  _Tp operator _Op (long lhs, _Tp rhs);					\
+  _Tp operator _Op (unsigned long lhs, _Tp rhs);			\
+  _Tp operator _Op (long long lhs, _Tp rhs);				\
+  _Tp operator _Op (unsigned long long lhs, _Tp rhs);
+
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal32, decimal32, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(+, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal32, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(+, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal32, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal64, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(+, decimal128)
+
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal32, decimal32, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(-, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal32, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(-, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal32, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal64, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(-, decimal128)
+
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal32, decimal32, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(*, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal32, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(*, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal32, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal64, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(*, decimal128)
+
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal32, decimal32, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(/, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal32, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(/, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal32, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal64, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal32)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal64)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal128)
+  _DECLARE_DECIMAL_BINARY_OP_WITH_INT(/, decimal128)
+
+#undef _DECLARE_DECIMAL_BINARY_OP_WITH_DEC
+#undef _DECLARE_DECIMAL_BINARY_OP_WITH_INT
+
+  // ISO/IEC TR 24733  3.2.9  Comparison operators.
+#define _DECLARE_DECIMAL_COMPARISON(_Op, _T)				\
+  bool operator _Op (_T lhs, decimal32 rhs);				\
+  bool operator _Op (_T lhs, decimal64 rhs);				\
+  bool operator _Op (_T lhs, decimal128 rhs);				\
+  bool operator _Op (_T lhs, int rhs);					\
+  bool operator _Op (_T lhs, unsigned int rhs);				\
+  bool operator _Op (_T lhs, long rhs);					\
+  bool operator _Op (_T lhs, unsigned long rhs);			\
+  bool operator _Op (_T lhs, long long rhs);				\
+  bool operator _Op (_T lhs, unsigned long long rhs);			\
+  bool operator _Op (int lhs, _T rhs);					\
+  bool operator _Op (unsigned int lhs, _T rhs);				\
+  bool operator _Op (long lhs, _T rhs);					\
+  bool operator _Op (unsigned long lhs, _T rhs);			\
+  bool operator _Op (long long lhs, _T rhs);				\
+  bool operator _Op (unsigned long long lhs, _T rhs);
+
+  _DECLARE_DECIMAL_COMPARISON(==, decimal32)
+  _DECLARE_DECIMAL_COMPARISON(==, decimal64)
+  _DECLARE_DECIMAL_COMPARISON(==, decimal128)
+
+  _DECLARE_DECIMAL_COMPARISON(!=, decimal32)
+  _DECLARE_DECIMAL_COMPARISON(!=, decimal64)
+  _DECLARE_DECIMAL_COMPARISON(!=, decimal128)
+
+  _DECLARE_DECIMAL_COMPARISON(<, decimal32)
+  _DECLARE_DECIMAL_COMPARISON(<, decimal64)
+  _DECLARE_DECIMAL_COMPARISON(<, decimal128)
+
+  _DECLARE_DECIMAL_COMPARISON(>=, decimal32)
+  _DECLARE_DECIMAL_COMPARISON(>=, decimal64)
+  _DECLARE_DECIMAL_COMPARISON(>=, decimal128)
+
+  _DECLARE_DECIMAL_COMPARISON(>, decimal32)
+  _DECLARE_DECIMAL_COMPARISON(>, decimal64)
+  _DECLARE_DECIMAL_COMPARISON(>, decimal128)
+
+  _DECLARE_DECIMAL_COMPARISON(>=, decimal32)
+  _DECLARE_DECIMAL_COMPARISON(>=, decimal64)
+  _DECLARE_DECIMAL_COMPARISON(>=, decimal128)
+
+#undef _DECLARE_DECIMAL_COMPARISON
+
+  // ISO/IEC TR 24733  3.2.2  Class decimal32.
+  class decimal32 {
+  public:
+    typedef float __decfloat32 __attribute__((mode(SD)));
+
+    // ISO/IEC TR 24733  3.2.2.1  Construct/copy/destroy.
+    decimal32()					: __val(0.e-101DF) {}
+
+    // ISO/IEC TR 24733  3.2.2.2  Conversion from floating-point type.
+    explicit decimal32(decimal64 d64);
+    explicit decimal32(decimal128 d128);
+    explicit decimal32(float r)			: __val(r) {}
+    explicit decimal32(double r)		: __val(r) {}
+    explicit decimal32(long double r)		: __val(r) {}
+
+    // ISO/IEC TR 24733  3.2.2.3  Conversion from integral type.
+    decimal32(int z)				: __val(z) {}
+    decimal32(unsigned int z)			: __val(z) {}
+    decimal32(long z)				: __val(z) {}
+    decimal32(unsigned long z)			: __val(z) {}
+    decimal32(long long z)			: __val(z) {}
+    decimal32(unsigned long long z)		: __val(z) {}
+
+    // Extension: Conversion from scalar decimal type.
+    decimal32(__decfloat32 z)			: __val(z) {}
+
+    // ISO/IEC TR 24733  3.2.2.4  Conversion to integral type.
+    //operator long long () const { return (long long)__val; }
+
+    // ISO/IEC TR 24733  3.2.2.5  Increment and decrement operators.
+    decimal32 & operator++()
+    {
+      __val += 1;
+      return *this;
+    }
+
+    decimal32   operator++(int)
+    {
+      decimal32 tmp = *this;
+      __val += 1;
+      return tmp;
+    }
+
+    decimal32 & operator--()
+    {
+      __val -= 1;
+      return *this;
+    }
+
+    decimal32   operator--(int)
+    {
+      decimal32 tmp = *this;
+      __val -= 1;
+      return tmp;
+    }
+
+    // ISO/IEC TR 24733  3.2.2.6  Compound assignment.
+#define _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(_Op)	\
+    decimal32 & operator _Op(decimal32 rhs);		\
+    decimal32 & operator _Op(decimal64 rhs);		\
+    decimal32 & operator _Op(decimal128 rhs);		\
+    decimal32 & operator _Op(int rhs);			\
+    decimal32 & operator _Op(unsigned int rhs);		\
+    decimal32 & operator _Op(long rhs);			\
+    decimal32 & operator _Op(unsigned long rhs);	\
+    decimal32 & operator _Op(long long rhs);		\
+    decimal32 & operator _Op(unsigned long long rhs);
+
+    _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(+=)
+    _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(-=)
+    _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(*=)
+    _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(/=)
+#undef _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT
+
+  private:
+    __decfloat32 __val;
+
+  public:
+    __decfloat32 __getval (void) { return __val; }
+    void __setval (__decfloat32 x) { __val = x; }
+  };
+
+  // ISO/IEC TR 24733  3.2.3  Class decimal64.
+  class decimal64 {
+  public:
+    typedef float __decfloat64 __attribute__((mode(DD)));
+
+    // ISO/IEC TR 24733  3.2.3.1  Construct/copy/destroy.
+    decimal64()					: __val(0.e-398dd) {}
+
+    // ISO/IEC TR 24733  3.2.3.2  Conversion from floating-point type.
+	     decimal64(decimal32 d32);
+    explicit decimal64(decimal128 d128);
+    explicit decimal64(float r)			: __val(r) {}
+    explicit decimal64(double r)		: __val(r) {}
+    explicit decimal64(long double r)		: __val(r) {}
+
+    // ISO/IEC TR 24733  3.2.3.3  Conversion from integral type.
+    decimal64(int z)				: __val(z) {}
+    decimal64(unsigned int z)			: __val(z) {}
+    decimal64(long z)				: __val(z) {}
+    decimal64(unsigned long z)			: __val(z) {}
+    decimal64(long long z)			: __val(z) {}
+    decimal64(unsigned long long z)		: __val(z) {}
+
+    // Extension: Conversion from scalar decimal type.
+    decimal64(__decfloat64 z)			: __val(z) {}
+
+    // ISO/IEC TR 24733  3.2.3.4  Conversion to integral type.
+    //operator long long() const { return (long long)__val; }
+
+    // ISO/IEC TR 24733  3.2.3.5  Increment and decrement operators.
+    decimal64 & operator++()
+    {
+      __val += 1;
+      return *this;
+    }
+
+    decimal64   operator++(int)
+    {
+      decimal64 tmp = *this;
+      __val += 1;
+      return tmp;
+    }
+
+    decimal64 & operator--()
+    {
+      __val -= 1;
+      return *this;
+    }
+
+    decimal64   operator--(int)
+    {
+      decimal64 tmp = *this;
+      __val -= 1;
+      return tmp;
+    }
+
+    // ISO/IEC TR 24733  3.2.3.6  Compound assignment.
+#define _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(_Op)	\
+    decimal64 & operator _Op(decimal32 rhs);		\
+    decimal64 & operator _Op(decimal64 rhs);		\
+    decimal64 & operator _Op(decimal128 rhs);		\
+    decimal64 & operator _Op(int rhs);			\
+    decimal64 & operator _Op(unsigned int rhs);		\
+    decimal64 & operator _Op(long rhs);			\
+    decimal64 & operator _Op(unsigned long rhs);	\
+    decimal64 & operator _Op(long long rhs);		\
+    decimal64 & operator _Op(unsigned long long rhs);
+
+    _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(+=)
+    _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(-=)
+    _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(*=)
+    _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(/=)
+#undef _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT
+
+  private:
+    __decfloat64 __val;
+
+  public:
+    __decfloat64 __getval (void) { return __val; }
+    void __setval (__decfloat64 x) { __val = x; }
+  };
+
+  // ISO/IEC TR 24733  3.2.4  Class decimal128.
+  class decimal128 {
+  public:
+    typedef float __decfloat128 __attribute__((mode(TD)));
+
+    // ISO/IEC TR 24733  3.2.4.1  Construct/copy/destroy.
+    decimal128()				: __val(0.e-6176DL) {}
+
+    // ISO/IEC TR 24733  3.2.4.2  Conversion from floating-point type.
+	     decimal128(decimal32 d32);
+	     decimal128(decimal64 d64);
+    explicit decimal128(float r)		: __val(r) {}
+    explicit decimal128(double r)		: __val(r) {}
+    explicit decimal128(long double r)		: __val(r) {}
+
+
+    // ISO/IEC TR 24733  3.2.4.3  Conversion from integral type.
+    decimal128(int z)				: __val(z) {}
+    decimal128(unsigned int z)			: __val(z) {}
+    decimal128(long z)				: __val(z) {}
+    decimal128(unsigned long z)			: __val(z) {}
+    decimal128(long long z)			: __val(z) {}
+    decimal128(unsigned long long z)		: __val(z) {}
+
+    // Extension: Conversion from scalar decimal type.
+    decimal128(__decfloat128 z)			: __val(z) {}
+
+    // ISO/IEC TR 24733  3.2.4.4  Conversion to integral type.
+    //operator long long() const { return (long long)__val; }
+
+    // ISO/IEC TR 24733  3.2.4.5  Increment and decrement operators.
+    decimal128 & operator++()
+    {
+      __val += 1;
+      return *this;
+    }
+
+    decimal128   operator++(int)
+    {
+      decimal128 tmp = *this;
+      __val += 1;
+      return tmp;
+    }
+
+    decimal128 & operator--()
+    {
+      __val -= 1;
+      return *this;
+    }
+
+    decimal128   operator--(int)
+    {
+      decimal128 tmp = *this;
+      __val -= 1;
+      return tmp;
+    }
+
+    // ISO/IEC TR 24733  3.2.4.6  Compound assignment.
+#define _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(_Op)	\
+    decimal128 & operator _Op(decimal32 rhs);		\
+    decimal128 & operator _Op(decimal64 rhs);		\
+    decimal128 & operator _Op(decimal128 rhs);		\
+    decimal128 & operator _Op(int rhs);			\
+    decimal128 & operator _Op(unsigned int rhs);	\
+    decimal128 & operator _Op(long rhs);		\
+    decimal128 & operator _Op(unsigned long rhs);	\
+    decimal128 & operator _Op(long long rhs);		\
+    decimal128 & operator _Op(unsigned long long rhs);
+
+    _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(+=)
+    _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(-=)
+    _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(*=)
+    _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(/=)
+#undef _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT
+
+  private:
+    __decfloat128 __val;
+
+  public:
+    __decfloat128 __getval (void) { return __val; }
+    void __setval (__decfloat128 x) { __val = x; }
+  };
+
+#define _GLIBCXX_USE_DECIMAL_ 1
+
+_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE
+
+#include <bits/decimal.h>
+
+#endif /* _GLIBCXX_DECIMAL */
Index: libstdc++-v3/include/bits/decimal.h
===================================================================
--- libstdc++-v3/include/bits/decimal.h	(revision 0)
+++ libstdc++-v3/include/bits/decimal.h	(revision 0)
@@ -0,0 +1,518 @@
+// decimal classes -*- C++ -*-
+
+// Copyright (C) 2009 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 3, 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/decimal.h
+ *  This is an internal header file, included by other library headers.
+ *  You should not attempt to use it directly.
+ */
+
+// ISO/IEC TR 24733
+// Written by Janis Johnson <janis187@us.ibm.com>
+
+#ifndef _GLIBCXX_DECIMAL_IMPL
+#define _GLIBCXX_DECIMAL_IMPL 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+_GLIBCXX_BEGIN_NAMESPACE(decimal)
+
+  // ISO/IEC TR 24733  3.2.[234].1  Construct/copy/destroy.
+
+  inline decimal32::decimal32 (decimal64 r)	: __val(r.__getval()) {}
+  inline decimal32::decimal32 (decimal128 r)	: __val(r.__getval()) {}
+  inline decimal64::decimal64 (decimal32 r)	: __val(r.__getval()) {}
+  inline decimal64::decimal64 (decimal128 r)	: __val(r.__getval()) {}
+  inline decimal128::decimal128 (decimal32 r)	: __val(r.__getval()) {}
+  inline decimal128::decimal128 (decimal64 r)	: __val(r.__getval()) {}
+
+  // ISO/IEC TR 24733  3.2.[234].6  Compound assignment.
+
+#define _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC(_Op1, _Op2, _T1, _T2)	\
+  inline _T1 & _T1::operator _Op1 (_T2 rhs)				\
+  {									\
+    __setval (__getval() _Op2 rhs.__getval());				\
+    return *this;							\
+  }
+
+#define _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT(_Op1, _Op2, _T1, _T2)	\
+  inline _T1 & _T1::operator _Op1 (_T2 rhs)				\
+  {									\
+    __setval (__getval() _Op2 rhs);					\
+    return *this;							\
+  }
+
+#define _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS(_O1, _O2, _T1)		\
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC (_O1,_O2,_T1, decimal32)	\
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC (_O1,_O2,_T1, decimal64)	\
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC (_O1,_O2,_T1, decimal128)	\
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT (_O1,_O2,_T1, int)		\
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT (_O1,_O2,_T1, unsigned int)	\
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT (_O1,_O2,_T1, long)		\
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT (_O1,_O2,_T1, unsigned long)	\
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT (_O1,_O2,_T1, long long)	\
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT (_O1,_O2,_T1, unsigned long long)
+
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (+=, +, decimal32)
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (-=, -, decimal32)
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (*=, *, decimal32)
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (/=, /, decimal32)
+
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (+=, +, decimal64)
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (-=, -, decimal64)
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (*=, *, decimal64)
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (/=, /, decimal64)
+
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (+=, +, decimal128)
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (-=, -, decimal128)
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (*=, *, decimal128)
+  _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS (/=, /, decimal128)
+
+#undef _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC
+#undef _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT
+#undef _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS
+
+  // Extension: Conversion to integral type.
+
+  inline long long decimal32_to_long_long (decimal32 d)
+  {
+    return (long long) d.__getval();
+  }
+
+  inline long long decimal64_to_long_long (decimal64 d)
+  {
+    return (long long) d.__getval();
+  }
+
+  inline long long decimal128_to_long_long (decimal128 d)
+  {
+    return (long long) d.__getval();
+  }
+
+  inline long long decimal_to_long_long (decimal32 d)
+  {
+    return (long long) d.__getval();
+  }
+
+  inline long long decimal_to_long_long (decimal64 d)
+  {
+    return (long long) d.__getval();
+  }
+
+  inline long long decimal_to_long_long (decimal128 d)
+  {
+    return (long long) d.__getval();
+  }
+
+  // ISO/IEC TR 24733  3.2.5  Initialization from coefficient and exponent.
+
+  static decimal32 make_decimal32 (long long coeff, int exponent)
+  {
+    decimal32 decexp = 1, multiplier;
+
+    if (exponent < 0)
+      {
+	multiplier = 1.E-1DF;
+	exponent = -exponent;
+      }
+    else
+      multiplier = 1.E1DF;
+
+    for (int i = 0; i < exponent; i++)
+      decexp *= multiplier;
+
+    return coeff * decexp;
+  }
+
+  static decimal32 make_decimal32 (unsigned long long coeff, int exponent)
+  {
+    decimal32 decexp = 1, multiplier;
+
+    if (exponent < 0)
+      {
+	multiplier = 1.E-1DF;
+	exponent = -exponent;
+      }
+    else
+      multiplier = 1.E1DF;
+
+    for (int i = 0; i < exponent; i++)
+      decexp *= multiplier;
+
+    return coeff * decexp;
+  }
+
+  static decimal64 make_decimal64 (long long coeff, int exponent)
+  {
+    decimal64 decexp = 1, multiplier;
+
+    if (exponent < 0)
+      {
+	multiplier = 1.E-1DD;
+	exponent = -exponent;
+      }
+    else
+      multiplier = 1.E1DD;
+
+    for (int i = 0; i < exponent; i++)
+      decexp *= multiplier;
+
+    return coeff * decexp;
+  }
+
+  static decimal64 make_decimal64 (unsigned long long coeff, int exponent)
+  {
+    decimal64 decexp = 1, multiplier;
+
+    if (exponent < 0)
+      {
+	multiplier = 1.E-1DD;
+	exponent = -exponent;
+      }
+    else
+      multiplier = 1.E1DD;
+
+    for (int i = 0; i < exponent; i++)
+      decexp *= multiplier;
+
+    return coeff * decexp;
+  }
+
+  static decimal128 make_decimal128 (long long coeff, int exponent)
+  {
+    decimal128 decexp = 1, multiplier;
+
+    if (exponent < 0)
+      {
+	multiplier = 1.E-1DL;
+	exponent = -exponent;
+      }
+    else
+      multiplier = 1.E1DL;
+
+    for (int i = 0; i < exponent; i++)
+      decexp *= multiplier;
+
+    return coeff * decexp;
+  }
+
+  static decimal128 make_decimal128 (unsigned long long coeff, int exponent)
+  {
+    decimal128 decexp = 1, multiplier;
+
+    if (exponent < 0)
+      {
+	multiplier = 1.E-1DL;
+	exponent = -exponent;
+      }
+    else
+      multiplier = 1.E1DL;
+
+    for (int i = 0; i < exponent; i++)
+      decexp *= multiplier;
+
+    return coeff * decexp;
+  }
+
+  // ISO/IEC TR 24733  3.2.6  Conversion to generic floating-point type.
+
+  inline float decimal32_to_float (decimal32 d)
+  {
+    return (float) d.__getval();
+  }
+
+  inline float decimal64_to_float (decimal64 d)
+  {
+    return (float) d.__getval();
+  }
+
+  inline float decimal128_to_float (decimal128 d)
+  {
+    return (float) d.__getval();
+  }
+
+  inline float decimal_to_float (decimal32 d)
+  {
+    return (float) d.__getval();
+  }
+
+  inline float decimal_to_float (decimal64 d)
+  {
+    return (float) d.__getval();
+  }
+
+  inline float decimal_to_float (decimal128 d)
+  {
+    return (float) d.__getval();
+  }
+
+  inline double decimal32_to_double (decimal32 d)
+  {
+    return (double) d.__getval();
+  }
+
+  inline double decimal64_to_double (decimal64 d)
+  {
+    return (double) d.__getval();
+  }
+
+  inline double decimal128_to_double (decimal128 d)
+  {
+    return (double) d.__getval();
+  }
+
+  inline double decimal_to_double (decimal32 d)
+  {
+    return (double) d.__getval();
+  }
+
+  inline double decimal_to_double (decimal64 d)
+  {
+    return (double) d.__getval();
+  }
+
+  inline double decimal_to_double (decimal128 d)
+  {
+    return (double) d.__getval();
+  }
+
+  inline long double decimal32_to_long_double (decimal32 d)
+  {
+    return (long double) d.__getval();
+  }
+
+  inline long double decimal64_to_long_double (decimal64 d)
+  {
+    return (long double) d.__getval();
+  }
+
+  inline long double decimal128_to_long_double (decimal128 d)
+  {
+    return (long double) d.__getval();
+  }
+
+  inline long double decimal_to_long_double (decimal32 d)
+  {
+    return (long double) d.__getval();
+  }
+
+  inline long double decimal_to_long_double (decimal64 d)
+  {
+    return (long double) d.__getval();
+  }
+
+  inline long double decimal_to_long_double (decimal128 d)
+  {
+    return (long double) d.__getval();
+  }
+
+  // ISO/IEC TR 24733  3.2.7  Unary arithmetic operators.
+
+#define _DEFINE_DECIMAL_UNARY_OP(_Op, _T)	\
+  inline _T operator _Op (_T rhs)		\
+  {						\
+    _T tmp;					\
+    tmp.__setval (0 _Op rhs.__getval());		\
+    return tmp;					\
+  }
+
+  _DEFINE_DECIMAL_UNARY_OP(+, decimal32)
+  _DEFINE_DECIMAL_UNARY_OP(+, decimal64)
+  _DEFINE_DECIMAL_UNARY_OP(+, decimal128)
+  _DEFINE_DECIMAL_UNARY_OP(-, decimal32)
+  _DEFINE_DECIMAL_UNARY_OP(-, decimal64)
+  _DEFINE_DECIMAL_UNARY_OP(-, decimal128)
+
+#undef _DEFINE_DECIMAL_UNARY_OP
+
+  // ISO/IEC TR 24733  3.2.8  Binary arithmetic operators.
+
+#define _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(_Op, _T1, _T2, _T3)	\
+  inline _T1 operator _Op (_T2 lhs, _T3 rhs)			\
+  {								\
+    _T1 retval;							\
+    retval.__setval (lhs.__getval() _Op rhs.__getval());	\
+    return retval;						\
+  }
+
+#define _DEFINE_DECIMAL_BINARY_OP_BOTH(_Op, _T1, _T2, _T3)	\
+  inline _T1 operator _Op (_T2 lhs, _T3 rhs)			\
+  {								\
+    _T1 retval;							\
+    retval.__setval (lhs.__getval() _Op rhs.__getval());	\
+    return retval;						\
+  }
+
+#define _DEFINE_DECIMAL_BINARY_OP_LHS(_Op, _T1, _T2)		\
+  inline _T1 operator _Op (_T1 lhs, _T2 rhs)			\
+  {								\
+    _T1 retval;							\
+    retval.__setval (lhs.__getval() _Op rhs);			\
+    return retval;						\
+  }
+
+#define _DEFINE_DECIMAL_BINARY_OP_RHS(_Op, _T1, _T2)		\
+  inline _T1 operator _Op (_T2 lhs, _T1 rhs)			\
+  {								\
+    _T1 retval;							\
+    retval.__setval (lhs _Op rhs.__getval());			\
+    return retval;						\
+  }
+
+#define _DEFINE_DECIMAL_BINARY_OP_WITH_INT(_Op,_Tp)		\
+  _DEFINE_DECIMAL_BINARY_OP_LHS(_Op,_Tp, int);			\
+  _DEFINE_DECIMAL_BINARY_OP_LHS(_Op,_Tp, unsigned int);		\
+  _DEFINE_DECIMAL_BINARY_OP_LHS(_Op,_Tp, long);			\
+  _DEFINE_DECIMAL_BINARY_OP_LHS(_Op,_Tp, unsigned long);	\
+  _DEFINE_DECIMAL_BINARY_OP_LHS(_Op,_Tp, long long);		\
+  _DEFINE_DECIMAL_BINARY_OP_LHS(_Op,_Tp, unsigned long long);	\
+  _DEFINE_DECIMAL_BINARY_OP_RHS(_Op,_Tp, int);			\
+  _DEFINE_DECIMAL_BINARY_OP_RHS(_Op,_Tp, unsigned int);		\
+  _DEFINE_DECIMAL_BINARY_OP_RHS(_Op,_Tp, long);			\
+  _DEFINE_DECIMAL_BINARY_OP_RHS(_Op,_Tp, unsigned long);	\
+  _DEFINE_DECIMAL_BINARY_OP_RHS(_Op,_Tp, long long);		\
+  _DEFINE_DECIMAL_BINARY_OP_RHS(_Op,_Tp, unsigned long long);	\
+
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal32, decimal32, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(+, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal32, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(+, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal32, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal64, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(+, decimal128)
+
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal32, decimal32, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(-, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal32, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(-, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal32, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal64, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(-, decimal128)
+
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal32, decimal32, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(*, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal32, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(*, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal32, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal64, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(*, decimal128)
+
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal32, decimal32, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(/, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal32, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(/, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal32, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal64, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal32)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal64)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal128)
+  _DEFINE_DECIMAL_BINARY_OP_WITH_INT(/, decimal128)
+
+#undef _DEFINE_DECIMAL_BINARY_OP_WITH_DEC
+#undef _DEFINE_DECIMAL_BINARY_OP_BOTH
+#undef _DEFINE_DECIMAL_BINARY_OP_LHS
+#undef _DEFINE_DECIMAL_BINARY_OP_RHS
+#undef _DEFINE_DECIMAL_BINARY_OP_WITH_INT
+
+  // ISO/IEC TR 24733  3.2.9  Comparison operators.
+
+#define _DEFINE_DECIMAL_COMPARISON_BOTH(_Op, _T1, _T2)	\
+  inline bool operator _Op (_T1 lhs, _T2 rhs)		\
+  {							\
+    return lhs.__getval() _Op rhs.__getval();		\
+  }
+
+#define _DEFINE_DECIMAL_COMPARISON_LHS(_Op, _T1, _T2)	\
+  inline bool operator _Op (_T1 lhs, _T2 rhs)		\
+  {							\
+    return lhs.__getval() _Op rhs;			\
+  }
+#define _DEFINE_DECIMAL_COMPARISON_RHS(_Op, _T1, _T2)	\
+  inline bool operator _Op (_T1 lhs, _T2 rhs)		\
+  {							\
+    return lhs _Op rhs.__getval();			\
+  }
+
+#define _DEFINE_DECIMAL_COMPARISONS(_Op, _Tp)			\
+  _DEFINE_DECIMAL_COMPARISON_BOTH (_Op, _Tp, decimal32)		\
+  _DEFINE_DECIMAL_COMPARISON_BOTH (_Op, _Tp, decimal64)		\
+  _DEFINE_DECIMAL_COMPARISON_BOTH (_Op, _Tp, decimal128)	\
+  _DEFINE_DECIMAL_COMPARISON_LHS  (_Op, _Tp, int)		\
+  _DEFINE_DECIMAL_COMPARISON_LHS  (_Op, _Tp, unsigned int)	\
+  _DEFINE_DECIMAL_COMPARISON_LHS  (_Op, _Tp, long)		\
+  _DEFINE_DECIMAL_COMPARISON_LHS  (_Op, _Tp, unsigned long)	\
+  _DEFINE_DECIMAL_COMPARISON_LHS  (_Op, _Tp, long long)		\
+  _DEFINE_DECIMAL_COMPARISON_LHS  (_Op, _Tp, unsigned long long) \
+  _DEFINE_DECIMAL_COMPARISON_RHS  (_Op, int, _Tp)		\
+  _DEFINE_DECIMAL_COMPARISON_RHS  (_Op, unsigned int, _Tp)	\
+  _DEFINE_DECIMAL_COMPARISON_RHS  (_Op, long, _Tp)		\
+  _DEFINE_DECIMAL_COMPARISON_RHS  (_Op, unsigned long, _Tp)	\
+  _DEFINE_DECIMAL_COMPARISON_RHS  (_Op, long long, _Tp)		\
+  _DEFINE_DECIMAL_COMPARISON_RHS  (_Op, unsigned long long, _Tp)
+
+  _DEFINE_DECIMAL_COMPARISONS (==, decimal32)
+  _DEFINE_DECIMAL_COMPARISONS (==, decimal64)
+  _DEFINE_DECIMAL_COMPARISONS (==, decimal128)
+  _DEFINE_DECIMAL_COMPARISONS (!=, decimal32)
+  _DEFINE_DECIMAL_COMPARISONS (!=, decimal64)
+  _DEFINE_DECIMAL_COMPARISONS (!=, decimal128)
+  _DEFINE_DECIMAL_COMPARISONS (<,  decimal32)
+  _DEFINE_DECIMAL_COMPARISONS (<,  decimal64)
+  _DEFINE_DECIMAL_COMPARISONS (<,  decimal128)
+  _DEFINE_DECIMAL_COMPARISONS (<=, decimal32)
+  _DEFINE_DECIMAL_COMPARISONS (<=, decimal64)
+  _DEFINE_DECIMAL_COMPARISONS (<=, decimal128)
+  _DEFINE_DECIMAL_COMPARISONS (>,  decimal32)
+  _DEFINE_DECIMAL_COMPARISONS (>,  decimal64)
+  _DEFINE_DECIMAL_COMPARISONS (>,  decimal128)
+  _DEFINE_DECIMAL_COMPARISONS (>=, decimal32)
+  _DEFINE_DECIMAL_COMPARISONS (>=, decimal64)
+  _DEFINE_DECIMAL_COMPARISONS (>=, decimal128)
+
+#undef _DEFINE_DECIMAL_COMPARISON_BOTH
+#undef _DEFINE_DECIMAL_COMPARISON_LHS
+#undef _DEFINE_DECIMAL_COMPARISON_RHS
+#undef _DEFINE_DECIMAL_COMPARISONS
+
+_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_DECIMAL_IMPL */




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]