Message ID | 20190129191746.14868-1-mark.cave-ayland@ilande.co.uk |
---|---|
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ilande.co.uk Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43pxFD1xXlz9sBn for <incoming@patchwork.ozlabs.org>; Wed, 30 Jan 2019 06:21:36 +1100 (AEDT) Received: from localhost ([127.0.0.1]:54348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1goYww-00088O-2x for incoming@patchwork.ozlabs.org; Tue, 29 Jan 2019 14:21:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <mark.cave-ayland@ilande.co.uk>) id 1goYtc-0005tq-MG for qemu-devel@nongnu.org; Tue, 29 Jan 2019 14:18:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mark.cave-ayland@ilande.co.uk>) id 1goYtb-00083q-Nn for qemu-devel@nongnu.org; Tue, 29 Jan 2019 14:18:08 -0500 Received: from chuckie.co.uk ([82.165.15.123]:41870 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mark.cave-ayland@ilande.co.uk>) id 1goYtb-00082s-Fy; Tue, 29 Jan 2019 14:18:07 -0500 Received: from host86-138-240-60.range86-138.btcentralplus.com ([86.138.240.60] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from <mark.cave-ayland@ilande.co.uk>) id 1goYtn-0006Zl-9y; Tue, 29 Jan 2019 19:18:20 +0000 From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, richard.henderson@linaro.org, david@gibson.dropbear.id.au Date: Tue, 29 Jan 2019 19:17:38 +0000 Message-Id: <20190129191746.14868-1-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 X-SA-Exim-Connect-IP: 86.138.240.60 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] [PATCH v4 0/8] target/ppc: remove various endian hacks from int_helper.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
target/ppc: remove various endian hacks from int_helper.c
|
expand
|
From working on the TCG vector operations patchset, it is apparent that there are a large number of endian-based hacks in int_helper.c which can be removed by making use of the various Vsr* macros. Patch 1 is simple enough, and implements the complete set of Vsr* macros for both big endian and little endian hosts. Patches 2 and 3 rework the vector merge and multiply algorithms so that they no longer require the endian-dependent HI_IDX and LO_IDX macros. Patches 4 and 5 then completely remove the HI_IDX/LO_IDX and EL_IDX macros by replacing the element accesses with their equivalent Vsr* macro instead. Patches 6 and 7 tidy up the VEXT_SIGNED macro and fix a potential shift bug in the ROTRu32 and ROTRu64 macros pointed out by Richard during the review of v1. Finally patch 8 is an inspection-based removal of other HOST_WORDS_BIGENDIAN hacks in int_helper.c, again replacing accesses with the relevant Vsr* macro instead. Note that there are still some endian hacks left in int_helper.c after this patchset: in particular the delightfully evil VECTOR_FOR_INORDER_I macro still remains in places where the index variable was used for purposes other than accessing elements within the vector. There were also some parts where additional conversion could be done, but I wasn't confident enough to make the change without access to PPC64 test images or real big-endian host hardware. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> v4: - Rebase onto master - Add R-B tag from Richard for patch 4 - Use Richard's improved vmrg{l,h} algorithm in patch 2 v3: - Rebase onto master - Add R-B tags from Richard v2: - Add R-B tags from Richard - Add patches 6 and 7 to simplify the VEXT_SIGNED macro and fix a potential shift bug in the ROTRu32 and ROTRu64 macros - Don't require ordered access for VNEG and VGENERIC_DO macros as pointed out by Richard Mark Cave-Ayland (8): target/ppc: implement complete set of Vsr* macros target/ppc: rework vmrg{l,h}{b,h,w} instructions to use Vsr* macros target/ppc: rework vmul{e,o}{s,u}{b,h,w} instructions to use Vsr* macros target/ppc: eliminate use of HI_IDX and LO_IDX macros from int_helper.c target/ppc: eliminate use of EL_IDX macros from int_helper.c target/ppc: simplify VEXT_SIGNED macro in int_helper.c target/ppc: remove ROTRu32 and ROTRu64 macros from int_helper.c target/ppc: remove various HOST_WORDS_BIGENDIAN hacks in int_helper.c target/ppc/int_helper.c | 507 +++++++++++++++++++----------------------------- target/ppc/internal.h | 9 +- 2 files changed, 209 insertions(+), 307 deletions(-)