This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/24518] Intrinsic MOD incorrect for large arg1/arg2 and slow.



------- Comment #13 from uros at kss-loka dot si  2006-10-26 22:22 -------
Just some performance numbers (sorry for the C testcase...) on x86_64:
--cut here--
#include <math.h>
#include <stdio.h>

int main()
{
  double x;
  double t = 0.0;

  for (x = 10000000.0; x > 0.0; x -= 1.0)
    t += fmod (x, 1.7e-8);

  printf("%f\n", t);

  return 0;
}
--cut here--

[uros@localhost x86_64-test]$ gcc -march=k8 -O2 -lm mod.c
[uros@localhost x86_64-test]$ time ./a.out
0.089927

real    0m4.304s
user    0m4.294s
sys     0m0.009s
[uros@localhost x86_64-test]$ gcc -march=k8 -O2 -lm -mfpmath=387 mod.c
[uros@localhost x86_64-test]$ time ./a.out
0.089927

real    0m0.351s
user    0m0.349s
sys     0m0.002s

I know that this measurement depends on the library implementation, but this is
current situation, where above tests shows that intrinsic MOD is 12.3 _times_
faster.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24518


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]