From patchwork Thu Oct 31 20:22:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 287618 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 519042C03F7 for ; Fri, 1 Nov 2013 08:07:51 +1100 (EST) Received: from localhost ([::1]:59195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vbyqz-0001Yi-Rk for incoming@patchwork.ozlabs.org; Thu, 31 Oct 2013 16:28:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbylX-0003DH-4H for qemu-devel@nongnu.org; Thu, 31 Oct 2013 16:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbylR-0000Uz-9Y for qemu-devel@nongnu.org; Thu, 31 Oct 2013 16:22:51 -0400 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]:44458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbylO-0000Ui-5k for qemu-devel@nongnu.org; Thu, 31 Oct 2013 16:22:45 -0400 Received: by mail-pb0-f52.google.com with SMTP id rr13so1872525pbb.11 for ; Thu, 31 Oct 2013 13:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=WXLk6ge2Cw108dNkLL4MLxFOZpkzXDLfPxNsVcvWQjk=; b=WoVK9B6uezqkcL1BkpH9W2+rHQoHwCLeCKtoEjEpnYTS6EL6E1JEJ/6FcChoX11oM2 xx1kBo9BDhWxLyanxYylzQMbotg6S1XwHCB9bcxI7nVM/ICe4OcsmovzuqVM3EpAa8uA mnkR2c0SdTZvw89vXCkiBaD6jREHJnITIZBu1GJEhIdnnaMcaOfYRHXWDnwpc1kjYJ2v 30mrvGxKEg/qQxnFrNNzVvx+LU6Diz9PeXWJYWdChjvY3O9PBOQr9woIsWZaHyIwoqdL PchbUP3n7We16cyZsGaUfwcwTnNPNn8g92OS4cBuLq6kcOwmL8sChupF69pUUcLVa/2C SE9Q== X-Received: by 10.66.231.42 with SMTP id td10mr3709212pac.144.1383250961262; Thu, 31 Oct 2013 13:22:41 -0700 (PDT) Received: from pebble.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPSA id ve9sm6109179pbc.19.2013.10.31.13.22.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Oct 2013 13:22:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 31 Oct 2013 13:22:09 -0700 Message-Id: <1383250929-10288-21-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1383250929-10288-1-git-send-email-rth@twiddle.net> References: <1383250929-10288-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::234 Cc: aliguori@amazon.com, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 20/20] tcg-ia64: Optimize small arguments to exit_tb X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 a9dd153..6483fa0 100644 --- a/tcg/ia64/tcg-target.c +++ b/tcg/ia64/tcg-target.c @@ -960,15 +960,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)); }