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

Bug#823672: ITP: sse-support -- prevent installation on processors without required support



* Peter Colberg <peter@colberg.org>, 2016-05-09, 13:33:
/* SSE2 */
#include <cpuid.h>
static int check_sse2() {
   unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;
   __get_cpuid(1, &eax, &ebx, &ecx, &edx);
   return edx & bit_SSE2 ? 1 : 0;
}

You can use __builtin_cpu_supports("sse2") instead of manually playing with CPUID.

Documentation:
https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/X86-Built-in-Functions.html

--
Jakub Wilk


Reply to: