From 3608c2419c95e7477dd282bb1268c78029501df8 Mon Sep 17 00:00:00 2001 From: Matheus Tavares Bernardino Date: Wed, 24 May 2023 11:41:47 -0300 Subject: target/hexagon/*.py: clean up used 'toss' and 'numregs' vars Many Hexagon python scripts call hex_common.get_tagregs(), but only one call site use the full reg structure given by this function. To make the code cleaner, let's make get_tagregs() filter out the unused fields (i.e. 'toss' and 'numregs'), properly removed the unused variables at the call sites. The hex_common.bad_register() function is also adjusted to work exclusively with 'regtype' and 'regid' args. For the single call site that does use toss/numregs, we provide an optional parameter to get_tagregs() which will restore the old full behavior. Suggested-by: Taylor Simpson Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Taylor Simpson Tested-by: Taylor Simpson Signed-off-by: Taylor Simpson Message-Id: <3ffd4ccb972879f57f499705c624e8eaba7f8b52.1684939078.git.quic_mathbern@quicinc.com> --- target/hexagon/gen_idef_parser_funcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'target/hexagon/gen_idef_parser_funcs.py') diff --git a/target/hexagon/gen_idef_parser_funcs.py b/target/hexagon/gen_idef_parser_funcs.py index 29160fcb1d..f4518e653f 100644 --- a/target/hexagon/gen_idef_parser_funcs.py +++ b/target/hexagon/gen_idef_parser_funcs.py @@ -131,7 +131,7 @@ def main(): imms = tagimms[tag] arguments = [] - for regtype, regid, toss, numregs in regs: + for regtype, regid in regs: prefix = "in " if hex_common.is_read(regid) else "" is_pair = hex_common.is_pair(regid) @@ -147,7 +147,7 @@ def main(): elif is_single_new: arguments.append(f"{prefix}{regtype}{regid}N") else: - hex_common.bad_register(regtype, regid, toss, numregs) + hex_common.bad_register(regtype, regid) for immlett, bits, immshift in imms: arguments.append(hex_common.imm_name(immlett)) -- cgit 1.4.1