[Bug other/90431] support __builtin_cpu_supports() in Linux kernel code

2021-05-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90431

Andrew Pinski  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Andrew Pinski  ---
No feedback on what I mentioned so closing as won't fix.
Also libgcc is reimplemented by the kernel IIRC.

[Bug other/90431] support __builtin_cpu_supports() in Linux kernel code

2019-05-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90431

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2019-05-11
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
__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?