qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Simpson <tsimpson@quicinc.com>
To: qemu-devel@nongnu.org
Cc: tsimpson@quicinc.com, richard.henderson@linaro.org,
	philmd@linaro.org, peter.maydell@linaro.org, bcain@quicinc.com,
	quic_mathbern@quicinc.com, stefanha@redhat.com, ale@rev.ng,
	anjo@rev.ng, quic_mliebel@quicinc.com
Subject: [PULL 09/11] Hexagon (target/hexagon) Remove unused slot variable in helpers
Date: Wed, 19 Apr 2023 20:26:32 -0700	[thread overview]
Message-ID: <20230420032634.105311-10-tsimpson@quicinc.com> (raw)
In-Reply-To: <20230420032634.105311-1-tsimpson@quicinc.com>

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 --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
-- 
2.25.1


  parent reply	other threads:[~2023-04-20  3:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20  3:26 [PULL 00/11] Hexagon queue Taylor Simpson
2023-04-20  3:26 ` [PULL 01/11] Hexagon (translate.c): avoid redundant PC updates on COF Taylor Simpson
2023-04-20  3:26 ` [PULL 02/11] Use f-strings in python scripts Taylor Simpson
2023-04-20  3:26 ` [PULL 03/11] Use black code style for " Taylor Simpson
2023-04-20  3:26 ` [PULL 04/11] Hexagon (target/hexagon) Remove redundant/unused macros Taylor Simpson
2023-04-20  3:26 ` [PULL 05/11] Hexagon (target/hexagon) Merge arguments to probe_pkt_scalar_hvx_stores Taylor Simpson
2023-04-20  3:26 ` [PULL 06/11] Hexagon (target/hexagon) Add overrides for count trailing zeros/ones Taylor Simpson
2023-04-20  3:26 ` [PULL 07/11] Hexagon (target/hexagon) Updates to USR should use get_result_gpr Taylor Simpson
2023-04-20  3:26 ` [PULL 08/11] Hexagon (tests/tcg/hexagon) Move HVX test infra to header file Taylor Simpson
2023-04-20  3:26 ` Taylor Simpson [this message]
2023-04-20  3:26 ` [PULL 10/11] Hexagon (target/hexagon) Add overrides for cache/sync/barrier instructions Taylor Simpson
2023-04-20  3:26 ` [PULL 11/11] Hexagon (target/hexagon) Additional instructions handled by idef-parser Taylor Simpson
2023-04-21  8:20 ` [PULL 00/11] Hexagon queue Richard Henderson
2023-04-21 15:06   ` Taylor Simpson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230420032634.105311-10-tsimpson@quicinc.com \
    --to=tsimpson@quicinc.com \
    --cc=ale@rev.ng \
    --cc=anjo@rev.ng \
    --cc=bcain@quicinc.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quic_mathbern@quicinc.com \
    --cc=quic_mliebel@quicinc.com \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).