Patchwork [v4,16/33] tcg-aarch64: Use tcg_fmt_Rdnm_cond for setcond

login
register
mail settings
Submitter Richard Henderson
Date Sept. 14, 2013, 9:54 p.m.
Message ID <1379195690-6509-17-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/274982/
State New
Headers show

Comments

Richard Henderson - Sept. 14, 2013, 9:54 p.m.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/aarch64/tcg-target.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Patch

diff --git a/tcg/aarch64/tcg-target.c b/tcg/aarch64/tcg-target.c
index e9a0f9b..5f2c437 100644
--- a/tcg/aarch64/tcg-target.c
+++ b/tcg/aarch64/tcg-target.c
@@ -690,14 +690,6 @@  static void tcg_out_cmp(TCGContext *s, TCGType ext, TCGReg a,
     }
 }
 
-static inline void tcg_out_cset(TCGContext *s, TCGType ext,
-                                TCGReg rd, TCGCond c)
-{
-    /* Using CSET alias of CSINC 0x1a800400 Xd, XZR, XZR, invert(cond) */
-    unsigned int base = ext ? 0x9a9f07e0 : 0x1a9f07e0;
-    tcg_out32(s, base | tcg_cond_to_aarch64[tcg_invert_cond(c)] << 12 | rd);
-}
-
 static inline void tcg_out_goto(TCGContext *s, tcg_target_long target)
 {
     tcg_target_long offset;
@@ -1426,7 +1418,9 @@  static void tcg_out_op(TCGContext *s, TCGOpcode opc,
         /* FALLTHRU */
     case INDEX_op_setcond_i64:
         tcg_out_cmp(s, ext, a1, a2, c2);
-        tcg_out_cset(s, ext, a0, args[3]);
+        /* Use CSET alias of CSINC Wd, WZR, WZR, invert(cond).  */
+        tcg_fmt_Rdnm_cond(s, INSN_CSINC, 0, a0, TCG_REG_XZR, TCG_REG_XZR,
+                          tcg_invert_cond(args[3]));
         break;
 
     case INDEX_op_movcond_i32: