aboutsummaryrefslogtreecommitdiff
path: root/tcg/ia64
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-10-31 15:19:23 -0400
committerRichard Henderson <rth@twiddle.net>2014-04-17 16:56:16 -0400
commitdcf91778caa36338a252703f6d40f06cc14acfce (patch)
treee8b3e7d17c7438350f41209543aa77f68e770548 /tcg/ia64
parentc6138aabfb2a8769392d605dc1e339b3095aab6a (diff)
downloadqemu-dcf91778caa36338a252703f6d40f06cc14acfce.zip
qemu-dcf91778caa36338a252703f6d40f06cc14acfce.tar.gz
qemu-dcf91778caa36338a252703f6d40f06cc14acfce.tar.bz2
tcg-ia64: Optimize small arguments to exit_tb
Saves one bundle for the common case of exit_tb 0. Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg/ia64')
-rw-r--r--tcg/ia64/tcg-target.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tcg/ia64/tcg-target.c b/tcg/ia64/tcg-target.c
index 2d8e00c..7407011 100644
--- a/tcg/ia64/tcg-target.c
+++ b/tcg/ia64/tcg-target.c
@@ -950,15 +950,21 @@ static inline void tcg_out_callr(TCGContext *s, TCGReg addr)
static void tcg_out_exit_tb(TCGContext *s, tcg_target_long arg)
{
int64_t disp;
- uint64_t imm;
+ uint64_t imm, opc1;
- tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_R8, arg);
+ /* At least arg == 0 is a common operation. */
+ if (arg == sextract64(arg, 0, 22)) {
+ opc1 = tcg_opc_movi_a(TCG_REG_P0, TCG_REG_R8, arg);
+ } else {
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_R8, arg);
+ opc1 = INSN_NOP_M;
+ }
disp = tb_ret_addr - s->code_ptr;
imm = (uint64_t)disp >> 4;
tcg_out_bundle(s, mLX,
- INSN_NOP_M,
+ opc1,
tcg_opc_l3 (imm),
tcg_opc_x3 (TCG_REG_P0, OPC_BRL_SPTK_MANY_X3, imm));
}