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

Function GetCPUFeaturesVersion

Scripts/InstallFEX.py:99–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97 return True
98
99def GetCPUFeaturesVersion():
100 global _ArchVersion
101
102 # Also LOR but kernel doesn't expose this
103 v8_1Mandatory = ["atomics", "asimdrdm", "crc32"]
104 v8_2Mandatory = v8_1Mandatory + ["dcpop"]
105 v8_3Mandatory = v8_2Mandatory + ["fcma", "jscvt", "lrcpc", "paca", "pacg"]
106 v8_4Mandatory = v8_3Mandatory + ["asimddp", "flagm", "ilrcpc", "uscat"]
107
108 # fphp asimdhp asimddp
109
110 if _ArchVersion == None:
111 File = open("/proc/cpuinfo", "r")
112 Lines = File.readlines()
113 File.close()
114
115 # Minimum spec is ARMv8.0
116 _ArchVersion = "8.0"
117 for Line in Lines:
118 if "Features" in Line:
119 Features = Line.split(":")[1].strip().split(" ")
120
121 # We don't care beyond 8.4 right now
122 if ListContainsRequired(Features, v8_4Mandatory):
123 _ArchVersion = "8.4"
124 elif ListContainsRequired(Features, v8_3Mandatory):
125 _ArchVersion = "8.3"
126 elif ListContainsRequired(Features, v8_2Mandatory):
127 _ArchVersion = "8.2"
128 elif ListContainsRequired(Features, v8_1Mandatory):
129 _ArchVersion = "8.1"
130 break;
131
132 return _ArchVersion
133
134_PPAInstalled = None
135FEXPPA_REGEX = r".*\/fex-emu\/fex\/ubuntu$"

Callers 1

GetPackagesToInstallFunction · 0.70

Calls 1

ListContainsRequiredFunction · 0.70

Tested by

no test coverage detected