From patchwork Mon Nov 28 22:57:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Bobroff X-Patchwork-Id: 700189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tSMX70zB7z9vDx for ; Tue, 29 Nov 2016 09:57:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 80A858863E; Mon, 28 Nov 2016 22:57:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7d-cA51OdNO6; Mon, 28 Nov 2016 22:57:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 92A9A885E9; Mon, 28 Nov 2016 22:57:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9321A1C0057 for ; Mon, 28 Nov 2016 22:57:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 907D0885E9 for ; Mon, 28 Nov 2016 22:57:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SSDYDf0392nJ for ; Mon, 28 Nov 2016 22:57:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by whitealder.osuosl.org (Postfix) with ESMTPS id D1AAF885DC for ; Mon, 28 Nov 2016 22:57:35 +0000 (UTC) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uASMtmF4080384 for ; Mon, 28 Nov 2016 17:57:35 -0500 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0a-001b2d01.pphosted.com with ESMTP id 270tu41px9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 28 Nov 2016 17:57:35 -0500 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 29 Nov 2016 08:57:32 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 29 Nov 2016 08:57:30 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id EEEA92CE8046 for ; Tue, 29 Nov 2016 09:57:29 +1100 (EST) Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uASMvTF250528450 for ; Tue, 29 Nov 2016 09:57:29 +1100 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uASMvT6i020000 for ; Tue, 29 Nov 2016 09:57:29 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uASMvTQF019997; Tue, 29 Nov 2016 09:57:29 +1100 Received: from tungsten.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 76C78A01CF; Tue, 29 Nov 2016 09:57:29 +1100 (AEDT) From: Sam Bobroff To: buildroot@busybox.net Date: Tue, 29 Nov 2016 09:57:29 +1100 X-Mailer: git-send-email 2.1.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112822-0048-0000-0000-000001E4DCF1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112822-0049-0000-0000-00004712B341 Message-Id: <519f9bc4a4a939e271938a2f974ce4b464187a1f.1480373845.git.sam.bobroff@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-28_17:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=18 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611280363 Subject: [Buildroot] [PATCH v2 1/1] package/libdvbcsa: fix altivec problems on powerpc64 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: http://autobuild.buildroot.net/results/e6d22f5e0258c7ebb8a3ed39c11e014c721cd219 Signed-off-by: Sam Bobroff --- Notes: I'm not an expert on Altivec, but the fix seems reasonable and the package's test programs succeed. package/libdvbcsa/0001-altivec-powerpc64.patch | 33 ++++++++++++++++++++++++++ package/libdvbcsa/libdvbcsa.mk | 1 + 2 files changed, 34 insertions(+) create mode 100644 package/libdvbcsa/0001-altivec-powerpc64.patch diff --git a/package/libdvbcsa/0001-altivec-powerpc64.patch b/package/libdvbcsa/0001-altivec-powerpc64.patch new file mode 100644 index 0000000..3605c14 --- /dev/null +++ b/package/libdvbcsa/0001-altivec-powerpc64.patch @@ -0,0 +1,33 @@ +Fix compile on powerpc64/powerpc64le w/ altivec + +Correct the type of some vectors passed to vec_slo() or vec_sro(), which only +takes a char vector. + +Signed-off-by: Sam Bobroff + +--- a/src/dvbcsa_bs_altivec.h 2016-11-28 14:33:34.410021500 +1100 ++++ b/src/dvbcsa_bs_altivec.h 2016-11-28 14:34:25.442238715 +1100 +@@ -64,7 +64,7 @@ + } + case 0x29: { + dvbcsa_bs_word_t x = vec_splat_u8(10); +- return (dvbcsa_bs_word_t)vec_add(vec_splat_u8(0x1),vec_rl(x,x)); ++ return (dvbcsa_bs_word_t)vec_add((dvbcsa_bs_word_t)vec_splat_u8(0x1),vec_rl(x,x)); + } + case 0x40: { + dvbcsa_bs_word_t x = vec_splat_u8(4); +@@ -99,10 +99,10 @@ + #define SHVAL_14 BS_VAL8(0e) + #define SHVAL_7 BS_VAL8(07) + +-#define BS_SHL(a, n) ({ dvbcsa_bs_word_t x = SHVAL_##n; vec_sll(vec_slo((a), x), x); }) +-#define BS_SHR(a, n) ({ dvbcsa_bs_word_t x = SHVAL_##n; vec_srl(vec_sro((a), x), x); }) +-#define BS_SHL8(a, n) ({ dvbcsa_bs_word_t x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_slo((a), x); }) +-#define BS_SHR8(a, n) ({ dvbcsa_bs_word_t x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_sro((a), x); }) ++#define BS_SHL(a, n) ({ vector unsigned char x = SHVAL_##n; vec_sll(vec_slo((a), x), x); }) ++#define BS_SHR(a, n) ({ vector unsigned char x = SHVAL_##n; vec_srl(vec_sro((a), x), x); }) ++#define BS_SHL8(a, n) ({ vector unsigned char x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_slo((a), x); }) ++#define BS_SHR8(a, n) ({ vector unsigned char x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_sro((a), x); }) + + #define BS_EXTRACT8(a, n) ((uint8_t*)&(a))[15 - (n)] + diff --git a/package/libdvbcsa/libdvbcsa.mk b/package/libdvbcsa/libdvbcsa.mk index 1472537..dfbb4c2 100644 --- a/package/libdvbcsa/libdvbcsa.mk +++ b/package/libdvbcsa/libdvbcsa.mk @@ -24,6 +24,7 @@ endif ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y) LIBDVBCSA_CONF_OPTS += --enable-altivec +LIBDVBCSA_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -flax-vector-conversions" else LIBDVBCSA_CONF_OPTS += --disable-altivec endif