One way to achieve what you want is to link to a dummy wrapper library that checks the processor capabilities at startup, loads the appropriate shared library, and then forwards all the function calls to their implementations in that shared library.
script. Implib.so :
$ gen-implib.py
load_mylib
( CPUID dlopen
) .