From patchwork Fri Oct 4 13:22:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Musta X-Patchwork-Id: 280625 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C0E3D2C00D1 for ; Fri, 4 Oct 2013 23:58:55 +1000 (EST) Received: from localhost ([::1]:48168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VS5u9-0003IM-OS for incoming@patchwork.ozlabs.org; Fri, 04 Oct 2013 09:58:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VS5Lq-0000bn-5J for qemu-devel@nongnu.org; Fri, 04 Oct 2013 09:23:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VS5Lh-0005UG-Of for qemu-devel@nongnu.org; Fri, 04 Oct 2013 09:23:26 -0400 Received: from mail-qe0-x236.google.com ([2607:f8b0:400d:c02::236]:39883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VS5LQ-0005QB-NP; Fri, 04 Oct 2013 09:23:00 -0400 Received: by mail-qe0-f54.google.com with SMTP id cy11so2933403qeb.27 for ; Fri, 04 Oct 2013 06:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=rF0cmAfbZIwdloeVdWW5Yi/vBqLELzGow5vEF3tpnxM=; b=OlYGAjid79Nr/xGDKyLIpp2xEcqnAuSO+HW+QqOGLOU/e8Olv40kmemWFBSCKZZvDy CXaDekKJfQX88O1Vo9Dy2e92nYU1U/BznDdPPbWkgIGZlNrT4cA7WJ2hPYdy1l66EzIr +6c1Tqf2ksGpvhW/sm0orutfOi686NCBKlReVRZTz/F63jopBTF1j2CdLCPFqtT4gPu5 VeZytub/kFYAz028APVYAppPXLBnMatMIrHCqQXNLDkSRGEKM9k3Vx8rKk4qMhoLOsQS fK6LdIlGk0vsuXhO+fOK47/h2VEIK6t4+olxF3tG73uHu1Ua09ZxPyuwbd7td+QdGC1R HjVA== X-Received: by 10.229.79.137 with SMTP id p9mr17370528qck.12.1380892980256; Fri, 04 Oct 2013 06:23:00 -0700 (PDT) Received: from [9.10.80.128] (rchp4.rochester.ibm.com. [129.42.161.36]) by mx.google.com with ESMTPSA id v96sm19097957yhp.3.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Oct 2013 06:22:59 -0700 (PDT) Message-ID: <524EC12E.5030002@gmail.com> Date: Fri, 04 Oct 2013 08:22:54 -0500 From: Tom Musta User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: qemu-ppc@nongnu.org References: <524EBE04.8050207@gmail.com> In-Reply-To: <524EBE04.8050207@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c02::236 X-Mailman-Approved-At: Fri, 04 Oct 2013 09:52:38 -0400 Cc: Tom Musta , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 09/13] Add Power7 VSX Logical Instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch adds the VSX logical instructions that are defined by the Version 2.06 Power ISA (aka Power7): - xxland - xxlandc - xxlor - xxlxor - xxlnor Signed-off-by: Tom Musta --- target-ppc/translate.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) /* Register moves */ @@ -9770,6 +9788,17 @@ GEN_XX2FORM(xvabssp, 0x12, 0x19, PPC2_VSX), GEN_XX2FORM(xvnabssp, 0x12, 0x1A, PPC2_VSX), GEN_XX2FORM(xvnegsp, 0x12, 0x1B, PPC2_VSX), GEN_XX3FORM(xvcpsgnsp, 0x00, 0x1A, PPC2_VSX), + +#undef VSX_LOGICAL +#define VSX_LOGICAL(name, opc2, opc3, fl2) \ +GEN_XX3FORM(name, opc2, opc3, fl2) + +VSX_LOGICAL(xxland, 0x8, 0x10, PPC2_VSX), +VSX_LOGICAL(xxlandc, 0x8, 0x11, PPC2_VSX), +VSX_LOGICAL(xxlor, 0x8, 0x12, PPC2_VSX), +VSX_LOGICAL(xxlxor, 0x8, 0x13, PPC2_VSX), +VSX_LOGICAL(xxlnor, 0x8, 0x14, PPC2_VSX), + GEN_XX3FORM_DM(xxpermdi, 0x08, 0x01), #undef GEN_SPE diff --git a/target-ppc/translate.c b/target-ppc/translate.c index d03675c..f1ce4fe 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -7267,6 +7267,24 @@ VSX_VECTOR_MOVE(xvnegsp, OP_NEG, SGN_MASK_SP) VSX_VECTOR_MOVE(xvcpsgnsp, OP_CPSGN, SGN_MASK_SP) +#define VSX_LOGICAL(name, tcg_op) \ +static void glue(gen_, name)(DisasContext * ctx) \ + { \ + if (unlikely(!ctx->vsx_enabled)) { \ + gen_exception(ctx, POWERPC_EXCP_VSXU); \ + return; \ + } \ + tcg_op(cpu_vsrh(xT(ctx->opcode)), cpu_vsrh(xA(ctx->opcode)), \ + cpu_vsrh(xB(ctx->opcode))); \ + tcg_op(cpu_vsrl(xT(ctx->opcode)), cpu_vsrl(xA(ctx->opcode)), \ + cpu_vsrl(xB(ctx->opcode))); \ + } + +VSX_LOGICAL(xxland, tcg_gen_and_tl) +VSX_LOGICAL(xxlandc, tcg_gen_andc_tl) +VSX_LOGICAL(xxlor, tcg_gen_or_tl) +VSX_LOGICAL(xxlxor, tcg_gen_xor_tl) +VSX_LOGICAL(xxlnor, tcg_gen_nor_tl) /*** SPE extension ***/