This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/24518] Intrinsic MOD incorrect for large arg1/arg2 and slow.
- From: "uros at kss-loka dot si" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Oct 2006 22:22:47 -0000
- Subject: [Bug fortran/24518] Intrinsic MOD incorrect for large arg1/arg2 and slow.
- References: <bug-24518-9236@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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