From patchwork Fri Oct 29 04:33:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516416 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp413366iml; Thu, 28 Oct 2021 22:10:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz24E37s13U8l8aeT453tpX0NnKwRS0x/bKu5aCfKHJmYfa3ECjOOie+dUAoteyv+1ySQK X-Received: by 2002:a05:6830:438e:: with SMTP id s14mr6896975otv.133.1635484248356; Thu, 28 Oct 2021 22:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635484248; cv=none; d=google.com; s=arc-20160816; b=JBr/HgyJmwZlPffzfsJiDSD6o5C0DqU9NGJeHHLE3R8ha+pQO7rB6PCram38+N2wcf odt5LW61IfYsJBDLa8jnOWI5vVuXq0h6YT1X3/VcqNbZJtZBKd3KdnsYepaMK0/v9qT5 De7zQLZXn/1R70ufcHsQwRyb/Ff4TCb6raNoMrNeBqcc9JJxBdL4K3jYt0RrNMJTWq6G Xn+GlRaDzEBVf9IM2P7eErcXufZFFxvp/Td476VesGCciOV/9yQNwk33nRv4iDhgwWuv 9JTYQTIgZAeiJAZYW+1LAoxQ8asJnDBlaT4QSLN8v77lfvH5rQdtBEDbm1jYYJlx2mV3 BCUA== 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=A6kctx71i8wzEpW9P/tf7EMU4+ENs8we2z5h5BKjvM0=; b=i/PFYsHzGL4Au7zD63lrq93Qg7XC4f2jY6t1MP62fBHimAOkVnCMdpWk2EKW5iMdPE g+xAIDXWcZmqMRlDMTSq2SPECc+G/N/tW/tUAebTBb0XShKSlqojEPE2Cye9gRKIUtHl JHGiqgdowHhLZBy06Woe50cl0wLDGY7jz1eO5YOR5JV81co9l+LdEv8GwEdl4Kkkn9Q/ 1080HB0RLuX9mgaTyqHooLFvgF7MWp0w2lIY1QlYiBPFcDUUjqNSOfNFcgGlu5EMRsO3 F57d3DWomMpBp8bN9BVIBXCUL5rGBRzC7QMhOl8wabp/tKN7ms/zSC50WzwyA3/gaFmB cdUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q31IzQeS; 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 i10si5563097oih.221.2021.10.28.22.10.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Oct 2021 22:10:48 -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=q31IzQeS; 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]:36116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgKAB-0006tZ-Ev for patch@linaro.org; Fri, 29 Oct 2021 01:10:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgJdr-0002dD-Mr for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:37:24 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:37449) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgJdl-0000OJ-IT for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:37:23 -0400 Received: by mail-pj1-x102a.google.com with SMTP id t5-20020a17090a4e4500b001a0a284fcc2so9653166pjl.2 for ; Thu, 28 Oct 2021 21:37:16 -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 :mime-version:content-transfer-encoding; bh=A6kctx71i8wzEpW9P/tf7EMU4+ENs8we2z5h5BKjvM0=; b=q31IzQeSrYcdc9cJBuuNkwxLHkc0M3H4uz0dWtL1XFkHSE31NITvYNItX9CPc68I89 9dF39fiDR7EXUq+JNF7bYlnV1LMemc+/darHj97B0WcRfMUgdec0ceFWabLr8wBrHQTX modIuqAlhQ/zyfPwU8cR0oROx2z8ih0ZPhFONIE/7cQ2nV8OxW3k6Brn1kpWHleOz4pC O76npblMY2JurdauB971JclG7dmzxV5EuFzxI3kP09xTVPuLV5XxdcuDmqsdRlVfs4m6 0Zn6uKSkQyJF7YXosslDg4GwL4X9ybrfxU93HyeErIH8k+ARK65npeFN6BJxeU9LKKET mTmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A6kctx71i8wzEpW9P/tf7EMU4+ENs8we2z5h5BKjvM0=; b=r2F06zsDOE6JYefmFc5S7FRHL3Y8Ie3VTSkLELFnWjhiZN6HbbXx1fu2X0Dj8Xky88 ltfCfar5OK/KgN05dX2fYP7ohp7lWOQd2ErCrYQTpM2zST/XWqPYMXZmCcxo828u1rG8 MARIkmjvZAn+QQy75ra9kBz4QJT9IM1wr/JV8dNfpc3W9qulALiA4O5GZhTj7RpJ8cqX FLxjkFEIFrXJU+FA6c5s5T1FDhRks7npVgM3/gb0buHChzpFYfvFI4DTwx5hkmUurTIP wpl0yiTYl2mk2MXCKd4Sc72V9JyhkAYGTJHgbvquvj6Gz07usarNHrAlUJyp7BSklb1a XXxg== X-Gm-Message-State: AOAM5333ZmqqlbnmKsBvj68+HVU7dxYwRnFwAXZQEmUSIfDbdWjfVWNt U3g8daz2UxKMRkOxe2tLBpnE8g3bZM9HbQ== X-Received: by 2002:a17:90a:4283:: with SMTP id p3mr17434371pjg.23.1635482235964; Thu, 28 Oct 2021 21:37:15 -0700 (PDT) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id b8sm5228232pfv.56.2021.10.28.21.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 21:37:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 56/60] tcg/optimize: Propagate sign info for bit counting Date: Thu, 28 Oct 2021 21:33:25 -0700 Message-Id: <20211029043329.1518029-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211029043329.1518029-1-richard.henderson@linaro.org> References: <20211029043329.1518029-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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=ham 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: Luis Pires , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The results are generally 6 bit unsigned values, though the count leading and trailing bits may produce any value for a zero input. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index 5fa4d7285d..c0eccc61d6 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1229,7 +1229,7 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } ctx->z_mask = arg_info(op->args[2])->z_mask | z_mask; - + ctx->s_mask = smask_from_zmask(ctx->z_mask); return false; } @@ -1249,6 +1249,7 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) default: g_assert_not_reached(); } + ctx->s_mask = smask_from_zmask(ctx->z_mask); return false; }