From nobody Thu Sep 19 02:07:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550503447186769.6011412049176; Mon, 18 Feb 2019 07:24:07 -0800 (PST) Received: from localhost ([127.0.0.1]:60437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkm1-00075C-1N for importer@patchew.org; Mon, 18 Feb 2019 10:24:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjye-0007Fe-P4 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:33:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyd-0003es-UY for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:33:00 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:34983) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyd-0003DA-H4; Mon, 18 Feb 2019 09:32:59 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s23BN7z9sRY; Tue, 19 Feb 2019 01:31:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500278; bh=euRyDtQkQGHZFeeOzuy1J579rlrETAxJoHQij8WW8uU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gqhpZcIKqTslv4a2MCzXBt6LzDDzfngKD/dK2JFxOqeo8CVAeY/luMtPgRpXakCo0 ovNXOT+G0oi1Y7mSCOZjMmQhzgCp6YoU6hwmdjTExbPQtCNjfjw7T2pU9n+I6ki2cg bwTwe4qu3FK3LWZlaQi7I86utfooZaBQAY8YJWmQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:40 +1100 Message-Id: <20190218143049.17142-35-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 34/43] target/ppc: convert xxsel to vector 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: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Richard Henderson Signed-off-by: Richard Henderson Acked-by: David Gibson Message-Id: <20190215100058.20015-9-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 55 ++++++++++++++--------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx= -impl.inc.c index 0e8cecb00a..e73197e717 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -1321,40 +1321,39 @@ static void glue(gen_, name)(DisasContext * ctx) = \ VSX_XXMRG(xxmrghw, 1) VSX_XXMRG(xxmrglw, 0) =20 -static void gen_xxsel(DisasContext * ctx) +static void xxsel_i64(TCGv_i64 t, TCGv_i64 a, TCGv_i64 b, TCGv_i64 c) { - TCGv_i64 a, b, c, tmp; - if (unlikely(!ctx->vsx_enabled)) { - gen_exception(ctx, POWERPC_EXCP_VSXU); - return; - } - a =3D tcg_temp_new_i64(); - b =3D tcg_temp_new_i64(); - c =3D tcg_temp_new_i64(); - tmp =3D tcg_temp_new_i64(); - - get_cpu_vsrh(a, xA(ctx->opcode)); - get_cpu_vsrh(b, xB(ctx->opcode)); - get_cpu_vsrh(c, xC(ctx->opcode)); - tcg_gen_and_i64(b, b, c); tcg_gen_andc_i64(a, a, c); - tcg_gen_or_i64(tmp, a, b); - set_cpu_vsrh(xT(ctx->opcode), tmp); + tcg_gen_or_i64(t, a, b); +} =20 - get_cpu_vsrl(a, xA(ctx->opcode)); - get_cpu_vsrl(b, xB(ctx->opcode)); - get_cpu_vsrl(c, xC(ctx->opcode)); +static void xxsel_vec(unsigned vece, TCGv_vec t, TCGv_vec a, + TCGv_vec b, TCGv_vec c) +{ + tcg_gen_and_vec(vece, b, b, c); + tcg_gen_andc_vec(vece, a, a, c); + tcg_gen_or_vec(vece, t, a, b); +} =20 - tcg_gen_and_i64(b, b, c); - tcg_gen_andc_i64(a, a, c); - tcg_gen_or_i64(tmp, a, b); - set_cpu_vsrl(xT(ctx->opcode), tmp); +static void gen_xxsel(DisasContext *ctx) +{ + static const GVecGen4 g =3D { + .fni8 =3D xxsel_i64, + .fniv =3D xxsel_vec, + .vece =3D MO_64, + }; + int rt =3D xT(ctx->opcode); + int ra =3D xA(ctx->opcode); + int rb =3D xB(ctx->opcode); + int rc =3D xC(ctx->opcode); =20 - tcg_temp_free_i64(a); - tcg_temp_free_i64(b); - tcg_temp_free_i64(c); - tcg_temp_free_i64(tmp); + if (unlikely(!ctx->vsx_enabled)) { + gen_exception(ctx, POWERPC_EXCP_VSXU); + return; + } + tcg_gen_gvec_4(vsr_full_offset(rt), vsr_full_offset(ra), + vsr_full_offset(rb), vsr_full_offset(rc), 16, 16, &g); } =20 static void gen_xxspltw(DisasContext *ctx) --=20 2.20.1