> From: "Todd C. Miller" <todd.mil...@sudo.ws>
> Date: Thu, 14 Oct 2021 14:40:13 -0600
> 
> On Thu, 14 Oct 2021 01:15:56 +0200, Mark Kettenis wrote:
> 
> > Currently the lib/libm/msun/run-lrint_test regress fails on powerpc64
> > and other platforms.  Our implementation came from NetBSD, but NetBSD
> > switched to the implementation from FreeBSD some time ago.  That is
> > the same implementation that we already use for lrintl(3) and
> > llrintl(3).
> >
> > Diff below makes us use that implementation for lrint(3), lrintf(3),
> > llrint(3) and llrintf(3) as well.  This makes the regress test pass on
> > powerpc64.
> 
> Doesn't this mean we end up with three copies of what is essentially
> the same code in s_lrint.c, s_lrintf.c and s_lrintl.c?
> 
> I know it's not much but why not just move the actual code to
> s_lrint.c and include that in the others?

This doesn't work because of the hidden symbol madness.  The way
things currently are we need one copy (s_lrint.c) with:

DEF_STD(fn);
LDBL_MAYBE_CLONE(fn);

another version (s_lrintf.c) with

DEF_STD(fn);

and a final version (s_lrintl.c) without any magic.

I suppose I could have the s_lrint.c and s_lrintf.c include
s_lrintfl.c if you think that would be better?

Reply via email to