[PATCH] libm: riscv: Reduce sqrt and sqrtf function for code size
Jeff Johnston
jjohnstn@redhat.com
Wed May 21 15:34:01 GMT 2025
Patch pushed, thanks.
-- Jeff J.
On Mon, May 19, 2025 at 3:04 AM Kito Cheng <kito.cheng@gmail.com> wrote:
> LGTM, thanks :)
>
> On Wed, May 14, 2025 at 4:57 PM Songhe Zhu <zhusonghe@eswincomputing.com>
> wrote:
> >
> > From: zhusonghe <zhusonghe@eswincomputing.com>
> >
> > The merged below patch modifies the __ieee754_sqrtf and __ieee754_sqrt
> functions to use a shared implementation, replacing the original fsqrt.d[s]
> instruction usage.
> >
> > patch:
> https://sourceware.org/git/?p=newlib-cygwin.git;a=commit;h=d572c4482b473d7725be0f9380d4f5d8342e4390
> >
> > Signed-off-by: Songhe Zhu <zhusonghe@eswincomputing.com>
> > ---
> > newlib/libm/machine/riscv/e_sqrt.c | 1 +
> > newlib/libm/machine/riscv/ef_sqrt.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/newlib/libm/machine/riscv/e_sqrt.c
> b/newlib/libm/machine/riscv/e_sqrt.c
> > index 0c5aaadf3..ba000d36c 100644
> > --- a/newlib/libm/machine/riscv/e_sqrt.c
> > +++ b/newlib/libm/machine/riscv/e_sqrt.c
> > @@ -35,6 +35,7 @@
> >
> > #include <math.h>
> > #include "math_config.h"
> > +#include "riscv_math.h"
> >
> > #if defined(__RISCV_HARD_FLOAT) && __RISCV_HARD_FLOAT >= 64
> >
> > diff --git a/newlib/libm/machine/riscv/ef_sqrt.c
> b/newlib/libm/machine/riscv/ef_sqrt.c
> > index cc41813dd..fd7ab4b41 100644
> > --- a/newlib/libm/machine/riscv/ef_sqrt.c
> > +++ b/newlib/libm/machine/riscv/ef_sqrt.c
> > @@ -35,6 +35,7 @@
> >
> > #include <math.h>
> > #include "math_config.h"
> > +#include "riscv_math.h"
> >
> > #if defined(__RISCV_HARD_FLOAT) && __RISCV_HARD_FLOAT >= 32
> >
> > --
> > 2.17.1
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/newlib/attachments/20250521/e7e5e6e9/attachment.htm>
More information about the Newlib
mailing list