The branch 'gabriel/powerpc-ieee128-printscan' was deleted. It previously pointed to: 1c4f7ff... RFC: powerpc64le: Enable support for IEEE long double Diff: !!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST): ------------------------------------------------------------------- 1c4f7ff... RFC: powerpc64le: Enable support for IEEE long double b843c8d... powerpc64le: Require a compiler with -mno-gnu-attribute 1383090... ldbl-128ibm-compat: Do not mix -mabi=*longdouble and -mlong a4b0f5c... Avoid compat symbols for totalorder in powerpc64le IEEE lon a213c7d... ldbl-128ibm-compat: Compiler flags for stdio functions 42508d9... Do not redirect calls to __GI_* symbols, when redirecting t db4e80f... ldbl-128ibm-compat: Add *cvt functions 46e069a... Refactor *cvt functions implementation (5/5) ebd7273... Refactor *cvt functions implementation (4/5) 8146c44... Refactor *cvt functions implementation (3/5) 6d9910e... Refactor *cvt functions implementation (2/5) 516e87f... Refactor *cvt functions implementation (1/5) 3151bb4... Remove hidden_def and hidden_proto from cvt functions 80c708b... ldbl-128ibm-compat: Add tests for strfroml, strtold, and wc 0311489... ldbl-128ibm-compat: Add tests for strfmon and strfmon_l 9db8411... ldbl-128ibm-compat: Add strfmon_l with IEEE long double for e7f6beb... ldbl-128ibm-compat: Add syslog functions e4fc800... ldbl-128ibm-compat: Add obstack printing functions b0e6ff5... ldbl-128ibm-compat: Add ISO C99 versions of scanf functions 71beb18... ldbl-128ibm-compat: Reuse tests for err.h and error.h funct 06b17cc... ldbl-128ibm-compat: Add error.h functions 099d748... ldbl-128ibm-compat: Add err.h functions f19302c... ldbl-128ibm-compat: Add argp_error and argp_failure 655d4f7... ldbl-128ibm-compat: Add wide character scanning functions 850b131... ldbl-128ibm-compat: Add regular character scanning function 58e9654... ldbl-128ibm-compat: Test positional arguments d7dc1ef... ldbl-128ibm-compat: Test double values cc8074c... ldbl-128ibm-compat: Add wide character, fortified printing 99092f6... ldbl-128ibm-compat: Add regular character, fortified printi d83653e... ldbl-128ibm-compat: Add wide character printing functions 197108a... ldbl-128ibm-compat: Add regular character printing function commit 1c4f7fffc4f1cc186906dd47812e725e51bb036a Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:48:28 2019 -0300 RFC: powerpc64le: Enable support for IEEE long double DO NOT COMMIT! On platforms where long double may have two different formats, i.e.: the same format as double (64-bits) or something else (128-bits), building with -mlong-double-128 is the default and function calls in the user program match the name of the function in Glibc. When building with -mlong-double-64, Glibc installed headers redirect such calls to the appropriate function. This patch adds similar redirections to be used by user code builds in IEEE long double mode (-mabi=ieeelongdouble). It also skips some uses of libc_hidden_proto in internal headers, because they also produce redirections, causing a redirection conflict. PS: Missing NEWS entry. commit b843c8d832cdb2a1000b45e853c17211de67b4e7 Author: Gabriel F. T. Gomes Date: Fri Oct 11 15:20:05 2019 -0300 powerpc64le: Require a compiler with -mno-gnu-attribute On powerpc64le, a few files are built on IEEE long double mode (-mabi=ieeelongdouble), whereas most are built on IBM long double mode (-mabi=ibmlongdouble, the default for -mlong-double-128). Since binutils 2.31, linking object files with different long double modes causes errors similar to: ld: libc_pic.a(s_isinfl.os) uses IBM long double, libc_pic.a(ieee128-qefgcvt.os) uses IEEE long double. collect2: error: ld returned 1 exit status make[2]: *** [../Makerules:649: libc_pic.os] Error 1 The warnings are fair and correct, but in order for glibc to have support for both long double modes on powerpc64le, they have to be ignored. This can be accomplished with the use of -mno-gnu-attribute option when building the few files that require IEEE long double mode. However, -mno-gnu-attribute is not available in GCC 6, the minimum version required to build glibc, so this patch adds a test for this feature in powerpc64le builds, and fails early if it's not available. Tested, on powerpc64le, that the build fails early with GCC 6 and that it succeeds with GCC 7 or greater. commit 1383090d1047e6d4c108e8478e94511307de77cd Author: Gabriel F. T. Gomes Date: Tue Sep 10 08:05:03 2019 -0500 ldbl-128ibm-compat: Do not mix -mabi=*longdouble and -mlong-double-128 Some compiler versions, e.g. GCC 7, complain when -mlong-double-128 is used together with -mabi=ibmlongdouble or -mabi=ieeelongdouble, producing the following error message: cc1: error: ‘-mabi=ibmlongdouble’ requires ‘-mlong-double-128’ This patch removes -mlong-double-128 from the compilation lines that explicitly request -mabi=*longdouble. Tested for powerpc64le. commit a4b0f5cf0f30f3e71d2f4dc3428fb65673d432b5 Author: Gabriel F. T. Gomes Date: Mon Sep 9 12:59:46 2019 -0500 Avoid compat symbols for totalorder in powerpc64le IEEE long double On powerpc64le, the libm_alias_float128_other_r_ldbl macro is used to create an alias between totalorderf128 and __totalorderlieee128, as well as between the totalordermagf128 and __totalordermaglieee128. However, the totalorder* and totalordermag* functions changed their parameter type since commit ID 42760d764649 and got compat symbols for their old versions. With this change, the aforementioned macro would create two conflicting aliases for __totalorderlieee128 and __totalordermaglieee128. This patch avoids the creation of the alias between the IEEE long double symbols (__totalorderl*ieee128) and the compat symbols, because the IEEE long double functions have never been exported thus don't need such compat symbol. commit a213c7d086add88350918467aff2e970d097e77e Author: Tulio Magno Quites Machado Filho Date: Mon Jul 30 12:04:40 2018 -0300 ldbl-128ibm-compat: Compiler flags for stdio functions Some of the files that provide stdio.h and wchar.h functions have a filename prefixed with 'io', such as 'iovsprintf.c'. On platforms that imply ldbl-128ibm-compat, these files must be compiled with the flag -mabi=ibmlongdouble. This patch adds this flag to their compilation. Notice that this is not required for the other files that provide similar functions, because filenames that are not prefixed with 'io' have ldbl-128ibm-compat counterparts in the Makefile, which already adds -mabi=ibmlongdouble to them. commit 42508d917d96003682b7a09459ebd61c0a9c64ad Author: Tulio Magno Quites Machado Filho Date: Tue Jul 24 16:06:23 2018 -0300 Do not redirect calls to __GI_* symbols, when redirecting to *ieee128 On platforms where long double has IEEE binary128 format as a third option (initially, only powerpc64le), many exported functions are redirected to their __*ieee128 equivalents. This redirection is provided by installed headers such as stdio-ldbl.h, and is supposed to work correctly with user code. However, during the build of glibc, similar redirections are employed, in internal headers such as include/stdio.h, in order to avoid extra PLT entries. These redirections conflict with the redirections to __*ieee128, and must be avoided during the build. This patch protects the second redirections with a test for __LONG_DOUBLE_USES_FLOAT128. commit db4e80f4d87bee8670497d0a672acee66fc1f384 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:48:24 2019 -0300 ldbl-128ibm-compat: Add *cvt functions This patch adds IEEE long double versions of q*cvt* functions for powerpc64le. Unlike all other long double to/from string conversion functions, these do not rely on internal functions that can take floating-point numbers with different formats and act on them accordingly, instead, the related files are rebuilt with the -mabi=ieeelongdouble compiler flag set. Having -mabi=ieeelongdouble passed to the compiler causes the object files to be marked with a .gnu_attribute that is incompatible with the .gnu_attribute in files built with -mabi=ibmlongdouble (the default). The difference causes error messages similar to the following: ld: libc_pic.a(s_isinfl.os) uses IBM long double, libc_pic.a(ieee128-qefgcvt_r.os) uses IEEE long double. collect2: error: ld returned 1 exit status make[2]: *** [../Makerules:649: libc_pic.os] Error 1 Although this warning is useful in other situations, the library actually needs to have functions with different long double formats, so .gnu_attribute generation is explicitly disabled for these files with the use of -mno-gnu-attribute. Tested for powerpc64le on the branch that actually enables the sysdeps/ieee754/ldbl-128ibm-compat for powerpc64le. commit 46e069a9d85c85f896674c93e3d9a3a6d5934699 Author: Gabriel F. T. Gomes Date: Tue Oct 15 15:05:53 2019 -0300 Refactor *cvt functions implementation (5/5) This patch is to be squashed with the other n/5 refactoring patches. This patch replaces the use of the APPEND macro with one new macro being defined for each of the cvt* functions. This makes it easier to define functions names for IEEE long double on powerpc64le, e.g. __ecvtieee128. commit ebd7273305ceee35771c4fe0c7498f31f712cc7a Author: Gabriel F. T. Gomes Date: Tue Oct 15 15:05:19 2019 -0300 Refactor *cvt functions implementation (4/5) This patch is to be squashed with the other n/5 refactoring patches. This patch splits the definition of the symbol names into separate files for double and long double, which will make it easier to define new symbol names for IEEE long double functions on powerpc64le. commit 8146c44cec0daec77e78dd95a504d664160d7780 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:48:16 2019 -0300 Refactor *cvt functions implementation (3/5) This patch is to be squashed with the other n/5 refactoring patches. This patch only moves and merges the contents of misc/qefgcvt.c and misc/qefgcvt_r.c into misc/efgcvt-ldbl-macros.h. commit 6d9910ed3409f42705a5335202f80f9e740510a7 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:48:12 2019 -0300 Refactor *cvt functions implementation (2/5) This patch is to be squashed with the other n/5 refactoring patches. This patch only moves and merges the contents of misc/efgcvt-template.c and misc/efgcvt_r-template.c into misc/efgcvt-dbl-macros.h. commit 516e87fea648cb1993df6991219cc6d0728e2429 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:48:08 2019 -0300 Refactor *cvt functions implementation (1/5) This patch is to be squashed with the other n/5 refactoring patches. I split it into these 5 patches, because even using -M and -C, the patches looks as if a lot has changed, when it's basically just moving code around. The final commit will be the squashing of patches 1 to 5, with the following commit message: -- 8< -- This patch refactors the *cvt functions implementation in a way that makes it easier to re-use them for implementing the IEEE long double on powerpc64le. By splitting the implementation per se in one file (efgcvt-template.c) and the alias definitions in others (e.g. efgcvt.c), the new code makes it easier to define new function names, such as __qecvtieee128. commit 3151bb4301d074893ee6e738ac81a2d3a7243fe5 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:48:04 2019 -0300 Remove hidden_def and hidden_proto from cvt functions Some *cvt functions are not called from within libc, yet they use hidden_def and hidden_proto. This patch cleans this up and adds attribute_hidden to the declarations, for architectures that need it. Tested for powerpc64le and x86_64. commit 80c708b51817c9313531eba9fcd0d023747a0475 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:48:00 2019 -0300 ldbl-128ibm-compat: Add tests for strfroml, strtold, and wcstold Since the commit commit 86a0f56158bd9cbaf2d640e2e6c66539f4cbbcc1 Author: Rajalakshmi Srinivasaraghavan Date: Thu Jun 28 13:57:50 2018 +0530 ldbl-128ibm-compat: Introduce ieee128 symbols IEEE long double versions of strfroml, strtold, and wcstold have been prepared, but not exposed (which will only happen when the full support for IEEE long double is complete). This patch adds tests for these functions in both IBM and IEEE long double mode. commit 03114891dc4763705c2bb207b53920c3597cacb8 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:56 2019 -0300 ldbl-128ibm-compat: Add tests for strfmon and strfmon_l This patch adds elementary tests to check that strfmon and strfmon_l correctly evaluate long double values with IBM Extended Precision and IEEE binary128 format. Tested for powerpc64le. commit 9db8411551545b391b2196246a3a750e8d7b855a Author: Rajalakshmi Srinivasaraghavan Date: Thu Jun 28 15:17:42 2018 +0530 ldbl-128ibm-compat: Add strfmon_l with IEEE long double format Similarly to what has been done for printf-like functions, more specifically to the internal implementation in __vfprintf_internal, this patch extends __vstrfmon_l_internal to deal with long double values with binary128 format (as a third format option and reusing the float128 implementation). Tested for powerpc64le and x86_64. commit e7f6beb8c1a3e5e8d59c1d0432f93cc26a15c1e8 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:51 2019 -0300 ldbl-128ibm-compat: Add syslog functions I'm using 'syslog (LOG_DEBUG, etc.);' and support_capture_subprocess in the test case, which I believe will not print to the console, but I'm not sure if changing some system setting to high verbosity will disturb people's lives. Please advise. :) -- 8< -- Similarly to __vfprintf_internal and __vfscanf_internal, the internal implementation of syslog functions (__vsyslog_internal) takes a 'mode_flags' parameter used to select the format of long double parameters. This patch adds variants of the syslog functions that set 'mode_flags' to PRINTF_LDBL_USES_FLOAT128, thus enabling the correct printing of long double values on powerpc64le, when long double has IEEE binary128 format (-mabi=ieeelongdouble). Tested for powerpc64le. commit e4fc8001a4413bf940eda6b189244fb90d0d9c1d Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:47 2019 -0300 ldbl-128ibm-compat: Add obstack printing functions Similarly to the functions from the *printf family, this patch adds implementations for __obstack_*printf* functions that set the 'mode_flags' parameter to PRINTF_LDBL_USES_FLOAT128, before making calls to __vfprintf_internal (indirectly through __obstack_vprintf_internal). Tested for powerpc64le. commit b0e6ff51859a8fb11a3af31a4d902842f614dc2a Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:43 2019 -0300 ldbl-128ibm-compat: Add ISO C99 versions of scanf functions In the format string for *scanf functions, the '%as', '%aS', and '%a[]' modifiers behave differently depending on ISO C99 compatibility and on _GNU_SOURCE. When _GNU_SOURCE is not set and when in compatibility with ISO C99, these modifiers consume a floating-point argument. Otherwise, they behave like ascanf, and allocate memory for the output. This patch adds the IEEE binary128 variant of these functions for the third long double format on powerpc64le. Tested for powerpc64le. commit 71beb187bc2d5808604542b9f1d22fff154f7e5f Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:39 2019 -0300 ldbl-128ibm-compat: Reuse tests for err.h and error.h functions Commit IDs 9771e6cb5102 and 7597b0c7f711 added tests for the functions from err.h and error.h that can take long double parameters. Afterwards, commit ID f0eaf8627654 reused them on architectures that changed the long double format from the same as double to something else (i.e.: architectures that imply ldbl-opt). This patch reuses it again for IEEE long double on powerpc64le. Tested for powerpc64le. commit 06b17ccdaf4ee7c0fe2fab4de443e8fdddcbe23e Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:35 2019 -0300 ldbl-128ibm-compat: Add error.h functions Use the recently added, internal functions, __error_at_line_internal and __error_internal, to provide error.h functions that can take long double arguments with IEEE binary128 format on platforms where long double can also take double format or some non-IEEE format (currently, this means powerpc64le). Tested for powerpc64le. commit 099d74805a59f25a339fe916a54eb1c753e59abe Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:30 2019 -0300 ldbl-128ibm-compat: Add err.h functions Use the recently added, internal functions, __vwarnx_internal and __vwarn_internal, to provide err.h functions that can take long double arguments with IEEE binary128 format on platforms where long double can also take double format or some non-IEEE format (currently, this means powerpc64le). Tested for powerpc64le. commit f19302ca897171bb924918a126cae4202672e17c Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:25 2019 -0300 ldbl-128ibm-compat: Add argp_error and argp_failure Use the recently added, internal functions, __argp_error_internal and __argp_failure_internal, to provide argp_error and argp_failure that can take long double arguments with IEEE binary128 format on platforms where long double can also take double format or some non-IEEE format (currently, this means powerpc64le). Tested for powerpc64le. commit 655d4f77a03ccd4116338ec508ef2b5c2801d1a6 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:21 2019 -0300 ldbl-128ibm-compat: Add wide character scanning functions Similarly to what was done for regular character scanning functions, this patch uses the new mode mask, SCANF_LDBL_USES_FLOAT128, in the 'mode' argument of the wide characters scanning function, __vfwscanf_internal (which is also extended to support scanning floating-point values with IEEE binary128, by redirecting calls to __wcstold_internal to __wcstof128_internal). Tested for powerpc64le. commit 850b1312aa64fb5fa0f063bbcd6dd45648eec2d5 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:16 2019 -0300 ldbl-128ibm-compat: Add regular character scanning functions The 'mode' argument to __vfscanf_internal allows the selection of the long double format for all long double arguments requested by the format string. Currently, there are two possibilities: long double with the same format as double or long double as something else. The 'something else' format varies between architectures, and on powerpc64le, it means IBM Extended Precision format. In preparation for the third option of long double format on powerpc64le, this patch uses the new mode mask, SCANF_LDBL_USES_FLOAT128, which tells __vfscanf_internal to call __strtof128_internal, instead of __strtold_internal, and save the output into a _Float128 variable. Tested for powerpc64le. commit 58e96547f70914e57cade21dd5b4b7d15edaa71a Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:12 2019 -0300 ldbl-128ibm-compat: Test positional arguments The format string can request positional parameters, instead of relying on the order in which they appear as arguments. Since this has an effect on how the type of each argument is determined, this patch extends the test cases to use positional parameters with mixed double and long double types, to verify that the IEEE long double implementations of *printf work correctly in this scenario. Tested for powerpc64le. commit d7dc1efc6d140e3ba28802c5fb03a7138422b7d7 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:06 2019 -0300 ldbl-128ibm-compat: Test double values A single format string can take double and long double parameters at the same time. Internally, these parameters are routed to the same function, which correctly reads them and calls the underlying functions responsible for the actual conversion to string. This patch adds a new case to test this scenario. Tested for powerpc64le. commit cc8074c014737e75694f23918a4d10b9730d69e4 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:47:01 2019 -0300 ldbl-128ibm-compat: Add wide character, fortified printing functions Similarly to what was done for the regular character, fortified printing functions, this patch combines the mode masks PRINTF_LDBL_USES_FLOAT128 and PRINTF_FORTIFY to provide wide character versions of fortified printf functions. It also adds two flavors of test cases: one that explicitly calls the fortified functions, and another that reuses the non-fortified test, but defining _FORTIFY_SOURCE as 2. The first guarantees that the implementations are actually being tested (independently of what's in bits/wchar2.h), whereas the second guarantees that the redirections calls the correct function in the IBM and IEEE long double cases. Tested for powerpc64le. commit 99092f60bed5cff54664b5c81473a94ca909359c Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:46:57 2019 -0300 ldbl-128ibm-compat: Add regular character, fortified printing functions Since the introduction of internal functions with explicit flags for the printf family of functions, the 'mode' parameter can be used to select which format long double parameters have (with the mode flags: PRINTF_LDBL_IS_DBL and PRINTF_LDBL_USES_FLOAT128), as well as to select whether to check for overflows (mode flag: PRINTF_FORTIFY). This patch combines PRINTF_LDBL_USES_FLOAT128 and PRINTF_FORTIFY to provide the IEEE binary128 version of printf-like function for platforms where long double can take this format, in addition to the double format and to some non-ieee format (currently, this means powerpc64le). There are two flavors of test cases provided with this patch: one that explicitly calls the fortified functions, for instance __asprintf_chk, and another that reuses the non-fortified test, but defining _FORTIFY_SOURCE as 2. The first guarantees that the implementations are actually being tested (in bits/stdio2.h, vprintf gets redirected to __vfprintf_chk, which would leave __vprintf_chk untested), whereas the second guarantees that the redirections calls the correct function in the IBM and IEEE long double cases. Tested for powerpc64le. commit d83653e772345782ff1009a873068e64fecbdef0 Author: Gabriel F. T. Gomes Date: Thu Jul 11 11:46:51 2019 -0300 ldbl-128ibm-compat: Add wide character printing functions Similarly to what was done for regular character printing functions, this patch uses the new mode mask, PRINTF_LDBL_USES_FLOAT128, in the 'mode' argument of the wide characters printing function, __vfwprintf_internal (which is also extended to support printing floating-point values with IEEE binary128, by saving floating-point values into variables of type __float128 and adjusting the parameters to __printf_fp and __printf_fphex as if it was a call from a wide-character version of strfromf128 (even though such version does not exist)). Tested for powerpc64le. commit 197108ae63b3c2173ba7476150759ecd6e065d4c Author: Gabriel F. T. Gomes Date: Thu Aug 8 10:42:35 2019 -0300 ldbl-128ibm-compat: Add regular character printing functions The 'mode' argument to __vfprintf_internal allows the selection of the long double format for all long double arguments requested by the format string. Currently, there are two possibilities: long double with the same format as double or long double as something else. The 'something else' format varies between architectures, and on powerpc64le, it means IBM Extended Precision format. In preparation for the third option of long double format on powerpc64le, this patch uses the new mode mask, PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the floating-point values into variables of type __float128 and adjusts the parameters to __printf_fp and __printf_fphex as if it was a call from strfromf128. Many files from the stdio-common, wcsmbs, argp, misc, and libio directories will have IEEE binary128 counterparts. Setting the correct compiler options to these files (original and counterparts) would produce a large amount of repetitive Makefile rules. To avoid this repetition, this patch adds a Makefile routine that iterates over the files adding or removing the appropriate flags. Tested for powerpc64le.