From patchwork Sat Oct 28 19:44:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738945 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c47:0:b0:32d:baff:b0ca with SMTP id n7csp480844wrt; Sat, 28 Oct 2023 12:46:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWcv3ZpwtXFzSRaxyy2pyscMIaFuyJx4C0qLvWGBS+6DTo3DcKbfEb48+eu1aXBNB3/zgp X-Received: by 2002:a05:620a:b8e:b0:778:9ae9:c1cd with SMTP id k14-20020a05620a0b8e00b007789ae9c1cdmr5901947qkh.77.1698522388907; Sat, 28 Oct 2023 12:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698522388; cv=none; d=google.com; s=arc-20160816; b=sLpDBA+idSl3zYE8yGLvEf9xby1AkwfGQP/lrQaHDsw6OUs39xOR/g3jz/Z9catMz2 9eg1Y7PNyOrDI3oj6/n9a/Y5GjyJA+JZ+blzrh5sscpamOK6jd9oXsqazQgNVYWu2KjH 1wEx86Fz0kMsfvM0AXBlcIkgmdfa0qeExdg8CwC6gyBY5PDymdF/8hAhXA4nxAJysCAG IOF0Ve37I6rniigM1ZrWQDWDDlf+OBLmMlb5qbdhYssDwWDIKQyD7B7BOyK7X1aE8XNB s1/iwcW4BscERhGdKQzgoXarL1QmD/YGODSdcuTP877AFBiOgo+GqgehSS/R2vELNZMr ejfw== 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:cc:to :from:dkim-signature; bh=9zCJMFAqdf2iFGNb4zrA/FuyIMECuUh8qss+ekAKVh8=; fh=GbSB792CRg76qyQfASHmg380JBauy2gTuYi49sbOwBU=; b=XI/uqzuJZ85u367d4qNGtiyYu77fW9qWUpTj0E9TDcwNfpjIIula7tL9K4nzIMOaoD NXKbXBr7aS+NccWE0FTiTwwsEZHmnDLHQs/LC/oY4xFstv0kfr5aUKg7LPQatSKEbjFM EzhR5rw2FdS2iejfPrd37LRbJJfR9qU9MmG1fkaWs0w5kAfm47/8CfWiFTBBnL1m0gzE bYYMR9jAHFYLM0FFbF1lIt4qPXKkHYo2Rw209BGoXJ0dbIAWLAotc4AmQdqYLk/FeElS UT/h0LrLqi2Z1tFMZTAVFv+UsqNhDm+Xr4QjNmP7OM5tg9VKcUvafs3cvu9keW7F8h70 95dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rHWgRTTN; 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 u24-20020a05620a121800b00767e994ff18si2767530qkj.143.2023.10.28.12.46.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Oct 2023 12:46:28 -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=rHWgRTTN; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwpFd-0004jv-43; Sat, 28 Oct 2023 15:45:44 -0400 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 ) id 1qwpFY-0004im-Af for qemu-devel@nongnu.org; Sat, 28 Oct 2023 15:45:36 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwpFW-000471-Js for qemu-devel@nongnu.org; Sat, 28 Oct 2023 15:45:35 -0400 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-357ccaf982eso10907545ab.0 for ; Sat, 28 Oct 2023 12:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698522333; x=1699127133; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9zCJMFAqdf2iFGNb4zrA/FuyIMECuUh8qss+ekAKVh8=; b=rHWgRTTNOOV3IwTl//jMU/IzPx1vH8gSFQ64l2x0NR32KamLOx6CU+X54rtfp53b4+ /Opk+Z9Bh8izUlP+aQ2aORxZqtdmt4Y6GXDYQ3NW+dVsonRoM4YDyXHyNZNs0grkXaHw sRMIQcLO7Vcz8jsMgPMx8YTR048Qghk5oZfXc8pxn7TZFjwiqe21KOQG+x20HKxFEHT8 E678PNwJTkLRvaCCyp+60eX3tTxw1/iwjxM5n1ErXDhw6T4mqMu7YRA1W5spU+1k2xHr Gea64ykywyA8QLa2fOWrmUOJYNvGU4Pz187l4bChMrlquJwu914bnjX8jK4SFpl25SED dEZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698522333; x=1699127133; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9zCJMFAqdf2iFGNb4zrA/FuyIMECuUh8qss+ekAKVh8=; b=b9Klhq36ykYDG8POXdawyoPhozXIgAi20R6rNavP2buhrO6tqq+JIuxBq2BwPb9cse ml5DiGnl0eU3nnJsJXHO3D4ApOZHEgm9NaRrNK7a5f1WZFmkHAlpJKdYwuyzMu+pY3K9 pmOulEg+g99KkMc3zKqjSnuvaHAcBqFgfAuJWt+bThcqncFeXZDaupW5dICKUYNECM35 z+13Zsn7dozQejqop5/coVw08s2fFsg2Abz5tZS7iXClbkLsu7EDQf6Jj3NZ4o65zaYp O2Yd+uvxvGI4FwR4H7KVAmqLbjImA8mIwWs4qEAXDI04NAg8kMsSNgd0YXa7kGvf9eaa SjDg== X-Gm-Message-State: AOJu0YwvDnqujlFKEHSe3QJTXeKFLndqpWmTe8KGVcDGI2qNbStRaOsK RVU382q4+gMawec5MX+vMAI2DDfWNqU9Uj1bAjg= X-Received: by 2002:a05:6e02:1e07:b0:357:43a5:acf8 with SMTP id g7-20020a056e021e0700b0035743a5acf8mr8466783ila.17.1698522333376; Sat, 28 Oct 2023 12:45:33 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id h9-20020a170902f7c900b001b8a3e2c241sm3600096plw.14.2023.10.28.12.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 12:45:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org, pbonzini@redhat.com Subject: [PATCH v2 10/35] tcg/aarch64: Generate CBNZ for TSTNE of UINT32_MAX Date: Sat, 28 Oct 2023 12:44:57 -0700 Message-Id: <20231028194522.245170-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231028194522.245170-1-richard.henderson@linaro.org> References: <20231028194522.245170-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::136; envelope-from=richard.henderson@linaro.org; helo=mail-il1-x136.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org ... and the inverse, CBZ for TSTEQ. Suggested-by: Paolo Bonzini Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 55225313ad..0c98c48f68 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -1453,6 +1453,7 @@ static void tcg_out_brcond(TCGContext *s, TCGType ext, TCGCond c, TCGArg a, break; case TCG_COND_LT: case TCG_COND_GE: + /* cmp xN,0; b.mi L -> tbnz xN,63,L */ if (b_const && b == 0) { c = (c == TCG_COND_LT ? TCG_COND_TSTNE : TCG_COND_TSTEQ); tbit = ext ? 63 : 31; @@ -1461,6 +1462,13 @@ static void tcg_out_brcond(TCGContext *s, TCGType ext, TCGCond c, TCGArg a, break; case TCG_COND_TSTEQ: case TCG_COND_TSTNE: + /* tst xN,0xffffffff; b.ne L -> cbnz wN,L */ + if (b_const && b == UINT32_MAX) { + ext = TCG_TYPE_I32; + need_cmp = false; + break; + } + /* tst xN,1< tbnz xN,B,L */ if (b_const && is_power_of_2(b)) { tbit = ctz64(b); need_cmp = false;