From patchwork Mon Nov 28 05:45:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Bobroff X-Patchwork-Id: 699861 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tRwdn4Yrbz9vDZ for ; Mon, 28 Nov 2016 16:46:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B109186910; Mon, 28 Nov 2016 05:46:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nBO7QJUGf74B; Mon, 28 Nov 2016 05:46:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D28EF86532; Mon, 28 Nov 2016 05:46:01 +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 1E8AD1C0180 for ; Mon, 28 Nov 2016 05:46:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1D9BD86B71 for ; Mon, 28 Nov 2016 05:46:00 +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 CE-GfIlIYsnt for ; Mon, 28 Nov 2016 05:45:59 +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 63E1A86B32 for ; Mon, 28 Nov 2016 05:45:59 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uAS5hxHo134613 for ; Mon, 28 Nov 2016 00:45:59 -0500 Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) by mx0a-001b2d01.pphosted.com with ESMTP id 2702xbxsbv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 28 Nov 2016 00:45:58 -0500 Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Nov 2016 15:45:56 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 28 Nov 2016 15:45:53 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 584412CE8046 for ; Mon, 28 Nov 2016 16:45:53 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uAS5jrDq63963272 for ; Mon, 28 Nov 2016 16:45:53 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uAS5jrwo013632 for ; Mon, 28 Nov 2016 16:45:53 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uAS5jrBA013629 for ; Mon, 28 Nov 2016 16:45:53 +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 D4664A01B7 for ; Mon, 28 Nov 2016 16:45:52 +1100 (AEDT) From: Sam Bobroff To: buildroot@busybox.net Date: Mon, 28 Nov 2016 16:45:52 +1100 X-Mailer: git-send-email 2.1.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112805-0052-0000-0000-000001F58C9A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112805-0053-0000-0000-0000075061A2 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-28_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=5 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611280100 Subject: [Buildroot] [PATCH 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 | 26 ++++++++++++++++++++++++++ package/libdvbcsa/libdvbcsa.mk | 1 + 2 files changed, 27 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..9a3c91a --- /dev/null +++ b/package/libdvbcsa/0001-altivec-powerpc64.patch @@ -0,0 +1,26 @@ +--- 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