From patchwork Wed Jan 10 22:44:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 761499 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2113261wrz; Wed, 10 Jan 2024 14:49:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjh4y9UhmStff9a8kMlqVhEaNgdXnoi1/5S4D1wX3TaraNzrXPXiu939Ypu0q90SVPZOex X-Received: by 2002:a81:c44b:0:b0:5e8:45b6:5b8a with SMTP id s11-20020a81c44b000000b005e845b65b8amr400850ywj.6.1704926952518; Wed, 10 Jan 2024 14:49:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704926952; cv=none; d=google.com; s=arc-20160816; b=udOjcI/PkVzWxPnuUhikSKU5Yjop9M5xF+OSAIObJnRVTSp0dLkrekWJ9mjpibaAQH VI3+i2C+jdWNVxNwEcwCtZ7kZS68FmiQJPu5m0OO/MeFlIBPIKK51mKoDh+k/zp2Kma+ 9XKneN9cJx0YOKsqUwfRjcZRsoSzyGUJh72Yo19L8w0lG5YnQhZ6P5vHfqhYqKH1qxTQ Tddg80NhWs+7y8YVrKtGMUvBoDLNTnn6oJIhiWn1cgceYqF32s+E686fdIYlueYnXsCm ehfEDP9+YbGS175vg28nc/Tq6QbNgT1C5ZkhxZokn49M41TGv1XCo2WVd7dRJOhGzVHB ZA6w== 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=qTBa5jnTmGPw5Fiyw2n1vRD4BYHoTuI+qXkHnySYH1Q=; fh=GbSB792CRg76qyQfASHmg380JBauy2gTuYi49sbOwBU=; b=YqJXUe6hDQ64F15ZQ4tv9nAXMYb1m2doWuSHhAz3yGKnmBetLwp4WO00uUyE949GYL Ng0K/tvOe1ZFLXmPfT/C686chkVPWGtKmi8OOE6qD0k0atdbivDYChp7ntx7cH8CTFv2 EzFnZLl5ZezNQfzMKN5AbgvSzLCaQS4iXFPnns4IJfv1pOI+ch6xCKKrS+LmCaR/on08 H3j9UO8CsLY3vMK5CeEe2/legzo+J7SoXShleTdWlj9S/ID0jphLPmD+dvF789VuXYrI c/YQ9X5NqqJWk0Z98RkQoMul/nfPPmJ/gLFirm4KpQhVgyv8ABeDTTKeW/IAPMSQWAbR sTAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q6PDwtMa; 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 v15-20020a05622a014f00b00429b91ea4e5si1513419qtw.458.2024.01.10.14.49.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 14:49:12 -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=q6PDwtMa; 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 1rNhM1-00034p-Vv; Wed, 10 Jan 2024 17:47:22 -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 1rNhLu-0002d9-GE for qemu-devel@nongnu.org; Wed, 10 Jan 2024 17:47:15 -0500 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNhLn-0003q4-0U for qemu-devel@nongnu.org; Wed, 10 Jan 2024 17:47:11 -0500 Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-783137d8049so430515885a.2 for ; Wed, 10 Jan 2024 14:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704926826; x=1705531626; 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=qTBa5jnTmGPw5Fiyw2n1vRD4BYHoTuI+qXkHnySYH1Q=; b=q6PDwtMaTNwqQLbyr3qCzvVrJZOehoFEkK16IgQdxMCI8gXiEoyvqt1JR99APEwRuy Da+ey0pMXp8p3Hi7H6WzD8bWt0u8tGO18MeQHS1G20VcOwaRtTiGtyO3BgBKpfwUaZv6 TrMhE+nRwFvxC0GurCrdjf0yuWs17XDF71c678IX14jmFR/BXMnqXo1K22WCwZcR44BY LYPy6sT91SytcnQQHckTWQhydJKyv4GGAvWl/Z8Nxe6P+N+e1fX9+eKoFXpQIZBLxnB3 u0dbyKly/DfvW1T4BcZ6kAiwoAVoPPm1pk55q7itcxvZCZBZTQ5n3da1KRNqPjnz9Hzs GqRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704926826; x=1705531626; 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=qTBa5jnTmGPw5Fiyw2n1vRD4BYHoTuI+qXkHnySYH1Q=; b=tOTEK0yFrwbfFGDadwUCKvaxI7QaH4p44D3dXPjydbSULaYFgdmlkALlxc4tw+WSdY s/Y5nIm+FV4duTP5HscTZwVFqESUSJhc8kG+UR0JaoudyvWfj0sPMfkUtAazVw6MgDyV 49MG/EKSr9zBo5ejNPnDU8YYYzl9S8qUWscTqhhtAwG2n6Xbva6j2c3xrnYfg2kzsjrg 9Ya8sXJhtKJN6BmblPYevbAdcLbqNad/ASgn5/5McXNxcCkQ5MUQVPeV+f2waqAqrYD5 wCvZfRuwXsNDrtrjhpHNVsEIouOcvt7s5096628yXlrzLkOetB+fW0juvfXq/gRIpik3 PbYQ== X-Gm-Message-State: AOJu0Yy6vbcJro4ZiNm7TCqfJF6TlxalmVyOLoOuTZXK8ypjBCfgYeXd 1CrTqgPIIthVhjm71mEo589hxYjccjn5sXPZG6HUj2YJvDKnbiZR X-Received: by 2002:a05:622a:216:b0:429:7dbd:1e50 with SMTP id b22-20020a05622a021600b004297dbd1e50mr246941qtx.110.1704926825914; Wed, 10 Jan 2024 14:47:05 -0800 (PST) Received: from stoup.. ([172.58.27.160]) by smtp.gmail.com with ESMTPSA id ks23-20020ac86217000000b0042987f6874bsm2092281qtb.92.2024.01.10.14.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 14:47:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org, pbonzini@redhat.com Subject: [PATCH v3 38/38] tcg/tci: Support TCG_COND_TST{EQ,NE} Date: Thu, 11 Jan 2024 09:44:08 +1100 Message-Id: <20240110224408.10444-39-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::729; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x729.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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 2 +- tcg/tci.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 609b2f4e4a..a076f401d2 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -117,7 +117,7 @@ #define TCG_TARGET_HAS_qemu_ldst_i128 0 -#define TCG_TARGET_HAS_tst 0 +#define TCG_TARGET_HAS_tst 1 /* Number of registers available. */ #define TCG_TARGET_NB_REGS 16 diff --git a/tcg/tci.c b/tcg/tci.c index 3cc851b7bd..39adcb7d82 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -228,6 +228,12 @@ static bool tci_compare32(uint32_t u0, uint32_t u1, TCGCond condition) case TCG_COND_GTU: result = (u0 > u1); break; + case TCG_COND_TSTEQ: + result = (u0 & u1) == 0; + break; + case TCG_COND_TSTNE: + result = (u0 & u1) != 0; + break; default: g_assert_not_reached(); } @@ -270,6 +276,12 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition) case TCG_COND_GTU: result = (u0 > u1); break; + case TCG_COND_TSTEQ: + result = (u0 & u1) == 0; + break; + case TCG_COND_TSTNE: + result = (u0 & u1) != 0; + break; default: g_assert_not_reached(); } @@ -1041,6 +1053,8 @@ static const char *str_c(TCGCond c) [TCG_COND_GEU] = "geu", [TCG_COND_LEU] = "leu", [TCG_COND_GTU] = "gtu", + [TCG_COND_TSTEQ] = "tsteq", + [TCG_COND_TSTNE] = "tstne", }; assert((unsigned)c < ARRAY_SIZE(cond));