Patchwork [20/35] tcg-s390: Use LOAD COMPLIMENT for negate.

login
register
mail settings
Submitter Richard Henderson
Date June 4, 2010, 7:14 p.m.
Message ID <1275678883-7082-21-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/54704/
State New
Headers show

Comments

Richard Henderson - June 4, 2010, 7:14 p.m.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/s390/tcg-target.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
Aurelien Jarno - June 12, 2010, 12:33 p.m.
On Fri, Jun 04, 2010 at 12:14:28PM -0700, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/s390/tcg-target.c |   10 ++--------
>  1 files changed, 2 insertions(+), 8 deletions(-)

This patch looks fine.

> diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
> index f53038b..826a2c8 100644
> --- a/tcg/s390/tcg-target.c
> +++ b/tcg/s390/tcg-target.c
> @@ -1134,16 +1134,10 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
>          break;
>  
>      case INDEX_op_neg_i32:
> -        /* FIXME: optimize args[0] != args[1] case */
> -        tcg_out_insn(s, RR, LR, 13, args[1]);
> -        tcg_out_movi(s, TCG_TYPE_I32, args[0], 0);
> -        tcg_out_insn(s, RR, SR, args[0], 13);
> +        tcg_out_insn(s, RR, LCR, args[0], args[1]);
>          break;
>      case INDEX_op_neg_i64:
> -        /* FIXME: optimize args[0] != args[1] case */
> -        tcg_out_mov(s, TCG_TMP0, args[1]);
> -        tcg_out_movi(s, TCG_TYPE_I64, args[0], 0);
> -        tcg_out_insn(s, RRE, SGR, args[0], TCG_TMP0);
> +        tcg_out_insn(s, RRE, LCGR, args[0], args[1]);
>          break;
>  
>      case INDEX_op_mul_i32:
> -- 
> 1.7.0.1
> 
> 
>

Patch

diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
index f53038b..826a2c8 100644
--- a/tcg/s390/tcg-target.c
+++ b/tcg/s390/tcg-target.c
@@ -1134,16 +1134,10 @@  static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
         break;
 
     case INDEX_op_neg_i32:
-        /* FIXME: optimize args[0] != args[1] case */
-        tcg_out_insn(s, RR, LR, 13, args[1]);
-        tcg_out_movi(s, TCG_TYPE_I32, args[0], 0);
-        tcg_out_insn(s, RR, SR, args[0], 13);
+        tcg_out_insn(s, RR, LCR, args[0], args[1]);
         break;
     case INDEX_op_neg_i64:
-        /* FIXME: optimize args[0] != args[1] case */
-        tcg_out_mov(s, TCG_TMP0, args[1]);
-        tcg_out_movi(s, TCG_TYPE_I64, args[0], 0);
-        tcg_out_insn(s, RRE, SGR, args[0], TCG_TMP0);
+        tcg_out_insn(s, RRE, LCGR, args[0], args[1]);
         break;
 
     case INDEX_op_mul_i32: