about summary refs log tree commit diff
path: root/sysdeps/ieee754/float128
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2016-11-03 12:37:08 -0200
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-06-07 17:08:21 -0300
commitcf2046ec7dd4b233180377cc5b8debcf551d1fc9 (patch)
tree40f45dc6bb3c49eadff4653c2a9ab0775f2f9cf7 /sysdeps/ieee754/float128
parent2bc646c9e95b7c0005b2bc09c06671ffbb509629 (diff)
downloadglibc-cf2046ec7dd4b233180377cc5b8debcf551d1fc9.tar.gz
glibc-cf2046ec7dd4b233180377cc5b8debcf551d1fc9.tar.xz
glibc-cf2046ec7dd4b233180377cc5b8debcf551d1fc9.zip
float128: Add strfromf128
Add strfromf128 to stdlib when _Float128 support is enabled.

	* stdio-common/printf-parsemb.c (__parse_one_specmb): Initialize
	spec->info.is_binary128 to zero.
	* stdio-common/printf.h (printf_info): Add new member is_binary128
	to indicate that the number being converted to string is compatible
	with the IEC 60559 binary128 format.
	* stdio-common/printf_fp.c (__printf_fp_l): Add code to deal with
	_Float128 numbers.
	* stdio-common/printf_fphex.c: Include ieee754_float128.h and
	ldbl-128/printf_fphex_macros.h
	(__printf_fphex): Add code to deal with _Float128 numbers.
	* stdio-common/printf_size.c (__printf_size): Likewise.
	* stdio-common/vfprintf.c (process_arg): Initialize member
	info.is_binary128 to zero.
	* stdlib/fpioconst.h (FLT128_MAX_10_EXP_LOG): New macro.
	* stdlib/stdlib.h: Include bits/floatn.h for _Float128 support.
	(strfromf128): New declaration.
	* stdlib/strfrom-skeleton.c (STRFROM): Set member info.is_binary128
	to one.
	* sysdeps/ieee754/float128/Makefile: Add strfromf128.
	* sysdeps/ieee754/float128/Versions: Likewise.
	* sysdeps/ieee754/float128/strfromf128.c: New file.
Diffstat (limited to 'sysdeps/ieee754/float128')
-rw-r--r--sysdeps/ieee754/float128/Makefile2
-rw-r--r--sysdeps/ieee754/float128/Versions5
-rw-r--r--sysdeps/ieee754/float128/strfromf128.c25
3 files changed, 31 insertions, 1 deletions
diff --git a/sysdeps/ieee754/float128/Makefile b/sysdeps/ieee754/float128/Makefile
index 6a7b0e0f45..c07586c1b6 100644
--- a/sysdeps/ieee754/float128/Makefile
+++ b/sysdeps/ieee754/float128/Makefile
@@ -1,3 +1,3 @@
 ifeq ($(subdir),stdlib)
-routines += float1282mpn
+routines += float1282mpn strfromf128
 endif
diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
index 9f431d920e..caf206475c 100644
--- a/sysdeps/ieee754/float128/Versions
+++ b/sysdeps/ieee754/float128/Versions
@@ -2,6 +2,11 @@
 %ifndef FLOAT128_VERSION
 % error "float128-abi.h must define FLOAT128_VERSION"
 %endif
+libc {
+  FLOAT128_VERSION {
+    strfromf128;
+  }
+}
 libm {
   FLOAT128_VERSION {
     __acosf128_finite;
diff --git a/sysdeps/ieee754/float128/strfromf128.c b/sysdeps/ieee754/float128/strfromf128.c
new file mode 100644
index 0000000000..597c7e62f9
--- /dev/null
+++ b/sysdeps/ieee754/float128/strfromf128.c
@@ -0,0 +1,25 @@
+/* Definitions for strfromf128.  Implementation in stdlib/strfrom-skeleton.c.
+
+   Copyright (C) 2017 Free Software Foundation, Inc.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define	FLOAT		_Float128
+#define STRFROM		strfromf128
+
+#include <bits/floatn.h>
+#include <float128_private.h>
+
+#include <stdlib/strfrom-skeleton.c>