diff options
author | Zack Weinberg <zackw@panix.com> | 2018-03-07 14:31:57 -0500 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.eti.br> | 2018-11-16 09:21:14 -0200 |
commit | c75772e3f079b9265738e2f54644ee47f932d99a (patch) | |
tree | f779b4f7b6e2de6eb5dbcf367824c71419d046fb /ChangeLog | |
parent | 346ef23f197a0c8ba807c344bd39101b711050ee (diff) | |
download | glibc-c75772e3f079b9265738e2f54644ee47f932d99a.tar.gz glibc-c75772e3f079b9265738e2f54644ee47f932d99a.tar.xz glibc-c75772e3f079b9265738e2f54644ee47f932d99a.zip |
Use STRFMON_LDBL_IS_DBL instead of __ldbl_is_dbl.
On platforms where long double used to have the same format as double, but later switched to a different format (alpha, s390, sparc, and powerpc), accessing the older behavior is possible and it happens via __nldbl_* functions (not on the API, but accessible from header redirection and from compat symbols). These functions write to the global flag __ldbl_is_dbl, which tells other functions that long double variables should be handled as double. This patch takes the first step towards removing this global flag and creates __vstrfmon_l_internal, which takes an explicit flags parameter. This change arguably makes the generated code slightly worse on architectures where __ldbl_is_dbl is never true; right now, on those architectures, it's a compile-time constant; after this change, the compiler could theoretically prove that __vstrfmon_l_internal was never called with a nonzero flags argument, but it would probably need LTO to do it. This is not performance critical code and I tend to think that the maintainability benefits of removing action at a distance are worth it. However, we _could_ wrap the runtime flag check with a macro that was defined to ignore its argument and always return false on architectures where __ldbl_is_dbl is never true, if people think the codegen benefits are important. Tested for powerpc and powerpc64le.
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 8dcdcc8b07..c71209b039 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2018-11-16 Zack Weinberg <zackw@panix.com> + Gabriel F. T. Gomes <gabriel@inconstante.eti.br> + + * include/monetary.h (STRFMON_LDBL_IS_DBL): New constant. + (__vstrfmon_l): Rename to __vstrfmon_l_internal and add flags + argument. + * stdlib/strfmon_l.c (__vstrfmon_l): Rename to __vstrfmon_l_internal + and add flags argument. Check flags instead of __ldbl_is_dbl when + deciding whether to set is_long_double. + (__strfmon_l): Call __vstrfmon_l_internal instead of __vstrfmon_l, + passing zero for flags argument. + * stdlib/strfmon.c (strfmon): Same change as made to __strfmon_l. + + * sysdeps/ieee754/ldbl-opt/nldbl-compat.c + (__nldbl___vstrfmon, __nldbl___vstrfmon_l) + (__nldbl_strfmon, __nldbl___strfmon_l): Call __vstrfmon_l_internal + directly, passing STRFMON_LDBL_IS_DBL for flags argument. Normalize + variable names. Remove libc_hidden_def/libc_hidden_proto from + __nldbl___vstrfmon and __nldbl___vstrfmon_l, because they are no + longer called from within the library. + * sysdeps/ieee754/ldbl-opt/nldbl-compat.h: Don't use NLDBL_DECL + for __nldbl___vstrfmon_l, declare it explicitly. + + * manual/locale.texi: Update a reference to vstrfmon_l in comments. + 2018-11-15 Samuel Thibault <samuel.thibault@ens-lyon.org> * sysdeps/mach/hurd/bits/fcntl.h (F_GETLK64, F_SETLK64, F_SETLKW64): New |