I'm writing a program using Intel intrinsics. I want to use _mm_permute_pd
intrinsic, which is only available on CPUs with AVX. For CPUs without AVX I can use _mm_shuffle_pd
but according to the specs it is much slower than _mm_permute_pd
. Do the header files for Intel intrinsics define constants that allow me to distinguish whether AVX is supported so that I can write sth like this:
#ifdef __IS_AVX_SUPPORTED__ // is there sth like this defined?
// use _mm_permute_pd
# else
// use _mm_shuffle_pd
#endif
? I have found this tutorial, which shows how to perform a runtime check but I need to do a static, compile-time check for the current machine.