[PATCH] Add a comment for NO_MATH_REDIRECT

H.J. Lu hjl.tools@gmail.com
Wed Nov 5 23:20:50 GMT 2025


On Thu, Nov 6, 2025 at 6:20 AM DJ Delorie <dj@redhat.com> wrote:
>
>
> Could you two please decide which of you is going to own this comment?  ;-)
>
> https://patchwork.sourceware.org/project/glibc/patch/20251028171141.3208834-10-adhemerval.zanella@linaro.org/
> Adhemerval's v2 "math: Don't redirect inlined builtin math functions" proposes:
> >  /* NB: Internal tests don't have access to internal symbols.  */
> >  # if !IS_IN (testsuite_internal) \
> >       && !(defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0)
> > +/* NB: Do not redirect math builtin functions when they are inlined.  */
> > +# include <math-use-builtins.h>
> >  #  ifndef NO_MATH_REDIRECT
> >  /* Declare some functions for use within GLIBC.  Compilers typically
> >     inline those functions as a single instruction.  Use an asm to
>
> https://patchwork.sourceware.org/project/glibc/patch/CAMe9rOr9HpwZuXy0j5v05pGDFULKR1K6DvDN=5C2O+uJrDhDig@mail.gmail.com/
> "H.J. Lu" <hjl.tools@gmail.com> proposes:
> >  /* NB: Internal tests don't have access to internal symbols.  */
> >  # if !IS_IN (testsuite_internal) \
> >       && !(defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0)
> > +/* NO_MATH_REDIRECT must be defined in the source implementing function,
> > +   FUNC, if FUNC is implemented as an alias of __FUNC or vice versa to
> > +   avoid redirecting FUNC to __FUNC.  */
> >  #  ifndef NO_MATH_REDIRECT
> >  /* Declare some functions for use within GLIBC.  Compilers typically
> >     inline those functions as a single instruction.  Use an asm to
>
> https://patchwork.sourceware.org/project/glibc/patch/20251031200300.3716090-7-adhemerval.zanella@linaro.org/
> Adhemerval's v3 proposes:
> >  /* NB: Internal tests don't have access to internal symbols.  */
> >  # if !IS_IN (testsuite_internal) \
> >       && !(defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0)
> > +/* NO_MATH_REDIRECT must be defined in the source implementing function,
> > +   FUNC, if FUNC is implemented as an alias of __FUNC or vice versa to
> > +   avoid redirecting FUNC to __FUNC.  */
> > +#  include <math-use-builtins.h>
> > +/* NB: Do not redirect math builtin functions when they are inlined.  */
> >  #  ifndef NO_MATH_REDIRECT
> >  /* Declare some functions for use within GLIBC.  Compilers typically
> >     inline those functions as a single instruction.  Use an asm to
>

Adhemerval's patch incorporated my comment update.

-- 
H.J.


More information about the Libc-alpha mailing list