Update multilib-gen-gen for GCC14 extensions: Zicond, Zcmp, Zcb. Hopefully handle the Zca vs C thing gracefully.
This commit is contained in:
parent
7430523c45
commit
b883be3c20
|
@ -1,13 +1,14 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Generate a multilib configure line for riscv-gnu-toolchain with all useful
|
# Generate a multilib configure line for riscv-gnu-toolchain with useful
|
||||||
# combinations of extensions supported by both Hazard3 and mainline GCC
|
# combinations of extensions supported by both Hazard3 and mainline GCC
|
||||||
# (currently GCC 13.2). Use as:
|
# (currently GCC 14). Use as:
|
||||||
# ./configure ... --with-multilib-generator="$(path/to/multilib-gen-gen.py)"
|
# ./configure ... --with-multilib-generator="$(path/to/multilib-gen-gen.py)"
|
||||||
|
|
||||||
base = "rv32i"
|
base = "rv32i"
|
||||||
abi = "-ilp32--"
|
abi = "-ilp32--"
|
||||||
options = [
|
options = [
|
||||||
|
# GCC13+:
|
||||||
"m",
|
"m",
|
||||||
"a",
|
"a",
|
||||||
"c",
|
"c",
|
||||||
|
@ -17,19 +18,29 @@ options = [
|
||||||
"zbb",
|
"zbb",
|
||||||
"zbc",
|
"zbc",
|
||||||
"zbs",
|
"zbs",
|
||||||
"zbkb"
|
"zbkb",
|
||||||
|
# GCC14 only:
|
||||||
|
"zicond",
|
||||||
|
"zca",
|
||||||
|
"zcb",
|
||||||
|
"zcmp"
|
||||||
]
|
]
|
||||||
|
|
||||||
# The relationship here is: do not build for LHS except when *all of* RHS is
|
# Do not build for LHS except when *all of* RHS is also present. This cuts
|
||||||
# also present. This cuts down on the number of configurations whilst
|
# down on the number of configurations. A leading "!" means antidependency,
|
||||||
# hopefully preserving ones that are useful for Hazard3 development.
|
# i.e. an incompatibility.
|
||||||
depends_on = {
|
depends_on = {
|
||||||
"zbb": ["m" ],
|
"zbb": ["m", "zba", "zbs" ],
|
||||||
"zba": ["m" ],
|
"zba": ["m", "zbb", "zbs" ],
|
||||||
|
"zbs": ["m", "zba", "zbb" ],
|
||||||
"zbkb": ["zbb" ],
|
"zbkb": ["zbb" ],
|
||||||
"zbs": ["zbb", ],
|
"zbc": ["zba", "zbb", "zbs", "zbkb"],
|
||||||
"zbc": ["zba", "zbb", "zbs"],
|
"zicond": ["zba", "zbb", "zbs" ],
|
||||||
"zifencei": ["zicsr" ],
|
"zifencei": ["zicsr" ],
|
||||||
|
"c": ["!zca" ],
|
||||||
|
"zca": ["!c" ],
|
||||||
|
"zcb": ["zca" ],
|
||||||
|
"zcmp": ["zca", "zcb", ],
|
||||||
}
|
}
|
||||||
|
|
||||||
l = []
|
l = []
|
||||||
|
@ -40,7 +51,9 @@ for i in range(2 ** len(options)):
|
||||||
opt = options[j]
|
opt = options[j]
|
||||||
if opt in depends_on:
|
if opt in depends_on:
|
||||||
for dep in depends_on[opt]:
|
for dep in depends_on[opt]:
|
||||||
if not (i & (1 << options.index(dep))):
|
inverted_dep = dep.startswith("!")
|
||||||
|
if inverted_dep: dep = dep[1:]
|
||||||
|
if inverted_dep == bool(i & (1 << options.index(dep))):
|
||||||
violates_dependencies = True
|
violates_dependencies = True
|
||||||
break
|
break
|
||||||
if violates_dependencies:
|
if violates_dependencies:
|
||||||
|
|
Loading…
Reference in New Issue