Patchwork ARM back-end: Use sxt[bh] instructions for ext{8, 6}s

login
register
mail settings
Submitter Laurent Desnogues
Date Sept. 13, 2009, 12:27 p.m.
Message ID <761ea48b0909130527r79393ed9y1cb87af4283d4f99@mail.gmail.com>
Download mbox | patch
Permalink /patch/33549/
State Superseded
Headers show

Comments

Laurent Desnogues - Sept. 13, 2009, 12:27 p.m.
Hello,

this patch uses sxtb for ext8s_i32 and sxth for ext16s_i32 in ARM back-end.


Laurent

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>

Patch

diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 4e17f7f..252558e 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -1547,16 +1547,26 @@  static inline void tcg_out_op(TCGContext *s, int opc,
         break;
 
     case INDEX_op_ext8s_i32:
+#ifdef __ARM_ARCH_7A__
+        /* sxtb */
+        tcg_out32(s, 0xe6af0070 | (args[0] << 12) | args[1]);
+#else
         tcg_out_dat_reg(s, COND_AL, ARITH_MOV,
                         args[0], 0, args[1], SHIFT_IMM_LSL(24));
         tcg_out_dat_reg(s, COND_AL, ARITH_MOV,
                         args[0], 0, args[0], SHIFT_IMM_ASR(24));
+#endif
         break;
     case INDEX_op_ext16s_i32:
+#ifdef __ARM_ARCH_7A__
+        /* sxth */
+        tcg_out32(s, 0xe6bf0070 | (args[0] << 12) | args[1]);
+#else
         tcg_out_dat_reg(s, COND_AL, ARITH_MOV,
                         args[0], 0, args[1], SHIFT_IMM_LSL(16));
         tcg_out_dat_reg(s, COND_AL, ARITH_MOV,
                         args[0], 0, args[0], SHIFT_IMM_ASR(16));
+#endif
         break;
 
     default: