From patchwork Mon Aug 30 06:24:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 504333 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp1533819jai; Mon, 30 Aug 2021 00:10:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgRBGoFVli43PzNhJNfYdEchQUu1hhNHwlkrDXzehnIyvLeLVLp0M3mNJ6sk2Sw9bL+TQK X-Received: by 2002:a02:90d0:: with SMTP id c16mr18949297jag.106.1630307403570; Mon, 30 Aug 2021 00:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630307403; cv=none; d=google.com; s=arc-20160816; b=nVhskuiUf4a+x7E9BnJXno8fx4L9TdB3yo85lIgZnPoW3Vw4g+9AdW/SIi9j13QJ7d i99eBseqWBsh9CeUBEhMM0tCvK12r2CXIfLamMYFWBG+CiZPdYs5Yu5z4IPQkszl7mE5 95ybImwqbjJ72+MBHoSO/xpFsIOqulrj7a0UqJaO/Zgwil/4i65o7ORUKyUtZy33pg1J Nr5WpmxjfTeiz/yMJHs9OfUu1q1k97JJmwu3hK4bmo8xgIc3CHprquZs6S87a0bnL0fi BG3+uEjkY4sBdjt2n2uh2kkpadbXPiCeS5fGh10PZSciB50q1en884s5I03Mm98fQZwQ FxlA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=rvNuXyDgl561ih0UCNemc0yPl83Dln6iOUSP6pwicZo=; b=AMQT5695oMPMm4P+gU8FvtYdU65d63c8vWf05WBEp7wJXDYA8xPP044WTWlWw9tAk0 w/YJoEYYSitWPSq0bgu7CxZ9lV5Bai1I4dA7kJthaxz1/62JCZ9kANa3dh9qePMR3dvD J71ebgz7s2+nBJmIaeI54B5ldAc7K9S/VcHPMe67piyI/xLzz/Q3JhGR45/3YuaCzm2M sVM17oaSOPqr3XIPqKCf+9jW5rWEhJQGIgYhsl7A/xXWlu8vzwt+JLitzOdMjk4ZZSyN UE+czic/lMWi42t+gt0YeAOWkU/xG9m+eUUkcfw+q7rImmo5EgGKYpBbWwR/CdK97URK h4pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NyFJ+B3q; 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=pass (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 12si16263747ilx.115.2021.08.30.00.10.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Aug 2021 00:10:03 -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=pass header.i=@linaro.org header.s=google header.b=NyFJ+B3q; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKbQh-0005p6-1D for patch@linaro.org; Mon, 30 Aug 2021 03:10:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKamT-0003Fe-Ud for qemu-devel@nongnu.org; Mon, 30 Aug 2021 02:28:29 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:51787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKamO-0001qT-Fz for qemu-devel@nongnu.org; Mon, 30 Aug 2021 02:28:28 -0400 Received: by mail-pj1-x1029.google.com with SMTP id oa17so8769727pjb.1 for ; Sun, 29 Aug 2021 23:28:24 -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:mime-version :content-transfer-encoding; bh=rvNuXyDgl561ih0UCNemc0yPl83Dln6iOUSP6pwicZo=; b=NyFJ+B3q6VEeVb012HH2SkZhFgBclrgflDc+5s+SITCxjv2CFsuJ6uLkgi0tZFgIZn HoE5t5JOxFKFUxTI7SGiv/YjF3ZjSJM8cDDUvqwqyI0aq17FGwSmSanS2QHzqHo6s7NZ j0VvKACxThDa2UiCej3z+RViNxakybJPq0Mj4NeYOMF7AQhKUCJldukAer4+dycGQe7b y8dSnEc+R/8HyNav2ZA4t5VrNmRWpHxebCpLrpVf01toL4Wxb797QPU+pr9mY+O3Pi6n d8aGPGM6cCdfQTFI560RBnXgXpyr3aCRuYz3g2Ad4O0pgy2pQ+9qhnDO6ggSzD5fhYRZ rHmA== 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:mime-version:content-transfer-encoding; bh=rvNuXyDgl561ih0UCNemc0yPl83Dln6iOUSP6pwicZo=; b=OO6nfuMHQRs7IIzJAsxqRiEyKz6DtkxVDhyk/S80bJv0Tslb1FcBhSkoLPCtiSr8Cr 1WX86yz7vtRZhZhADCnXQJctg2I1On9YgM2IByBW9F2nLQ9hOHbPWk5C8EbKVN7SmKwU d9L6xlgqoyR/EvZKYuMUHPOYsRcbsVZes53/sWqd+E3x+woWy22EMmW+ucsoey/Zb7C7 WOnEODudYVlRgKzQxqpzD2yrlazSI7pKgPsg3hQ1B7czM0bx68QP1haEDDpMhmvddGHv kmNqo4qMoga40bJCzRnKE9YpJLDmvHNSTe2ECxV7LtYmb23KN2kBrwf+UiaJsDz5gEOI wKVA== X-Gm-Message-State: AOAM533TGmv+sy5RUXAcX3c9LkRsoG3lhKaD11AZGUexq0z3mB6M3QW9 XBgvEoGb7C1eLihKWVx36zVEOz6+u+XxdA== X-Received: by 2002:a17:90a:6907:: with SMTP id r7mr7175283pjj.226.1630304903270; Sun, 29 Aug 2021 23:28:23 -0700 (PDT) Received: from localhost.localdomain (174-21-72-39.tukw.qwest.net. [174.21.72.39]) by smtp.gmail.com with ESMTPSA id o6sm13337072pjk.4.2021.08.29.23.28.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Aug 2021 23:28:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 47/48] tcg/optimize: Propagate sign info for bit counting Date: Sun, 29 Aug 2021 23:24:50 -0700 Message-Id: <20210830062451.639572-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830062451.639572-1-richard.henderson@linaro.org> References: <20210830062451.639572-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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: , 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. Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index 788a5acf10..dad72b2ff5 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1216,6 +1216,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(z_mask); return false; } @@ -1236,6 +1237,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; }