Gentoo Archives: gentoo-commits

From: "Joseph Jezak (josejx)" <josejx@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-libs/aften/files: aften-0.0.8-ppc.patch
Date: Sun, 06 Jan 2008 01:33:06
Message-Id: E1JBKNp-0005jQ-6C@stork.gentoo.org
1 josejx 08/01/06 01:33:01
2
3 Added: aften-0.0.8-ppc.patch
4 Log:
5 Added patch to fix compilation on ppc, bug #200866.
6 (Portage version: 2.1.4_rc13)
7
8 Revision Changes Path
9 1.1 media-libs/aften/files/aften-0.0.8-ppc.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/aften/files/aften-0.0.8-ppc.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/aften/files/aften-0.0.8-ppc.patch?rev=1.1&content-type=text/plain
13
14 Index: aften-0.0.8-ppc.patch
15 ===================================================================
16 Index: libaften/ppc/ppc_cpu_caps.h
17 ===================================================================
18 --- libaften/ppc/ppc_cpu_caps.h
19 +++ libaften/ppc/ppc_cpu_caps.h
20 @@ -20,6 +20,7 @@
21 #ifndef PPC_CPU_CAPS_H
22 #define PPC_CPU_CAPS_H
23
24 +#include "aften-types.h"
25 #include "common.h"
26 #include "cpu_caps.h"
27
28 Index: libaften/ppc/mdct_altivec.c
29 ===================================================================
30 --- libaften/ppc/mdct_altivec.c (revision 659)
31 +++ libaften/ppc/mdct_altivec.c (revision 660)
32 @@ -47,11 +47,11 @@
33 #include "mem.h"
34
35 // sign change constants
36 -static const vec_u32_t vPNNP = (vec_u32_t)
37 +static const vec_u32_t vPNNP = VEC_U32
38 (0x00000000, 0x80000000, 0x80000000, 0x00000000);
39 -static const vec_u32_t vPNPN = (vec_u32_t)
40 +static const vec_u32_t vPNPN = VEC_U32
41 (0x00000000, 0x80000000, 0x00000000, 0x80000000);
42 -static const vec_u32_t vNNNN = (vec_u32_t)
43 +static const vec_u32_t vNNNN = VEC_U32
44 (0x80000000, 0x80000000, 0x80000000, 0x80000000);
45
46
47 @@ -92,7 +92,7 @@
48 vec_u8_t perm1036 = VPERMUTE4(1, 0, 3, 6);
49 vec_u8_t perm5472 = VPERMUTE4(5, 4, 7, 2);
50 vector float zero = (vector float) vec_splat_u32(0);
51 - vector float pi2_8 = (vector float)(AFT_PI2_8, AFT_PI2_8, AFT_PI2_8, AFT_PI2_8);
52 + vector float pi2_8 = VEC_FLOAT(AFT_PI2_8, AFT_PI2_8, AFT_PI2_8, AFT_PI2_8);
53 vector float x0to3, x4to7, x8to11, x12to15;
54 vector float v1, v2, v3, v4, v5;
55
56 @@ -143,7 +143,7 @@
57 vec_u8_t perm0022 = VPERMUTE4(0, 0, 2, 2);
58 vec_u8_t perm1405 = VPERMUTE4(1, 4, 0, 5);
59 vector float zero = (vector float) vec_splat_u32(0);
60 - vector float cpi = (vector float) (AFT_PI2_8, AFT_PI2_8, AFT_PI1_8, AFT_PI3_8);
61 + vector float cpi = VEC_FLOAT(AFT_PI2_8, AFT_PI2_8, AFT_PI1_8, AFT_PI3_8);
62 vec_u32_t vNPNP = vec_sld(vPNPN, vPNPN, 4);
63 vector float x0to3, x4to7, x8to11, x12to15, x16to19, x20to23, x24to27, x28to31;
64 vector float pi3122, pi1322, pi1313, pi3131;
65 @@ -395,7 +395,7 @@
66 vec_u8_t perm3636 = vec_add(perm1414, vec_splat_u8(8));
67 vec_u8_t perm2266, perm3377;
68
69 - vector float point5 = (vector float) (0.5f, 0.5f, 0.5f, 0.5f);
70 + vector float point5 = VEC_FLOAT(0.5f, 0.5f, 0.5f, 0.5f);
71 vector float zero = (vector float) vec_splat_u32(0);
72 vec_u32_t vNPNP = vec_sld(vPNPN, vPNPN, 4);
73
74 Index: libaften/ppc/altivec_common.h
75 ===================================================================
76 --- libaften/ppc/altivec_common.h (revision 659)
77 +++ libaften/ppc/altivec_common.h (revision 660)
78 @@ -28,11 +28,23 @@
79 typedef vector unsigned int vec_u32_t;
80 typedef vector signed int vec_s32_t;
81
82 +#if defined( __APPLE_CC__ ) && defined( __APPLE_ALTIVEC__ ) /* apple */
83 +#define VEC_U32(a,b,c,d) (vec_u32_t) (a, b, c, d)
84 +#define VEC_FLOAT(a,b,c,d) (vector float) (a, b, c, d)
85 #define VPERMUTE4(a,b,c,d) (vec_u8_t) \
86 ( (a*4)+0, (a*4)+1, (a*4)+2, (a*4)+3, \
87 (b*4)+0, (b*4)+1, (b*4)+2, (b*4)+3, \
88 (c*4)+0, (c*4)+1, (c*4)+2, (c*4)+3, \
89 (d*4)+0, (d*4)+1, (d*4)+2, (d*4)+3 )
90 +#else /* gnu */
91 +#define VEC_U32(a,b,c,d) {a, b, c, d}
92 +#define VEC_FLOAT(a,b,c,d) {a, b, c, d}
93 +#define VPERMUTE4(a,b,c,d) \
94 + { (a*4)+0, (a*4)+1, (a*4)+2, (a*4)+3, \
95 + (b*4)+0, (b*4)+1, (b*4)+2, (b*4)+3, \
96 + (c*4)+0, (c*4)+1, (c*4)+2, (c*4)+3, \
97 + (d*4)+0, (d*4)+1, (d*4)+2, (d*4)+3 }
98 +#endif
99
100 static inline vector float vec_ld_float(const float *a)
101 {
102 --- ppc_cpu_caps.bak 2007-12-23 17:13:33.000000000 +0000
103 +++ libaften/ppc/ppc_cpu_caps.c 2007-12-23 17:13:43.000000000 +0000
104 @@ -81,7 +81,7 @@
105 //Attempt to use AltiVec
106 if(!sigsetjmp(g_env, 0))
107 {
108 - asm volatile ( "vor v0, v0, v0" );
109 + asm volatile ( "vor 0, 0, 0" );
110 }
111
112 //Restore the old signal handler
113
114
115
116 --
117 gentoo-commits@g.o mailing list