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
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 2 Aug 2016 21:53:33 +0000
- Subject: Re: [PATCHv2 03/11] Support for type-generic libm function implementations libm
- Authentication-results: sourceware.org; auth=none
- References: <cover.1467403875.git.murphyp@linux.vnet.ibm.com> <cebc316f7e28549a07e05d8f3fba066ad80eca73.1467403875.git.murphyp@linux.vnet.ibm.com>
On Fri, 1 Jul 2016, Paul E. Murphy wrote:
> +#if M_LIBM_NEED_COMPAT (carg)
> + declare_mgen_libm_compat (__carg, carg)
> #endif
This sort of thing is not conventionally indented.
> diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
> new file mode 100644
> index 0000000..3befde1
> --- /dev/null
> +++ b/sysdeps/generic/math-type-macros.h
How would you envisage additional types being handled? Overriding the
header with a variant that duplicates its contents but with extra types
being handled doesn't seem like a good idea. Maybe there should actually
be a header per type, which then includes the generic type-independent
header, or something like that? I think more rationale is needed for the
design relating to this header, anyway.
> +#if M_TYPE == M_FLOAT
> +# define M_PFX FLT
> +# define M_LIT(c) c ## f
> +/* Use the double version instead. */
> +# define M_MLIT(c) c
> +# define M_SUF(c) c ## f
> +# define M_FUNC(c) c ## f
> +# define FLOAT float
> +# define CFLOAT __complex__ float
> +# define M_HUGE_VAL HUGE_VALF
Somewhere there needs to be a comment explaining the semantics of every
one of these macros. Especially, I can't tell what the difference of
intent between M_SUF and M_FUNC is (which places should use one, which
should use the other). In one place you call M_SUF (__atan2), in another
you define M_ATAN2 to M_FUNC (__ieee754_atan2) - why the difference
between M_SUF and M_FUNC there?
> +#ifndef M_DECL_FUNC
> +# define M_DECL_FUNC(f) M_FUNC(f)
> +#endif
Missing space before '(' in macro call.
--
Joseph S. Myers
joseph@codesourcery.com