On 02/08/2011 12:11 PM, Niels Möller wrote:
What I was wondering is how would you think of implementing the cpu-specific optimizations in assembly?
If/when we do that, and if we want to be able to select which code to use at runtime (rater than compile time),
The compile time will cause problems to distributions that ship a single library across compatible architectures. Given that they will ship the version without special instructions for compatibility, most systems will not be affected by such optimizations.
I think we should use global pointers, one for each routine that can make use special instructions. Either setup automagically at first use, or at library load time (using the same mechanisms as C++ constructors).
I like the latter... An explicit global library initialization function might also do.
regards, Nikos