about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-11-03 17:09:21 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-11-03 17:10:39 +0000
commit9725517070c1dda41aa3676cf1cf61daa527e14e (patch)
tree67eb1dc42fcf74f2c37fc5b007eb926e508ad788
parent6d58ce5e5072945d44f2dba83ad16cd6febd056c (diff)
downloadglibc-9725517070c1dda41aa3676cf1cf61daa527e14e.tar.gz
glibc-9725517070c1dda41aa3676cf1cf61daa527e14e.tar.xz
glibc-9725517070c1dda41aa3676cf1cf61daa527e14e.zip
Declare strtof, strfromf functions for more _FloatN, _FloatNx types.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch arranges for <stdlib.h> to declare strtof and
strfromf functions for all such types, similarly to the declarations
already present for _Float128.

Tested for x86_64.

	* stdlib/stdlib.h
	[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof16):
	Declare.
	[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof32):
	Likewise.
	[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof64):
	Likewise.
	[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strtof32x): Likewise.
	[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strtof64x): Likewise.
	[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strtof128x): Likewise.
	[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf16): Likewise.
	[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf32): Likewise.
	[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf64): Likewise.
	[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf32x): Likewise.
	[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf64x): Likewise.
	[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf128x): Likewise.
	[__USE_GNU && __HAVE_FLOAT16] (strtof16_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT32] (strtof32_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT64] (strtof64_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT32X] (strtof32x_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT64X] (strtof64x_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT128X] (strtof128x_l): Likewise.
-rw-r--r--ChangeLog34
-rw-r--r--stdlib/stdlib.h119
2 files changed, 151 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d0ef94c3ed..aa115b62fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2017-11-03  Joseph Myers  <joseph@codesourcery.com>
+
+	* stdlib/stdlib.h
+	[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof16):
+	Declare.
+	[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof32):
+	Likewise.
+	[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof64):
+	Likewise.
+	[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
+	(strtof32x): Likewise.
+	[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
+	(strtof64x): Likewise.
+	[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
+	(strtof128x): Likewise.
+	[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
+	(strfromf16): Likewise.
+	[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
+	(strfromf32): Likewise.
+	[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
+	(strfromf64): Likewise.
+	[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
+	(strfromf32x): Likewise.
+	[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
+	(strfromf64x): Likewise.
+	[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
+	(strfromf128x): Likewise.
+	[__USE_GNU && __HAVE_FLOAT16] (strtof16_l): Likewise.
+	[__USE_GNU && __HAVE_FLOAT32] (strtof32_l): Likewise.
+	[__USE_GNU && __HAVE_FLOAT64] (strtof64_l): Likewise.
+	[__USE_GNU && __HAVE_FLOAT32X] (strtof32x_l): Likewise.
+	[__USE_GNU && __HAVE_FLOAT64X] (strtof64x_l): Likewise.
+	[__USE_GNU && __HAVE_FLOAT128X] (strtof128x_l): Likewise.
+
 2017-11-03  Richard Henderson  <rth@twiddle.net>
 
 	* sysdeps/unix/sysv/linux/aarch64/sysconf.c: New file.
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 7a720cfd11..64dc39422e 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -128,10 +128,47 @@ extern long double strtold (const char *__restrict __nptr,
      __THROW __nonnull ((1));
 #endif
 
+/* Likewise for '_FloatN' and '_FloatNx'.  */
+
+#if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern _Float16 strtof16 (const char *__restrict __nptr,
+			  char **__restrict __endptr)
+     __THROW __nonnull ((1));
+#endif
+
+#if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern _Float32 strtof32 (const char *__restrict __nptr,
+			  char **__restrict __endptr)
+     __THROW __nonnull ((1));
+#endif
+
+#if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern _Float64 strtof64 (const char *__restrict __nptr,
+			  char **__restrict __endptr)
+     __THROW __nonnull ((1));
+#endif
+
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
-/* Likewise for the '_Float128' format  */
 extern _Float128 strtof128 (const char *__restrict __nptr,
-		      char **__restrict __endptr)
+			    char **__restrict __endptr)
+     __THROW __nonnull ((1));
+#endif
+
+#if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern _Float32x strtof32x (const char *__restrict __nptr,
+			    char **__restrict __endptr)
+     __THROW __nonnull ((1));
+#endif
+
+#if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern _Float64x strtof64x (const char *__restrict __nptr,
+			    char **__restrict __endptr)
+     __THROW __nonnull ((1));
+#endif
+
+#if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern _Float128x strtof128x (const char *__restrict __nptr,
+			      char **__restrict __endptr)
      __THROW __nonnull ((1));
 #endif
 
@@ -185,12 +222,48 @@ extern int strfroml (char *__dest, size_t __size, const char *__format,
      __THROW __nonnull ((3));
 #endif
 
+#if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern int strfromf16 (char *__dest, size_t __size, const char * __format,
+		       _Float16 __f)
+     __THROW __nonnull ((3));
+#endif
+
+#if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern int strfromf32 (char *__dest, size_t __size, const char * __format,
+		       _Float32 __f)
+     __THROW __nonnull ((3));
+#endif
+
+#if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern int strfromf64 (char *__dest, size_t __size, const char * __format,
+		       _Float64 __f)
+     __THROW __nonnull ((3));
+#endif
+
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
 extern int strfromf128 (char *__dest, size_t __size, const char * __format,
 			_Float128 __f)
      __THROW __nonnull ((3));
 #endif
 
+#if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern int strfromf32x (char *__dest, size_t __size, const char * __format,
+			_Float32x __f)
+     __THROW __nonnull ((3));
+#endif
+
+#if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern int strfromf64x (char *__dest, size_t __size, const char * __format,
+			_Float64x __f)
+     __THROW __nonnull ((3));
+#endif
+
+#if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
+extern int strfromf128x (char *__dest, size_t __size, const char * __format,
+			 _Float128x __f)
+     __THROW __nonnull ((3));
+#endif
+
 
 #ifdef __USE_GNU
 /* Parallel versions of the functions above which take the locale to
@@ -232,12 +305,54 @@ extern long double strtold_l (const char *__restrict __nptr,
 			      locale_t __loc)
      __THROW __nonnull ((1, 3));
 
+# if __HAVE_FLOAT16
+extern _Float16 strtof16_l (const char *__restrict __nptr,
+			    char **__restrict __endptr,
+			    locale_t __loc)
+     __THROW __nonnull ((1, 3));
+# endif
+
+# if __HAVE_FLOAT32
+extern _Float32 strtof32_l (const char *__restrict __nptr,
+			    char **__restrict __endptr,
+			    locale_t __loc)
+     __THROW __nonnull ((1, 3));
+# endif
+
+# if __HAVE_FLOAT64
+extern _Float64 strtof64_l (const char *__restrict __nptr,
+			    char **__restrict __endptr,
+			    locale_t __loc)
+     __THROW __nonnull ((1, 3));
+# endif
+
 # if __HAVE_FLOAT128
 extern _Float128 strtof128_l (const char *__restrict __nptr,
 			      char **__restrict __endptr,
 			      locale_t __loc)
      __THROW __nonnull ((1, 3));
 # endif
+
+# if __HAVE_FLOAT32X
+extern _Float32x strtof32x_l (const char *__restrict __nptr,
+			      char **__restrict __endptr,
+			      locale_t __loc)
+     __THROW __nonnull ((1, 3));
+# endif
+
+# if __HAVE_FLOAT64X
+extern _Float64x strtof64x_l (const char *__restrict __nptr,
+			      char **__restrict __endptr,
+			      locale_t __loc)
+     __THROW __nonnull ((1, 3));
+# endif
+
+# if __HAVE_FLOAT128X
+extern _Float128x strtof128x_l (const char *__restrict __nptr,
+				char **__restrict __endptr,
+				locale_t __loc)
+     __THROW __nonnull ((1, 3));
+# endif
 #endif /* GNU */