My Life in WordsAll about information and technology
|
If you want to if your compiler, such as gcc, support the advanced instruction set. For example, you want to know if SSE4.2 is supported. You can compile and run the following program. Check the include header file cpuid.h you can find more macro definition for other instruction set. #include <cpuid.h> #include <stdio.h> void main () { unsigned int eax, ebx, ecx, edx; __get_cpuid(1, &eax, &ebx, &ecx, &edx); if (ecx & bit_SSE4_2) printf ("SSE4.2 is supported\n"); return; } Reference: http://www.drdobbs.com/parallel/fast-parallelized-crc-computation-using/229401411 You can also use the command "gcc -march=native -E -v </dev/null 2>&1 | grep cc1" to check the architecture that GCC recognizes.
0 Comments
Leave a Reply. |
AuthorThis is a blog that is about my works on Benchmarking Performance, Compiling Optimization, Optimize Compile, Parallel Programming, Virtualization, Container, Docker, Moby, Linuxkit, Open Source and any others. Archives
August 2018
Categories |