diff mbox series

Hexagon (target/hexagon) Remove unused slot variable in helpers

Message ID 20230407204521.357244-1-tsimpson@quicinc.com
State New
Headers show
Series Hexagon (target/hexagon) Remove unused slot variable in helpers | expand

Commit Message

Taylor Simpson April 7, 2023, 8:45 p.m. UTC
The slot variable in helpers was only passed to log_reg_write function
where the argument is unused.
- Remove declaration from generated helper functions
- Remove slot argument from log_reg_write

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
---
 target/hexagon/macros.h            | 2 +-
 target/hexagon/op_helper.h         | 2 +-
 target/hexagon/op_helper.c         | 2 +-
 target/hexagon/gen_helper_funcs.py | 2 --
 4 files changed, 3 insertions(+), 5 deletions(-)

Comments

Richard Henderson April 8, 2023, 3:10 p.m. UTC | #1
On 4/7/23 13:45, Taylor Simpson wrote:
> The slot variable in helpers was only passed to log_reg_write function
> where the argument is unused.
> - Remove declaration from generated helper functions
> - Remove slot argument from log_reg_write
> 
> Signed-off-by: Taylor Simpson<tsimpson@quicinc.com>
> ---
>   target/hexagon/macros.h            | 2 +-
>   target/hexagon/op_helper.h         | 2 +-
>   target/hexagon/op_helper.c         | 2 +-
>   target/hexagon/gen_helper_funcs.py | 2 --
>   4 files changed, 3 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h
index 482a9c787f..b978fd1840 100644
--- a/target/hexagon/macros.h
+++ b/target/hexagon/macros.h
@@ -28,7 +28,7 @@ 
 #define READ_REG(NUM)                    (env->gpr[(NUM)])
 #define READ_PREG(NUM)                   (env->pred[NUM])
 
-#define WRITE_RREG(NUM, VAL)             log_reg_write(env, NUM, VAL, slot)
+#define WRITE_RREG(NUM, VAL)             log_reg_write(env, NUM, VAL)
 #define WRITE_PREG(NUM, VAL)             log_pred_write(env, NUM, VAL)
 #endif
 
diff --git a/target/hexagon/op_helper.h b/target/hexagon/op_helper.h
index 34b3a53975..db22b54401 100644
--- a/target/hexagon/op_helper.h
+++ b/target/hexagon/op_helper.h
@@ -27,7 +27,7 @@  uint32_t mem_load4(CPUHexagonState *env, uint32_t slot, target_ulong vaddr);
 uint64_t mem_load8(CPUHexagonState *env, uint32_t slot, target_ulong vaddr);
 
 void log_reg_write(CPUHexagonState *env, int rnum,
-                   target_ulong val, uint32_t slot);
+                   target_ulong val);
 void log_store64(CPUHexagonState *env, target_ulong addr,
                  int64_t val, int width, int slot);
 void log_store32(CPUHexagonState *env, target_ulong addr,
diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c
index c9a156030e..63a5b9b202 100644
--- a/target/hexagon/op_helper.c
+++ b/target/hexagon/op_helper.c
@@ -53,7 +53,7 @@  G_NORETURN void HELPER(raise_exception)(CPUHexagonState *env, uint32_t excp)
 }
 
 void log_reg_write(CPUHexagonState *env, int rnum,
-                   target_ulong val, uint32_t slot)
+                   target_ulong val)
 {
     HEX_DEBUG_LOG("log_reg_write[%d] = " TARGET_FMT_ld " (0x" TARGET_FMT_lx ")",
                   rnum, val, val);
diff --git a/target/hexagon/gen_helper_funcs.py b/target/hexagon/gen_helper_funcs.py
index 7a224b66e6..6edd82c423 100755
--- a/target/hexagon/gen_helper_funcs.py
+++ b/target/hexagon/gen_helper_funcs.py
@@ -265,8 +265,6 @@  def gen_helper_function(f, tag, tagregs, tagimms):
             if i > 0: f.write(", ")
             f.write("uint32_t part1")
         f.write(")\n{\n")
-        if (not hex_common.need_slot(tag)):
-            f.write("    uint32_t slot __attribute__((unused)) = 4;\n" )
         if hex_common.need_ea(tag): gen_decl_ea(f)
         ## Declare the return variable
         i=0