glibc/sysdeps/powerpc/fpu
Adhemerval Zanella 2666f96390 powerpc: Remove optimized isnan
The powerpc isnan optimizations are not really a gain:

  - GCC will call libm iff -fsignaling-nans is used. This usage pattern
    is usually not performance oriented and for such calls PLT overhead
    should dominate execution time.

  - The power5, power6, and power6x are just micro-optimization to
    improve the Load-Hit-Store hazards from floating-point to general
    register transfer, and current GCC already has support to minimize
    it by inserting either extra nops or group dispatch instructions.

  - The power7 uses ftdiv to optimize for some input patterns, but at
    cost of others.  Comparing against generic C implementation built
    for powerpc-linux-gnu-power4 (which uses the hp-timing support on
    benchtests):

    - Generic sysdeps/ieee754 implementation:
      "isnan": {
       "": {
        "duration": 4.98415e+09,
        "iterations": 2.34516e+09,
        "max": 45.925,
        "min": 2.052,
        "mean": 2.12529
       },
       "INF": {
        "duration": 4.74057e+09,
        "iterations": 1.69761e+09,
        "max": 91.01,
        "min": 2.052,
        "mean": 2.79249
       },
       "NAN": {
        "duration": 4.74071e+09,
        "iterations": 1.68768e+09,
        "max": 282.343,
        "min": 2.052,
        "mean": 2.809
       }
      }

    - power7 optimized one:
    $ ./testrun.sh benchtests/bench-isnan
      "isnan": {
       "": {
        "duration": 4.96842e+09,
        "iterations": 2.56297e+09,
        "max": 50.048,
        "min": 1.872,
        "mean": 1.93854
       },
       "INF": {
        "duration": 4.76648e+09,
        "iterations": 1.54213e+09,
        "max": 373.408,
        "min": 2.661,
        "mean": 3.09084
       },
       "NAN": {
        "duration": 4.76845e+09,
        "iterations": 1.54515e+09,
        "max": 51.016,
        "min": 2.736,
        "mean": 3.08607
       }
      }

    So it basically optimizes marginally for normal numbers while
    increasing the latency for other kind of FP.

  - The generic implementation requires getting the floating point
    status, disable the invalid operation bit, and restore the
    floating-point status.  Each operation is costly and requires
    flushing the FP pipeline.

    Using the same scenarion for the previous analysis:

      "isnan": {
       "": {
        "duration": 5.08284e+09,
        "iterations": 6.2898e+08,
        "max": 41.844,
        "min": 8.057,
        "mean": 8.08108
       },
       "INF": {
        "duration": 4.97904e+09,
        "iterations": 6.16176e+08,
        "max": 39.661,
        "min": 8.057,
        "mean": 8.08055
       },
       "NAN": {
        "duration": 4.98695e+09,
        "iterations": 5.95866e+08,
        "max": 29.728,
        "min": 8.345,
        "mean": 8.36925
       }
      }

  - The power8 implementation is just the generic implementation using
    ISA 2.07 mfvsrd instruction (which GCC uses for generic implementation).
    So generic implementation is the best option for powerpc64le.

Checked on powerpc-linux-gnu (built without --with-cpu, with
--with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch),
powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+
and --disable-multi-arch).

	* sysdeps/powerpc/fpu/s_isnan.c: Remove file.
	* sysdeps/powerpc/fpu/s_isnanf.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
	(sysdeps_routines, libm-sysdep_routines): Remove s_isnan-* and
	s_isnanf-* objects.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S:
	Remove file
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c: Likewise.
	* sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (sysdep_calls):
	Remove s_isnan-* and s_isnanf-* objects.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S:
	Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/fpu/s_isnanf.S: Likewise.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S: Likewise.

Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
2019-06-12 14:32:36 -03:00
..
e_hypot.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
e_hypotf.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
e_sqrt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
e_sqrtf.c Use float in e_sqrt.c 2019-02-11 12:03:23 -02:00
fclrexcpt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fe_mask.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fe_nomask.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fedisblxcpt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
feenablxcpt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fegetenv.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fegetexcept.c [powerpc] fegetexcept: utilize function instead of duplicating code 2019-06-05 19:38:10 -05:00
fegetmode.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fegetround.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
feholdexcpt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fenv_const.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fenv_libc.h powerpc: ceil/ceilf refactor 2019-04-29 08:43:37 -03:00
fenv_private.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fesetenv.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fesetexcept.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fesetmode.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fesetround.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
feupdateenv.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fgetexcptflg.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fix-fp-int-compare-invalid.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fraiseexcpt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fsetexcptflg.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
ftestexcept.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
get-rounding-mode.h [powerpc] get_rounding_mode: utilize faster method to get rounding mode 2019-06-06 14:11:56 -05:00
libm-test-ulps Add new exp and exp2 implementations 2018-09-05 16:22:00 +01:00
libm-test-ulps-name Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
Makefile Link extra-libs consistently with libc and ld.so. 2013-05-31 16:16:33 +00:00
math_ldbl.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
math_private.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
math-barriers.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
math-tests-trap-force.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
round_to_integer.h powerpc: consolidate rint 2019-06-12 11:46:22 -03:00
s_ceil.c powerpc: ceil/ceilf refactor 2019-04-29 08:43:37 -03:00
s_ceilf.c powerpc: ceil/ceilf refactor 2019-04-29 08:43:37 -03:00
s_copysign.c powerpc: copysign cleanup 2019-06-12 11:46:26 -03:00
s_copysignf.c powerpc: copysign cleanup 2019-06-12 11:46:26 -03:00
s_floor.c powerpc: floor/floorf refactor 2019-05-09 09:38:40 -03:00
s_floorf.c powerpc: floor/floorf refactor 2019-05-09 09:38:40 -03:00
s_fma.c powerpc: Fix format issue from 3a16dd780e 2019-04-17 18:32:01 -03:00
s_fmaf.c powerpc: Fix format issue from 3a16dd780e 2019-04-17 18:32:01 -03:00
s_lrintf.S Update. 1999-10-10 00:00:36 +00:00
s_nearbyint.c powerpc: generic nearbyint/nearbyintf 2019-05-28 18:16:48 -03:00
s_nearbyintf.c powerpc: generic nearbyint/nearbyintf 2019-05-28 18:16:48 -03:00
s_rint.c powerpc: consolidate rint 2019-06-12 11:46:22 -03:00
s_rintf.c powerpc: consolidate rint 2019-06-12 11:46:22 -03:00
s_round.c powerpc: round/roundf refactor 2019-05-09 09:39:07 -03:00
s_roundf.c powerpc: round/roundf refactor 2019-05-09 09:39:07 -03:00
s_trunc.c powerpc: trunc/truncf refactor 2019-05-09 09:39:28 -03:00
s_truncf.c powerpc: trunc/truncf refactor 2019-05-09 09:39:28 -03:00
t_sqrt.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
tst-setcontext-fpscr.c [powerpc] Use __builtin_{mffs,mtfsf} 2019-03-29 19:16:34 -05:00