| 48 | }; |
| 49 | |
| 50 | FEXCore::HostFeatures CPUFeatures::FetchHostFeatures(bool IsWine) { |
| 51 | HKEY Key = OpenProcessorKey(0); |
| 52 | if (!Key) { |
| 53 | ERROR_AND_DIE_FMT("Couldn't detect CPU features"); |
| 54 | } |
| 55 | |
| 56 | CPUFeaturesFromRegistry Features(Key); |
| 57 | |
| 58 | uint64_t CTR = ReadRegU64(Key, "CP 5801"); |
| 59 | uint64_t MIDR = ReadRegU64(Key, "CP 4000"); |
| 60 | |
| 61 | |
| 62 | auto HostFeatures = FEX::FetchHostFeatures(Features, !IsWine, CTR, MIDR); |
| 63 | |
| 64 | // Force-disable SVE until wine/windows gain support for SVE context save/restore |
| 65 | HostFeatures.SupportsSVE128 = false; |
| 66 | HostFeatures.SupportsSVE256 = false; |
| 67 | |
| 68 | for (uint32_t Idx = 0; Key; Key = OpenProcessorKey(++Idx)) { |
| 69 | // Truncate to 32-bits, top 32-bits are all reserved in MIDR |
| 70 | HostFeatures.CPUMIDRs.push_back(static_cast<uint32_t>(ReadRegU64(Key, "CP 4000"))); |
| 71 | RegCloseKey(Key); |
| 72 | } |
| 73 | |
| 74 | HostFeatures.SupportsCPUIndexInTPIDRRO = !IsWine; |
| 75 | return HostFeatures; |
| 76 | } |
| 77 | |
| 78 | CPUFeatures::CPUFeatures(FEXCore::Context::Context& CTX) { |
| 79 | #ifdef _M_ARM_64EC |
nothing calls this directly
no test coverage detected