I think it may be best to create global variables or global bit mask then write a CPU specific filter. Use your own CPUID (or one you trust) to poll the system for supported features.
Then wse a functor to dispatch to your functions.
Initialize the functor foreach function to point to a platform determination filter
typedef void void_fn_void();
void_fn_void* foo = fooSelect;
foo = fooAVX();
foo = fooSSE4_1();
foo = fooMMX();
foo(); // 1st time calls fooSelect()
foo(); // remainder calls to appropriate foo without feature filtering
It will mean some work onyour part,at least until the compiler writers convert from "which processor" to "which feature".
Maybe you need to push for
__declspec(feature_specific(SSE3)) // ...
Is there a simple Header which have functions like 'hasSSE4()', 'hasAVX()', 'hasAVX2()', etc?
Header which is portable (Windows, macOS, Linux)?