Good dotProduct

bearophile bearophileHUGS at lycos.com
Fri Jun 25 15:27:15 PDT 2010


I have added to Bugzilla a small enhancement request for Phobos:
http://d.puremagic.com/issues/show_bug.cgi?id=4393

In my opinion this can be a critical operation, so it deserves care as much as the array ops. Re-implementing this many times is bad, better to implement it well and put it in Phobos (as a specialization of std.numeric.dotProduct). I am now able to write some working SSE* code, but I am not expert yet. So if someone is willing to write it (or even offer it, if already written), I think Andrei will be willing to add it to the std.numeric module.

std.numeric.dotProduct looks almost as efficient as D code gets. So what I'd like added to Phobos are three (or six) efficient asm routines:
- dotProduct among two dynamic arrays of doubles (optionally floats too, if you want).
- Optionally dotProduct among two double[3] and two double[4] (optionally floats too, if you want) (later this code can be moved inside a small vect struct).

Bye and thank you,
bearophile


More information about the Digitalmars-d mailing list