diff options
| author | Taylor Simpson <ltaylorsimpson@gmail.com> | 2024-03-06 20:23:20 -0700 |
|---|---|---|
| committer | Brian Cain <bcain@quicinc.com> | 2024-05-05 16:22:07 -0700 |
| commit | 9196381993a3fd365fd47fe056754ff550a3b67d (patch) | |
| tree | 05d7a632473a1c6b345977a3900194993759f5d4 /target/hexagon/gen_trans_funcs.py | |
| parent | 2720bd1dbd390da8bfbbc84c9293433c82dda88b (diff) | |
| download | focaccia-qemu-9196381993a3fd365fd47fe056754ff550a3b67d.tar.gz focaccia-qemu-9196381993a3fd365fd47fe056754ff550a3b67d.zip | |
Hexagon (target/hexagon) Mark new_read_idx in trans functions
Check that the value matches opcode_reginfo Signed-off-by: Taylor Simpson <ltaylorsimpson@gmail.com> Reviewed-by: Brian Cain <bcain@quicinc.com> Message-Id: <20240307032327.4799-3-ltaylorsimpson@gmail.com> Signed-off-by: Brian Cain <bcain@quicinc.com>
Diffstat (limited to 'target/hexagon/gen_trans_funcs.py')
| -rwxr-xr-x | target/hexagon/gen_trans_funcs.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/target/hexagon/gen_trans_funcs.py b/target/hexagon/gen_trans_funcs.py index 53e844a44b..8acecdb993 100755 --- a/target/hexagon/gen_trans_funcs.py +++ b/target/hexagon/gen_trans_funcs.py @@ -68,6 +68,7 @@ def mark_which_imm_extended(f, tag): ## insn->regno[0] = args->Rd; ## insn->regno[1] = args->Rs; ## insn->regno[2] = args->Rt; +## insn->new_read_idx = -1; ## return true; ## } ## @@ -84,14 +85,14 @@ def gen_trans_funcs(f): insn->opcode = {tag}; """)) - regno = 0 - for reg in regs: - reg_type = reg[0] - reg_id = reg[1] + new_read_idx = -1 + for regno, (reg_type, reg_id, *_) in enumerate(regs): + reg = hex_common.get_register(tag, reg_type, reg_id) f.write(code_fmt(f"""\ insn->regno[{regno}] = args->{reg_type}{reg_id}; """)) - regno += 1 + if reg.is_read() and reg.is_new(): + new_read_idx = regno if len(imms) != 0: mark_which_imm_extended(f, tag) @@ -112,6 +113,9 @@ def gen_trans_funcs(f): insn->immed[{immno}] = args->{imm_type}{imm_letter}; """)) + f.write(code_fmt(f"""\ + insn->new_read_idx = {new_read_idx}; + """)) f.write(textwrap.dedent(f"""\ return true; {close_curly} @@ -120,5 +124,6 @@ def gen_trans_funcs(f): if __name__ == "__main__": hex_common.read_semantics_file(sys.argv[1]) + hex_common.init_registers() with open(sys.argv[2], "w") as f: gen_trans_funcs(f) |