Re: question about "x86 Built-in Functions" to detect cpu type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dennis Clarke wrote on 07/08/2018 03:44 PM:

As seen at :

     https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.html


The example there seems to suggest that I could do this :


     __builtin_cpu_init ();
     if ( __builtin_cpu_is ("corei7") ){
         fprintf ( stdout, "Intel Core i7 CPU.       \n" );
     } else {
         fprintf ( stdout, " NOT Intel Core i7 CPU.       \n" );
     }


However I get an odd result from my Debian machine here when I try to
check for every possible option :

Just guessing: are you maybe calling __builtin_cpu_init() multiple times?
Though it shouldn't make a difference, IMO.





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux