From nobody Tue Feb 10 20:57:23 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 1636730521155222.35075769975572; Fri, 12 Nov 2021 07:22:01 -0800 (PST) Received: from localhost ([::1]:43592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlYNL-0003Hv-Vg for importer@patchew.org; Fri, 12 Nov 2021 10:21:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlY2k-000480-Ob; Fri, 12 Nov 2021 10:00:42 -0500 Received: from zm-mta-out-3.u-ga.fr ([152.77.200.56]:41354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlY2e-0005xO-PA; Fri, 12 Nov 2021 10:00:40 -0500 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 A778141F4B; Fri, 12 Nov 2021 16:00:02 +0100 (CET) Received: from smtps.univ-grenoble-alpes.fr (smtps2.u-ga.fr [152.77.18.2]) by mailhost.u-ga.fr (Postfix) with ESMTP id 8DB0860066; Fri, 12 Nov 2021 16:00:02 +0100 (CET) Received: from palmier.tima.u-ga.fr (unknown [217.114.201.18]) (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 42D2614005C; Fri, 12 Nov 2021 16:00:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=univ-grenoble-alpes.fr; s=2020; t=1636729202; bh=OQYpdTI/TXeJNZqJxWgOtOpWNx5Pe2PJGi5/7VlsCSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xwBz6Y0eaatvBKIRZ8/d8YBW6q4ihIqOvHVYeeIn6TJwHPHmPbNDVsnPY4/gn+LPj NeAvl3g1kvNgzA7pQQwrwCZ9t8hAOPP1zTQu46mRdJ8XWxLaqNm/1Bazz7hM/3Vzm5 NAV3D3p5QaFU5dHgucrgHYr3o0YpptypZEXJ8tP11MXpeBQUXoz2Eh5Z/UBJXBoS0b 9AHMLOV8/GjyMrJ1a5jRx83O96+T9r+Oiw87EV9gOp8gq8roI0+mXScYw3s2FvFMXa devczadauZxM7xtdpPePrOnLOoEMopQPIvTulWc7IEmMzQvcx/6c3UQBKWEZEUsqmy xpXv4Z4aZhzVA== From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9trot?= To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v5 10/18] target/riscv: support for 128-bit bitwise instructions Date: Fri, 12 Nov 2021 15:58:54 +0100 Message-Id: <20211112145902.205131-11-frederic.petrot@univ-grenoble-alpes.fr> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211112145902.205131-1-frederic.petrot@univ-grenoble-alpes.fr> References: <20211112145902.205131-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.29 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: 1636730522823100001 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: Alistair Francis 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 554cf05084..508ae87985 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -448,7 +448,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; } @@ -462,7 +470,16 @@ static bool gen_logic(DisasContext *ctx, arg_r *a, =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.1