On 11/01/2018 03:44, Roland Schulz wrote: > Is it possible to have a "if constexpr" inside a __target_clones__ > multiversioned function to have certain parts of the function depend > on the target? Outside of multiversioned function one normally would > use preprocessor defines to query the SIMD support (e.g. __AVX__). > But this doesn't work inside target_clones given that preprocessor > variables don't depend on the target. __builtin_cpu_supports doesn't > work because it isn't constexpr (and is meant for runtime detection). > One could extract the target specific part into its own function > (using target rather than target_clones attribute) but that doesn't > work with different types. Is there some other way to query the > target which does work inside a multiversioned function? I've CCed a few people involved in function multi-versioning. Also, Billy O'Mahony used to work on FMV. The following article might be interesting to you: https://lwn.net/Articles/691932/ Regards.