From nobody Mon Feb 9 20:12:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1610522293; cv=none; d=zohomail.com; s=zohoarc; b=C7K7HlusVwF3Jx4TN5fNAAnmUEZ3ttCs4ZbtHz7SOaRrTUThdo0oWIGGAbZXXdUtOD18N0jL4NV/IJztigH5YV1lwXSuYN7R85esTx/PneeDj0mnAo0P4Fgap9XMIyNLtBBHLMaXiMWlAs964Hj6Zu9mu/htUPJeXhHN3hNpjOo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610522293; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=VCtK6MeJWrRcE924S2JR9pxGgosMYU4dcOsKsyLoLCo=; b=QBvq5Q9A+n12ComFr1HWZJDaSL6lrCFY4xAj57udtbt5Y5iLupdQE4lIf+KEN2nXQmGHkuLYsszpPD5lCBvaQ0wVShjknlIsUWjxCKm+tb/eKEcJ+50wZaBP+GZi0ZHzV2w2+5QrJa1O2cF6eMSGYisPbiVIFqnccuBcypPK+tU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161052229333968.91459434335752; Tue, 12 Jan 2021 23:18:13 -0800 (PST) Received: from localhost ([::1]:50838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzaPy-0000oS-E3 for importer@patchew.org; Wed, 13 Jan 2021 02:18:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzaMJ-00073m-4x for qemu-devel@nongnu.org; Wed, 13 Jan 2021 02:14:23 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:39930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzaMG-0003so-4Q for qemu-devel@nongnu.org; Wed, 13 Jan 2021 02:14:22 -0500 Received: by mail-pl1-x634.google.com with SMTP id x18so561841pln.6 for ; Tue, 12 Jan 2021 23:14:19 -0800 (PST) Received: from frankchang-ThinkPad-T490.internal.sifive.com (114-34-229-221.HINET-IP.hinet.net. [114.34.229.221]) by smtp.gmail.com with ESMTPSA id l7sm1361888pjy.29.2021.01.12.23.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 23:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VCtK6MeJWrRcE924S2JR9pxGgosMYU4dcOsKsyLoLCo=; b=hy+tDcv8WRwYExW69P6jDROsVcpLqTtTaE9fKJaX4B8VaRfoNww942qjbDi2hWFhlt 1bLh4o+EIbvyOjLuGVHs8ySVbe6R1zI4opZomh2Tcsg1nZU3MkQSZM3dbb8BCoi4DolC fD7PWHREK1Lj36KNBO0K8iK5yylXDAnoPBtMyTJdUzhctLg572TYPY5rpJ1/xUtiweFi kKxSDFZymv75EzNHxekISz58ldsGv9FtAUe84MtXBxyZDSRyS0UBSx4T9/r9O+RlF8Rj 5Lmp0pkpf8tGWag8ZqSgz9Y7b0k1H9owDzoxtSau9oCK069O0K/q2oR7QGGmtej8RlLS 8KAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VCtK6MeJWrRcE924S2JR9pxGgosMYU4dcOsKsyLoLCo=; b=HKjGmf58ySzW61/gxxys+DriSf9hGd7+GSVKFWSYs/mnCQPhwVrrmpNo5f2EOx/QiU UHxFQBduv+Fmr98JLADsIrzZxYeHMUh4EPLL84iJrI8ce74WBM+WcVHP7UPyOe6yFVdP 39a0LmKDuadVh6YJsyn9WhMBHVemSCHYpDCxl1uyFFsy1z4/IlJWQFAWapPbSnlOHtjV LvmyEijTFqzmerdA1rHoLKMg8DRTLqQ4UXlgeV4Upt8b9UQPYH4pW5AiOZkp+m+QBgL0 oQEtbfQR2HlrTvSsCjAOIuy5j1Ioy17Qqu6VYUAOf4vNORainXYk3qGUj4ie4GKAbOsL wK6A== X-Gm-Message-State: AOAM533Yyxbv9nSTHEeekkGUdvPzhRC95cS3KWo1/DKdqNBDdfNLXCM0 kHV1SrkqJvythNlp6qsRwrMfMo464SJNIG6a X-Google-Smtp-Source: ABdhPJylVSqMQF3JHqZxPPlNh67nKKiXAGneLBscsFmZ8bZpgeQes2yaGfIEhx5zRgzYiZmmyVokUw== X-Received: by 2002:a17:90a:4893:: with SMTP id b19mr808207pjh.193.1610522058667; Tue, 12 Jan 2021 23:14:18 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [RFC v4 04/16] target/riscv: rvb: logic-with-negate Date: Wed, 13 Jan 2021 15:13:36 +0800 Message-Id: <20210113071350.24852-5-frank.chang@sifive.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210113071350.24852-1-frank.chang@sifive.com> References: <20210113071350.24852-1-frank.chang@sifive.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=frank.chang@sifive.com; helo=mail-pl1-x634.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=unavailable 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: , Cc: Sagar Karandikar , Frank Chang , Bastian Koppelmann , Richard Henderson , Alistair Francis , Palmer Dabbelt , Kito Cheng Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Kito Cheng Signed-off-by: Kito Cheng Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn32.decode | 4 ++++ target/riscv/insn_trans/trans_rvb.c.inc | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index 0e321da37f4..d0b3f109b4e 100644 --- a/target/riscv/insn32.decode +++ b/target/riscv/insn32.decode @@ -598,3 +598,7 @@ vsetvl 1000000 ..... ..... 111 ..... 1010111 = @r clz 011000 000000 ..... 001 ..... 0010011 @r2 ctz 011000 000001 ..... 001 ..... 0010011 @r2 cpop 011000 000010 ..... 001 ..... 0010011 @r2 + +andn 0100000 .......... 111 ..... 0110011 @r +orn 0100000 .......... 110 ..... 0110011 @r +xnor 0100000 .......... 100 ..... 0110011 @r diff --git a/target/riscv/insn_trans/trans_rvb.c.inc b/target/riscv/insn_tr= ans/trans_rvb.c.inc index dbbd94e1015..73c4693a263 100644 --- a/target/riscv/insn_trans/trans_rvb.c.inc +++ b/target/riscv/insn_trans/trans_rvb.c.inc @@ -35,6 +35,24 @@ static bool trans_cpop(DisasContext *ctx, arg_cpop *a) return gen_unary(ctx, a, tcg_gen_ctpop_tl); } =20 +static bool trans_andn(DisasContext *ctx, arg_andn *a) +{ + REQUIRE_EXT(ctx, RVB); + return gen_arith(ctx, a, tcg_gen_andc_tl); +} + +static bool trans_orn(DisasContext *ctx, arg_orn *a) +{ + REQUIRE_EXT(ctx, RVB); + return gen_arith(ctx, a, tcg_gen_orc_tl); +} + +static bool trans_xnor(DisasContext *ctx, arg_xnor *a) +{ + REQUIRE_EXT(ctx, RVB); + return gen_arith(ctx, a, tcg_gen_eqv_tl); +} + /* RV64-only instructions */ #ifdef TARGET_RISCV64 =20 --=20 2.17.1