[PATCH 1/2] target/hexagon/*.py: remove undef vars from bad_register()

Matheus Tavares Bernardino posted 2 patches 2 years, 8 months ago
Maintainers: Taylor Simpson <tsimpson@quicinc.com>
[PATCH 1/2] target/hexagon/*.py: remove undef vars from bad_register()
Posted by Matheus Tavares Bernardino 2 years, 8 months ago
Some calls to `hex_common.bad_register()` in Hexagon python files are
passing undefined variables. Let's remove those.

Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
---
 target/hexagon/gen_helper_funcs.py | 8 ++++----
 target/hexagon/gen_tcg_funcs.py    | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/hexagon/gen_helper_funcs.py b/target/hexagon/gen_helper_funcs.py
index e80550f94e..367d08aceb 100755
--- a/target/hexagon/gen_helper_funcs.py
+++ b/target/hexagon/gen_helper_funcs.py
@@ -87,9 +87,9 @@ def gen_helper_arg_opn(f, regtype, regid, i, tag):
         elif hex_common.is_new_val(regtype, regid, tag):
             gen_helper_arg_new(f, 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)
 
 
 def gen_helper_arg_imm(f, immlett):
@@ -135,7 +135,7 @@ def gen_helper_dest_decl_opn(f, regtype, regid, i):
         else:
             gen_helper_dest_decl(f, regtype, regid, i)
     else:
-        hex_common.bad_register(regtype, regid, toss, numregs)
+        hex_common.bad_register(regtype, regid)
 
 
 def gen_helper_src_var_ext(f, regtype, regid):
@@ -185,7 +185,7 @@ def gen_helper_return_opn(f, regtype, regid, i):
         else:
             gen_helper_return(f, regtype, regid, i)
     else:
-        hex_common.bad_register(regtype, regid, toss, numregs)
+        hex_common.bad_register(regtype, regid)
 
 
 ##
diff --git a/target/hexagon/gen_tcg_funcs.py b/target/hexagon/gen_tcg_funcs.py
index c73467b840..c87ea856f7 100755
--- a/target/hexagon/gen_tcg_funcs.py
+++ b/target/hexagon/gen_tcg_funcs.py
@@ -354,9 +354,9 @@ def genptr_src_read_opn(f, regtype, regid, tag):
         elif hex_common.is_new_val(regtype, regid, tag):
             genptr_src_read_new(f, regtype, regid)
         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)
 
 
 def gen_helper_call_opn(f, tag, regtype, regid, toss, numregs, i):
@@ -468,7 +468,7 @@ def genptr_dst_write_opn(f, regtype, regid, tag):
         else:
             genptr_dst_write(f, tag, regtype, regid)
     else:
-        hex_common.bad_register(regtype, regid, toss, numregs)
+        hex_common.bad_register(regtype, regid)
 
 
 ##
-- 
2.37.2
RE: [PATCH 1/2] target/hexagon/*.py: remove undef vars from bad_register()
Posted by Taylor Simpson 2 years, 8 months ago

> -----Original Message-----
> From: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
> Sent: Tuesday, May 23, 2023 3:36 PM
> To: qemu-devel@nongnu.org
> Cc: Taylor Simpson <tsimpson@quicinc.com>; Brian Cain
> <bcain@quicinc.com>; Marco Liebel (QUIC) <quic_mliebel@quicinc.com>
> Subject: [PATCH 1/2] target/hexagon/*.py: remove undef vars from
> bad_register()
> 
> Some calls to `hex_common.bad_register()` in Hexagon python files are
> passing undefined variables. Let's remove those.
> 
> Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
> ---
>  target/hexagon/gen_helper_funcs.py | 8 ++++----
>  target/hexagon/gen_tcg_funcs.py    | 6 +++---
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/target/hexagon/gen_helper_funcs.py
> b/target/hexagon/gen_helper_funcs.py
> index e80550f94e..367d08aceb 100755
> --- a/target/hexagon/gen_helper_funcs.py
> +++ b/target/hexagon/gen_helper_funcs.py
> @@ -87,9 +87,9 @@ def gen_helper_arg_opn(f, regtype, regid, i, tag):
>          elif hex_common.is_new_val(regtype, regid, tag):
>              gen_helper_arg_new(f, 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)

There are other places where toss and numregs are passed to bad_register.  Let's go ahead and change bad_register to only take regtype and regid as arguments and remove those arguments everywhere.

Also, if you want to pull the thread on the sweater, go ahead and remove toss and numregs from the many places they are unused.

Thanks,
Taylor