[PATCHv2,03/11] Support for type-generic libm function implementations libm
diff mbox

Message ID ca21e998-8469-7c93-4982-24505f9b408b@linux.vnet.ibm.com
State New
Headers show

Commit Message

Paul E. Murphy Aug. 11, 2016, 12:30 a.m. UTC
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:

Comments

Joseph Myers Aug. 11, 2016, 1:22 a.m. UTC | #1
On Wed, 10 Aug 2016, Paul E. Murphy wrote:

> 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#*__}};                       \

There's a further unfixed instance of this non-POSIX shell usage.

Please send a complete fixed patch.

Patch
diff mbox

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