diff options
author | Pan Li <pan2.li@intel.com> | 2023-12-19 09:22:29 +0800 |
---|---|---|
committer | Christoph Müllner <christophm30@gmail.com> | 2023-12-19 09:16:42 +0100 |
commit | 8c969a9efe68a811cf524174d25255632029f3d3 (patch) | |
tree | b04383aea5dab58ec3e4bddfdf5b5dbf09a121a8 | |
parent | be49d9a9a82ad506d0cedca34bbdac3777777ae9 (diff) | |
download | riscv-gnu-toolchain-8c969a9efe68a811cf524174d25255632029f3d3.zip riscv-gnu-toolchain-8c969a9efe68a811cf524174d25255632029f3d3.tar.gz riscv-gnu-toolchain-8c969a9efe68a811cf524174d25255632029f3d3.tar.bz2 |
Address the comments.2023.12.20
Signed-off-by: Pan Li <pan2.li@intel.com>
-rwxr-xr-x | scripts/march-to-cpu-opt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/march-to-cpu-opt b/scripts/march-to-cpu-opt index 653dc49..bbf5978 100755 --- a/scripts/march-to-cpu-opt +++ b/scripts/march-to-cpu-opt @@ -147,9 +147,11 @@ def get_vlen(ext_dict): vlen = max(vlen, zvelen) return vlen -def get_elen(ext_dict): - elen = 32 +def get_elen(ext_dict, xlen): + elen = xlen + if "zve32x" in ext_dict or "zve32f" in ext_dict: + elen = 32 if "zve64x" in ext_dict or "zve64f" in ext_dict or "zve64d" in ext_dict: elen = 64 @@ -263,10 +265,12 @@ def parse_elf_file(elf_file_path): for extension in extension_dict.keys(): extensions.append(extension) + xlen = get_xlen(elf_file_path) + CPU_OPTIONS["extensions"] = extensions CPU_OPTIONS["vlen"] = get_vlen(extension_dict) - CPU_OPTIONS["elen"] = get_elen(extension_dict) - CPU_OPTIONS["xlen"] = get_xlen(elf_file_path) + CPU_OPTIONS["elen"] = get_elen(extension_dict, xlen) + CPU_OPTIONS["xlen"] = xlen def main(argv): opt = parse_opt(argv) |