]> Git Repo - qemu.git/commitdiff
tcg-aarch64: Implement mov with tcg_out_insn
authorRichard Henderson <[email protected]>
Tue, 13 Aug 2013 21:49:18 +0000 (14:49 -0700)
committerRichard Henderson <[email protected]>
Fri, 14 Mar 2014 17:59:41 +0000 (10:59 -0700)
Avoid the magic numbers in the current implementation.

Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Claudio Fontana <[email protected]>
Tested-by: Claudio Fontana <[email protected]>
tcg/aarch64/tcg-target.c

index b5f19ad493f68cf5e160588b60f376b58ed125d3..9b6374dbe4f062c452dc3e147028c13fbf940af3 100644 (file)
@@ -376,13 +376,16 @@ static inline void tcg_out_ldst_12(TCGContext *s,
               | op_type << 20 | scaled_uimm << 10 | rn << 5 | rd);
 }
 
-static inline void tcg_out_movr(TCGContext *s, TCGType ext,
-                                TCGReg rd, TCGReg src)
+/* Register to register move using ORR (shifted register with no shift). */
+static void tcg_out_movr(TCGContext *s, TCGType ext, TCGReg rd, TCGReg rm)
 {
-    /* register to register move using MOV (shifted register with no shift) */
-    /* using MOV 0x2a0003e0 | (shift).. */
-    unsigned int base = ext ? 0xaa0003e0 : 0x2a0003e0;
-    tcg_out32(s, base | src << 16 | rd);
+    tcg_out_insn(s, 3510, ORR, ext, rd, TCG_REG_XZR, rm);
+}
+
+/* Register to register move using ADDI (move to/from SP).  */
+static void tcg_out_movr_sp(TCGContext *s, TCGType ext, TCGReg rd, TCGReg rn)
+{
+    tcg_out_insn(s, 3401, ADDI, ext, rd, rn, 0);
 }
 
 static inline void tcg_out_movi_aux(TCGContext *s,
@@ -457,15 +460,6 @@ static inline void tcg_out_ldst(TCGContext *s, enum aarch64_ldst_op_data data,
     tcg_out_ldst_r(s, data, type, rd, rn, TCG_REG_TMP);
 }
 
-/* mov alias implemented with add immediate, useful to move to/from SP */
-static inline void tcg_out_movr_sp(TCGContext *s, TCGType ext,
-                                   TCGReg rd, TCGReg rn)
-{
-    /* using ADD 0x11000000 | (ext) | rn << 5 | rd */
-    unsigned int base = ext ? 0x91000000 : 0x11000000;
-    tcg_out32(s, base | rn << 5 | rd);
-}
-
 static inline void tcg_out_mov(TCGContext *s,
                                TCGType type, TCGReg ret, TCGReg arg)
 {
This page took 0.028999 seconds and 4 git commands to generate.