MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / cpuid

Function cpuid

src/OpenColorIO/CPUInfo.cpp:49–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49static inline void cpuid(int index, int *data)
50{
51#if _MSC_VER
52 __cpuid(data, index);
53#elif OCIO_ARCH_X86_32
54 __asm__ volatile (
55 "mov %%ebx, %%esi \n\t"
56 "cpuid \n\t"
57 "xchg %%ebx, %%esi"
58 : "=a" (data[0]), "=S" (data[1]), "=c" (data[2]), "=d" (data[3])
59 : "0" (index), "2"(0));
60#else
61 __asm__ volatile (
62 "mov %%rbx, %%rsi \n\t"
63 "cpuid \n\t"
64 "xchg %%rbx, %%rsi"
65 : "=a" (data[0]), "=S" (data[1]), "=c" (data[2]), "=d" (data[3])
66 : "0" (index), "2"(0));
67#endif
68}
69
70} // anonymous namespace
71

Callers 1

CPUInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected