On Mon, Jan 21, 2019 at 9:09 AM H.J. Lu <hjl.to...@gmail.com> wrote:
>
> On Mon, Jan 21, 2019 at 8:59 AM Uros Bizjak <ubiz...@gmail.com> wrote:
> >
> > On Mon, Jan 21, 2019 at 5:56 PM H.J. Lu <hjl.to...@gmail.com> wrote:
> > >
> > > On Mon, Jan 21, 2019 at 8:43 AM Uros Bizjak <ubiz...@gmail.com> wrote:
> > > >
> > > > On Mon, Jan 21, 2019 at 5:15 PM H.J. Lu <hjl.to...@gmail.com> wrote:
> > > > >
> > > > > TI->SF and TI->DF conversions in libgcc2.c:
> > > > >
> > > > > FSTYPE
> > > > > FUNC (DWtype u)
> > > > > {
> > > > >   ...
> > > > > }
> > > > >
> > > > > have no rounding mode support.  We should replace __floattisf, 
> > > > > __floattidf,
> > > > > __floatuntisf and __floatuntidf in libgcc2.c with these from soft-fp.
> > > > >
> > > > >         PR libgcc/88931
> > > > >         * config/i386/64/t-softfp-compat (libgcc2-ti-functions): New.
> > > > >         (LIB2FUNCS_EXCLUDE): Likewise.
> > > > >         (libgcc2-ti-softp): Likewise.
> > > > >         (LIB2ADD): Likewise.
> > > > > ---
> > > > >  libgcc/config/i386/64/t-softfp-compat | 8 ++++++++
> > > > >  1 file changed, 8 insertions(+)
> > > > >
> > > > > diff --git a/libgcc/config/i386/64/t-softfp-compat 
> > > > > b/libgcc/config/i386/64/t-softfp-compat
> > > > > index 0978695c3a4..abb78032bf5 100644
> > > > > --- a/libgcc/config/i386/64/t-softfp-compat
> > > > > +++ b/libgcc/config/i386/64/t-softfp-compat
> > > > > @@ -13,3 +13,11 @@ libgcc2-tf-functions = _divtc3 _multc3 _powitf2
> > > > >  LIB2FUNCS_EXCLUDE += $(libgcc2-tf-functions)
> > > > >  libgcc2-tf-compats = $(addsuffix .c, $(libgcc2-tf-functions))
> > > > >  LIB2ADD += $(addprefix $(srcdir)/config/i386/64/, 
> > > > > $(libgcc2-tf-compats))
> > > > > +
> > > > > +# Replace _floatdisf, _floatdidf, _floatundisf and _floatundidf in
> > > > > +# libgcc2.c, which have no rounding mode support, with floattisf.c,
> > > > > +# floattidf.c, floatundisf.c and floatundidf.c from soft-fp.
> > > > > +libgcc2-ti-functions = _floatdisf _floatdidf _floatundisf 
> > > > > _floatundidf
> > > > > +LIB2FUNCS_EXCLUDE += $(libgcc2-ti-functions)
> > > > > +libgcc2-ti-softp = floattisf.c floattidf.c floatuntisf.c 
> > > > > floatuntidf.c
> > > > > +LIB2ADD += $(addprefix $(srcdir)/soft-fp/, $(libgcc2-ti-softp))
> > > >
> > > > It is not that simple. Please note that libgcc2 functions use FP
> > > > instructions in narrower mode (so, in effect still use FPU), while
> > > > soft-fp functions don't even touch the FPU, and do everything using
> > > > bit twiddling. I think that your change would introduce qoute
> > > > noticeable runtime regressions.
> > > >
> > >
> > > By "run-time regressions", did you mean performance or correctness?
> >
> > Performance.
> >
>
> We will check performance change.
>

I created a micro benchmark on int128/double branch at

https://github.com/hjl-tools/microbenchmark

On Coffee Lake, I got

[hjl@gnu-cfl-2 microbenchmark]$ make
gcc -g -I. -O2   -c -o test.o test.c
gcc -g   -c -o libgcc2.o libgcc2.S
gcc -g   -c -o soft-fp.o soft-fp.S
gcc -g   -c -o floattidf-libgcc2.o floattidf-libgcc2.S
gcc -g   -c -o floattidf-soft-fp.o floattidf-soft-fp.S
gcc -o test test.o libgcc2.o soft-fp.o floattidf-libgcc2.o floattidf-soft-fp.o
./test
300000000 loops:
total  : 4.4999999767e+16
libgcc2: 2299371252
total  : 4.4999999767e+16
soft-fp: 3122038661 (135.78%)
[hjl@gnu-cfl-2 microbenchmark]$

We will collect SPEC CPU 2017 numbers.

-- 
H.J.

Reply via email to