27# if defined(__x86_64__)
28 asm(
"cpuid" :
"=a"(
data[0]),
"=b"(
data[1]),
"=c"(
data[2]),
"=d"(
data[3]) :
"a"(selector));
44 return (
result[2] & (
int(1) << 20)) != 0;
51 static char buf[49] = {0};
54 if (
result[0] >=
int(0x80000004)) {
55 __cpuid(
reinterpret_cast<int *
>(buf + 0), 0x80000002);
56 __cpuid(
reinterpret_cast<int *
>(buf + 16), 0x80000003);
57 __cpuid(
reinterpret_cast<int *
>(buf + 32), 0x80000004);
58 const char *buf_ptr = buf;
60 while (*buf_ptr ==
' ') {
69extern "C" __declspec(dllexport)
void cpu_check_win32()
73 std::string error_title =
"Unsupported CPU - " + std::string(
cpu_brand_string());
75 "Blender requires a CPU with SSE42 support.",
77 MB_OK | MB_ICONERROR);
83extern "C" BOOL WINAPI DllMain(HINSTANCE , DWORD fdwReason, LPVOID )
86 case DLL_PROCESS_ATTACH:
__declspec(dllexport) DWORD NvOptimusEnablement=0x00000001
struct AtomicSpinLock __attribute__((aligned(32))) AtomicSpinLock
static int cpu_supports_sse42()
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const size_t num
static const char * cpu_brand_string()
static void __cpuid(int data[4], int selector)