Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 51853 | Differences between
and this patch

Collapse All | Expand All

(-)work.orig/MPlayer-1.0pre5/liba52/imdct.c (+22 lines)
Lines 758-763 Link Here
758
#define HAVE_3DNOWEX
758
#define HAVE_3DNOWEX
759
#include "imdct_3dnow.h"
759
#include "imdct_3dnow.h"
760
760
761
#ifdef __PIC__
762
    static int breg_sv;
763
#endif
764
761
void
765
void
762
imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
766
imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
763
{
767
{
Lines 782-797 Link Here
782
    /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
786
    /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
783
    /* Bit reversed shuffling */
787
    /* Bit reversed shuffling */
784
	asm volatile(
788
	asm volatile(
789
#ifdef __PIC__
790
		"movl %%ebx,breg_sv\n\t"
791
#endif
785
		"xorl %%esi, %%esi			\n\t"
792
		"xorl %%esi, %%esi			\n\t"
786
		"leal "MANGLE(bit_reverse_512)", %%eax	\n\t"
793
		"leal "MANGLE(bit_reverse_512)", %%eax	\n\t"
787
		"movl $1008, %%edi			\n\t"
794
		"movl $1008, %%edi			\n\t"
788
		"pushl %%ebp				\n\t" //use ebp without telling gcc
795
		"pushl %%ebp				\n\t" //use ebp without telling gcc
789
		".balign 16				\n\t"
796
		".balign 16				\n\t"
790
		"1:					\n\t"
797
		"1:					\n\t"
798
#ifndef __PIC__
791
		"movlps (%0, %%esi), %%xmm0		\n\t" // XXXI
799
		"movlps (%0, %%esi), %%xmm0		\n\t" // XXXI
792
		"movhps 8(%0, %%edi), %%xmm0		\n\t" // RXXI
800
		"movhps 8(%0, %%edi), %%xmm0		\n\t" // RXXI
793
		"movlps 8(%0, %%esi), %%xmm1		\n\t" // XXXi
801
		"movlps 8(%0, %%esi), %%xmm1		\n\t" // XXXi
794
		"movhps (%0, %%edi), %%xmm1		\n\t" // rXXi
802
		"movhps (%0, %%edi), %%xmm1		\n\t" // rXXi
803
#else
804
		"movl %[data],%%ebx			\n\t"
805
		"movlps (%%ebx, %%esi), %%xmm0		\n\t" // XXXI
806
		"movhps 8(%%ebx, %%edi), %%xmm0		\n\t" // RXXI
807
		"movlps 8(%%ebx, %%esi), %%xmm1		\n\t" // XXXi
808
		"movhps (%%ebx, %%edi), %%xmm1		\n\t" // rXXi
809
#endif
795
		"shufps $0x33, %%xmm1, %%xmm0		\n\t" // irIR
810
		"shufps $0x33, %%xmm1, %%xmm0		\n\t" // irIR
796
		"movaps "MANGLE(sseSinCos1c)"(%%esi), %%xmm2\n\t"
811
		"movaps "MANGLE(sseSinCos1c)"(%%esi), %%xmm2\n\t"
797
		"mulps %%xmm0, %%xmm2			\n\t"
812
		"mulps %%xmm0, %%xmm2			\n\t"
Lines 807-813 Link Here
807
		"subl $16, %%edi			\n\t"
822
		"subl $16, %%edi			\n\t"
808
		" jnc 1b				\n\t"
823
		" jnc 1b				\n\t"
809
		"popl %%ebp				\n\t"//no we didnt touch ebp *g*
824
		"popl %%ebp				\n\t"//no we didnt touch ebp *g*
825
#ifdef __PIC__
826
		"movl breg_sv,%%ebx"
827
#endif
828
#ifndef __PIC__
810
		:: "b" (data), "c" (buf)
829
		:: "b" (data), "c" (buf)
830
#else
831
		:: [data] "g" (data), "c" (buf)
832
#endif
811
		: "%esi", "%edi", "%eax", "%edx"
833
		: "%esi", "%edi", "%eax", "%edx"
812
	);
834
	);
813
835
(-)work.orig/MPlayer-1.0pre5/libavcodec/i386/dsputil_mmx.c (-1 / +1 lines)
Lines 57-63 Link Here
57
    "pcmpeqd %%" #regd ", %%" #regd " \n\t"\
57
    "pcmpeqd %%" #regd ", %%" #regd " \n\t"\
58
    "paddb %%" #regd ", %%" #regd " \n\t" ::)
58
    "paddb %%" #regd ", %%" #regd " \n\t" ::)
59
59
60
#ifndef PIC
60
#ifndef __PIC__
61
#define MOVQ_BONE(regd)  __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_bone))
61
#define MOVQ_BONE(regd)  __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_bone))
62
#define MOVQ_WTWO(regd)  __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo))
62
#define MOVQ_WTWO(regd)  __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo))
63
#else
63
#else
(-)work.orig/MPlayer-1.0pre5/libavcodec/i386/dsputil_mmx_rnd.h (-2 / +2 lines)
Lines 96-102 Link Here
96
	"addl	%5, %3			\n\t"
96
	"addl	%5, %3			\n\t"
97
	"subl	$4, %0			\n\t"
97
	"subl	$4, %0			\n\t"
98
	"jnz	1b			\n\t"
98
	"jnz	1b			\n\t"
99
#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
99
#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
100
        :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
100
        :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
101
#else
101
#else
102
        :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
102
        :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
Lines 191-197 Link Here
191
	"addl	$32, %2			\n\t"
191
	"addl	$32, %2			\n\t"
192
	"subl	$2, %0			\n\t"
192
	"subl	$2, %0			\n\t"
193
	"jnz	1b			\n\t"
193
	"jnz	1b			\n\t"
194
#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
194
#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
195
	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
195
	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
196
#else
196
#else
197
	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
197
	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
(-)work.orig/MPlayer-1.0pre5/libavcodec/msmpeg4.c (-1 / +1 lines)
Lines 716-722 Link Here
716
       necessitate to modify mpegvideo.c. The problem comes from the
716
       necessitate to modify mpegvideo.c. The problem comes from the
717
       fact they decided to store the quantized DC (which would lead
717
       fact they decided to store the quantized DC (which would lead
718
       to problems if Q could vary !) */
718
       to problems if Q could vary !) */
719
#if defined ARCH_X86 && !defined PIC
719
#if defined ARCH_X86 && !defined __PIC__
720
    asm volatile(
720
    asm volatile(
721
        "movl %3, %%eax		\n\t"
721
        "movl %3, %%eax		\n\t"
722
	"shrl $1, %%eax		\n\t"
722
	"shrl $1, %%eax		\n\t"
(-)work.orig/MPlayer-1.0pre5/libmpcodecs/vf_decimate.c (+15 lines)
Lines 19-29 Link Here
19
	int max, last, cnt;
19
	int max, last, cnt;
20
};
20
};
21
21
22
#ifdef __PIC__
23
	static int breg_sv;
24
#endif
25
22
#ifdef HAVE_MMX
26
#ifdef HAVE_MMX
23
static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
27
static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
24
{
28
{
25
	volatile short out[4];
29
	volatile short out[4];
26
	asm (
30
	asm (
31
#ifdef __PIC__
32
		"movl %%ebx,breg_sv\n\t"
33
		"movl %[ns],%%ebx\n\t"
34
#endif
27
		"movl $8, %%ecx \n\t"
35
		"movl $8, %%ecx \n\t"
28
		"pxor %%mm4, %%mm4 \n\t"
36
		"pxor %%mm4, %%mm4 \n\t"
29
		"pxor %%mm7, %%mm7 \n\t"
37
		"pxor %%mm7, %%mm7 \n\t"
Lines 53-60 Link Here
53
		"jnz 1b \n\t"
61
		"jnz 1b \n\t"
54
		"movq %%mm4, (%%edx) \n\t"
62
		"movq %%mm4, (%%edx) \n\t"
55
		"emms \n\t"
63
		"emms \n\t"
64
#ifdef __PIC__
65
		"movl breg_sv,%%ebx"
66
#endif
56
		: 
67
		: 
68
#ifndef __PIC__
57
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
69
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
70
#else
71
		: "S" (old), "D" (new), "a" (os), [ns] "g" (ns), "d" (out)
72
#endif
58
		: "memory"
73
		: "memory"
59
		);
74
		);
60
	return out[0]+out[1]+out[2]+out[3];
75
	return out[0]+out[1]+out[2]+out[3];
(-)work.orig/MPlayer-1.0pre5/libmpcodecs/vf_divtc.c (+15 lines)
Lines 28-33 Link Here
28
   int *history;
28
   int *history;
29
   };
29
   };
30
30
31
#ifdef __PIC__
32
   static int breg_sv;
33
#endif
34
31
/*
35
/*
32
 * diff_MMX and diff_C stolen from vf_decimate.c
36
 * diff_MMX and diff_C stolen from vf_decimate.c
33
 */
37
 */
Lines 37-42 Link Here
37
   {
41
   {
38
   volatile short out[4];
42
   volatile short out[4];
39
   asm (
43
   asm (
44
#ifdef __PIC__
45
	"movl %%ebx,breg_sv\n\t"
46
	"movl %[ns],%%ebx\n\t"
47
#endif
40
	"movl $8, %%ecx \n\t"
48
	"movl $8, %%ecx \n\t"
41
	"pxor %%mm4, %%mm4 \n\t"
49
	"pxor %%mm4, %%mm4 \n\t"
42
	"pxor %%mm7, %%mm7 \n\t"
50
	"pxor %%mm7, %%mm7 \n\t"
Lines 66-73 Link Here
66
	"jnz 1b \n\t"
74
	"jnz 1b \n\t"
67
	"movq %%mm4, (%%edx) \n\t"
75
	"movq %%mm4, (%%edx) \n\t"
68
	"emms \n\t"
76
	"emms \n\t"
77
#ifdef __PIC__
78
	"movl breg_sv,%%ebx"
79
#endif
69
	:
80
	:
81
#ifndef __PIC__
70
	: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
82
	: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
83
#else
84
	: "S" (old), "D" (new), "a" (os), [ns] "g" (ns), "d" (out)
85
#endif
71
	: "memory"
86
	: "memory"
72
	);
87
	);
73
   return out[0]+out[1]+out[2]+out[3];
88
   return out[0]+out[1]+out[2]+out[3];
(-)work.orig/MPlayer-1.0pre5/libmpcodecs/vf_ilpack.c (+26 lines)
Lines 22-27 Link Here
22
	pack_func_t *pack[2];
22
	pack_func_t *pack[2];
23
};
23
};
24
24
25
#ifdef __PIC__
26
	static int breg_sv;
27
#endif
28
25
static void pack_nn_C(unsigned char *dst, unsigned char *y,
29
static void pack_nn_C(unsigned char *dst, unsigned char *y,
26
	unsigned char *u, unsigned char *v, int w)
30
	unsigned char *u, unsigned char *v, int w)
27
{
31
{
Lines 96-101 Link Here
96
	unsigned char *u, unsigned char *v, int w, int us, int vs)
100
	unsigned char *u, unsigned char *v, int w, int us, int vs)
97
{
101
{
98
	asm volatile (""
102
	asm volatile (""
103
#ifdef __PIC__
104
		"movl %%ebx,breg_sv\n\t"
105
		"movl %[v],%%ebx\n\t"
106
#endif
99
		"pushl %%ebp \n\t"
107
		"pushl %%ebp \n\t"
100
		"movl 4(%%edx), %%ebp \n\t"
108
		"movl 4(%%edx), %%ebp \n\t"
101
		"movl (%%edx), %%edx \n\t"
109
		"movl (%%edx), %%edx \n\t"
Lines 184-191 Link Here
184
		"jnz .Lli0 \n\t"
192
		"jnz .Lli0 \n\t"
185
		"emms \n\t"
193
		"emms \n\t"
186
		"popl %%ebp \n\t"
194
		"popl %%ebp \n\t"
195
#ifdef __PIC__
196
		"movl breg_sv,%%ebx"
197
#endif
187
		: 
198
		: 
199
#ifndef __PIC__
188
		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
200
		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
201
#else
202
		: "S" (y), "D" (dst), "a" (u), [v] "g" (v), "d" (&us), "c" (w/16)
203
#endif
189
		: "memory"
204
		: "memory"
190
		);
205
		);
191
	pack_li_0_C(dst, y, u, v, (w&15), us, vs);
206
	pack_li_0_C(dst, y, u, v, (w&15), us, vs);
Lines 195-200 Link Here
195
	unsigned char *u, unsigned char *v, int w, int us, int vs)
210
	unsigned char *u, unsigned char *v, int w, int us, int vs)
196
{
211
{
197
	asm volatile (""
212
	asm volatile (""
213
#ifdef __PIC__
214
		"movl %%ebx,breg_sv\n\t"
215
		"movl %[v],%%ebx\n\t"
216
#endif
198
		"pushl %%ebp \n\t"
217
		"pushl %%ebp \n\t"
199
		"movl 4(%%edx), %%ebp \n\t"
218
		"movl 4(%%edx), %%ebp \n\t"
200
		"movl (%%edx), %%edx \n\t"
219
		"movl (%%edx), %%edx \n\t"
Lines 287-294 Link Here
287
		"jnz .Lli1 \n\t"
306
		"jnz .Lli1 \n\t"
288
		"emms \n\t"
307
		"emms \n\t"
289
		"popl %%ebp \n\t"
308
		"popl %%ebp \n\t"
309
#ifdef __PIC__
310
		"movl breg_sv,%%ebx"
311
#endif
290
		: 
312
		: 
313
#ifndef __PIC__
291
		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
314
		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
315
#else
316
		: "S" (y), "D" (dst), "a" (u), [v] "g" (v), "d" (&us), "c" (w/16)
317
#endif
292
		: "memory"
318
		: "memory"
293
		);
319
		);
294
	pack_li_1_C(dst, y, u, v, (w&15), us, vs);
320
	pack_li_1_C(dst, y, u, v, (w&15), us, vs);
(-)work.orig/MPlayer-1.0pre5/libmpcodecs/vf_ivtc.c (+26 lines)
Lines 40-45 Link Here
40
	F_SHOW
40
	F_SHOW
41
};
41
};
42
42
43
#ifdef __PIC__
44
        static int breg_sv;
45
#endif
46
43
static inline void *my_memcpy_pic(void * dst, void * src, int bytesPerLine, int height, int dstStride, int srcStride)
47
static inline void *my_memcpy_pic(void * dst, void * src, int bytesPerLine, int height, int dstStride, int srcStride)
44
{
48
{
45
	int i;
49
	int i;
Lines 62-67 Link Here
62
	short out[24]; // output buffer for the partial metrics from the mmx code
66
	short out[24]; // output buffer for the partial metrics from the mmx code
63
	
67
	
64
	asm (
68
	asm (
69
#ifdef __PIC__
70
		"movl %%ebx,breg_sv\n\t"
71
		"movl %[ns],%%ebx\n\t"
72
#endif
65
		"movl $4, %%ecx \n\t"
73
		"movl $4, %%ecx \n\t"
66
		"pxor %%mm4, %%mm4 \n\t" // 4 even difference sums
74
		"pxor %%mm4, %%mm4 \n\t" // 4 even difference sums
67
		"pxor %%mm5, %%mm5 \n\t" // 4 odd difference sums
75
		"pxor %%mm5, %%mm5 \n\t" // 4 odd difference sums
Lines 112-119 Link Here
112
		"jnz 1b \n\t"
120
		"jnz 1b \n\t"
113
		"movq %%mm4, (%%edx) \n\t"
121
		"movq %%mm4, (%%edx) \n\t"
114
		"movq %%mm5, 8(%%edx) \n\t"
122
		"movq %%mm5, 8(%%edx) \n\t"
123
#ifdef __PIC__
124
		"movl breg_sv,%%ebx"
125
#endif
115
		: 
126
		: 
127
#ifndef __PIC__
116
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
128
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
129
#else
130
		: "S" (old), "D" (new), "a" (os), [ns] "g" (ns), "d" (out)
131
#endif
117
		: "memory"
132
		: "memory"
118
		);
133
		);
119
	m->e = out[0]+out[1]+out[2]+out[3];
134
	m->e = out[0]+out[1]+out[2]+out[3];
Lines 121-126 Link Here
121
	m->d = m->e + m->o;
136
	m->d = m->e + m->o;
122
137
123
	asm (
138
	asm (
139
#ifdef __PIC__
140
		"movl %%ebx,breg_sv\n\t"
141
		"movl %[ns],%%ebx\n\t"
142
#endif
124
		// First loop to measure first four columns
143
		// First loop to measure first four columns
125
		"movl $4, %%ecx \n\t"
144
		"movl $4, %%ecx \n\t"
126
		"pxor %%mm4, %%mm4 \n\t" // Past spacial noise
145
		"pxor %%mm4, %%mm4 \n\t" // Past spacial noise
Lines 223-230 Link Here
223
		"movq %%mm6, 40(%%edx) \n\t"
242
		"movq %%mm6, 40(%%edx) \n\t"
224
243
225
		"emms \n\t"
244
		"emms \n\t"
245
#ifdef __PIC__
246
		"movl breg_sv,%%ebx"
247
#endif
226
		: 
248
		: 
249
#ifndef __PIC__
227
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
250
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
251
#else
252
		: "S" (old), "D" (new), "a" (os), [ns] "g" (ns), "d" (out)
253
#endif
228
		: "memory"
254
		: "memory"
229
		);
255
		);
230
	m->p = m->t = m->s = 0;
256
	m->p = m->t = m->s = 0;
(-)work.orig/MPlayer-1.0pre5/libmpcodecs/vf_tfields.c (-1 / +16 lines)
Lines 12-17 Link Here
12
12
13
#include "../libvo/fastmemcpy.h"
13
#include "../libvo/fastmemcpy.h"
14
14
15
#ifdef __PIC__
16
	static int breg_sv;
17
#endif
18
15
struct vf_priv_s {
19
struct vf_priv_s {
16
	int mode;
20
	int mode;
17
};
21
};
Lines 197-202 Link Here
197
	d += ds; s += ss;
201
	d += ds; s += ss;
198
	for (i=h-3; i; i--) {
202
	for (i=h-3; i; i--) {
199
		asm volatile(
203
		asm volatile(
204
#ifdef __PIC__
205
			"movl %%ebx,breg_sv\n\t"
206
			"movl %[nssd],%%ebx\n\t"
207
#endif
200
			"pxor %%mm0, %%mm0 \n\t"
208
			"pxor %%mm0, %%mm0 \n\t"
201
			"movq (%%edx), %%mm4 \n\t"
209
			"movq (%%edx), %%mm4 \n\t"
202
			"movq 8(%%edx), %%mm5 \n\t"
210
			"movq 8(%%edx), %%mm5 \n\t"
Lines 244-251 Link Here
244
			"addl $8, %%edi \n\t"
252
			"addl $8, %%edi \n\t"
245
			"decl %%ecx \n\t"
253
			"decl %%ecx \n\t"
246
			"jnz 4b \n\t"
254
			"jnz 4b \n\t"
255
#ifdef __PIC__
256
			"movl breg_sv,%%ebx"
257
#endif
247
			: "=S"(crap1), "=D"(crap2)
258
			: "=S"(crap1), "=D"(crap2)
248
			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd), "b"(-ssd), "d"(filter)
259
#ifndef __PIC__
260
			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd), "g"(-ssd), "d"(filter)
261
#else
262
			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd), [nssd] "g"(-ssd), "d"(filter)
263
#endif
249
		);
264
		);
250
		for (j=w-(w&7); j<w; j++)
265
		for (j=w-(w&7); j<w; j++)
251
			d[j] = (-9*s[j-ssd] + 111*s[j] + 29*s[j+ssd] - 3*s[j+ssd+ssd])>>7;
266
			d[j] = (-9*s[j-ssd] + 111*s[j] + 29*s[j+ssd] - 3*s[j+ssd+ssd])>>7;
(-)work.orig/MPlayer-1.0pre5/libmpeg2/cpu_accel.c (-1 / +1 lines)
Lines 35-41 Link Here
35
    int AMD;
35
    int AMD;
36
    uint32_t caps;
36
    uint32_t caps;
37
37
38
#ifndef PIC
38
#ifndef __PIC__
39
#define cpuid(op,eax,ebx,ecx,edx)	\
39
#define cpuid(op,eax,ebx,ecx,edx)	\
40
    __asm__ ("cpuid"			\
40
    __asm__ ("cpuid"			\
41
	     : "=a" (eax),		\
41
	     : "=a" (eax),		\
(-)work.orig/MPlayer-1.0pre5/mp3lib/dct36_3dnow.c (+15 lines)
Lines 27-32 Link Here
27
27
28
#include "../mangle.h"
28
#include "../mangle.h"
29
29
30
#ifdef __PIC__
31
	static int breg_sv;
32
#endif
33
30
#ifdef __DCT36_OPTIMIZE_FOR_K7
34
#ifdef __DCT36_OPTIMIZE_FOR_K7
31
void dct36_3dnowex(real *inbuf, real *o1,
35
void dct36_3dnowex(real *inbuf, real *o1,
32
    real *o2, real *wintab, real *tsbuf)
36
    real *o2, real *wintab, real *tsbuf)
Lines 36-41 Link Here
36
#endif
40
#endif
37
{
41
{
38
    __asm__ __volatile__(
42
    __asm__ __volatile__(
43
#ifdef __PIC__
44
	"movl %%ebx,breg_sv\n\t"
45
	"movl %[tsbuf],%%ebx\n\t"
46
#endif
39
	"movq (%%eax),%%mm0\n\t"
47
	"movq (%%eax),%%mm0\n\t"
40
	"movq 4(%%eax),%%mm1\n\t"
48
	"movq 4(%%eax),%%mm1\n\t"
41
	"pfadd %%mm1,%%mm0\n\t"
49
	"pfadd %%mm1,%%mm0\n\t"
Lines 491-497 Link Here
491
	"movd %%mm5,1664(%%ebx)\n\t"
499
	"movd %%mm5,1664(%%ebx)\n\t"
492
500
493
	"femms\n\t"
501
	"femms\n\t"
502
#ifdef __PIC__
503
	"movl breg_sv,%%ebx"
504
#endif
494
	:
505
	:
506
#ifndef __PIC__
495
	: "a" (inbuf), "S" (o1), "c" (o2), "d" (wintab), "b" (tsbuf)
507
	: "a" (inbuf), "S" (o1), "c" (o2), "d" (wintab), "b" (tsbuf)
508
#else
509
	: "a" (inbuf), "S" (o1), "c" (o2), "d" (wintab), [tsbuf] "g" (tsbuf)
510
#endif
496
	: "memory");
511
	: "memory");
497
}
512
}
(-)work.orig/MPlayer-1.0pre5/mp3lib/decode_MMX.c (+13 lines)
Lines 11-16 Link Here
11
#include "../mangle.h"
11
#include "../mangle.h"
12
#define real float /* ugly - but only way */
12
#define real float /* ugly - but only way */
13
13
14
#ifdef __PIC__
15
	static int breg_sv;
16
#endif
14
static unsigned long long attribute_used __attribute__((aligned(8))) null_one = 0x0000ffff0000ffffULL;
17
static unsigned long long attribute_used __attribute__((aligned(8))) null_one = 0x0000ffff0000ffffULL;
15
static unsigned long long attribute_used __attribute__((aligned(8))) one_null = 0xffff0000ffff0000ULL;
18
static unsigned long long attribute_used __attribute__((aligned(8))) one_null = 0xffff0000ffff0000ULL;
16
unsigned long __attribute__((aligned(8))) costab_mmx[] =
19
unsigned long __attribute__((aligned(8))) costab_mmx[] =
Lines 54-59 Link Here
54
{
57
{
55
58
56
__asm __volatile(
59
__asm __volatile(
60
#ifdef __PIC__
61
	"movl %%ebx,breg_sv\n\t"
62
#endif
57
        "movl %1,%%ecx\n\t"
63
        "movl %1,%%ecx\n\t"
58
        "movl %2,%%edi\n\t"
64
        "movl %2,%%edi\n\t"
59
        "movl $15,%%ebx\n\t"
65
        "movl $15,%%ebx\n\t"
Lines 242-248 Link Here
242
        "movd %%mm0,%%eax\n\t"
248
        "movd %%mm0,%%eax\n\t"
243
	"movw %%ax,(%%edi)\n\t"
249
	"movw %%ax,(%%edi)\n\t"
244
	"emms\n\t"
250
	"emms\n\t"
251
#ifdef __PIC__
252
	"movl breg_sv,%%ebx"
253
#endif
245
        :
254
        :
246
	:"m"(bandPtr),"m"(channel),"m"(samples),"m"(buffs),"m"(bo), "m"(temp)
255
	:"m"(bandPtr),"m"(channel),"m"(samples),"m"(buffs),"m"(bo), "m"(temp)
256
#ifndef __PIC__
247
	:"memory","%edi","%esi","%ebx","%esp");
257
	:"memory","%edi","%esi","%ebx","%esp");
258
#else
259
	:"memory","%edi","%esi","%esp");
260
#endif
248
}
261
}
(-)work.orig/MPlayer-1.0pre5/mp3lib/tabinit_MMX.c (+49 lines)
Lines 54-59 Link Here
54
void make_decode_tables_MMX(long scaleval)
54
void make_decode_tables_MMX(long scaleval)
55
{
55
{
56
  long intwinbase_step;
56
  long intwinbase_step;
57
  long *mp3lib_decwins_0=&mp3lib_decwins[0];
58
  real *mp3lib_decwin_0=&mp3lib_decwin[0];
57
  intwinbase_step=2;
59
  intwinbase_step=2;
58
  scaleval =- scaleval;
60
  scaleval =- scaleval;
59
    __asm __volatile(
61
    __asm __volatile(
Lines 65-71 Link Here
65
	"cmpl $528,%%ecx\n\t"
67
	"cmpl $528,%%ecx\n\t"
66
	"jnc .L02\n\t"
68
	"jnc .L02\n\t"
67
	"movswl (%%edi),%%eax\n\t"
69
	"movswl (%%edi),%%eax\n\t"
70
#ifndef __PIC__
68
	"cmpl %0+444,%%edi\n\t"
71
	"cmpl %0+444,%%edi\n\t"
72
#else
73
	"movl %0,%%edx\n\t"		// Using edx here is ok; it's overwritten in L02 anyway.
74
	"addl $444,%%edx\n\t"
75
	"cmpl %%edx,%%edi\n\t"
76
#endif
69
	"jc .L01\n\t"
77
	"jc .L01\n\t"
70
	"addl $60000,%%eax\n\t"
78
	"addl $60000,%%eax\n\t"
71
".L01:\n\t"
79
".L01:\n\t"
Lines 74-81 Link Here
74
	"fdivs "MANGLE(intwindiv)"\n\t"
82
	"fdivs "MANGLE(intwindiv)"\n\t"
75
	"popl %%eax\n\t"
83
	"popl %%eax\n\t"
76
	"fimull %2\n\t"
84
	"fimull %2\n\t"
85
#ifndef __PIC__
77
	"fsts  %1(,%%ecx,4)\n\t"
86
	"fsts  %1(,%%ecx,4)\n\t"
78
	"fstps %1+64(,%%ecx,4)\n\t"
87
	"fstps %1+64(,%%ecx,4)\n\t"
88
#else
89
	"movl  %1,%%edx\n\t"		// Using edx here is ok; it's overwritten in L02 anyway.
90
	"fsts  (%%edx,%%ecx,4)\n\t"
91
	"addl  $64,%%edx\n\t"
92
	"fstps (%%edx,%%ecx,4)\n\t"
93
#endif
79
".L02:\n\t"
94
".L02:\n\t"
80
	"leal -1(%%esi),%%edx\n\t"
95
	"leal -1(%%esi),%%edx\n\t"
81
	"and %%ebx,%%edx\n\t"
96
	"and %%ebx,%%edx\n\t"
Lines 96-102 Link Here
96
	"negl %3\n\t"
111
	"negl %3\n\t"
97
	"jmp .L00\n\t"
112
	"jmp .L00\n\t"
98
".L04:\n\t"
113
".L04:\n\t"
114
#ifndef __PIC__
99
	::"g"(intwinbase_MMX),"m"(mp3lib_decwin[0]),"m"(scaleval),"m"(intwinbase_step)
115
	::"g"(intwinbase_MMX),"m"(mp3lib_decwin[0]),"m"(scaleval),"m"(intwinbase_step)
116
#else
117
	::"g"(intwinbase_MMX),"m"(mp3lib_decwin_0),"m"(scaleval),"m"(intwinbase_step)
118
#endif
100
	:"memory","%ebx","%esi","%edi");
119
	:"memory","%ebx","%esi","%edi");
101
intwinbase_step=2;
120
intwinbase_step=2;
102
  __asm __volatile(
121
  __asm __volatile(
Lines 106-115 Link Here
106
	"cmpl $528,%%ecx\n\t"
125
	"cmpl $528,%%ecx\n\t"
107
	"jnc .L11\n\t"
126
	"jnc .L11\n\t"
108
	"movswl (%%edi),%%eax\n\t"
127
	"movswl (%%edi),%%eax\n\t"
128
#ifndef __PIC__
109
	"cmpl %0+444,%%edi\n\t"
129
	"cmpl %0+444,%%edi\n\t"
130
#else
131
	"pushl %%edx\n\t"		// Need to save edx here - it's already in use.  Pop after L06.
132
	"movl %0,%%edx\n\t"
133
	"addl $444,%%edx\n\t"
134
	"cmpl %%edx,%%edi\n\t"
135
#endif
110
	"jc .L06\n\t"
136
	"jc .L06\n\t"
111
	"addl $60000,%%eax\n\t"
137
	"addl $60000,%%eax\n\t"
112
".L06:\n\t"
138
".L06:\n\t"
139
#ifdef __PIC__
140
	"popl %%edx\n\t"
141
#endif
113
	"cltd\n\t"
142
	"cltd\n\t"
114
	"imull %2\n\t"
143
	"imull %2\n\t"
115
	"shrdl $17,%%edx,%%eax\n\t"
144
	"shrdl $17,%%edx,%%eax\n\t"
Lines 126-140 Link Here
126
	"cmpl $512,%%ecx\n\t"
155
	"cmpl $512,%%ecx\n\t"
127
	"jnc .L09\n\t"
156
	"jnc .L09\n\t"
128
	"subl %%ecx,%%edx\n\t"
157
	"subl %%ecx,%%edx\n\t"
158
#ifndef __PIC__
129
	"movw %%ax,%1(,%%edx,2)\n\t"
159
	"movw %%ax,%1(,%%edx,2)\n\t"
130
	"movw %%ax,%1-32(,%%edx,2)\n\t"
160
	"movw %%ax,%1-32(,%%edx,2)\n\t"
161
#else
162
	"pushl %%ebx\n\t"			// Save ebx here
163
	"movl %1,%%ebx\n\t"
164
	"movw %%ax,(%%ebx,%%edx,2)\n\t"
165
	"addl $-32,%%ebx\n\t"
166
	"movw %%ax,(%%ebx,%%edx,2)\n\t"
167
#endif
131
".L09:\n\t"
168
".L09:\n\t"
132
	"testl $1,%%ecx\n\t"
169
	"testl $1,%%ecx\n\t"
133
	"jnz .L10\n\t"
170
	"jnz .L10\n\t"
134
	"negl %%eax\n\t"
171
	"negl %%eax\n\t"
135
".L10:\n\t"
172
".L10:\n\t"
173
#ifndef __PIC__
136
	"movw %%ax,%1(,%%ecx,2)\n\t"
174
	"movw %%ax,%1(,%%ecx,2)\n\t"
137
	"movw %%ax,%1+32(,%%ecx,2)\n\t"
175
	"movw %%ax,%1+32(,%%ecx,2)\n\t"
176
#else
177
	"movl %1,%%ebx\n\t"
178
	"movw %%ax,(%%ebx,%%ecx,2)\n\t"
179
	"addl $32,%%ebx\n\t"
180
	"movw %%ax,(%%ebx,%%ecx,2)\n\t"
181
	"popl %%ebx\n\t"			// Restore
182
#endif
138
".L11:\n\t"
183
".L11:\n\t"
139
	"leal -1(%%esi),%%edx\n\t"
184
	"leal -1(%%esi),%%edx\n\t"
140
	"and %%ebx,%%edx\n\t"
185
	"and %%ebx,%%edx\n\t"
Lines 155-160 Link Here
155
	"negl %3\n\t"
200
	"negl %3\n\t"
156
	"jmp .L05\n\t"
201
	"jmp .L05\n\t"
157
".L13:\n\t"
202
".L13:\n\t"
203
#ifndef __PIC__
158
	::"g"(intwinbase_MMX),"m"(mp3lib_decwins[0]),"m"(scaleval),"m"(intwinbase_step)
204
	::"g"(intwinbase_MMX),"m"(mp3lib_decwins[0]),"m"(scaleval),"m"(intwinbase_step)
205
#else
206
	::"g"(intwinbase_MMX),"m"(mp3lib_decwins_0),"m"(scaleval),"m"(intwinbase_step)
207
#endif
159
	:"memory","%ebx","%esi","%edi");
208
	:"memory","%ebx","%esi","%edi");
160
}
209
}

Return to bug 51853