From nobody Thu Nov 6 19:11:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 148834467662282.44114593454333; Tue, 28 Feb 2017 21:04:36 -0800 (PST) Received: from localhost ([::1]:38444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciwRH-0000s6-8X for importer@patchew.org; Wed, 01 Mar 2017 00:04:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciw7u-0008Al-51 for qemu-devel@nongnu.org; Tue, 28 Feb 2017 23:44:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciw7r-0000CY-7Z for qemu-devel@nongnu.org; Tue, 28 Feb 2017 23:44:34 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:34147) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciw7q-000092-Nu; Tue, 28 Feb 2017 23:44:31 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3vY2sV0MFsz9sNH; Wed, 1 Mar 2017 15:44:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1488343454; bh=CUBALT434zw5/nRbFe6WhWhqLKxfBG6iekZRA32+f5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j/4+0ROHOUuEhKkbQ2mwmxb+As3Jf7g6VCJTQJZPy3AJ2+pwEj6fQmJUoIlxIdymq 3vw5TZcgHlB38ItzkVgdUl93le54lnGoLxS/OInOgtd/9pMGOx4bUi67VsJBGbw7b/ tmALkOufP/wdO1AA8weGYdmwJ66CsrrC40vS0WcQ= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 1 Mar 2017 15:43:37 +1100 Message-Id: <20170301044405.1792-23-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170301044405.1792-1-david@gibson.dropbear.id.au> References: <20170301044405.1792-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 22/50] target/ppc: add ov32 flag in divide operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, thuth@redhat.com, qemu-devel@nongnu.org, Nikunj A Dadhania , aik@ozlabs.ru, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Nikunj A Dadhania Add helper_div_compute_ov() in the int_helper for updating the overflow flags. For Divide Word: SO, OV, and OV32 bits reflects overflow of the 32-bit result For Divide DoubleWord: SO, OV, and OV32 bits reflects overflow of the 64-bit result Signed-off-by: Nikunj A Dadhania Reviewed-by: Richard Henderson Signed-off-by: David Gibson --- target/ppc/translate.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index ccf3bff..982e66f 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -1021,6 +1021,9 @@ static inline void gen_op_arith_divw(DisasContext *ct= x, TCGv ret, TCGv arg1, } if (compute_ov) { tcg_gen_extu_i32_tl(cpu_ov, t2); + if (is_isa300(ctx)) { + tcg_gen_extu_i32_tl(cpu_ov32, t2); + } tcg_gen_or_tl(cpu_so, cpu_so, cpu_ov); } tcg_temp_free_i32(t0); @@ -1092,6 +1095,9 @@ static inline void gen_op_arith_divd(DisasContext *ct= x, TCGv ret, TCGv arg1, } if (compute_ov) { tcg_gen_mov_tl(cpu_ov, t2); + if (is_isa300(ctx)) { + tcg_gen_mov_tl(cpu_ov32, t2); + } tcg_gen_or_tl(cpu_so, cpu_so, cpu_ov); } tcg_temp_free_i64(t0); @@ -1110,10 +1116,10 @@ static void glue(gen_, name)(DisasContext *ctx) cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)], = \ sign, compute_ov); = \ } -/* divwu divwu. divwuo divwuo. */ +/* divdu divdu. divduo divduo. */ GEN_INT_ARITH_DIVD(divdu, 0x0E, 0, 0); GEN_INT_ARITH_DIVD(divduo, 0x1E, 0, 1); -/* divw divw. divwo divwo. */ +/* divd divd. divdo divdo. */ GEN_INT_ARITH_DIVD(divd, 0x0F, 1, 0); GEN_INT_ARITH_DIVD(divdo, 0x1F, 1, 1); =20 --=20 2.9.3