From patchwork Fri Dec 7 08:56:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 10717671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7B8C15A6 for ; Fri, 7 Dec 2018 09:00:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94ED72DFF0 for ; Fri, 7 Dec 2018 09:00:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85E562DFFD; Fri, 7 Dec 2018 09:00:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1AF1F2DFF0 for ; Fri, 7 Dec 2018 09:00:01 +0000 (UTC) Received: from localhost ([::1]:44809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVBzL-0006SN-WF for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Dec 2018 04:00:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVBwZ-0002JW-F2 for qemu-devel@nongnu.org; Fri, 07 Dec 2018 03:57:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVBwT-00005C-5R for qemu-devel@nongnu.org; Fri, 07 Dec 2018 03:57:05 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38282 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gVBwS-0008Ow-Ry; Fri, 07 Dec 2018 03:57:01 -0500 Received: from host86-191-82-245.range86-191.btcentralplus.com ([86.191.82.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gVBwZ-00034L-Aw; Fri, 07 Dec 2018 08:57:08 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 7 Dec 2018 08:56:29 +0000 Message-Id: <20181207085635.4291-1-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 X-SA-Exim-Connect-IP: 86.191.82.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [RFC PATCH 0/6] target/ppc: convert VMX instructions to use TCG 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patchset is an attempt at trying to improve the VMX (Altivec) instruction performance by making use of the new TCG vector operations where possible. In order to use TCG vector operations, the registers must be accessible from cpu_env whilst currently they are accessed via arrays of static TCG globals. Patches 1-3 are therefore mechanical patches which introduce access helpers for FPR, AVR and VSR registers using the supplied TCGv_i64 parameter. Once this is done, patch 4 enables us to remove the static TCG global arrays and updates the access helpers to read/write to the relevant fields in cpu_env directly. The final patches 5 and 6 convert the VMX logical instructions and addition/subtraction instructions respectively over to the TCG vector operations. NOTE: there are a lot of instructions that cannot (yet) be optimised to use TCG vector operations, however it struck me that there may be some potential for converting saturating add/sub and cmp instructions if there were a mechanism to return a set of flags indicating the result of the saturation/comparison. Finally thanks to Richard for taking the time to answer some of my (mostly beginner) questions related to TCG. Signed-off-by: Mark Cave-Ayland Mark Cave-Ayland (6): target/ppc: introduce get_fpr() and set_fpr() helpers for FP register access target/ppc: introduce get_avr64() and set_avr64() helpers for VMX register access target/ppc: introduce get_cpu_vsr{l,h}() and set_cpu_vsr{l,h}() helpers for VSR register access target/ppc: switch FPR, VMX and VSX helpers to access data directly from cpu_env target/ppc: convert VMX logical instructions to use vector operations target/ppc: convert vaddu[b,h,w,d] and vsubu[b,h,w,d] over to use vector operations target/ppc/helper.h | 8 - target/ppc/int_helper.c | 7 - target/ppc/translate.c | 72 ++-- target/ppc/translate/fp-impl.inc.c | 492 ++++++++++++++++++----- target/ppc/translate/vmx-impl.inc.c | 182 ++++++--- target/ppc/translate/vsx-impl.inc.c | 782 ++++++++++++++++++++++++++---------- 6 files changed, 1110 insertions(+), 433 deletions(-)