From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKub8-00009W-OY for qemu-devel@nongnu.org; Tue, 04 Mar 2014 14:01:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKub2-0000lD-Uw for qemu-devel@nongnu.org; Tue, 04 Mar 2014 14:01:50 -0500 Received: from mail-qc0-x231.google.com ([2607:f8b0:400d:c01::231]:46472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKub2-0000l6-QC for qemu-devel@nongnu.org; Tue, 04 Mar 2014 14:01:44 -0500 Received: by mail-qc0-f177.google.com with SMTP id w7so5712976qcr.8 for ; Tue, 04 Mar 2014 11:01:44 -0800 (PST) Sender: Richard Henderson From: Richard Henderson Date: Tue, 4 Mar 2014 11:01:00 -0800 Message-Id: <1393959667-19125-2-git-send-email-rth@twiddle.net> In-Reply-To: <1393959667-19125-1-git-send-email-rth@twiddle.net> References: <1393959667-19125-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PULL 1/8] tcg-ia64: Optimize small arguments to exit_tb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, aliguori@amazon.com, aurelien@aurel32.net Saves one bundle for the common case of exit_tb 0. Signed-off-by: Richard Henderson --- tcg/ia64/tcg-target.c | 12 +++++++++--- 1 file 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)); } -- 1.8.5.3