This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv2 03/11] Support for type-generic libm function implementations libm
On 08/10/2016 05:05 PM, Joseph Myers wrote:
> On Wed, 10 Aug 2016, Paul E. Murphy wrote:
>
>> Ok, here is a patch which does all of the above. I like this approach
>> much better than the previous patches. This approach is much more
>> inline with the existing idioms, much easier to understand, and more
>> robust.
>
> The shell code you're embedding in the makefile uses $${gfunc/F/} which is
> a bash-specific feature. Makefile shell code is run with /bin/sh; you can
> only rely on POSIX shell features. dash does not support this non-POSIX
> feature.
>
>> Notable changes from the last patch:
>
> This patch has not addressed my point that the comment about LDBL_EPSILON
> for IBM long double should refer to both underflows and overflows.
>
Oops, thanks for catching those. Both are fixed with minor changes
to the patch:
diff --git a/math/Makefile b/math/Makefile
index 567b7ed..7451e4e 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -274,7 +274,7 @@ generated += $(addsuffix .c,$(call type-foreach,$(gen-libm-calls:%=%$(s)))) \
# Create wrappers in the math build directory.
$(objpfx)gen-libm-templates.stmp:
for gfunc in $(gen-libm-calls); do \
- gfunc_basefile=$${gfunc/F/}_template.c; \
+ gfunc_basefile=$${gfunc%F*}$${gfunc#*F}_template.c; \
for type in $(foreach t,$(types),$(t)__$(type-$(t)-suffix)); do \
func=$(objpfx)$${gfunc/F/$${type#*__}}; \
type=$${type%__*}; \
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
index 91394ba..259cb94 100644
--- a/sysdeps/generic/math-type-macros.h
+++ b/sysdeps/generic/math-type-macros.h
@@ -95,7 +95,7 @@
#include <float.h>
/* Use a special epsilon value for IBM long double
- to avoid spurious overflows. */
+ to avoid spurious overflows/underflows. */
#if M_MANT_DIG != 106
# define M_EPSILON __M_CONCATX (M_PFX, _EPSILON)
#else