From patchwork Wed Jan 10 22:43:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 761484 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2112791wrz; Wed, 10 Jan 2024 14:47:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3bxDm/DLANGxigG6JI0ZrbhSG8oNrJahvx3r7bG0UIA9H93qK1nQJk/wue/dXMiNwjz7B X-Received: by 2002:a05:6214:3d8e:b0:67a:9400:2322 with SMTP id om14-20020a0562143d8e00b0067a94002322mr245794qvb.3.1704926869554; Wed, 10 Jan 2024 14:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704926869; cv=none; d=google.com; s=arc-20160816; b=0VyF0Oc/7LWdyYGtvXt64w5M1AtIU0W3/kaws2mCcAluh0DObOCe9duWhRejX7grN7 +vRXdFL6wCFqmPj5s2HSuDEjU8uMaRCxqaCyGmXYPah9Y3cfMs9dXIKB9cNfc8ABb0EV DcgJvpkozvd9bDsdJjs+9JTZcfsAqmuoZpyiPupm4G+QfQSKcfyJLlKS8HteSGDOqtXu ThMemsWBcLL7YOCkzYf81DnGun/3+MK0JjU1S79lO5SjcYFvTYoXLaePXMbAG36XBxOj sB4ckKxHZHRxJW2wHyzRFUzYQgwho7MzhK8CAg8Gc5XuIXn65IqJK2wp0W/Ua+IU7kwG d/Vg== 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=WK0tcoqlC9OinJTkUwe5gkL6xxfrk1DL5i3wRriKzXwyp5ZBu00M2zgvk9Y0Hz3yru v5/F/T3f8t0A7lbNr1l+pPZZ5E35C6oMuoMnO7YS1J9ck7Q5OAWPhuQWRu4EgG1JLuZU Vgb6Hy7QeYsc5FDlqAnqmuK3ecQuBsB0Zqy39pgFVWgeKd7b10FHyL9SvL/yBI20ALFD T3pqxJ8AVZB+sWeYvccHnDyCBdhcGhhcz2c2iMuGq3ZnZ0Vsc2x77zd8LeiNZR8jJsUI QixoYT9IEFmkjRxLsbB+RD6RJfGdvu7/H5GK+wFWvoy9AP7rocBsUhUN4YivVmgvDQkp Ab+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eLaddh3/"; 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 dg16-20020a056214085000b00680196555b3si5427145qvb.604.2024.01.10.14.47.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 14:47:49 -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="eLaddh3/"; 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 1rNhLK-0007Eg-1a; Wed, 10 Jan 2024 17:46:38 -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 ) id 1rNhKi-0005mH-W8 for qemu-devel@nongnu.org; Wed, 10 Jan 2024 17:46:01 -0500 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNhKh-0003AQ-CO for qemu-devel@nongnu.org; Wed, 10 Jan 2024 17:46:00 -0500 Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-4298bdafa54so25704131cf.1 for ; Wed, 10 Jan 2024 14:45:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704926758; x=1705531558; 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=eLaddh3/aB5stt/DScS0KSsLoZ8h3acGVqTRqmRgc4KwK5+gwE6EJWOUNAUDkMLbdo nWHkYrWcdLe5+EDxzsm6upurAO8dL44+Fl2JvInph0sXzTyVQowBQr83x6wJEWTsg2kq Bjk/gVkFYhijaxAjxw3FJKxT9DUt7yNkorQb21KGhWIB3Y2NPI2EUtppBSCz2Aha7lKW jPniBPGSqUFWoVA7k614EsN0NZb/yuS0vj9/6wUcVFIj0260CxzkoNCO2iYeOQaf/w/W P5ASo5c4xaQkqLzZuILObFsi5E4RDB6iKhzAC99J6sDgQPwAxs3UMv7A/OOgu6Pjnumw tzAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704926758; x=1705531558; 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=syegySttrPZ3WgnxrQCmXetxfzsn3Ja6b3YtsXFGi9CCIjgkdo6lOGNpDudH0ycbI3 x7c9LYJr+rJe2CffP6QSlfmLlET1YToCoxFGAlzM0KL896JB4uP3pW8P3/9wuyxlTjf9 CMDFWAPh62cvBomS/VEuteW730vyv1pWzDM3bujMWaltuepo9mqgM2upQzDdmaJIaBhX aaoBhOW1sYed/IP9fJUfEvs7w3uuod+tbNeu3ja3XbQ0cYW3GDnD7qSESmY06oqLsKi4 qRu8Xe0/57sGmOCaWDdZrGd5wrowRfe8YtYt3wBTUBDEpVTKG2E75YvsmclCUWV/xGee jvug== X-Gm-Message-State: AOJu0YwI5l5TYVvtJtvE9eiz984lCMYaCGsoptTrvuN1mqVzta9iHFAh pG1CAAMSBIY5NHPIieqcUdyUSxlFfw1TKmo/RyjiywuinGRaQ9+a X-Received: by 2002:a05:622a:19a2:b0:429:7fac:a670 with SMTP id u34-20020a05622a19a200b004297faca670mr291082qtc.57.1704926758097; Wed, 10 Jan 2024 14:45:58 -0800 (PST) Received: from stoup.. ([172.58.27.160]) by smtp.gmail.com with ESMTPSA id ks23-20020ac86217000000b0042987f6874bsm2092281qtb.92.2024.01.10.14.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 14:45:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org, pbonzini@redhat.com Subject: [PATCH v3 19/38] tcg/aarch64: Generate CBNZ for TSTNE of UINT32_MAX Date: Thu, 11 Jan 2024 09:43:49 +1100 Message-Id: <20240110224408.10444-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240110224408.10444-1-richard.henderson@linaro.org> References: <20240110224408.10444-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::836; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x836.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Reviewed-by: Philippe Mathieu-Daudé --- 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;