Floating point performance issue

Vincent Lefevre vincent+gcc@vinc17.org
Tue Dec 20 12:00:00 GMT 2011


On 2011-12-20 12:16:34 +0100, Vincent Lefevre wrote:
> Now, the test program is faster where the values are *closer* to 0.
> This contradicts what you say about subnormals.

Actually, after thinking a bit more about it, there are also more
operations on the subnormals in the case 0.9, so that the subnormals
could also be a problem, and indeed:

ypig:~> time ./a.out 0.9999999
./a.out 0.9999999  0.10s user 0.00s system 92% cpu 0.108 total

ypig:~> time ./a.out 0.9
./a.out 0.9  2.93s user 0.00s system 98% cpu 2.987 total

ypig:~> time ./a.out 0.1
./a.out 0.1  0.10s user 0.00s system 86% cpu 0.116 total

The fact that only the second case is slower tends to indicate that
the problem is the subnormals (whether they are implemented in
software and in hardware).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)



More information about the Gcc-help mailing list