On Saturday, 18 July 2015 at 13:16:26 UTC, Adam D. Ruppe wrote:
On Saturday, 18 July 2015 at 10:06:07 UTC, Tamas wrote:
Compile & execute:
$ dmd positive0.d; ./positive0; echo $?
$ ldc2 positive0.d; ./positive0; echo $?
Try adding the automatic optimize flags in all your cases. For
dmd, `-O -inline`. Not sure about ldc but I think it is `-O` as
well.
Thanks, indeed, after -O -inline the bodies of the two abs
functions are the same! :)
The asm code of the templated version is still longer overall,
but I think it's only some garbage that is not really executed.
(e.g some with assert and unittest in the name, although I have
none such)
Soo thank you, it's really awesome! :)