diff options
author | Matheus Tavares Bernardino <quic_mathbern@quicinc.com> | 2023-05-24 11:41:47 -0300 |
---|---|---|
committer | Taylor Simpson <tsimpson@quicinc.com> | 2023-05-26 07:03:41 -0700 |
commit | 3608c2419c95e7477dd282bb1268c78029501df8 (patch) | |
tree | 2be305676d555be086a17cc3a821534fd2704775 /target/hexagon/gen_analyze_funcs.py | |
parent | 3fd49e22171a019beebffdda081380a5276525a6 (diff) | |
download | qemu-3608c2419c95e7477dd282bb1268c78029501df8.zip qemu-3608c2419c95e7477dd282bb1268c78029501df8.tar.gz qemu-3608c2419c95e7477dd282bb1268c78029501df8.tar.bz2 |
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 <tsimpson@quicinc.com>
Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Tested-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id: <3ffd4ccb972879f57f499705c624e8eaba7f8b52.1684939078.git.quic_mathbern@quicinc.com>
Diffstat (limited to 'target/hexagon/gen_analyze_funcs.py')
-rwxr-xr-x | target/hexagon/gen_analyze_funcs.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/target/hexagon/gen_analyze_funcs.py b/target/hexagon/gen_analyze_funcs.py index 00868cc..c3b521a 100755 --- a/target/hexagon/gen_analyze_funcs.py +++ b/target/hexagon/gen_analyze_funcs.py @@ -165,7 +165,7 @@ def analyze_opn_new(f, tag, regtype, regid, regno): hex_common.bad_register(regtype, regid) -def analyze_opn(f, tag, regtype, regid, toss, numregs, i): +def analyze_opn(f, tag, regtype, regid, i): if hex_common.is_pair(regid): analyze_opn_old(f, tag, regtype, regid, i) elif hex_common.is_single(regid): @@ -174,9 +174,9 @@ def analyze_opn(f, tag, regtype, regid, toss, numregs, i): elif hex_common.is_new_val(regtype, regid, tag): analyze_opn_new(f, tag, regtype, regid, i) else: - hex_common.bad_register(regtype, regid, toss, numregs) + hex_common.bad_register(regtype, regid) else: - hex_common.bad_register(regtype, regid, toss, numregs) + hex_common.bad_register(regtype, regid) ## @@ -202,8 +202,8 @@ def gen_analyze_func(f, tag, regs, imms): i = 0 ## Analyze all the registers - for regtype, regid, toss, numregs in regs: - analyze_opn(f, tag, regtype, regid, toss, numregs, i) + for regtype, regid in regs: + analyze_opn(f, tag, regtype, regid, i) i += 1 has_generated_helper = not hex_common.skip_qemu_helper( |