On Thursday, 30 January 2014 at 16:53:22 UTC, bearophile wrote:
Yes. The older version of LDC2 doesn't even compile the code. I need to use 0.13.0-alpha1.
Hmm.
Your D code with small changes: http://codepad.org/xqqScd42
That won't compile with dmd (at least, with 2.064.2): it expects constants as initializers for vectors. :( That's why I rolled up that toDouble2() function.
With N = 5_000_000 my timings on an old CPU are 2.23 seconds for ldc2 and 1.83 seconds for g++. So there's some performance difference.
What about 50_000_000?
I have tried to unroll manually the loop in the D code, but I see worse performance. I'll try some more later.
I'm also fiddling :)