qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] target/arm: Introduce store_cpu_field_constant() helper


From: Richard Henderson
Subject: Re: [PATCH 2/3] target/arm: Introduce store_cpu_field_constant() helper
Date: Sun, 3 Oct 2021 11:35:42 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/3/21 10:39 AM, Philippe Mathieu-Daudé wrote:
-static inline void store_cpu_offset(TCGv_i32 var, int offset)
+static inline void store_cpu_offset(TCGv_i32 var, int offset, bool is_temp)
  {
      tcg_gen_st_i32(var, cpu_env, offset);
-    tcg_temp_free_i32(var);
+    if (is_temp) {
+        tcg_temp_free_i32(var);
+    }
  }
#define store_cpu_field(var, name) \
-    store_cpu_offset(var, offsetof(CPUARMState, name))
+    store_cpu_offset(var, offsetof(CPUARMState, name), true)
+
+#define store_cpu_field_constant(val, name) \
+    store_cpu_offset(tcg_const_i32(val), offsetof(CPUARMState, name), false)

You missed out on using tcg_constant_i32 in the end.

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]