mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-31 14:02:05 -06:00
tcg/arm: use the blx instruction when possible
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
8f7f749f21
commit
23401b58a4
1 changed files with 12 additions and 4 deletions
|
@ -357,6 +357,11 @@ static inline void tcg_out_bl(TCGContext *s, int cond, int32_t offset)
|
||||||
(((offset - 8) >> 2) & 0x00ffffff));
|
(((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,
|
static inline void tcg_out_dat_reg(TCGContext *s,
|
||||||
int cond, int opc, int rd, int rn, int rm, int shift)
|
int cond, int opc, int rd, int rn, int rm, int shift)
|
||||||
{
|
{
|
||||||
|
@ -778,10 +783,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)
|
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); */
|
if (use_armv5_instructions) {
|
||||||
tcg_out_dat_reg(s, cond, ARITH_MOV, TCG_REG_R14, 0,
|
tcg_out_blx(s, cond, arg);
|
||||||
TCG_REG_PC, SHIFT_IMM_LSL(0));
|
} else {
|
||||||
tcg_out_bx(s, cond, arg);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void tcg_out_goto_label(TCGContext *s, int cond, int label_index)
|
static inline void tcg_out_goto_label(TCGContext *s, int cond, int label_index)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue