https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90431
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2019-05-11 Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- __builtin_cpu_supports support is in libgcc really. For x86: All it is create an access to the variable __cpu_model. Which is defined in libgcc/config/i386/cpuinfo.h . The code to initialize the variable __cpu_model is found in libgcc/config/i386/cpuinfo.c So there is nothing special about it really except the ABI is fixed though can be still extended (the last field is an array of bits). To add support for the kernel, the kernel needs to implement the same exact ABI for the variable __cpu_model. That is it. Nothing special. It is up to the Linux kernel to implement that. PowerPC implements it slightly different and there needs some support added to the compiler to support it. What target do you want to use __builtin_cpu_supports inside the kernel for?