diff mbox series

[v3,20/30] target/arm: Don't use tcg_temp_local_new_*

Message ID 20230225085945.1798188-21-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg: Simplify temporary usage | expand

Commit Message

Richard Henderson Feb. 25, 2023, 8:59 a.m. UTC
Since tcg_temp_new_* is now identical, use those.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 6 +++---
 target/arm/translate.c     | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Philippe Mathieu-Daudé Feb. 25, 2023, 10:05 a.m. UTC | #1
On 25/2/23 09:59, Richard Henderson wrote:
> Since tcg_temp_new_* is now identical, use those.
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/arm/translate-sve.c | 6 +++---
>   target/arm/translate.c     | 6 +++---
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
> index 02150d93e8..718a5bce1b 100644
> --- a/target/arm/translate-sve.c
> +++ b/target/arm/translate-sve.c


> @@ -4342,7 +4342,7 @@ void gen_sve_ldr(DisasContext *s, TCGv_ptr base, int vofs,
>           tcg_temp_free_i64(t0);
>       } else {
>           TCGLabel *loop = gen_new_label();
> -        TCGv_ptr tp, i = tcg_const_local_ptr(0);
> +        TCGv_ptr tp, i = tcg_const_ptr(0);

Can we directly switch to tcg_constant_ptr(NULL)?

>           gen_set_label(loop);
>   
> @@ -4427,7 +4427,7 @@ void gen_sve_str(DisasContext *s, TCGv_ptr base, int vofs,
>           tcg_temp_free_i64(t0);
>       } else {
>           TCGLabel *loop = gen_new_label();
> -        TCGv_ptr tp, i = tcg_const_local_ptr(0);
> +        TCGv_ptr tp, i = tcg_const_ptr(0);

Ditto.
Richard Henderson Feb. 25, 2023, 10:09 a.m. UTC | #2
On 2/25/23 00:05, Philippe Mathieu-Daudé wrote:
> On 25/2/23 09:59, Richard Henderson wrote:
>> Since tcg_temp_new_* is now identical, use those.
>>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>   target/arm/translate-sve.c | 6 +++---
>>   target/arm/translate.c     | 6 +++---
>>   2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
>> index 02150d93e8..718a5bce1b 100644
>> --- a/target/arm/translate-sve.c
>> +++ b/target/arm/translate-sve.c
> 
> 
>> @@ -4342,7 +4342,7 @@ void gen_sve_ldr(DisasContext *s, TCGv_ptr base, int vofs,
>>           tcg_temp_free_i64(t0);
>>       } else {
>>           TCGLabel *loop = gen_new_label();
>> -        TCGv_ptr tp, i = tcg_const_local_ptr(0);
>> +        TCGv_ptr tp, i = tcg_const_ptr(0);
> 
> Can we directly switch to tcg_constant_ptr(NULL)?

No, i is written.  This ought to get changed to tcg_temp_new + tcg_gen_movi, but that'll 
wait for a different patch set.


r~
Philippe Mathieu-Daudé Feb. 25, 2023, 10:13 a.m. UTC | #3
On 25/2/23 11:09, Richard Henderson wrote:
> On 2/25/23 00:05, Philippe Mathieu-Daudé wrote:
>> On 25/2/23 09:59, Richard Henderson wrote:
>>> Since tcg_temp_new_* is now identical, use those.
>>>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>>> ---
>>>   target/arm/translate-sve.c | 6 +++---
>>>   target/arm/translate.c     | 6 +++---
>>>   2 files changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
>>> index 02150d93e8..718a5bce1b 100644
>>> --- a/target/arm/translate-sve.c
>>> +++ b/target/arm/translate-sve.c
>>
>>
>>> @@ -4342,7 +4342,7 @@ void gen_sve_ldr(DisasContext *s, TCGv_ptr 
>>> base, int vofs,
>>>           tcg_temp_free_i64(t0);
>>>       } else {
>>>           TCGLabel *loop = gen_new_label();
>>> -        TCGv_ptr tp, i = tcg_const_local_ptr(0);
>>> +        TCGv_ptr tp, i = tcg_const_ptr(0);
>>
>> Can we directly switch to tcg_constant_ptr(NULL)?
> 
> No, i is written.  This ought to get changed to tcg_temp_new + 
> tcg_gen_movi, but that'll wait for a different patch set.

Indeed. Sure :)
diff mbox series

Patch

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 02150d93e8..718a5bce1b 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -2694,7 +2694,7 @@  static bool do_clast_vector(DisasContext *s, arg_rprr_esz *a, bool before)
         return true;
     }
 
-    last = tcg_temp_local_new_i32();
+    last = tcg_temp_new_i32();
     over = gen_new_label();
 
     find_last_active(s, last, esz, a->pg);
@@ -4342,7 +4342,7 @@  void gen_sve_ldr(DisasContext *s, TCGv_ptr base, int vofs,
         tcg_temp_free_i64(t0);
     } else {
         TCGLabel *loop = gen_new_label();
-        TCGv_ptr tp, i = tcg_const_local_ptr(0);
+        TCGv_ptr tp, i = tcg_const_ptr(0);
 
         gen_set_label(loop);
 
@@ -4427,7 +4427,7 @@  void gen_sve_str(DisasContext *s, TCGv_ptr base, int vofs,
         tcg_temp_free_i64(t0);
     } else {
         TCGLabel *loop = gen_new_label();
-        TCGv_ptr tp, i = tcg_const_local_ptr(0);
+        TCGv_ptr tp, i = tcg_const_ptr(0);
 
         gen_set_label(loop);
 
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 92955d505c..9c8e1ac04c 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -7136,7 +7136,7 @@  static bool op_strex(DisasContext *s, arg_STREX *a, MemOp mop, bool rel)
         tcg_gen_mb(TCG_MO_ALL | TCG_BAR_STRL);
     }
 
-    addr = tcg_temp_local_new_i32();
+    addr = tcg_temp_new_i32();
     load_reg_var(s, addr, a->rn);
     tcg_gen_addi_i32(addr, addr, a->imm);
 
@@ -7289,7 +7289,7 @@  static bool op_ldrex(DisasContext *s, arg_LDREX *a, MemOp mop, bool acq)
         return true;
     }
 
-    addr = tcg_temp_local_new_i32();
+    addr = tcg_temp_new_i32();
     load_reg_var(s, addr, a->rn);
     tcg_gen_addi_i32(addr, addr, a->imm);
 
@@ -8696,7 +8696,7 @@  static bool trans_LE(DisasContext *s, arg_LE *a)
          * Decrement by 1 << (4 - LTPSIZE). We need to use a TCG local
          * so that decr stays live after the brcondi.
          */
-        TCGv_i32 decr = tcg_temp_local_new_i32();
+        TCGv_i32 decr = tcg_temp_new_i32();
         TCGv_i32 ltpsize = load_cpu_field(v7m.ltpsize);
         tcg_gen_sub_i32(decr, tcg_constant_i32(4), ltpsize);
         tcg_gen_shl_i32(decr, tcg_constant_i32(1), decr);