From patchwork Thu Jan 28 22:41:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 372639 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1669428jam; Thu, 28 Jan 2021 14:56:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvBA76H7XfqSPgd5Pr4lCkA7OIzyEUKgACJGMWZAQVt5UKuy6UcAgLSOrk1r77dpsfZm4N X-Received: by 2002:a25:2f55:: with SMTP id v82mr1919805ybv.481.1611874601336; Thu, 28 Jan 2021 14:56:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611874601; cv=none; d=google.com; s=arc-20160816; b=BoqB3zP8Hlf9LaZ9To5kqsIRAXu/5d1aW0I+k9de3IZnxDV19QaHAgqvEfU0Oka5Rs JlS1SzLWMnbuv1P5A3xhmuUItEr5hqRQnm9R0pDpEg0jDZc0EM15jEsADm6bKK87V+6M WsTLJ6VJRhvQDnVG3gez3CwhkPBzDxiOY5wGOVAoOkyiaxAhIs8NfHXO49yfboyzOy3j 4SPVoh+Hn5y+7valu0d3HstTYA3yKztL7CAfcp3+VYJmR8etDdfaaonkulvY58IC8s9+ hdVugKvtBlSI/HsiMEGkcQMfs71hQsEXM6Ryi1nmCqtiL747i4TcPVH+FKQxHW19sS1n a2jg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=3ZJGnXzF/NMDb1ycGSuuM5DTXpfVPEQ3f0lC4BF0AxI=; b=GztmT9b7uKGeSrBbVZVVI+nYHG2i4b3SltuHPEDRy2bpAOJnhNrwTGPcNZCkemmQar eWQHgfHwqqkVbuyh5UnMY9WS9geWbruAF1h8sEpEDu52rIuHE/7zVyoqwnt7bF0VsmUR JwYxUkEODn7QB0d2VGFiCMDXrcf5o9/Ea7R/5N6jH3ZpEyaJsELP20koP0IliU383ish ttWdbWdLTEYvGH9yOIMPBAzK7NqUeVXJ8+w25gg2IBCQVK4pkHZoDoCQiyItsTABrxMd 3tnSefMX2iWIQciXU77RMpWTvQT32jO2Sj+cE/bFsnSpB9lZm+O7GdJLPi2YSEuR0acP 0cjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pbRkK3Ia; 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 d186si6785894ybc.401.2021.01.28.14.56.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Jan 2021 14:56:41 -0800 (PST) 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=pbRkK3Ia; 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]:51712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5GDQ-00046O-R7 for patch@linaro.org; Thu, 28 Jan 2021 17:56:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5Fzc-0005eE-UF for qemu-devel@nongnu.org; Thu, 28 Jan 2021 17:42:24 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:41584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l5FzM-0008A8-1X for qemu-devel@nongnu.org; Thu, 28 Jan 2021 17:42:24 -0500 Received: by mail-pg1-x52e.google.com with SMTP id i7so5277695pgc.8 for ; Thu, 28 Jan 2021 14:42:07 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=3ZJGnXzF/NMDb1ycGSuuM5DTXpfVPEQ3f0lC4BF0AxI=; b=pbRkK3IaVOuCPYjmdn+qbJWZnZgI2Vlttcs3pu6ylmrf1y/64VpXi4t4gaEQM24GvZ UdMXOjgPcTYCt+LFPBIJ/4yrufITKEwp0RGkyumSrwa/YFiua2QBX/oEnd7c81LyvdWv W2Z8weYXAGOtMABscklC8UtbqUXw2EzANfMpKkcMtgwJS4CkstXyt0cThA9fEXnRVFWw BdMrz3EmnXIKlccxWr4/PxU+dcp5gYWfYzAI16D5WDpe5tRhhwNMZn/Tx3F9aBc0c0ls QEWFLldga2q4QtMkVVL29PB799q0io14N86sLuffUu20kvkN0yI4Cool7DzVvB0Pu9EL 7Krw== 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:mime-version:content-transfer-encoding; bh=3ZJGnXzF/NMDb1ycGSuuM5DTXpfVPEQ3f0lC4BF0AxI=; b=sq+GerO1GM0aZCrL4FNIwYXKaOvU21wcUQ/lpBYybwoCjxg8RZnmcoNvshvsEI8kyO trBzAWxXtPdsXtmNukv6uXkH8exyst+kPm4bL/17RAqJg8zAtOUu09oJEdCYFEPXxnym Xtk5kjmdSCkYUEVfT5gtk4B1LGsvOEBdQ56++tkF3CuiTEQv6GmIhJGS5Fbiym8rV9eh Az3jNgmmu3xkZYdZe+ApX9cHLorBeecUoSrVlyc5y9wrkV/Er7cIAg8QEre8KTqxT/+v MV+emTDGQvJLZi0zaMacSz5IwN3ufEGDu7WRuty4mzTj0iROxUazOwLmP9NANuGyMSC/ xUag== X-Gm-Message-State: AOAM531mbxETMjXdSb51v6YIbTB514LpXxgqRSkL3sLlXg14J6g/a+zx VQaT0FgnW7390PzIwLg+CB30NsofXUKMcf0c X-Received: by 2002:a63:1865:: with SMTP id 37mr1595347pgy.206.1611873726197; Thu, 28 Jan 2021 14:42:06 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id m10sm6042358pjs.25.2021.01.28.14.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 14:42:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 13/23] target/arm: Improve gen_top_byte_ignore Date: Thu, 28 Jan 2021 12:41:31 -1000 Message-Id: <20210128224141.638790-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210128224141.638790-1-richard.henderson@linaro.org> References: <20210128224141.638790-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use simple arithmetic instead of a conditional move when tbi0 != tbi1. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index ffc060e5d7..3ec0dc17d8 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -183,17 +183,20 @@ static void gen_top_byte_ignore(DisasContext *s, TCGv_i64 dst, /* Sign-extend from bit 55. */ tcg_gen_sextract_i64(dst, src, 0, 56); - if (tbi != 3) { - TCGv_i64 tcg_zero = tcg_const_i64(0); - - /* - * The two TBI bits differ. - * If tbi0, then !tbi1: only use the extension if positive. - * if !tbi0, then tbi1: only use the extension if negative. - */ - tcg_gen_movcond_i64(tbi == 1 ? TCG_COND_GE : TCG_COND_LT, - dst, dst, tcg_zero, dst, src); - tcg_temp_free_i64(tcg_zero); + switch (tbi) { + case 1: + /* tbi0 but !tbi1: only use the extension if positive */ + tcg_gen_and_i64(dst, dst, src); + break; + case 2: + /* !tbi0 but tbi1: only use the extension if negative */ + tcg_gen_or_i64(dst, dst, src); + break; + case 3: + /* tbi0 and tbi1: always use the extension */ + break; + default: + g_assert_not_reached(); } } }