MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getBrand

Function getBrand

Engine/source/platformWin32/winCPUInfo.cpp:34–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32extern void PlatformBlitInit();
33
34static void getBrand(char* brand)
35{
36 S32 extendedInfo[4];
37 __cpuid(extendedInfo, 0x80000000);
38 S32 numberExtendedIds = extendedInfo[0];
39
40 // Sets brand
41 if (numberExtendedIds >= 0x80000004)
42 {
43 int offset = 0;
44 for (int i = 0; i < 3; ++i)
45 {
46 S32 brandInfo[4];
47 __cpuidex(brandInfo, 0x80000002 + i, 0);
48
49 *reinterpret_cast<int*>(brand + offset + 0) = brandInfo[0];
50 *reinterpret_cast<int*>(brand + offset + 4) = brandInfo[1];
51 *reinterpret_cast<int*>(brand + offset + 8) = brandInfo[2];
52 *reinterpret_cast<int*>(brand + offset + 12) = brandInfo[3];
53
54 offset += sizeof(S32) * 4;
55 }
56 }
57}
58
59enum CpuFlags
60{

Callers 1

initMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected