diff mbox series

[PULL,v2,09/10] Hexagon (target/hexagon) Remove unused slot variable in helpers

Message ID 20230421164922.3608183-10-tsimpson@quicinc.com (mailing list archive)
State New, archived
Headers show
Series [PULL,v2,01/10] Hexagon (translate.c): avoid redundant PC updates on COF | expand

Commit Message

Taylor Simpson April 21, 2023, 4:49 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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230407204521.357244-1-tsimpson@quicinc.com>
---
 target/hexagon/macros.h            | 14 +++++++-------
 target/hexagon/op_helper.h         |  2 +-
 target/hexagon/op_helper.c         |  2 +-
 target/hexagon/gen_helper_funcs.py |  2 --
 4 files changed, 9 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h
index 21b5b5a06c..9ddfc91b1d 100644
--- a/target/hexagon/macros.h
+++ b/target/hexagon/macros.h
@@ -347,9 +347,9 @@  static inline TCGv gen_read_ireg(TCGv result, TCGv val, int shift)
 
 #define fREAD_LR() (env->gpr[HEX_REG_LR])
 
-#define fWRITE_LR(A) log_reg_write(env, HEX_REG_LR, A, slot)
-#define fWRITE_FP(A) log_reg_write(env, HEX_REG_FP, A, slot)
-#define fWRITE_SP(A) log_reg_write(env, HEX_REG_SP, A, slot)
+#define fWRITE_LR(A) log_reg_write(env, HEX_REG_LR, A)
+#define fWRITE_FP(A) log_reg_write(env, HEX_REG_FP, A)
+#define fWRITE_SP(A) log_reg_write(env, HEX_REG_SP, A)
 
 #define fREAD_SP() (env->gpr[HEX_REG_SP])
 #define fREAD_LC0 (env->gpr[HEX_REG_LC0])
@@ -377,13 +377,13 @@  static inline TCGv gen_read_ireg(TCGv result, TCGv val, int shift)
 #define fHINTJR(TARGET) { /* Not modelled in qemu */}
 #define fWRITE_LOOP_REGS0(START, COUNT) \
     do { \
-        log_reg_write(env, HEX_REG_LC0, COUNT, slot);  \
-        log_reg_write(env, HEX_REG_SA0, START, slot); \
+        log_reg_write(env, HEX_REG_LC0, COUNT);  \
+        log_reg_write(env, HEX_REG_SA0, START); \
     } while (0)
 #define fWRITE_LOOP_REGS1(START, COUNT) \
     do { \
-        log_reg_write(env, HEX_REG_LC1, COUNT, slot);  \
-        log_reg_write(env, HEX_REG_SA1, START, slot);\
+        log_reg_write(env, HEX_REG_LC1, COUNT);  \
+        log_reg_write(env, HEX_REG_SA1, START);\
     } while (0)
 
 #define fSET_OVERFLOW() SET_USR_FIELD(USR_OVF, 1)
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 099c111a8c..3cc71b69d9 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 c4e04508f8..c73d792580 100755
--- a/target/hexagon/gen_helper_funcs.py
+++ b/target/hexagon/gen_helper_funcs.py
@@ -308,8 +308,6 @@  def gen_helper_function(f, tag, tagregs, tagimms):
                 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