DMD 1.034 and 2.018 releases

bearophile bearophileHUGS at lycos.com
Sat Aug 9 11:45:34 PDT 2008


Walter Bright:
> I wouldn't be a bit surprised at that since / for int[]s does not have a 
> custom asm routine for it.

I didn't know it. We may write a list about such things.
But as you can see I have performed benchmarks with + * / not just /.

It's very easy to write wrong benchmarks, so I am careful, but from the little I have seen so far the speed improvements are absent or less than 1 (slow down). And I haven't seen yet SS2 asm in my compiled programs :-)


>>Is it able to compute a+b+c with a single loop (as all Fortran compilers do)?<<

>Yes.<

But later on Reddit the answer by Walter was:

>This optimization is called "loop fusion", and is well known. It doesn't always result in a speedup, though. The dmd compiler doesn't do it, but that is not the fault of D.<

At a closer look the two questions are different, I think he meant:
a += b + c; => single loop
a += b; a += c; => two loops
I think this is acceptable.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list