On Fri, Dec 09, 2022 at 10:18:34AM +0100, Martin Liška wrote: > I'm going to push the revision. > > What exactly do you mean by random? I just know there are differences in > between > x86 and ppc: > > int __builtin_cpu_supports(const char *feature) > This function returns a positive integer if the run-time CPU supports feature > and returns 0 otherwise. > > This function returns a value of 1 if the run-time CPU supports the HWCAP > feature feature and returns 0 otherwise.
Because x86-64-v2 etc. isn't a HWCAP feature, but rather an architecture (or set of canned HWCAP features). So __builtin_cpu_is for those, or especially for __builtin_cpu_is ("x86-64") would make more sense. Though I see that many of the valid -march= values actually aren't supported by __builtin_cpu_is either, whether it is pentium, nocona, lakemont etc. but does support say some vendors (intel, amd). Jakub