[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/18] tcg/arm: use the blx instruction when possibl
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [PATCH 08/18] tcg/arm: use the blx instruction when possible |
Date: |
Wed, 7 Apr 2010 19:51:15 +0200 |
Signed-off-by: Aurelien Jarno <address@hidden>
---
tcg/arm/tcg-target.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 777c4ac..3360c23 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -333,6 +333,11 @@ static inline void tcg_out_bl(TCGContext *s, int cond,
int32_t offset)
(((offset - 8) >> 2) & 0x00ffffff));
}
+static inline void tcg_out_blx(TCGContext *s, int cond, int rn)
+{
+ tcg_out32(s, (cond << 28) | 0x012fff30 | rn);
+}
+
static inline void tcg_out_dat_reg(TCGContext *s,
int cond, int opc, int rd, int rn, int rm, int shift)
{
@@ -754,10 +759,13 @@ static inline void tcg_out_call(TCGContext *s, int cond,
uint32_t addr)
static inline void tcg_out_callr(TCGContext *s, int cond, int arg)
{
- /* TODO: on ARMv5 and ARMv6 replace with tcg_out_blx(s, cond, arg); */
+#ifdef USE_ARMV5_INSTRUCTIONS
+ tcg_out_blx(s, cond, arg);
+#else
tcg_out_dat_reg(s, cond, ARITH_MOV, TCG_REG_R14, 0,
TCG_REG_PC, SHIFT_IMM_LSL(0));
tcg_out_bx(s, cond, arg);
+#endif
}
static inline void tcg_out_goto_label(TCGContext *s, int cond, int label_index)
--
1.7.0.4
- [Qemu-devel] [PATCH 0/18] tcg/arm: cleanup and improvements, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 02/18] tcg/arm: explicitely list clobbered/reserved regs, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 01/18] tcg/arm: remove SAVE_LR code, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 05/18] tcg/arm: align 64-bit arguments in function calls, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 09/18] tcg/arm: add rotation ops, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 07/18] tcg/arm: sxtb and sxth are available starting with ARMv6, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 11/18] tcg/arm: add bswap ops, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 08/18] tcg/arm: use the blx instruction when possible,
Aurelien Jarno <=
- [Qemu-devel] [PATCH 06/18] tcg/arm: add defines for the allowed instructions set, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 03/18] tcg/arm: remove store signed functions, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 04/18] tcg/arm: replace integer values by registers enum, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 18/18] tcg/arm: don't try to load constants using pc, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 13/18] tcg/arm: use ext* ops in qemu_ld, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 10/18] tcg/arm: add ext16u op, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 16/18] tcg/arm: fix argument alignment in qemu_st64, Aurelien Jarno, 2010/04/07
- [Qemu-devel] [PATCH 17/18] tcg/arm: optimize register allocation order, Aurelien Jarno, 2010/04/07