From nobody Wed Feb 11 02:56:33 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; dmarc=fail(p=none dis=none) header.from=univ-grenoble-alpes.fr Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1635166380438878.9410041442528; Mon, 25 Oct 2021 05:53:00 -0700 (PDT) Received: from localhost ([::1]:42122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mezTH-0007KE-4v for importer@patchew.org; Mon, 25 Oct 2021 08:52:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mez5q-0005tP-0B; Mon, 25 Oct 2021 08:28:47 -0400 Received: from zm-mta-out-3.u-ga.fr ([152.77.200.56]:43092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mez5n-00085P-Jq; Mon, 25 Oct 2021 08:28:45 -0400 Received: from mailhost.u-ga.fr (mailhost2.u-ga.fr [129.88.177.242]) by zm-mta-out-3.u-ga.fr (Postfix) with ESMTP id 1A4C141991; Mon, 25 Oct 2021 14:28:34 +0200 (CEST) Received: from smtps.univ-grenoble-alpes.fr (smtps2.u-ga.fr [152.77.18.2]) by mailhost.u-ga.fr (Postfix) with ESMTP id F22BD60066; Mon, 25 Oct 2021 14:28:33 +0200 (CEST) Received: from palmier.tima.u-ga.fr (35.201.90.79.rev.sfr.net [79.90.201.35]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: petrotf@univ-grenoble-alpes.fr) by smtps.univ-grenoble-alpes.fr (Postfix) with ESMTPSA id C02A114005D; Mon, 25 Oct 2021 14:28:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=univ-grenoble-alpes.fr; s=2020; t=1635164914; bh=/bNWm2CFEsWTQuQiFZGa3cZy0Xiybgs7M/tdpEV7Gfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EEz5ZtKorV25bZmhLmhJuCYeegAukgyug9yXX5Z8opKqpHc5FVJONYhZO7P5SA8iP clUMU5wIhMN2cDJEMTQOX5opnJ5/1y9UWW8JDpZdkB8lZ2k76zqG5h1zVEZLBdDKzQ hQyudLm249U6SvO7olutwTc2bCXOSkpS0nfrc1NK2Du05lZTPZb5GW93zYIkMudeKt B37H7iOMu6Lb+hvLDEgWpY1dcChZcNaTvMl3sSblnlhw9GaLB8IMpegjMx+/KNJeyO dZZ0+MUrZx4f3zKw73+p2EA0NdVgDOP2U+v9A6sfL11AsV+Q3fqVPXi6HZsmX9nrsa LHJ1vmNqPr2cQ== From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9trot?= To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v4 09/17] target/riscv: support for 128-bit bitwise instructions Date: Mon, 25 Oct 2021 14:28:10 +0200 Message-Id: <20211025122818.168890-10-frederic.petrot@univ-grenoble-alpes.fr> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211025122818.168890-1-frederic.petrot@univ-grenoble-alpes.fr> References: <20211025122818.168890-1-frederic.petrot@univ-grenoble-alpes.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Greylist: Whitelist-UGA SMTP Authentifie (petrotf@univ-grenoble-alpes.fr) via submission-587 ACL (41) X-Greylist: Whitelist-UGA MAILHOST (SMTP non authentifie) depuis 152.77.18.2 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=152.77.200.56; envelope-from=frederic.petrot@univ-grenoble-alpes.fr; helo=zm-mta-out-3.u-ga.fr 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_MSPIKE_H2=-0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bin.meng@windriver.com, richard.henderson@linaro.org, alistair.francis@wdc.com, fabien.portas@grenoble-inp.org, palmer@dabbelt.com, =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9trot?= , philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1635166382048100001 The 128-bit bitwise instructions do not need any function prototype change as the functions can be applied independently on the lower and upper part of the registers. Signed-off-by: Fr=C3=A9d=C3=A9ric P=C3=A9trot Co-authored-by: Fabien Portas Reviewed-by: Richard Henderson --- target/riscv/translate.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 070db77ca5..b183ad2b6e 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -426,7 +426,15 @@ static bool gen_logic_imm_fn(DisasContext *ctx, arg_i = *a, =20 func(dest, src1, a->imm); =20 - gen_set_gpr(ctx, a->rd, dest); + if (get_xl(ctx) =3D=3D MXL_RV128) { + TCGv src1h =3D get_gprh(ctx, a->rs1); + TCGv desth =3D dest_gprh(ctx, a->rd); + + func(desth, src1h, -(a->imm < 0)); + gen_set_gpr128(ctx, a->rd, dest, desth); + } else { + gen_set_gpr(ctx, a->rd, dest); + } =20 return true; } @@ -440,7 +448,16 @@ static bool gen_logic(DisasContext *ctx, arg_r *a, Dis= asExtend ext, =20 func(dest, src1, src2); =20 - gen_set_gpr(ctx, a->rd, dest); + if (get_xl(ctx) =3D=3D MXL_RV128) { + TCGv src1h =3D get_gprh(ctx, a->rs1); + TCGv src2h =3D get_gprh(ctx, a->rs2); + TCGv desth =3D dest_gprh(ctx, a->rd); + + func(desth, src1h, src2h); + gen_set_gpr128(ctx, a->rd, dest, desth); + } else { + gen_set_gpr(ctx, a->rd, dest); + } =20 return true; } --=20 2.33.0