25# if defined(__x86_64__)
26 asm(
"cpuid" :
"=a"(data[0]),
"=b"(data[1]),
"=c"(data[2]),
"=d"(data[3]) :
"a"(selector));
29 data[0] = data[1] = data[2] = data[3] = 0;
42 return (result[2] & (
int(1) << 20)) != 0;
49 static char buf[49] = {0};
52 if (result[0] >=
int(0x80000004)) {
53 __cpuid((
int *)(buf + 0), 0x80000002);
54 __cpuid((
int *)(buf + 16), 0x80000003);
55 __cpuid((
int *)(buf + 32), 0x80000004);
56 const char *buf_ptr = buf;
58 while (*buf_ptr ==
' ') {
67extern "C" __declspec(dllexport)
void cpu_check_win32()
71 std::string error_title =
"Unsupported CPU - " + std::string(
cpu_brand_string());
73 "Blender requires a CPU with SSE42 support.",
75 MB_OK | MB_ICONERROR);
81BOOL WINAPI DllMain(HINSTANCE , DWORD fdwReason, LPVOID )
84 case DLL_PROCESS_ATTACH:
99 "\nBlender requires a CPU with SSE42 support.";
__declspec(dllexport) DWORD NvOptimusEnablement=0x00000001
static const char * cpu_brand_string()
static __attribute__((constructor)) void cpu_check()
static int cpu_supports_sse42()
static void __cpuid(int data[4], int selector)
static void error(const char *str)