From nobody Sat Jul 12 15:06:07 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 1486014408764830.0913391844989; Wed, 1 Feb 2017 21:46:48 -0800 (PST) Received: from localhost ([::1]:54372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZAEI-0003tC-Qk for importer@patchew.org; Thu, 02 Feb 2017 00:46:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZ9jk-0007GH-63 for qemu-devel@nongnu.org; Thu, 02 Feb 2017 00:15:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZ9jh-0003cs-Kp for qemu-devel@nongnu.org; Thu, 02 Feb 2017 00:15:12 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:46733) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cZ9jh-0003Xx-5L; Thu, 02 Feb 2017 00:15:09 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3vDSqN6NDYz9s7h; Thu, 2 Feb 2017 16:14:56 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1486012496; bh=La7I9Yu733XZDvN+eTKTKx90j1fkVZMod6Bp1zvcZzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q9tmI3tDmOHQx+jtDNSuNSogMIVpvrg3UUcE+Og+KOm5A+68tSPMZmtE77pSqA2ob +jTpcgtY1GE7XUrv9IjKekldQRt+7yNQz19guVytfZTwx3GN5aQUxLr5NQX6Jf/c36 GwRVV832GTv3FnfTlMOQP4K6FYxmow8cCqdu2jMg= From: David Gibson To: peter.maydell@linaro.org Date: Thu, 2 Feb 2017 16:13:23 +1100 Message-Id: <20170202051445.5735-26-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170202051445.5735-1-david@gibson.dropbear.id.au> References: <20170202051445.5735-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 025/107] target-ppc: implement xscpsgnqp instruction 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, Nikunj A Dadhania , qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, agraf@suse.de, aik@ozlabs.ru, 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 xscpsgnqp: VSX Scalar Copy Sign Quad-Precision Signed-off-by: Nikunj A Dadhania Reviewed-by: Richard Henderson Signed-off-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 12 +++++++++++- target/ppc/translate/vsx-ops.inc.c | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx= -impl.inc.c index e74e16e..90d26a2 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -612,9 +612,10 @@ VSX_SCALAR_MOVE(xscpsgndp, OP_CPSGN, SGN_MASK_DP) #define VSX_SCALAR_MOVE_QP(name, op, sgn_mask) \ static void glue(gen_, name)(DisasContext *ctx) \ { \ + int xa; \ int xt =3D rD(ctx->opcode) + 32; \ int xb =3D rB(ctx->opcode) + 32; \ - TCGv_i64 xbh, xbl, sgm; \ + TCGv_i64 xah, xbh, xbl, sgm; \ \ if (unlikely(!ctx->vsx_enabled)) { \ gen_exception(ctx, POWERPC_EXCP_VSXU); \ @@ -636,6 +637,14 @@ static void glue(gen_, name)(DisasContext *ctx) = \ case OP_NEG: \ tcg_gen_xor_i64(xbh, xbh, sgm); \ break; \ + case OP_CPSGN: \ + xah =3D tcg_temp_new_i64(); \ + xa =3D rA(ctx->opcode) + 32; \ + tcg_gen_and_i64(xah, cpu_vsrh(xa), sgm); \ + tcg_gen_andc_i64(xbh, xbh, sgm); \ + tcg_gen_or_i64(xbh, xbh, xah); \ + tcg_temp_free_i64(xah); \ + break; \ } \ tcg_gen_mov_i64(cpu_vsrh(xt), xbh); \ tcg_gen_mov_i64(cpu_vsrl(xt), xbl); \ @@ -647,6 +656,7 @@ static void glue(gen_, name)(DisasContext *ctx) = \ VSX_SCALAR_MOVE_QP(xsabsqp, OP_ABS, SGN_MASK_DP) VSX_SCALAR_MOVE_QP(xsnabsqp, OP_NABS, SGN_MASK_DP) VSX_SCALAR_MOVE_QP(xsnegqp, OP_NEG, SGN_MASK_DP) +VSX_SCALAR_MOVE_QP(xscpsgnqp, OP_CPSGN, SGN_MASK_DP) =20 #define VSX_VECTOR_MOVE(name, op, sgn_mask) \ static void glue(gen_, name)(DisasContext * ctx) \ diff --git a/target/ppc/translate/vsx-ops.inc.c b/target/ppc/translate/vsx-= ops.inc.c index f7132b4..68fa171 100644 --- a/target/ppc/translate/vsx-ops.inc.c +++ b/target/ppc/translate/vsx-ops.inc.c @@ -99,6 +99,7 @@ GEN_XX3FORM(xscpsgndp, 0x00, 0x16, PPC2_VSX), GEN_VSX_XFORM_300_EO(xsabsqp, 0x04, 0x19, 0x00, 0x00000001), GEN_VSX_XFORM_300_EO(xsnabsqp, 0x04, 0x19, 0x08, 0x00000001), GEN_VSX_XFORM_300_EO(xsnegqp, 0x04, 0x19, 0x10, 0x00000001), +GEN_VSX_XFORM_300(xscpsgnqp, 0x04, 0x03, 0x00000001), =20 GEN_XX2FORM(xvabsdp, 0x12, 0x1D, PPC2_VSX), GEN_XX2FORM(xvnabsdp, 0x12, 0x1E, PPC2_VSX), --=20 2.9.3