This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Undocumented parameters for __builtin_cpu_supports()?
- From: Martin Liška <mliska at suse dot cz>
- To: Martin Reinecke <martin at MPA-Garching dot MPG dot DE>, gcc at gcc dot gnu dot org
- Date: Tue, 6 Nov 2018 13:52:09 +0100
- Subject: Re: Undocumented parameters for __builtin_cpu_supports()?
- References: <0e524664-19fe-7d49-5b52-935e325f6f78@mpa-garching.mpg.de>
On 11/6/18 1:35 PM, Martin Reinecke wrote:
> Compiling and running the following code on a CPU with BMI2 support
> prints "BMI2 detected" as one would expect:
>
> #include <stdio.h>
>
> int main(void)
> {
> if (__builtin_cpu_supports("bmi2"))
> printf("BMI2 detected\n");
> return 0;
> }
>
> However, "bmi2" is not documented in the list of arguments at
> https://gcc.gnu.org/onlinedocs/gcc-8.2.0/gcc/x86-Built-in-Functions.html#x86-Built-in-Functions
Hi.
Thanks for reporting that. Yes, it's missing.
>
> Is this list supposed to be complete? If yes, I can open a PR. If not,
> is there any other way to obtain the full list of allowed parameters?
If I see correctly, not.
I filed a PR for it:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87903
for which I'll prepare a patch.
Martin
>
> Cheers,
> Martin
>