mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
3fd49e2217
commit
3608c2419c
7 changed files with 70 additions and 70 deletions
|
@ -70,7 +70,7 @@ def strip_reg_prefix(x):
|
|||
def main():
|
||||
hex_common.read_semantics_file(sys.argv[1])
|
||||
hex_common.read_attribs_file(sys.argv[2])
|
||||
tagregs = hex_common.get_tagregs()
|
||||
tagregs = hex_common.get_tagregs(full=True)
|
||||
tagimms = hex_common.get_tagimms()
|
||||
|
||||
with open(sys.argv[3], "w") as f:
|
||||
|
@ -79,7 +79,7 @@ def main():
|
|||
rregs = []
|
||||
wregs = []
|
||||
regids = ""
|
||||
for regtype, regid, toss, numregs in regs:
|
||||
for regtype, regid, _, numregs in regs:
|
||||
if hex_common.is_read(regid):
|
||||
if regid[0] not in regids:
|
||||
regids += regid[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue