From patchwork Mon Jun 10 02:02:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 166282 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp490913ilk; Sun, 9 Jun 2019 19:48:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7YaZwhd77YoSk+CtxT6h8tM9HMLoZbpkQVVjYgH8/nAuizK/9vmQz/Dj5i+ZtdQUB3EMS X-Received: by 2002:ac8:38d5:: with SMTP id g21mr56557821qtc.52.1560134894086; Sun, 09 Jun 2019 19:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560134894; cv=none; d=google.com; s=arc-20160816; b=aTt1QATiMQXQIqcfU9nzf11lhKrOHfvvoRPpUKm1ix5l0j+kxlSC3s8L76r4OhfOGY hleVsJIctKxT79pJdITH/nP1GAYNweBfPOran17d6aLWYzqphvcQNUfq4Jc+4aa1HYIR Vh3W9OEoetald4bZIN5ZnrBfqpa5tuXpIgLAXrTW7aLFkt+cjAPBO4Vjhu/vvkaBGamm uQa8AYUARsN/11DkONg/azGqfG7Fb7zGIDUYGMoxQpoaYklzsNjyNX7ESWDyy2JLjnQb j0OgfMLhKgr/XZUo+9Nca6+nFuqTZ/VEBy4heu/vXJ7M6jL7Y4d2aS+kvX8z3h7HpkEg w9QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=8wDpuqt2tvKadOymhMpkkiKWS+EHs0ZcemyyrplJ7bs=; b=JPb+iKR3YAWcf67k7VIPmNnXKHy/gyJBYiacTgnkPkRkAkjqLKYZgkBaH5LJSPR6+a 2xnZBGHLCGLKPu0TEpEDjT2EfZLEzPzDpjSBjnmOzE/Kz8vZL4PCkYSqc6mGuwuIrQsZ +8o0oyQUMiFCCV+8Mw5AVGqFSWEmXqYlcbE/y1oGB0iqMHLppuU8Hq1FN4PE6lBw/0uW ILHD0D/qKv4B4v8qGQ0+hokoCtC/ZUcyX5ARUR29SrkJUQS73E/Yo2llVy5cnVsm5wUd PP1LRiYOBryl/oQHeBzzMWSkawvPywhgvw989gzwGf+GjBODBg/ZZCcV906zx0IV0ZIu P17g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pa5sXyyU; 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 t8si6249916qti.213.2019.06.09.19.48.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2019 19:48:14 -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=Pa5sXyyU; 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 ([::1]:39970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haAM1-0002yb-Ip for patch@linaro.org; Sun, 09 Jun 2019 22:48:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53448) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha9eT-0006z3-FR for qemu-devel@nongnu.org; Sun, 09 Jun 2019 22:03:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ha9eR-00028B-GM for qemu-devel@nongnu.org; Sun, 09 Jun 2019 22:03:13 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:44777) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ha9eQ-00025L-El for qemu-devel@nongnu.org; Sun, 09 Jun 2019 22:03:11 -0400 Received: by mail-pl1-x644.google.com with SMTP id t7so372726plr.11 for ; Sun, 09 Jun 2019 19:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8wDpuqt2tvKadOymhMpkkiKWS+EHs0ZcemyyrplJ7bs=; b=Pa5sXyyUli+7bcoMZwYI6ygYrsVmEagluOG/GkVNE9asG5yEHoe6fDsjkyL0wp7ujV AZlQHT1VStnhfIOyj96dbjmYOvpIv4Igt/V7nE4IL7Fz2HvUSZBFK462dWiFHeRLJbiT OOSKkrdOscSA5Sh1Pu8UMejgCOEYQHx6HhZnIje5jKM/wV1pV0akgZRVdV7YDvs8UUco 3HZyW+5iDSpq7edhX489/AAOyJMAXn0qVAmGy38umhSWs+gBpiN0tWBVpiivjx/teOL/ IEDlpmhMLVavmhEFtad8DL8yZIhRSgGozuXeEOip0LGKxcqH70+DU3WdPuIyWO63BqUN pKeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8wDpuqt2tvKadOymhMpkkiKWS+EHs0ZcemyyrplJ7bs=; b=FBHVT2WIPxuyxdKyNmbIcnmmMFElz7wT8XyWhl6s6PSIII+8+AVowsYzqu/WIbXqh5 hs9PrHHHsqJ+dpzLQ0g22WrA12dLLtCFLNh4RZsrDXWLSjkq+gwPXAFFDtSYbLZVo6Np 5iN5SQLpR9NEATdxHW3iv5FUJWVsBiogB0PaWxMUe0uM9aqWnxnxrcuU8LlHHLyFh1hb +HTQuk+0KTxw2QnL8g54F7Ivbk10reT6KZrkSgbZvdetxj0yHtuxw6vqnOFfiJvaeJ8K WeuIy/tX1wEZolzG39BjSye2R6ynAykCN9Jb7ysM4Dx92bxNuMy3iPoJ0R17qyAZecws nBBg== X-Gm-Message-State: APjAAAWKSonep2gpi4NB+tEOBRorCZMLcTTOt6yxaonWs+zlyEFx9Zh+ ///ru+pOcV3G2kUU6hW94JmlH1wNDhU= X-Received: by 2002:a17:902:70c4:: with SMTP id l4mr32326368plt.171.1560132187540; Sun, 09 Jun 2019 19:03:07 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id l63sm9749013pfl.181.2019.06.09.19.03.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jun 2019 19:03:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 9 Jun 2019 19:02:18 -0700 Message-Id: <20190610020218.9228-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190610020218.9228-1-richard.henderson@linaro.org> References: <20190610020218.9228-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::644 Subject: [Qemu-devel] [PULL 39/39] tcg/arm: Remove mostly unreachable tlb special case X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org 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. Acked-by: Alistair Francis Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.inc.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index 276e843627..ece88dc2eb 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) {