Depending on the OS you might be able to use something like Function Multiversioning in the future. I'm working on the feature right now, but it'll be a while before it's ready for use in a production compiler.
See http://gcc.gnu.org/wiki/FunctionMultiVersioning for more details.