From patchwork Wed May 8 00:06:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163594 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp2007436ilm; Tue, 7 May 2019 17:34:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4Uj419MYwzp7Il7mu9FqZpC1gk8lBzxNViWnvAwjRYrIf5PCtIt+t0COB3CwQNtfVyrT6 X-Received: by 2002:a7b:ce83:: with SMTP id q3mr753904wmj.32.1557275694264; Tue, 07 May 2019 17:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557275694; cv=none; d=google.com; s=arc-20160816; b=Xw0szv6+daINjbVptyDf5JK5YqXbcKd9clVMFFObthR564f3ZUqadgKfDmVYa4KiDm nME5IXFhWuC2v/bY6cpeUYWP8P0T209wICPNfIF/hx7Em9yvNncNOh9W3P7B1dMnp6T9 62MOQ9PSTRnY4BAcWPrb/CVHcnaEcYjbNqbKh+soVP9QaQoCaTiFZnp4EavTRukGmR1u VmDktLM2XUryPWPqh4gTghXUl11CP5wHQKy3fflcGqYGQgNR1LNaCiHWwJjkW0z7+n5g xUdU2D1mGwIKoQDd7XPK9PI9hNCexeFYu3duGtNyP7tEasG9MqJ8cbdElT1Fy/QXYwIC dt4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=/VisHp15wmByWPI9wrDoIYVzQ1fadCpZ+X3Fx4ON5aw=; b=NtobZuVe+EteRxDaV7BQiLA0Kpvb1fgHpZ1y+DSPM4QX7GhMymaFeGnO5nPFJ+lz8w f8bF9JELHezMljBgbi7bM5Lqu+Hf0CYbbDTi0XDhLM6pKn+M8gyaDfjSMcmNXgtUEJSI C3wtClYKTNfUqeYkzPqgl5UhBqNXWVBIhePPH59nrMlPOjwR2t8vAZmrxh8R3ZXD9zx0 B86/vugDTU7mOsEeyCoKOBJMFLr9sqdnWW52VdPT0f9lVNlfAH5gnC4EBL8QqF8lODwg CpkY1zbozad3aW/4TKhNOKalZRzI6juMcyjd09ERQQXoduskYvSD2aAq8tSw4ajGhD7M XFvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uyC3EDDx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n21si378024wmh.98.2019.05.07.17.34.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 May 2019 17:34:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uyC3EDDx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:56766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOAXt-0006yv-8f for patch@linaro.org; Tue, 07 May 2019 20:34:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOA7W-00080o-6Z for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOA7V-00088F-7q for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:38 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:42913) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOA7V-00081f-29 for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:37 -0400 Received: by mail-pg1-x52d.google.com with SMTP id p6so9105913pgh.9 for ; Tue, 07 May 2019 17:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=/VisHp15wmByWPI9wrDoIYVzQ1fadCpZ+X3Fx4ON5aw=; b=uyC3EDDxkaYnDjrjZFoYjidue6lNiQiawjkOzkgFjBiYdqU6HhgkvKQolHFs2P0sRp D8FTg3u70ocU4Ce7kbX2cl5ubevigBd42AHcmC5KtDImk8tDk5QLf2Xj8Z+5bxe+tSsz GFiik9/m+2F6A5KPDAYBnaLa6+qO4DZ1VfPumMUcZjCzvWG7eoHDUBv0xPOAqMHvU8zN XpIufTkdsHZX7Z6jvEvIGYroOkHWsGB/so8rnBaz38e9hQnU0YCS7mLtrhiXoYz9QR8l EsaQd97J9iOE4tz4kOu5ReCpi5Nbhe9dyCVY66J9Qi2QH2RNmziwEjmglu0PaqWBze+6 vlbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=/VisHp15wmByWPI9wrDoIYVzQ1fadCpZ+X3Fx4ON5aw=; b=NGBPdApXKGmyIYdnRLPVY6B6Sl96yHCGMMLK2OLvwoGlpUlUlauOf2lJZMcN3Xo3Ur mp9STZ7OiS8pjBPrG/4OFfys5ZtukeqG/7Gqt0R65oH98GiX4c4gZQxK9W0WO88wB+Eo CQKuBBnshZ2/FEYLX+QoxBwTqSEPYuE+zRqSOKbC3NfzyiD9jScemlotDt22gjtswAyk Bk8DhI0wJESYM1q8sayvDyuIaxb57KqHeB4+XG8pvRD6S3D5uPwG/DOdbUK4fh6mJC9g RaJH+araRbSh6M6i/aUN0fHAPp6lj/Ux/CxqPcayAEKx+AA2aFkBwNHha3rWqAFom2D1 tVwg== X-Gm-Message-State: APjAAAUZIv2wIPP0H45hnn9BXJKH+eg8XokE9EPImPrJysIO2snI7CZU otNm4LSKdn44868P2lHvFANdHpYa36I= X-Received: by 2002:a62:5915:: with SMTP id n21mr43602164pfb.180.1557274054723; Tue, 07 May 2019 17:07:34 -0700 (PDT) Received: from localhost.localdomain (97-113-189-189.tukw.qwest.net. [97.113.189.189]) by smtp.gmail.com with ESMTPSA id j1sm15793183pgp.91.2019.05.07.17.07.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 17:07:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 17:06:41 -0700 Message-Id: <20190508000641.19090-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508000641.19090-1-richard.henderson@linaro.org> References: <20190508000641.19090-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52d Subject: [Qemu-devel] [PATCH v3 39/39] tcg/arm: Remove mostly unreachable tlb special case 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There was nothing armv7 specific about the bic+cmp sequence, however looking at the set of guests more closely shows that the 8-bit immediate operand for the bic can only be satisfied with one guest in tree: baseline m-profile -- 10-bit pages with aligned 4-byte memory ops. Therefore it does not seem useful to keep this path. Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.inc.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) -- 2.17.1 Acked-by: Alistair Francis diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index ac813abfb8..e0fcc1d990 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.inc.c @@ -1290,19 +1290,20 @@ static TCGReg tcg_out_tlb_read(TCGContext *s, TCGReg addrlo, TCGReg addrhi, tcg_out_ld32_12(s, COND_AL, TCG_REG_R1, TCG_REG_R1, offsetof(CPUTLBEntry, addend)); - /* Check alignment, check comparators. */ - if (use_armv7_instructions) { + /* + * Check alignment, check comparators. + * Do this in no more than 3 insns. Use MOVW for v7, if possible, + * to reduce the number of sequential conditional instructions. + * Almost all guests have at least 4k pages, which means that we need + * to clear at least 9 bits even for an 8-byte memory, which means it + * isn't worth checking for an immediate operand for BIC. + */ + if (use_armv7_instructions && TARGET_PAGE_BITS <= 16) { tcg_target_ulong mask = ~(TARGET_PAGE_MASK | ((1 << a_bits) - 1)); - int rot = encode_imm(mask); - if (rot >= 0) { - tcg_out_dat_imm(s, COND_AL, ARITH_BIC, TCG_REG_TMP, addrlo, - rotl(mask, rot) | (rot << 7)); - } else { - tcg_out_movi32(s, COND_AL, TCG_REG_TMP, mask); - tcg_out_dat_reg(s, COND_AL, ARITH_BIC, TCG_REG_TMP, - addrlo, TCG_REG_TMP, 0); - } + tcg_out_movi32(s, COND_AL, TCG_REG_TMP, mask); + tcg_out_dat_reg(s, COND_AL, ARITH_BIC, TCG_REG_TMP, + addrlo, TCG_REG_TMP, 0); tcg_out_dat_reg(s, COND_AL, ARITH_CMP, 0, TCG_REG_R2, TCG_REG_TMP, 0); } else { if (a_bits) {