diff mbox series

[v2,27/29] target/s390x: Use tcg_gen_abs_i64

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

Commit Message

Richard Henderson May 1, 2019, 5:05 a.m. UTC
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

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

-- 
2.17.1

Comments

David Hildenbrand May 2, 2019, 1:44 p.m. UTC | #1
On 01.05.19 07:05, Richard Henderson wrote:
> Cc: David Hildenbrand <david@redhat.com>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/s390x/translate.c | 8 +-------

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

> 

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

> index d4951836ad..e8e8a79b7d 100644

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

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

> @@ -1407,13 +1407,7 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c,

>  

>  static DisasJumpType op_abs(DisasContext *s, DisasOps *o)

>  {

> -    TCGv_i64 z, n;

> -    z = tcg_const_i64(0);

> -    n = tcg_temp_new_i64();

> -    tcg_gen_neg_i64(n, o->in2);

> -    tcg_gen_movcond_i64(TCG_COND_LT, o->out, o->in2, z, n, o->in2);

> -    tcg_temp_free_i64(n);

> -    tcg_temp_free_i64(z);

> +    tcg_gen_abs_i64(o->out, o->in2);

>      return DISAS_NEXT;

>  }

>  

> 

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


-- 

Thanks,

David / dhildenb
diff mbox series

Patch

diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index d4951836ad..e8e8a79b7d 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -1407,13 +1407,7 @@  static DisasJumpType help_branch(DisasContext *s, DisasCompare *c,
 
 static DisasJumpType op_abs(DisasContext *s, DisasOps *o)
 {
-    TCGv_i64 z, n;
-    z = tcg_const_i64(0);
-    n = tcg_temp_new_i64();
-    tcg_gen_neg_i64(n, o->in2);
-    tcg_gen_movcond_i64(TCG_COND_LT, o->out, o->in2, z, n, o->in2);
-    tcg_temp_free_i64(n);
-    tcg_temp_free_i64(z);
+    tcg_gen_abs_i64(o->out, o->in2);
     return DISAS_NEXT;
 }