Re: Floating point performance issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 2011-12-20 11:46:24 +0100, Marc Glisse wrote:
> you are thinking about the program flow in terms high level code. Most float
> operations simply go through the hardware and complete in equal time, but
> that doesn't include operations on denormals (numbers very close to 0) which
> are emulated and take forever to complete. Notice that -ffast-math implies
> "I don't care about that" and makes it fast.

I really don't think subnormals are emulated on x86 processors.
They may be slower (I haven't tested), but I'm quite sure that
they are implemented in hardware (x86 processors even implement
elementary functions, though not accurately).

Now, the test program is faster where the values are *closer* to 0.
This contradicts what you say about subnormals. I just think that
for small values, one gets 0 very early, and the multiplication by 0
is much faster than a generic multiplication (IIRC, for old SPARC
processors at least, this was the opposite!).

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - 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)


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux