Message ID | 20241220041104.53105-43-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853709wrq; Thu, 19 Dec 2024 20:19:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUXalLakHZ4udVTgxljbV4Tx8mUDvX98FeiG1RRJQzHpVLwoFvRRSc8cvlEdluQgo1tYRHYYw==@linaro.org X-Google-Smtp-Source: AGHT+IGC78Y3rTHjaJAg0v+yD2XG8dx3/YTAb5FwQ1xW9vq8+YTmlOToTTCocGaAAz9d+MlRhLvP X-Received: by 2002:a05:6214:761:b0:6d4:3437:d858 with SMTP id 6a1803df08f44-6dd233574eamr30557246d6.25.1734668364551; Thu, 19 Dec 2024 20:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668364; cv=none; d=google.com; s=arc-20240605; b=kvj5ZfNZ/CWFGV+k3m4rLOzY+Pg4jJHCXi7SCEibJKX1i0exeyDj1sqdVVNtDcMIeA dpJJA754OWBWSNGMJ1T5yKd0tVMIwO962PjTGJArjMwfWBNO832qr/BWTW325rf1Vjxv y/pwAfuXZO4BmSKRedSTzbsJA0ysCaXLDqLtcryO0n8efJqzjssXLSpO9bUjonB5bzT7 BB4uh+7yg2evweKVAjp/0D2k8JGNRbpjE5nBBuedqnuLIiUv740W7wxUcodbWTw8tFsf ZCY1y90JVWv4c3OQKaZJ7q5kZwpgBzl1S/C6ynM9z7mFLMXGxIJChefvK1HBQS5XbQDj +bcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=atQvaPE2FE0PiFVNmcXbnVbK/0bdfapYYtNsmIEQxj0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=X6WRvLUK590jhzxV3wR0qYrQYfjlpOyHcvprgaWIl25Fhl6X0BsBLLD7qWC8IYOBG7 IpHVwU35iS5rk2kbFDQ3s4xrUdVcljMDusPsvdkxVoVDjn8mPXdFFZlT2sPljwl4ktOF 3iiA4RLFDfuVBXqx6ZmxC9bXvPhfTu+i4za03o1MQcjSYeeRl0+uWQy/XrJa6rvpnXyI V44dObTW61Om+uGGCLTZzBkmwuFXvzRrmYjMtO5IGWFB1LGyVhh/9mpza5GiIyzVdNyG Ti6cqgWf6K0Ee1hsNasut5aCASg6zqluM5ppGcaFZUHt9NTAXqJ4Bl8eTRVyzOH0WnQ+ Qq6Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gxIE6seK; 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; dara=neutral header.i=@linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd18232db3si30777996d6.199.2024.12.19.20.19.24 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:19:24 -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=pass header.i=@linaro.org header.s=google header.b=gxIE6seK; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1tOUQ7-0001z5-0O; Thu, 19 Dec 2024 23:15:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1tOUPP-000115-OO for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:39 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1tOUPO-0006pg-Be for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:39 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-725f2f79ed9so1245380b3a.2 for <qemu-devel@nongnu.org>; Thu, 19 Dec 2024 20:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668077; x=1735272877; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=atQvaPE2FE0PiFVNmcXbnVbK/0bdfapYYtNsmIEQxj0=; b=gxIE6seK8VkIVMydtdQxUewAPF+3uItJm3rRtUUTT0fhOKok2Um0OorOEJ6tlHWvvK OmiqHfL+kxaySoEoSigZ0urSfzb30yGu7qfYAO1WCDyVPsxJEOylE7Yu1wX0ABe66Jxq vqCprHqqbXlSeNcSP8ZoBsZdR4zoAo91CERFYd+djJHBlkz5Vifcqz9VKL7Fyvgz55nC Bqwb4TJVrPfPpmH9yOhGri5T/jOzVZ467lGTJ1XzdiuOEusLG33PF5v0x52TmkwBrbf5 xJNR+TqEkjKUKWzLGfi8pBJp6GJAE/IKWPki9luSJzWf6no71ON7hsD8xDyyEVoofKGz SHpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668077; x=1735272877; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=atQvaPE2FE0PiFVNmcXbnVbK/0bdfapYYtNsmIEQxj0=; b=aMdFu8cyBuLOORDebXC4/I/5sILw6lkrxGgQkSpARfrp8iitAfKRAEcK6JgxfMyJ3g czoxSu4IWZgSftfCUZjP4HoQuCUhlOkjQiyFhPYW+iHUrwaoxCiAD0SdSlF4CyYnPBEb UT6Nw8+tFzxzBo/C9+OR5o38W9NPra/Kh3Kft0DNN67xPe/DPNvIzf2SN780rUEB9NB3 o8qCYu69dze0kw965Yu+8p07zom5tUSdTwA4EHHlhEeruwfRqTmkeJqjuVrZzYYYCqMC HHQDkiGqHzx+WHL1M9umxJOjDq2DgEXDQBXw3UOB1aEOMe/Ez78N2K0aukE7kjG+jUKM nnNg== X-Gm-Message-State: AOJu0Yz36sX+I4F7X8/LEeEXK5rrE+Tz1xwZa2qIZcbBKo5+7tk+/Q6h fbAaKuyoa9N0NO3EUUvezyAj+UxXTB2eNcsVxP9aCB52nGQNSxtld562IvvOGsQwUJTWrJb6kT/ 1 X-Gm-Gg: ASbGncvfV3zY1UZ6cy8339B44JJ6x5zyp/F9aXfC1ZkW/SlR8tEcIx5ZI9kqEawMjss WvPXpG4BqeZR5bD8/V+eQYnFLatSct6CqT0Oftvwq6PuyFDSyUFekfwefl9ZIThlFIbi8jmEeAy 5082ASAQbwBpgan4CXBKH5a/wNrMu5C44zxG73km4c7OwkF95bU++BDp/N1+paPrUZJrjnO2oGi bXqlMtDTSWnYSdtoODWYqzfum3YXiK9M+FGs/qv2mQ4+zBHWg2AO8aL6rEVztE= X-Received: by 2002:a05:6a21:3987:b0:1e1:dbfd:582b with SMTP id adf61e73a8af0-1e5e0461e18mr2930372637.15.1734668077050; Thu, 19 Dec 2024 20:14:37 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.35 for <qemu-devel@nongnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:36 -0800 (PST) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PATCH v2 42/51] tcg/optimize: Simplify sign bit test in fold_shift Date: Thu, 19 Dec 2024 20:10:54 -0800 Message-ID: <20241220041104.53105-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
tcg: Remove in-flight mask data from OptContext
|
expand
|
On 12/19/24 20:10, Richard Henderson wrote: > Merge the two conditions, sign != 0 && !(z_mask & sign), > by testing ~z_mask & sign. If sign == 0, the logical and > will produce false. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > tcg/optimize.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tcg/optimize.c b/tcg/optimize.c > index da48aadd12..7219415fe2 100644 > --- a/tcg/optimize.c > +++ b/tcg/optimize.c > @@ -2590,7 +2590,7 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) > * will not reduce the number of input sign repetitions. > */ > sign = (s_mask & -s_mask) >> 1; > - if (sign && !(z_mask & sign)) { > + if (~z_mask & sign) { > return fold_masks_s(ctx, op, s_mask); > } > break; Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff --git a/tcg/optimize.c b/tcg/optimize.c index da48aadd12..7219415fe2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2590,7 +2590,7 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) * will not reduce the number of input sign repetitions. */ sign = (s_mask & -s_mask) >> 1; - if (sign && !(z_mask & sign)) { + if (~z_mask & sign) { return fold_masks_s(ctx, op, s_mask); } break;
Merge the two conditions, sign != 0 && !(z_mask & sign), by testing ~z_mask & sign. If sign == 0, the logical and will produce false. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)