From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 936C9C25B10 for ; Wed, 1 May 2024 13:06:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s29dr-00020H-Vz; Wed, 01 May 2024 09:05:00 -0400 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 1s29dn-0001y1-KY for qemu-devel@nongnu.org; Wed, 01 May 2024 09:04:55 -0400 Received: from ik1-413-38519.vs.sakura.ne.jp ([153.127.30.23] helo=sakura.ysato.name) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s29dl-0005tI-TG for qemu-devel@nongnu.org; Wed, 01 May 2024 09:04:55 -0400 Received: from SIOS1075.ysato.ml (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by sakura.ysato.name (Postfix) with ESMTPSA id B5AA91C028A; Wed, 1 May 2024 22:04:51 +0900 (JST) Date: Wed, 01 May 2024 22:04:51 +0900 Message-ID: <87plu5adjg.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Philippe =?ISO-8859-1?Q?Mathieu-Daud=E9?= Cc: qemu-devel@nongnu.org, John Paul Adrian Glaubitz , Paul Cercueil , Richard Henderson Subject: Re: [PATCH v4 4/4] target/sh4: Rename TCGv variables as manual for SUBV opcode In-Reply-To: <20240430163125.77430-5-philmd@linaro.org> References: <20240430163125.77430-1-philmd@linaro.org> <20240430163125.77430-5-philmd@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Received-SPF: softfail client-ip=153.127.30.23; envelope-from=ysato@users.sourceforge.jp; helo=sakura.ysato.name X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Wed, 01 May 2024 01:31:25 +0900, Philippe Mathieu-Daud=E9 wrote: >=20 > To easily compare with the SH4 manual, rename: >=20 > REG(B11_8) -> Rn > REG(B7_4) -> Rm > t0 -> result >=20 > Mention how underflow is calculated. >=20 > Reviewed-by: Richard Henderson > Signed-off-by: Philippe Mathieu-Daud=E9 > --- > target/sh4/translate.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) >=20 > diff --git a/target/sh4/translate.c b/target/sh4/translate.c > index 47c0f3404e..e599ab9d1a 100644 > --- a/target/sh4/translate.c > +++ b/target/sh4/translate.c > @@ -933,16 +933,20 @@ static void _decode_opc(DisasContext * ctx) > return; > case 0x300b: /* subv Rm,Rn */ > { > - TCGv t0, t1, t2; > - t0 =3D tcg_temp_new(); > - tcg_gen_sub_i32(t0, REG(B11_8), REG(B7_4)); > + TCGv Rn =3D REG(B11_8); > + TCGv Rm =3D REG(B7_4); > + TCGv result, t1, t2; > + > + result =3D tcg_temp_new(); > t1 =3D tcg_temp_new(); > - tcg_gen_xor_i32(t1, t0, REG(B11_8)); > t2 =3D tcg_temp_new(); > - tcg_gen_xor_i32(t2, REG(B11_8), REG(B7_4)); > + tcg_gen_sub_i32(result, Rn, Rm); > + /* T =3D ((Rn ^ Rm) & (Result ^ Rn)) >> 31 */ > + tcg_gen_xor_i32(t1, result, Rn); > + tcg_gen_xor_i32(t2, Rn, Rm); > tcg_gen_and_i32(t1, t1, t2); > tcg_gen_shri_i32(cpu_sr_t, t1, 31); > - tcg_gen_mov_i32(REG(B11_8), t0); > + tcg_gen_mov_i32(Rn, result); > } > return; > case 0x2008: /* tst Rm,Rn */ > --=20 > 2.41.0 >=20 Reviewed-by: Yoshinori Sato --=20 Yosinori Sato