summaryrefslogtreecommitdiff
path: root/libquadmath/printf
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-17 19:57:18 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-17 19:57:18 +0000
commitabb2a4bd504c9958ac546e455e43edd369f9a885 (patch)
treeb5a17c88786cf39ebb208a8d2d138097c0866b3e /libquadmath/printf
parent455188e991d39c980b400395b19b30db229c20eb (diff)
downloadgcc-abb2a4bd504c9958ac546e455e43edd369f9a885.tar.gz
* libquadmath.texi (FLT128_DIG, FLT128_MIN_10_EXP,
FLT128_MAX_10_EXP): Document. (strtoflt128): Remove obsolete comment. * configure.ac (HAVE_STRTOULL): New check. * printf/gmp-impl.h (mpn_construct_float128): New prototype, define. * printf/mul_n.c: Include <config.h>. * printf/add_n.c: Likewise. * printf/cmp.c: Likewise. * printf/fpioconst.c: Likewise. * printf/mul_1.c: Likewise. * printf/rshift.c: Likewise. * printf/lshift.c: Likewise. * printf/submul_1.c: Likewise. * printf/sub_n.c: Likewise. * printf/divrem.c: Likewise. * printf/addmul_1.c: Likewise. * printf/mul.c: Likewise. * printf/quadmath-printf.h (isupper, isdigit, tolower): Change to avoid evaluating argument multiple times. (isxdigit): Redefine. * strtod/strtoflt128.c: New file. * strtod/strtod_l.c: New file. * strtod/mpn2flt128.c: New file. * strtod/grouping.h: New file. * strtod/tens_in_limb.c: New file. * gdtoa/arith.h: Removed. * gdtoa/gd_qnan.h: Removed. * gdtoa/gdtoa_fltrnds.h: Removed. * gdtoa/gdtoa.h: Removed. * gdtoa/gdtoaimp.h: Removed. * gdtoa/gethex.c: Removed. * gdtoa/gmisc.c: Removed. * gdtoa/hd_init.c: Removed. * gdtoa/hexnan.c: Removed. * gdtoa/makefile: Removed. * gdtoa/misc.c: Removed. * gdtoa/README.gdtoa: Removed. * gdtoa/smisc.c: Removed. * gdtoa/strtodg.c: Removed. * gdtoa/strtopQ.c: Removed. * gdtoa/sum.c: Removed. * quadmath.h (FLT128_DIG, FLT128_MIN_10_EXP, FLT128_MAX_10_EXP): Define. * Makefile.am (libquadmath_la_SOURCES): Remove gdtoa/*, add strtod/strtoflt128.c, strtod/mpn2flt128.c and strtod/tens_in_limb.c. * config.h.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170254 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libquadmath/printf')
-rw-r--r--libquadmath/printf/add_n.c1
-rw-r--r--libquadmath/printf/addmul_1.c1
-rw-r--r--libquadmath/printf/cmp.c1
-rw-r--r--libquadmath/printf/divrem.c1
-rw-r--r--libquadmath/printf/fpioconst.c1
-rw-r--r--libquadmath/printf/gmp-impl.h4
-rw-r--r--libquadmath/printf/lshift.c1
-rw-r--r--libquadmath/printf/mul.c1
-rw-r--r--libquadmath/printf/mul_1.c1
-rw-r--r--libquadmath/printf/mul_n.c1
-rw-r--r--libquadmath/printf/quadmath-printf.h16
-rw-r--r--libquadmath/printf/rshift.c1
-rw-r--r--libquadmath/printf/sub_n.c1
-rw-r--r--libquadmath/printf/submul_1.c1
14 files changed, 29 insertions, 3 deletions
diff --git a/libquadmath/printf/add_n.c b/libquadmath/printf/add_n.c
index cf3ab9fdd37..749cf3ee8ad 100644
--- a/libquadmath/printf/add_n.c
+++ b/libquadmath/printf/add_n.c
@@ -19,6 +19,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
mp_limb_t
diff --git a/libquadmath/printf/addmul_1.c b/libquadmath/printf/addmul_1.c
index 41408d5316b..f527f984839 100644
--- a/libquadmath/printf/addmul_1.c
+++ b/libquadmath/printf/addmul_1.c
@@ -22,6 +22,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
mp_limb_t
diff --git a/libquadmath/printf/cmp.c b/libquadmath/printf/cmp.c
index d033d19651b..a4be43e2a17 100644
--- a/libquadmath/printf/cmp.c
+++ b/libquadmath/printf/cmp.c
@@ -19,6 +19,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
/* Compare OP1_PTR/OP1_SIZE with OP2_PTR/OP2_SIZE.
diff --git a/libquadmath/printf/divrem.c b/libquadmath/printf/divrem.c
index 723ea34d117..944d1a0c08c 100644
--- a/libquadmath/printf/divrem.c
+++ b/libquadmath/printf/divrem.c
@@ -20,6 +20,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
/* Divide num (NP/NSIZE) by den (DP/DSIZE) and write
diff --git a/libquadmath/printf/fpioconst.c b/libquadmath/printf/fpioconst.c
index 7306770c092..8c67e6f904f 100644
--- a/libquadmath/printf/fpioconst.c
+++ b/libquadmath/printf/fpioconst.c
@@ -18,6 +18,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <config.h>
#include "gmp-impl.h" /* This defines BITS_PER_MP_LIMB. */
#include "fpioconst.h"
diff --git a/libquadmath/printf/gmp-impl.h b/libquadmath/printf/gmp-impl.h
index 4ced3bd076f..ca49e196613 100644
--- a/libquadmath/printf/gmp-impl.h
+++ b/libquadmath/printf/gmp-impl.h
@@ -140,6 +140,10 @@ mp_limb_t mpn_submul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
mp_size_t mpn_extract_flt128 (mp_ptr res_ptr, mp_size_t size, int *expt,
int *is_neg, __float128 value) attribute_hidden;
+#define mpn_construct_float128 __MPN(construct_float128)
+__float128 mpn_construct_float128 (mp_srcptr frac_ptr, int expt, int sign)
+ attribute_hidden;
+
#define mpn_divmod(qp,np,nsize,dp,dsize) mpn_divrem (qp,0,np,nsize,dp,dsize)
static inline mp_limb_t
diff --git a/libquadmath/printf/lshift.c b/libquadmath/printf/lshift.c
index b00be87e7df..58aa8d4649f 100644
--- a/libquadmath/printf/lshift.c
+++ b/libquadmath/printf/lshift.c
@@ -19,6 +19,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
/* Shift U (pointed to by UP and USIZE digits long) CNT bits to the left
diff --git a/libquadmath/printf/mul.c b/libquadmath/printf/mul.c
index 8ecbff21cb1..d31fa36fa98 100644
--- a/libquadmath/printf/mul.c
+++ b/libquadmath/printf/mul.c
@@ -19,6 +19,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
/* Multiply the natural numbers u (pointed to by UP, with USIZE limbs)
diff --git a/libquadmath/printf/mul_1.c b/libquadmath/printf/mul_1.c
index bc363f7241b..48a273f075b 100644
--- a/libquadmath/printf/mul_1.c
+++ b/libquadmath/printf/mul_1.c
@@ -20,6 +20,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
mp_limb_t
diff --git a/libquadmath/printf/mul_n.c b/libquadmath/printf/mul_n.c
index 21b7b8ce092..c4bc1bed28f 100644
--- a/libquadmath/printf/mul_n.c
+++ b/libquadmath/printf/mul_n.c
@@ -19,6 +19,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
/* Multiply the natural numbers u (pointed to by UP) and v (pointed to by VP),
diff --git a/libquadmath/printf/quadmath-printf.h b/libquadmath/printf/quadmath-printf.h
index 05fed7aaf07..9e574c1eccc 100644
--- a/libquadmath/printf/quadmath-printf.h
+++ b/libquadmath/printf/quadmath-printf.h
@@ -62,10 +62,20 @@ Boston, MA 02110-1301, USA. */
/* Won't work for EBCDIC. */
#undef isupper
#undef isdigit
+#undef isxdigit
#undef tolower
-#define isupper(x) ((x) >= 'A' && (x) <= 'Z')
-#define isdigit(x) ((x) >= '0' && (x) <= '9')
-#define tolower(x) (isupper (x) ? (x) - 'A' + 'a' : (x))
+#define isupper(x) \
+ ({__typeof(x) __is_x = (x); __is_x >= 'A' && __is_x <= 'Z'; })
+#define isdigit(x) \
+ ({__typeof(x) __is_x = (x); __is_x >= '0' && __is_x <= '9'; })
+#define isxdigit(x) \
+ ({__typeof(x) __is_x = (x); \
+ (__is_x >= '0' && __is_x <= '9') \
+ || ((x) >= 'A' && (x) <= 'F') \
+ || ((x) >= 'a' && (x) <= 'f'); })
+#define tolower(x) \
+ ({__typeof(x) __is_x = (x); \
+ (__is_x >= 'A' && __is_x <= 'Z') ? __is_x - 'A' + 'a' : __is_x; })
#endif
#ifndef CHAR_MAX
diff --git a/libquadmath/printf/rshift.c b/libquadmath/printf/rshift.c
index 508bc586e34..17fd914d9d0 100644
--- a/libquadmath/printf/rshift.c
+++ b/libquadmath/printf/rshift.c
@@ -19,6 +19,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
/* Shift U (pointed to by UP and USIZE limbs long) CNT bits to the right
diff --git a/libquadmath/printf/sub_n.c b/libquadmath/printf/sub_n.c
index c833abc6eec..92e7187313b 100644
--- a/libquadmath/printf/sub_n.c
+++ b/libquadmath/printf/sub_n.c
@@ -19,6 +19,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
mp_limb_t
diff --git a/libquadmath/printf/submul_1.c b/libquadmath/printf/submul_1.c
index 97607e80985..31903c6284e 100644
--- a/libquadmath/printf/submul_1.c
+++ b/libquadmath/printf/submul_1.c
@@ -22,6 +22,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#include <config.h>
#include "gmp-impl.h"
mp_limb_t