[cfe-dev] Floating-point performance question

Richard Hadsell hadsell at blueskystudios.com
Mon Sep 9 08:49:27 PDT 2013


On 09/08/2013 05:54 PM, Renato Golin wrote:
> On 6 September 2013 21:55, Chris Lattner <clattner at apple.com <mailto:clattner at apple.com>> wrote:
>
>     IMO, if glibc's implementation of exp2 is so bad, LibCall info should get a bit to indicate this.  This could disable pow(2 -> exp2, and could enable transformations from exp2(x) -> pow(2,x).
>
>
> Maybe a cost table / cost info in LC, so that optimizers could work out if it's worth exchanging N pows for M exps, or something like that, on a target specific basis.
This may not be necessary.  I found another clue here, in section 1.1: https://sourceware.org/newlib/libm.html

When I tested the initial value of libm's |_LIB_VERSION, I found that my G++ version starts up with _IEEE_, the fastest mode (no exception handling, no warnings, ignoring errno.  The Clang++ version starts up with _POSIX_, which sets errno correctly.

I will test our code's behavior, when I set ||_LIB_VERSION to ||_IEEE_ explicitly, and I'll let you know if this explains the difference.
|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130909/98869020/attachment.html>


More information about the cfe-dev mailing list