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 275EDC4345F for ; Wed, 1 May 2024 13:05:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s29dT-0001wY-P9; Wed, 01 May 2024 09:04:35 -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 1s29dS-0001wN-Hj for qemu-devel@nongnu.org; Wed, 01 May 2024 09:04:34 -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 1s29dQ-0005q4-CB for qemu-devel@nongnu.org; Wed, 01 May 2024 09:04:34 -0400 Received: from SIOS1075.ysato.ml (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by sakura.ysato.name (Postfix) with ESMTPSA id 63CF31C028A; Wed, 1 May 2024 22:04:26 +0900 (JST) Date: Wed, 01 May 2024 22:04:25 +0900 Message-ID: <87r0eladk6.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 3/4] target/sh4: Rename TCGv variables as manual for ADDV opcode In-Reply-To: <20240430163125.77430-4-philmd@linaro.org> References: <20240430163125.77430-1-philmd@linaro.org> <20240430163125.77430-4-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:24 +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 overflow is calculated. >=20 > Signed-off-by: Philippe Mathieu-Daud=E9 > Reviewed-by: Richard Henderson > --- > 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 3e013b7c7c..47c0f3404e 100644 > --- a/target/sh4/translate.c > +++ b/target/sh4/translate.c > @@ -705,16 +705,20 @@ static void _decode_opc(DisasContext * ctx) > return; > case 0x300f: /* addv Rm,Rn */ > { > - TCGv t0, t1, t2; > - t0 =3D tcg_temp_new(); > - tcg_gen_add_i32(t0, REG(B7_4), REG(B11_8)); > + 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(B7_4), REG(B11_8)); > + tcg_gen_add_i32(result, Rm, Rn); > + /* T =3D ((Rn ^ Rm) & (Result ^ Rn)) >> 31 */ > + tcg_gen_xor_i32(t1, result, Rn); > + tcg_gen_xor_i32(t2, Rm, Rn); > tcg_gen_andc_i32(cpu_sr_t, t1, t2); > tcg_gen_shri_i32(cpu_sr_t, cpu_sr_t, 31); > - tcg_gen_mov_i32(REG(B11_8), t0); > + tcg_gen_mov_i32(Rn, result); > } > return; > case 0x2009: /* and Rm,Rn */ > --=20 > 2.41.0 >=20 Reviewed-by: Yoshinori Sato --=20 Yosinori Sato