From patchwork Mon Jun 19 18:18:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9797135 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7348F600C5 for ; Mon, 19 Jun 2017 18:20:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 497E42844C for ; Mon, 19 Jun 2017 18:20:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EA5E28459; Mon, 19 Jun 2017 18:20:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2B662846A for ; Mon, 19 Jun 2017 18:20:23 +0000 (UTC) Received: from localhost ([::1]:43823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN1HU-0008NF-Q0 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Jun 2017 14:20:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN1GC-0008LL-Fb for qemu-devel@nongnu.org; Mon, 19 Jun 2017 14:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dN1GB-0002Ct-KN for qemu-devel@nongnu.org; Mon, 19 Jun 2017 14:18:48 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:36371) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dN1GB-0002CZ-Fo for qemu-devel@nongnu.org; Mon, 19 Jun 2017 14:18:47 -0400 Received: by mail-pg0-x241.google.com with SMTP id e187so8690768pgc.3 for ; Mon, 19 Jun 2017 11:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=suOvBjYsdyzgDadyYZ3dijcg+kPPRJEFebrn14pDwhU=; b=mzvyA1CuuG0lrs14paUcSw/4MuxuQrISoK6UP/HZYmmJY62xUlYv+FyVGxMkdXNB54 8VvFBtXQCDsGATu/e2A77CNHy5H1Ogoh1XiusXvuTjHBDqXuAJ65DkBRbdngjOKq51Lj UmqFoSPQz4r/llK0foCQy9u+Igyvp0Zb9ZYxbMCn+nelxIsRlNndMEBJG2cRcw2fW+hn Ib3A5aqQpgbQf09nTYLZmW7Et40rtetB+EFGi63gGik26TWKhl55GbrNO40ygZ9otYN/ 7BU10g9fK9IUn/ofkq62FlBXi32IMJ+XssZp8pMEz0bWASCIA2TxWUzmG+INSKL8/Odi 3gjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=suOvBjYsdyzgDadyYZ3dijcg+kPPRJEFebrn14pDwhU=; b=TUKUHrivAPsqlJJD3FXHfuttfgCzSwdgymOfJuce4fSuN/6AJIs0bJO2gUkjHh6XaO 9/vmQCJSxbkDzGqwVtGiasPAuRZDG4S1AEYawf4xm8kb5SInkIz7uxgeyt06cpsRykLY l9OjKBX11fjfpv/RsNTgnASDu5fn0vgz9JciruafkjIdcPxeCfix9rCpf0L0KvTdYrO+ 7bgpYWiX9W/hIY05zHW9TOlVTxoPf+0NKOJiFwdQu8DF3oXWaRfhQDyll1vCZv+oHtMf tKsFw6sR4RsdkjAEV7P4SQznkkgcHOv+kivP9fE39btTYhhISKZJ3UTLVt+OzdJlkPcV LmKQ== X-Gm-Message-State: AKS2vOyhxXyfBhjzFLKKOGvOE2yNoJyUxTFrH3MD9zLcCzRFSXURykXl 97BZpFxUOKof6KFJPng= X-Received: by 10.98.69.219 with SMTP id n88mr25926607pfi.93.1497896326394; Mon, 19 Jun 2017 11:18:46 -0700 (PDT) Received: from pike.twiddle.net (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id e63sm22917171pfb.18.2017.06.19.11.18.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jun 2017 11:18:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Jun 2017 11:18:31 -0700 Message-Id: <20170619181839.25249-5-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170619181839.25249-1-rth@twiddle.net> References: <20170619181839.25249-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PULL 04/12] tcg/aarch64: Use ADR in tcg_out_movi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The new placement of the TB means that we can use one insn to load the return value for exit_tb returning the TB pointer. Tested-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.inc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 5f18545..1fa3bcc 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -616,7 +616,12 @@ static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd, /* Look for host pointer values within 4G of the PC. This happens often when loading pointers to QEMU's own data structures. */ if (type == TCG_TYPE_I64) { - tcg_target_long disp = (value >> 12) - ((intptr_t)s->code_ptr >> 12); + tcg_target_long disp = value - (intptr_t)s->code_ptr; + if (disp == sextract64(disp, 0, 21)) { + tcg_out_insn(s, 3406, ADR, rd, disp); + return; + } + disp = (value >> 12) - ((intptr_t)s->code_ptr >> 12); if (disp == sextract64(disp, 0, 21)) { tcg_out_insn(s, 3406, ADRP, rd, disp); if (value & 0xfff) {