arch-specific template code

Ulrich Drepper drepper@gmail.com
Mon Aug 27 14:28:00 GMT 2012


The next question is how to to implement arch-specific optimizations
to template code.

Obviously, these headers have to be multilib aware and therefore
handle, e.g., x86, x86-64, and perhaps x32 concurrently.  But having
code for unrelated architectures in the same file would probably be
rather distracting.

There will likely be two different situations:
- entire functions are replaced
- specializations are provided

The former probably will require constructs of the form

  #ifndef _SOME_FUNCTION_defined
  ...
  #endif

Should these files go into libstdc++-v3/config/cpu ?

Aside from <random> there will be a few more headers which can benefit
from such optimizations.

Any opinions?



More information about the Libstdc++ mailing list