MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / Function_01h

Method Function_01h

FEXCore/Source/Interface/Core/CPUID.cpp:419–498  ·  view source on GitHub ↗

Processor Info and Features bits

Source from the content-addressed store, hash-verified

417
418// Processor Info and Features bits
419FEXCore::CPUID::FunctionResults CPUIDEmu::Function_01h(uint32_t Leaf) const {
420 FEXCore::CPUID::FunctionResults Res {};
421
422 // Hypervisor bit is normally set but some applications have issues with it.
423 uint32_t Hypervisor = HideHypervisorBit() ? 0 : 1;
424
425 Res.eax = FAMILY_IDENTIFIER;
426
427 Res.ebx = 0 | // Brand index
428 (8 << 8) | // Cache line size in bytes
429 (Cores << 16) | // Number of addressable IDs for the logical cores in the physical CPU
430 (0 << 24); // Local APIC ID
431
432 Res.ecx = (1 << 0) | // SSE3
433 (CTX->HostFeatures.SupportsPMULL_128Bit << 1) | // PCLMULQDQ
434 (1 << 2) | // DS area supports 64bit layout
435 (1 << 3) | // MWait
436 (0 << 4) | // DS-CPL
437 (0 << 5) | // VMX
438 (0 << 6) | // SMX
439 (0 << 7) | // Intel SpeedStep
440 (1 << 8) | // Thermal Monitor 2
441 (1 << 9) | // SSSE3
442 (0 << 10) | // L1 context ID
443 (0 << 11) | // Silicon debug
444 (SupportsAVX() << 12) | // FMA3
445 (1 << 13) | // CMPXCHG16B
446 (0 << 14) | // xTPR update control
447 (0 << 15) | // Perfmon and debug capability
448 (0 << 16) | // Reserved
449 (0 << 17) | // Process-context identifiers
450 (0 << 18) | // Prefetching from memory mapped device
451 (1 << 19) | // SSE4.1
452 (CTX->HostFeatures.SupportsCRC << 20) | // SSE4.2
453 (0 << 21) | // X2APIC
454 (1 << 22) | // MOVBE
455 (1 << 23) | // POPCNT
456 (0 << 24) | // APIC TSC-Deadline
457 (CTX->HostFeatures.SupportsAES << 25) | // AES
458 (SupportsAVX() << 26) | // XSAVE
459 (SupportsAVX() << 27) | // OSXSAVE
460 (SupportsAVX() << 28) | // AVX
461 (SupportsAVX() << 29) | // F16C
462 (CTX->HostFeatures.SupportsRAND << 30) | // RDRAND
463 (Hypervisor << 31);
464
465 Res.edx = (1 << 0) | // FPU
466 (1 << 1) | // Virtual 8086 mode enhancements
467 (0 << 2) | // Debugging extensions
468 (0 << 3) | // Page size extension
469 (1 << 4) | // RDTSC supported
470 (1 << 5) | // MSR supported
471 (1 << 6) | // PAE
472 (1 << 7) | // Machine Check exception
473 (1 << 8) | // CMPXCHG8B
474 (1 << 9) | // APIC on-chip
475 (0 << 10) | // Reserved
476 (1 << 11) | // SYSENTER/SYSEXIT

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected