Skip to content

Commit

Permalink
run: fix disabling the c extension
Browse files Browse the repository at this point in the history
This commit fixes the way that the `c` extension is disabled, i.e.
removed from the arch ISA string. Before this change, for GCC where
Zicsr and Zifencei constitute separate extensions, the following ISA
string:

  rv32imc_zicsr_zifencei_zba_zbb_zbc_zbs

Would be changed to (note incorrect `_zisr` vs correct `_zicsr`):

  rv32im_zisr_zifenei_zba_zbb_zb_zbs

Instead of the expected:

  rv32im_zicsr_zifencei_zba_zbb_zbc_zbs

Signed-off-by: Filip Kokosinski <[email protected]>
  • Loading branch information
fkokosinski committed Jul 12, 2024
1 parent f01f628 commit e560506
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,12 @@ def gcc_compile(test_list, output_dir, isa, mabi, opts, debug_cmd):
if 'gen_opts' in test:
# Disable compressed instruction
if re.search('disable_compressed_instr', test['gen_opts']):
test_isa = re.sub("c", "", test_isa)
# Note that this substitution assumes the cannonical order
# of extensions, i.e. that extensions with a preceding
# underscores will be provided after all letter extensions.
# This assumption should hold true, as this is a
# requirement enforced by e.g. gcc
test_isa = re.sub(r"(rv.+?)c", r"\1", test_isa)
# If march/mabi is not defined in the test gcc_opts, use the default
# setting from the command line.
if not re.search('march', cmd):
Expand Down

0 comments on commit e560506

Please sign in to comment.