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

Function GetCPUFeaturesVersion

Scripts/ClassifyCPU.py:14–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12 return True
13
14def GetCPUFeaturesVersion():
15
16 # Also LOR but kernel doesn't expose this
17 v8_1Mandatory = ["atomics", "asimdrdm", "crc32"]
18 v8_2Mandatory = v8_1Mandatory + ["dcpop"]
19 v8_3Mandatory = v8_2Mandatory + ["fcma", "jscvt", "lrcpc", "paca", "pacg"]
20 v8_4Mandatory = v8_3Mandatory + ["asimddp", "flagm", "ilrcpc", "uscat"]
21
22 # fphp asimdhp asimddp
23
24 File = open("/proc/cpuinfo", "r")
25 Lines = File.readlines()
26 File.close()
27
28 # Minimum spec is ARMv8.0
29 _ArchVersion = "8.0"
30 for Line in Lines:
31 if "Features" in Line:
32 Features = Line.split(":")[1].strip().split(" ")
33
34 # We don't care beyond 8.4 right now
35 if ListContainsRequired(Features, v8_4Mandatory):
36 _ArchVersion = "8.4"
37 elif ListContainsRequired(Features, v8_3Mandatory):
38 _ArchVersion = "8.3"
39 elif ListContainsRequired(Features, v8_2Mandatory):
40 _ArchVersion = "8.2"
41 elif ListContainsRequired(Features, v8_1Mandatory):
42 _ArchVersion = "8.1"
43 break;
44
45 return _ArchVersion
46
47def main():
48 if (platform.machine() == "aarch64"):

Callers 1

mainFunction · 0.70

Calls 1

ListContainsRequiredFunction · 0.70

Tested by

no test coverage detected