aboutsummaryrefslogtreecommitdiff
path: root/parse.py
diff options
context:
space:
mode:
authorNyembezi Nyirongo <nyembezi.nyirongo@imgtec.com>2024-07-17 14:59:22 +0100
committerNyembezi Nyirongo <nyembezi.nyirongo@imgtec.com>2024-07-17 14:59:22 +0100
commit9a56ab24a89f5e921412a9a4acc392773db55c51 (patch)
tree32a3a92fc5c8464f81073cbf4212534d143da339 /parse.py
parent048218e19195949342636ff69f4b743da167f91f (diff)
downloadriscv-opcodes-9a56ab24a89f5e921412a9a4acc392773db55c51.zip
riscv-opcodes-9a56ab24a89f5e921412a9a4acc392773db55c51.tar.gz
riscv-opcodes-9a56ab24a89f5e921412a9a4acc392773db55c51.tar.bz2
[Fix] Fix Missing Extensions in Pseudo Instructions
- Added code to extend the extension list of a pseudo instruction in the YAML output - This ensures that all the extensions that a pseudo instruction can belong to are listed - This is in line with what happens for regular and imported instructions - No changes to all other output types
Diffstat (limited to 'parse.py')
-rwxr-xr-xparse.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/parse.py b/parse.py
index 675aa6b..ffbefff 100755
--- a/parse.py
+++ b/parse.py
@@ -336,6 +336,13 @@ def create_inst_dict(file_filter, include_pseudo=False, include_pseudo_ops=[]):
if name not in instr_dict:
instr_dict[name] = single_dict
logging.debug(f' including pseudo_ops:{name}')
+ else:
+ # if a pseudo instruction has already been added to the filtered
+ # instruction dictionary but the extension is not in the current
+ # list, add it
+ ext_name = single_dict['extension']
+ if ext_name not in instr_dict[name]['extension']:
+ instr_dict[name]['extension'].extend(ext_name)
else:
logging.debug(f' Skipping pseudo_op {pseudo_inst} since original instruction {orig_inst} already selected in list')