archspec: bump

This commit is contained in:
Harmen Stoppels 2025-05-21 11:30:30 +02:00
parent 0107792a9e
commit 8c8d54db5d
7 changed files with 759 additions and 618 deletions

View File

@ -9,8 +9,8 @@
import argparse
import typing
import _vendoring.archspec
import _vendoring.archspec.cpu
from . import __version__ as archspec_version
from .cpu import host
def _make_parser() -> argparse.ArgumentParser:
@ -24,7 +24,7 @@ def _make_parser() -> argparse.ArgumentParser:
"-V",
help="Show the version and exit.",
action="version",
version=f"archspec, version {_vendoring.archspec.__version__}",
version=f"archspec, version {archspec_version}",
)
parser.add_argument("--help", "-h", help="Show the help and exit.", action="help")
@ -45,9 +45,9 @@ def _make_parser() -> argparse.ArgumentParser:
def cpu() -> int:
"""Run the `_vendoring.archspec.cpu` subcommand."""
"""Run the `archspec cpu` subcommand."""
try:
print(_vendoring.archspec.cpu.host())
print(host())
except FileNotFoundError as exc:
print(exc)
return 1

View File

@ -6,12 +6,11 @@
import functools
import platform
import re
import sys
import warnings
from typing import IO, List, Set, Tuple
import _vendoring.archspec
import _vendoring.archspec.cpu.alias
import _vendoring.archspec.cpu.schema
from . import schema
from .alias import FEATURE_ALIASES
from .schema import LazyDictionary
@ -67,7 +66,7 @@ class Microarchitecture:
cpu_part (str): cpu part of the architecture, if relevant.
"""
# pylint: disable=too-many-arguments,too-many-instance-attributes
# pylint: disable=too-many-arguments,too-many-positional-arguments,too-many-instance-attributes
#: Aliases for micro-architecture's features
feature_aliases = FEATURE_ALIASES
@ -150,17 +149,25 @@ def __ge__(self, other):
return (self == other) or (self > other)
def __repr__(self):
cls_name = self.__class__.__name__
fmt = (
cls_name + "({0.name!r}, {0.parents!r}, {0.vendor!r}, "
"{0.features!r}, {0.compilers!r}, generation={0.generation!r}, "
"cpu_part={0.cpu_part!r})"
)
return fmt.format(self)
return f"{self.__class__.__name__}({self.name!r})"
def __str__(self):
return self.name
def tree(self, fp: IO[str] = sys.stdout, indent: int = 4) -> None:
"""Format the partial order of ancestors of this microarchitecture as a tree."""
seen: Set[str] = set()
stack: List[Tuple[int, Microarchitecture]] = [(0, self)]
while stack:
level, current = stack.pop()
print(f"{'':>{level}}{current.name}", file=fp)
if current.name in seen:
continue
for parent in reversed(current.parents):
stack.append((level + indent, parent))
def __contains__(self, feature):
# Feature must be of a string type, so be defensive about that
if not isinstance(feature, str):
@ -384,7 +391,7 @@ def fill_target_from_dict(name, data, targets):
)
known_targets = {}
data = _vendoring.archspec.cpu.schema.TARGETS_JSON["microarchitectures"]
data = schema.TARGETS_JSON["microarchitectures"]
for name in data:
if name in known_targets:
# name was already brought in as ancestor to a target

View File

@ -6,19 +6,25 @@
"features": []
},
"i686": {
"from": ["x86"],
"from": [
"x86"
],
"vendor": "GenuineIntel",
"features": []
},
"pentium2": {
"from": ["i686"],
"from": [
"i686"
],
"vendor": "GenuineIntel",
"features": [
"mmx"
]
},
"pentium3": {
"from": ["pentium2"],
"from": [
"pentium2"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -26,7 +32,9 @@
]
},
"pentium4": {
"from": ["pentium3"],
"from": [
"pentium3"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -35,7 +43,9 @@
]
},
"prescott": {
"from": ["pentium4"],
"from": [
"pentium4"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -107,7 +117,9 @@
}
},
"x86_64_v2": {
"from": ["x86_64"],
"from": [
"x86_64"
],
"vendor": "generic",
"features": [
"cx16",
@ -145,6 +157,13 @@
"flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3"
}
],
"aocc": [
{
"versions": "2.2:",
"name": "x86-64-v2",
"flags": "-march={name} -mtune=generic"
}
],
"intel": [
{
"versions": "16.0:",
@ -170,7 +189,9 @@
}
},
"x86_64_v3": {
"from": ["x86_64_v2"],
"from": [
"x86_64_v2"
],
"vendor": "generic",
"features": [
"cx16",
@ -217,6 +238,13 @@
"flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mmovbe -mxsave"
}
],
"aocc": [
{
"versions": "2.2:",
"name": "x86-64-v3",
"flags": "-march={name} -mtune=generic"
}
],
"apple-clang": [
{
"versions": "8.0:",
@ -255,7 +283,9 @@
}
},
"x86_64_v4": {
"from": ["x86_64_v3"],
"from": [
"x86_64_v3"
],
"vendor": "generic",
"features": [
"cx16",
@ -307,6 +337,13 @@
"flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mmovbe -mxsave -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl"
}
],
"aocc": [
{
"versions": "4:",
"name": "x86-64-v4",
"flags": "-march={name} -mtune=generic"
}
],
"apple-clang": [
{
"versions": "8.0:",
@ -345,7 +382,9 @@
}
},
"nocona": {
"from": ["x86_64"],
"from": [
"x86_64"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -400,7 +439,9 @@
}
},
"core2": {
"from": ["nocona"],
"from": [
"nocona"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -455,7 +496,10 @@
}
},
"nehalem": {
"from": ["core2", "x86_64_v2"],
"from": [
"core2",
"x86_64_v2"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -521,7 +565,9 @@
}
},
"westmere": {
"from": ["nehalem"],
"from": [
"nehalem"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -584,7 +630,9 @@
}
},
"sandybridge": {
"from": ["westmere"],
"from": [
"westmere"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -660,7 +708,9 @@
}
},
"ivybridge": {
"from": ["sandybridge"],
"from": [
"sandybridge"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -738,7 +788,10 @@
}
},
"haswell": {
"from": ["ivybridge", "x86_64_v3"],
"from": [
"ivybridge",
"x86_64_v3"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -821,7 +874,9 @@
}
},
"broadwell": {
"from": ["haswell"],
"from": [
"haswell"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -897,7 +952,9 @@
}
},
"skylake": {
"from": ["broadwell"],
"from": [
"broadwell"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -976,7 +1033,9 @@
}
},
"mic_knl": {
"from": ["broadwell"],
"from": [
"broadwell"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -1056,7 +1115,10 @@
}
},
"skylake_avx512": {
"from": ["skylake", "x86_64_v4"],
"from": [
"skylake",
"x86_64_v4"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -1147,7 +1209,9 @@
}
},
"cannonlake": {
"from": ["skylake"],
"from": [
"skylake"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -1234,7 +1298,9 @@
}
},
"cascadelake": {
"from": ["skylake_avx512"],
"from": [
"skylake_avx512"
],
"vendor": "GenuineIntel",
"features": [
"mmx",
@ -1483,7 +1549,10 @@
"movdir64b",
"movdiri",
"serialize",
"waitpkg"
"waitpkg",
"amx_bf16",
"amx_tile",
"amx_int8"
],
"compilers": {
"gcc": [
@ -1519,7 +1588,9 @@
}
},
"k10": {
"from": ["x86_64"],
"from": [
"x86_64"
],
"vendor": "AuthenticAMD",
"features": [
"mmx",
@ -1578,7 +1649,9 @@
}
},
"bulldozer": {
"from": ["x86_64_v2"],
"from": [
"x86_64_v2"
],
"vendor": "AuthenticAMD",
"features": [
"mmx",
@ -1648,7 +1721,9 @@
}
},
"piledriver": {
"from": ["bulldozer"],
"from": [
"bulldozer"
],
"vendor": "AuthenticAMD",
"features": [
"mmx",
@ -1722,7 +1797,9 @@
}
},
"steamroller": {
"from": ["piledriver"],
"from": [
"piledriver"
],
"vendor": "AuthenticAMD",
"features": [
"mmx",
@ -1798,7 +1875,10 @@
}
},
"excavator": {
"from": ["steamroller", "x86_64_v3"],
"from": [
"steamroller",
"x86_64_v3"
],
"vendor": "AuthenticAMD",
"features": [
"mmx",
@ -1880,7 +1960,9 @@
}
},
"zen": {
"from": ["x86_64_v3"],
"from": [
"x86_64_v3"
],
"vendor": "AuthenticAMD",
"features": [
"bmi1",
@ -1964,7 +2046,9 @@
}
},
"zen2": {
"from": ["zen"],
"from": [
"zen"
],
"vendor": "AuthenticAMD",
"features": [
"bmi1",
@ -2049,7 +2133,9 @@
}
},
"zen3": {
"from": ["zen2"],
"from": [
"zen2"
],
"vendor": "AuthenticAMD",
"features": [
"bmi1",
@ -2137,7 +2223,10 @@
}
},
"zen4": {
"from": ["zen3", "x86_64_v4"],
"from": [
"zen3",
"x86_64_v4"
],
"vendor": "AuthenticAMD",
"features": [
"bmi1",
@ -2237,7 +2326,9 @@
}
},
"zen5": {
"from": ["zen4"],
"from": [
"zen4"
],
"vendor": "AuthenticAMD",
"features": [
"abm",
@ -2335,7 +2426,9 @@
}
},
"power7": {
"from": ["ppc64"],
"from": [
"ppc64"
],
"vendor": "IBM",
"generation": 7,
"features": [],
@ -2355,7 +2448,9 @@
}
},
"power8": {
"from": ["power7"],
"from": [
"power7"
],
"vendor": "IBM",
"generation": 8,
"features": [],
@ -2380,7 +2475,9 @@
}
},
"power9": {
"from": ["power8"],
"from": [
"power8"
],
"vendor": "IBM",
"generation": 9,
"features": [],
@ -2400,7 +2497,9 @@
}
},
"power10": {
"from": ["power9"],
"from": [
"power9"
],
"vendor": "IBM",
"generation": 10,
"features": [],
@ -2441,7 +2540,9 @@
}
},
"power8le": {
"from": ["ppc64le"],
"from": [
"ppc64le"
],
"vendor": "IBM",
"generation": 8,
"features": [],
@ -2477,7 +2578,9 @@
}
},
"power9le": {
"from": ["power8le"],
"from": [
"power8le"
],
"vendor": "IBM",
"generation": 9,
"features": [],
@ -2507,7 +2610,9 @@
}
},
"power10le": {
"from": ["power9le"],
"from": [
"power9le"
],
"vendor": "IBM",
"generation": 10,
"features": [],
@ -2562,7 +2667,9 @@
}
},
"armv8.1a": {
"from": ["aarch64"],
"from": [
"aarch64"
],
"vendor": "generic",
"features": [],
"compilers": {
@ -2593,7 +2700,9 @@
}
},
"armv8.2a": {
"from": ["armv8.1a"],
"from": [
"armv8.1a"
],
"vendor": "generic",
"features": [],
"compilers": {
@ -2624,7 +2733,9 @@
}
},
"armv8.3a": {
"from": ["armv8.2a"],
"from": [
"armv8.2a"
],
"vendor": "generic",
"features": [],
"compilers": {
@ -2655,7 +2766,9 @@
}
},
"armv8.4a": {
"from": ["armv8.3a"],
"from": [
"armv8.3a"
],
"vendor": "generic",
"features": [],
"compilers": {
@ -2686,7 +2799,9 @@
}
},
"armv8.5a": {
"from": ["armv8.4a"],
"from": [
"armv8.4a"
],
"vendor": "generic",
"features": [],
"compilers": {
@ -2717,7 +2832,9 @@
}
},
"armv9.0a": {
"from": ["armv8.5a"],
"from": [
"armv8.5a"
],
"vendor": "generic",
"features": [],
"compilers": {
@ -2748,7 +2865,9 @@
}
},
"thunderx2": {
"from": ["armv8.1a"],
"from": [
"armv8.1a"
],
"vendor": "Cavium",
"features": [
"fp",
@ -2796,7 +2915,9 @@
"cpupart": "0x0af"
},
"a64fx": {
"from": ["armv8.2a"],
"from": [
"armv8.2a"
],
"vendor": "Fujitsu",
"features": [
"fp",
@ -2865,7 +2986,9 @@
"cpupart": "0x001"
},
"cortex_a72": {
"from": ["aarch64"],
"from": [
"aarch64"
],
"vendor": "ARM",
"features": [
"fp",
@ -2903,7 +3026,10 @@
"cpupart": "0xd08"
},
"neoverse_n1": {
"from": ["cortex_a72", "armv8.2a"],
"from": [
"cortex_a72",
"armv8.2a"
],
"vendor": "ARM",
"features": [
"fp",
@ -2989,7 +3115,10 @@
"cpupart": "0xd0c"
},
"neoverse_v1": {
"from": ["neoverse_n1", "armv8.4a"],
"from": [
"neoverse_n1",
"armv8.4a"
],
"vendor": "ARM",
"features": [
"fp",
@ -3072,7 +3201,6 @@
"versions": "10.3:",
"flags": "-mcpu=neoverse-v1"
}
],
"clang": [
{
@ -3113,7 +3241,10 @@
"cpupart": "0xd40"
},
"neoverse_v2": {
"from": ["neoverse_n1", "armv9.0a"],
"from": [
"neoverse_n1",
"armv9.0a"
],
"vendor": "ARM",
"features": [
"fp",
@ -3225,7 +3356,10 @@
"cpupart": "0xd4f"
},
"neoverse_n2": {
"from": ["neoverse_n1", "armv9.0a"],
"from": [
"neoverse_n1",
"armv9.0a"
],
"vendor": "ARM",
"features": [
"fp",
@ -3329,7 +3463,9 @@
"cpupart": "0xd49"
},
"m1": {
"from": ["armv8.4a"],
"from": [
"armv8.4a"
],
"vendor": "Apple",
"features": [
"fp",
@ -3396,7 +3532,10 @@
"cpupart": "0x022"
},
"m2": {
"from": ["m1", "armv8.5a"],
"from": [
"m1",
"armv8.5a"
],
"vendor": "Apple",
"features": [
"fp",
@ -3492,29 +3631,25 @@
"from": [],
"vendor": "generic",
"features": [],
"compilers": {
}
"compilers": {}
},
"ppcle": {
"from": [],
"vendor": "generic",
"features": [],
"compilers": {
}
"compilers": {}
},
"sparc": {
"from": [],
"vendor": "generic",
"features": [],
"compilers": {
}
"compilers": {}
},
"sparc64": {
"from": [],
"vendor": "generic",
"features": [],
"compilers": {
}
"compilers": {}
},
"riscv64": {
"from": [],
@ -3536,7 +3671,9 @@
}
},
"u74mc": {
"from": ["riscv64"],
"from": [
"riscv64"
],
"vendor": "SiFive",
"features": [],
"compilers": {

View File

@ -9,4 +9,4 @@ macholib==1.16.2
altgraph==0.17.3
ruamel.yaml==0.17.21
typing_extensions==4.1.1
archspec @ git+https://github.com/archspec/archspec.git@38ce485258ffc4fc6dd6688f8dc90cb269478c47
archspec @ git+https://github.com/archspec/archspec.git@77f3f81df3dd80b7e538e2e41bc4485fbec2dbaa

View File

@ -260,9 +260,6 @@ substitute = [
{ match = "from attr", replace = "from _vendoring.attr" },
{ match = "import jsonschema", replace = "import _vendoring.jsonschema" },
{ match = "from jsonschema", replace = "from _vendoring.jsonschema" },
{ match = "archspec.cpu", replace = "_vendoring.archspec.cpu" },
{ match = "archspec.__version__", replace = "_vendoring.archspec.__version__" },
{ match = "import archspec", replace = "import _vendoring.archspec" },
]
drop = [
# contains unnecessary scripts