diff mbox series

[v3,25/31] target/cris: Use tcg_gen_abs_tl

Message ID 20190504055300.18426-26-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg vector improvements | expand

Commit Message

Richard Henderson May 4, 2019, 5:52 a.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/cris/translate.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

-- 
2.17.1

Comments

David Hildenbrand May 8, 2019, 7:54 p.m. UTC | #1
On 04.05.19 07:52, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/cris/translate.c | 9 +--------

>  1 file changed, 1 insertion(+), 8 deletions(-)

> 

> diff --git a/target/cris/translate.c b/target/cris/translate.c

> index b005a5c20e..31b40a57f9 100644

> --- a/target/cris/translate.c

> +++ b/target/cris/translate.c

> @@ -1686,18 +1686,11 @@ static int dec_cmp_r(CPUCRISState *env, DisasContext *dc)

>  

>  static int dec_abs_r(CPUCRISState *env, DisasContext *dc)

>  {

> -    TCGv t0;

> -

>      LOG_DIS("abs $r%u, $r%u\n",

>              dc->op1, dc->op2);

>      cris_cc_mask(dc, CC_MASK_NZ);

>  

> -    t0 = tcg_temp_new();

> -    tcg_gen_sari_tl(t0, cpu_R[dc->op1], 31);

> -    tcg_gen_xor_tl(cpu_R[dc->op2], cpu_R[dc->op1], t0);

> -    tcg_gen_sub_tl(cpu_R[dc->op2], cpu_R[dc->op2], t0);

> -    tcg_temp_free(t0);

> -

> +    tcg_gen_abs_tl(cpu_R[dc->op2], cpu_R[dc->op1]);

>      cris_alu(dc, CC_OP_MOVE,

>              cpu_R[dc->op2], cpu_R[dc->op2], cpu_R[dc->op2], 4);

>      return 2;

> 


Reviewed-by: David Hildenbrand <david@redhat.com>


-- 

Thanks,

David / dhildenb
diff mbox series

Patch

diff --git a/target/cris/translate.c b/target/cris/translate.c
index b005a5c20e..31b40a57f9 100644
--- a/target/cris/translate.c
+++ b/target/cris/translate.c
@@ -1686,18 +1686,11 @@  static int dec_cmp_r(CPUCRISState *env, DisasContext *dc)
 
 static int dec_abs_r(CPUCRISState *env, DisasContext *dc)
 {
-    TCGv t0;
-
     LOG_DIS("abs $r%u, $r%u\n",
             dc->op1, dc->op2);
     cris_cc_mask(dc, CC_MASK_NZ);
 
-    t0 = tcg_temp_new();
-    tcg_gen_sari_tl(t0, cpu_R[dc->op1], 31);
-    tcg_gen_xor_tl(cpu_R[dc->op2], cpu_R[dc->op1], t0);
-    tcg_gen_sub_tl(cpu_R[dc->op2], cpu_R[dc->op2], t0);
-    tcg_temp_free(t0);
-
+    tcg_gen_abs_tl(cpu_R[dc->op2], cpu_R[dc->op1]);
     cris_alu(dc, CC_OP_MOVE,
             cpu_R[dc->op2], cpu_R[dc->op2], cpu_R[dc->op2], 4);
     return 2;