diff options
Diffstat (limited to 'target/hexagon/gen_decodetree.py')
| -rwxr-xr-x | target/hexagon/gen_decodetree.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/target/hexagon/gen_decodetree.py b/target/hexagon/gen_decodetree.py index 9634554142..a4fcd622c5 100755 --- a/target/hexagon/gen_decodetree.py +++ b/target/hexagon/gen_decodetree.py @@ -96,8 +96,10 @@ def skip_tag(tag, class_to_decode): ## A2_add ..................-.....---..... @A2_add ## def gen_decodetree_file(f, class_to_decode): + is_subinsn = class_to_decode.startswith("SUBINSN_") f.write(f"## DO NOT MODIFY - This file is generated by {sys.argv[0]}\n\n") - f.write("%PP\t14:2\n\n") + if not is_subinsn: + f.write("%PP\t14:2\n\n") for tag in sorted(encs.keys(), key=iset.tags.index): if skip_tag(tag, class_to_decode): continue @@ -108,6 +110,10 @@ def gen_decodetree_file(f, class_to_decode): f"## {tag}:\t{enc_str}\n" "##\n") + # The subinstructions come with a 13-bit encoding, but + # decodetree.py needs 16 bits + if is_subinsn: + enc_str = "---" + enc_str regs = ordered_unique(regre.findall(iset.iset[tag]["syntax"])) imms = ordered_unique(immre.findall(iset.iset[tag]["syntax"])) @@ -174,7 +180,9 @@ def gen_decodetree_file(f, class_to_decode): imm_letter = "i" if imm_type.islower() else "I" f.write(f" {imm_type}{imm_letter}=%{tag}_{imm_type}{imm_letter}") - f.write(" %PP\n") + if not is_subinsn: + f.write(" %PP") + f.write("\n") # Replace the 0s and 1s with . enc_str = enc_str.replace("0", ".").replace("1", ".") |