On 27/2/26 21:36, Brian Cain wrote:
From: Brian Cain <[email protected]>

Reviewed-by: Taylor Simpson <[email protected]>
Signed-off-by: Brian Cain <[email protected]>
---
  target/hexagon/translate.h | 36 ++++++++++++++++++++++++++++++++++++
  1 file changed, 36 insertions(+)

diff --git a/target/hexagon/translate.h b/target/hexagon/translate.h
index f80830f5f16..6e1008b363a 100644
--- a/target/hexagon/translate.h
+++ b/target/hexagon/translate.h
@@ -40,6 +40,14 @@ typedef struct DisasContext {
      DECLARE_BITMAP(regs_written, TOTAL_PER_THREAD_REGS);
      DECLARE_BITMAP(predicated_regs, TOTAL_PER_THREAD_REGS);
      bool implicit_usr_write;
+#ifndef CONFIG_USER_ONLY
+    int greg_log[GREG_WRITES_MAX];
+    int greg_log_idx;
+    int sreg_log[SREG_WRITES_MAX];
+    int sreg_log_idx;
+    TCGv t_sreg_new_value[NUM_SREGS];
+    TCGv greg_new_value[NUM_GREGS];

TCGv_i32.

+#endif
      int preg_log[PRED_WRITES_MAX];
      int preg_log_idx;
      DECLARE_BITMAP(pregs_written, NUM_PREGS);
@@ -80,6 +88,34 @@ typedef struct DisasContext {
bool is_gather_store_insn(DisasContext *ctx); +#ifndef CONFIG_USER_ONLY
+static inline void ctx_log_greg_write(DisasContext *ctx, int rnum)
+{
+    if (rnum <= HEX_GREG_G3) {

Shouldn't we assert(rnum > HEX_GREG_G3)?

+        ctx->greg_log[ctx->greg_log_idx] = rnum;
+        ctx->greg_log_idx++;
+    }
+}
+
+static inline void ctx_log_greg_write_pair(DisasContext *ctx, int rnum)
+{
+    ctx_log_greg_write(ctx, rnum);

Should we assert(!(rnum % 2))?

+    ctx_log_greg_write(ctx, rnum + 1);
+}

Reply via email to