# Infer arch from --with-arch, --target, and --with-abi.
case "${with_arch}" in
- rv32e* | rv32i* | rv32g* | rv64e* | rv64i* | rv64g*)
+ rv32e* | rv32i* | rv32g* | rv64e* | rv64i* | rv64g* \
+ | rvi20* | rva20* | rva22* | rva23* | rvb23*)
# OK.
;;
"")
esac
;;
*)
- echo "--with-arch=${with_arch} is not supported. The argument must begin with rv32e, rv32i, rv32g, rv64e, rv64i, or rv64g." 1>&2
+ echo "--with-arch=${with_arch} is not supported. The argument must begin with rv32e, rv32i, rv32g, rv64e, rv64i, rv64g, or a profile." 1>&2
exit 1
;;
esac
ilp32,rv32* | ilp32e,rv32e* \
| ilp32f,rv32*f* | ilp32f,rv32g* \
| ilp32d,rv32*d* | ilp32d,rv32g* \
+ | ilp32,rvi20u32* | ilp32f,rvi20u32* \
+ | ilp32d,rvi20u32* \
| lp64,rv64* | lp64e,rv64e* \
| lp64f,rv64*f* | lp64f,rv64g* \
- | lp64d,rv64*d* | lp64d,rv64g*)
+ | lp64d,rv64*d* | lp64d,rv64g* \
+ | lp64,rvi20u64* | lp64f,rvi20u64* \
+ | lp64d,rva20u64* | lp64d,rva22u64* \
+ | lp64d,rva23u64* | lp64d,rva23s64* \
+ | lp64d,rvb23u64* | lp64d,rvb23s64)
;;
*)
echo "--with-abi=${with_abi} is not supported for ISA ${with_arch}" 1>&2
#
IMPLIED_EXT = parse_def_files()
+def load_profiles():
+ profiles = set()
+ def_path = os.path.join(os.path.dirname(__file__), "riscv-profiles.def")
+ with open(def_path) as f:
+ for line in f:
+ line = line.strip()
+ if line.startswith("RISCV_PROFILE"):
+ # Format: RISCV_PROFILE("rva20u64", "rv64imafd...")
+ parts = line.split('"')
+ if len(parts) >= 2:
+ profiles.add(parts[1]) # Compare PROFILE_NAME
+ return profiles
+
+SUPPORTED_PROFILES = load_profiles()
+
+def is_profile_arch(arch):
+ return arch in SUPPORTED_PROFILES
+
def arch_canonicalize(arch, isa_spec):
# TODO: Support extension version.
is_isa_spec_2p2 = isa_spec == '2.2'
sys.exit(run_unit_tests())
elif args.arch_strs:
for arch in args.arch_strs:
- print (arch_canonicalize(arch, args.misa_spec))
+ if is_profile_arch(arch):
+ print(arch)
+ else:
+ print(arch_canonicalize(arch, args.misa_spec))
else:
parser.print_help()
sys.exit(1)