math: Use sign as double for reduced case in sinf
commit94d80dfc7349b3545942fbbb1d5ff05f354afdf8
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 5 Dec 2017 17:27:03 +0000 (5 15:27 -0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 5 Dec 2017 18:27:44 +0000 (5 16:27 -0200)
tree07984816a08b1592f3a765cc211752fd2a7d3598
parent00d54af7c86cdcabc18c00619c229f49f4978610
math: Use sign as double for reduced case in sinf

This patch avoid an extra floating point to integer conversion in
reduced internal function for generic sinf by defining the sign as
double instead of integers.

There is no much difference on Haswell with GCC 7.2.1:

           Before        After
min          9.11        9.108
mean       21.982      21.9224

However H.J. Lu reported gains on Skylake:

Before:

  "sinf": {
   "": {
    "duration": 3.4044e+10,
    "iterations": 1.9942e+09,
    "max": 141.106,
    "min": 7.704,
    "mean": 17.0715
   }
  }

After:

  "sinf": {
   "": {
    "duration": 3.40665e+10,
    "iterations": 2.03199e+09,
    "max": 95.994,
    "min": 7.704,
    "mean": 16.765
   }
  }

Checked on x86_64-linux-gnu.

* sysdeps/ieee754/flt-32/s_sinf.c (ones): Define as double.
(reduced): Use ones as double instead of integer.
ChangeLog
sysdeps/ieee754/flt-32/s_sinf.c