To access registers within tcg_env, in a helper function, a pointer to
the required register is traditionally passed to the helper function.
Adding one such function for future usage.

Signed-off-by: Chinmay Rath <[email protected]>
---
 target/ppc/translate/dmf-impl.c.inc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/target/ppc/translate/dmf-impl.c.inc 
b/target/ppc/translate/dmf-impl.c.inc
index 45aabe2a4d..5bc70663f8 100644
--- a/target/ppc/translate/dmf-impl.c.inc
+++ b/target/ppc/translate/dmf-impl.c.inc
@@ -10,6 +10,13 @@ static inline void get_dmr_row(TCGv_i128 dst, int reg, int 
row)
     tcg_gen_ld_i128(dst, tcg_env, dmr_row_offset(reg, row));
 }
 
+static inline TCGv_ptr gen_dmr_ptr(int reg)
+{
+    TCGv_ptr r = tcg_temp_new_ptr();
+    tcg_gen_addi_ptr(r, tcg_env, offsetof(CPUPPCState, dmr[reg]));
+    return r;
+}
+
 static bool trans_DMSETDMRZ(DisasContext *ctx, arg_DMSETDMRZ *a)
 {
     TCGv_i128 zero;
-- 
2.55.0


Reply via email to