D for the Win

Iain Buclaw via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sun Aug 24 08:16:43 PDT 2014


On 24 Aug 2014 14:09, "ketmar via Digitalmars-d-announce" <
digitalmars-d-announce at puremagic.com> wrote:
>
> On Sun, 24 Aug 2014 12:51:10 +0000
> Mike via Digitalmars-d-announce <digitalmars-d-announce at puremagic.com>
> wrote:
>
> > 5. Using C's floor instead of D's floor. - very significant (why?)
> gcc/clang inlines floorf().
>
> gdc generates calls to floor() in both cases, C floor() is just faster.
> i.e. gdc fails to see that floor() can be converted to intrinsic.
>
> the same thing with DMD i believe.

That's because floor isn't an intrinsic.  The crippling speed issue was the
fact that floor computed and returned at real precision.  On recent
(sandybridge?) CPU's, it was found that x87 does more ill than good.  So I
changed it to a template in Phobos (and did some nice tidy ups in the
process).  This will be pulled down in the 2.066 merge.

Speed improvements were discussed in the PR and in the original pnoise
thread.  Though it's very likely that a hand optimised SSE3 assembly
implementation in C's mathlib might still be faster.

Iain.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20140824/9da0eecf/attachment.html>


More information about the Digitalmars-d-announce mailing list