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 (+18 lines)
Lines 782-797 Link Here
782
    /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
782
    /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
783
    /* Bit reversed shuffling */
783
    /* Bit reversed shuffling */
784
	asm volatile(
784
	asm volatile(
785
#ifdef __PIC__
786
		"pushl %%ebx\n\t"
787
#endif
785
		"xorl %%esi, %%esi			\n\t"
788
		"xorl %%esi, %%esi			\n\t"
786
		"leal "MANGLE(bit_reverse_512)", %%eax	\n\t"
789
		"leal "MANGLE(bit_reverse_512)", %%eax	\n\t"
787
		"movl $1008, %%edi			\n\t"
790
		"movl $1008, %%edi			\n\t"
788
		"pushl %%ebp				\n\t" //use ebp without telling gcc
791
		"pushl %%ebp				\n\t" //use ebp without telling gcc
789
		".balign 16				\n\t"
792
		".balign 16				\n\t"
790
		"1:					\n\t"
793
		"1:					\n\t"
794
#ifndef __PIC__
791
		"movlps (%0, %%esi), %%xmm0		\n\t" // XXXI
795
		"movlps (%0, %%esi), %%xmm0		\n\t" // XXXI
792
		"movhps 8(%0, %%edi), %%xmm0		\n\t" // RXXI
796
		"movhps 8(%0, %%edi), %%xmm0		\n\t" // RXXI
793
		"movlps 8(%0, %%esi), %%xmm1		\n\t" // XXXi
797
		"movlps 8(%0, %%esi), %%xmm1		\n\t" // XXXi
794
		"movhps (%0, %%edi), %%xmm1		\n\t" // rXXi
798
		"movhps (%0, %%edi), %%xmm1		\n\t" // rXXi
799
#else
800
		"movl	%[data], %%ebx\n\t"
801
		"movlps (%%ebx, %%esi), %%xmm0		\n\t" // XXXI
802
		"movhps 8(%%ebx, %%edi), %%xmm0		\n\t" // RXXI
803
		"movlps 8(%%ebx, %%esi), %%xmm1		\n\t" // XXXi
804
		"movhps (%%ebx, %%edi), %%xmm1		\n\t" // rXXi
805
#endif
795
		"shufps $0x33, %%xmm1, %%xmm0		\n\t" // irIR
806
		"shufps $0x33, %%xmm1, %%xmm0		\n\t" // irIR
796
		"movaps "MANGLE(sseSinCos1c)"(%%esi), %%xmm2\n\t"
807
		"movaps "MANGLE(sseSinCos1c)"(%%esi), %%xmm2\n\t"
797
		"mulps %%xmm0, %%xmm2			\n\t"
808
		"mulps %%xmm0, %%xmm2			\n\t"
Lines 807-813 Link Here
807
		"subl $16, %%edi			\n\t"
818
		"subl $16, %%edi			\n\t"
808
		" jnc 1b				\n\t"
819
		" jnc 1b				\n\t"
809
		"popl %%ebp				\n\t"//no we didnt touch ebp *g*
820
		"popl %%ebp				\n\t"//no we didnt touch ebp *g*
821
#ifdef __PIC__
822
		"popl %%ebx\n\t"
823
#endif
824
#ifndef __PIC__
810
		:: "b" (data), "c" (buf)
825
		:: "b" (data), "c" (buf)
826
#else
827
		:: [data] "g" (data), "c" (buf)
828
#endif
811
		: "%esi", "%edi", "%eax", "%edx"
829
		: "%esi", "%edi", "%eax", "%edx"
812
	);
830
	);
813
831
(-)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 (+11 lines)
Lines 24-29 Link Here
24
{
24
{
25
	volatile short out[4];
25
	volatile short out[4];
26
	asm (
26
	asm (
27
#ifdef __PIC__
28
		"pushl %%ebx\n\t"
29
		"movl  %[ns],%%ebx\n\t"
30
#endif
27
		"movl $8, %%ecx \n\t"
31
		"movl $8, %%ecx \n\t"
28
		"pxor %%mm4, %%mm4 \n\t"
32
		"pxor %%mm4, %%mm4 \n\t"
29
		"pxor %%mm7, %%mm7 \n\t"
33
		"pxor %%mm7, %%mm7 \n\t"
Lines 53-60 Link Here
53
		"jnz 1b \n\t"
57
		"jnz 1b \n\t"
54
		"movq %%mm4, (%%edx) \n\t"
58
		"movq %%mm4, (%%edx) \n\t"
55
		"emms \n\t"
59
		"emms \n\t"
60
#ifdef __PIC__
61
		"popl %%ebx"
62
#endif
56
		: 
63
		: 
64
#ifndef __PIC__
57
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
65
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
66
#else
67
		: "S" (old), "D" (new), "a" (os), [ns] "g" (ns), "d" (out)
68
#endif
58
		: "memory"
69
		: "memory"
59
		);
70
		);
60
	return out[0]+out[1]+out[2]+out[3];
71
	return out[0]+out[1]+out[2]+out[3];
(-)work.orig/MPlayer-1.0pre5/libmpcodecs/vf_divtc.c (+11 lines)
Lines 37-42 Link Here
37
   {
37
   {
38
   volatile short out[4];
38
   volatile short out[4];
39
   asm (
39
   asm (
40
#ifdef __PIC__
41
	"pushl %%ebx\n\t"
42
	"movl  %[ns],%%ebx\n\t"
43
#endif
40
	"movl $8, %%ecx \n\t"
44
	"movl $8, %%ecx \n\t"
41
	"pxor %%mm4, %%mm4 \n\t"
45
	"pxor %%mm4, %%mm4 \n\t"
42
	"pxor %%mm7, %%mm7 \n\t"
46
	"pxor %%mm7, %%mm7 \n\t"
Lines 66-73 Link Here
66
	"jnz 1b \n\t"
70
	"jnz 1b \n\t"
67
	"movq %%mm4, (%%edx) \n\t"
71
	"movq %%mm4, (%%edx) \n\t"
68
	"emms \n\t"
72
	"emms \n\t"
73
#ifdef __PIC__
74
	"popl %%ebx"
75
#endif
69
	:
76
	:
77
#ifndef __PIC__
70
	: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
78
	: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
79
#else
80
	: "S" (old), "D" (new), "a" (os), [ns] "g" (ns), "d" (out)
81
#endif
71
	: "memory"
82
	: "memory"
72
	);
83
	);
73
   return out[0]+out[1]+out[2]+out[3];
84
   return out[0]+out[1]+out[2]+out[3];
(-)work.orig/MPlayer-1.0pre5/libmpcodecs/vf_ilpack.c (+22 lines)
Lines 96-101 Link Here
96
	unsigned char *u, unsigned char *v, int w, int us, int vs)
96
	unsigned char *u, unsigned char *v, int w, int us, int vs)
97
{
97
{
98
	asm volatile (""
98
	asm volatile (""
99
#ifdef __PIC__
100
		"pushl %%ebx\n\t"
101
		"movl  %[v],%%ebx\n\t"
102
#endif
99
		"pushl %%ebp \n\t"
103
		"pushl %%ebp \n\t"
100
		"movl 4(%%edx), %%ebp \n\t"
104
		"movl 4(%%edx), %%ebp \n\t"
101
		"movl (%%edx), %%edx \n\t"
105
		"movl (%%edx), %%edx \n\t"
Lines 184-191 Link Here
184
		"jnz .Lli0 \n\t"
188
		"jnz .Lli0 \n\t"
185
		"emms \n\t"
189
		"emms \n\t"
186
		"popl %%ebp \n\t"
190
		"popl %%ebp \n\t"
191
#ifdef __PIC__
192
		"pushl %%ebx"
193
#endif
187
		: 
194
		: 
195
#ifndef __PIC__
188
		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
196
		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
197
#else
198
		: "S" (y), "D" (dst), "a" (u), [v] "g" (v), "d" (&us), "c" (w/16)
199
#endif
189
		: "memory"
200
		: "memory"
190
		);
201
		);
191
	pack_li_0_C(dst, y, u, v, (w&15), us, vs);
202
	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)
206
	unsigned char *u, unsigned char *v, int w, int us, int vs)
196
{
207
{
197
	asm volatile (""
208
	asm volatile (""
209
#ifdef __PIC__
210
		"pushl %%ebx\n\t"
211
		"movl  %[v],%%ebx\n\t"
212
#endif
198
		"pushl %%ebp \n\t"
213
		"pushl %%ebp \n\t"
199
		"movl 4(%%edx), %%ebp \n\t"
214
		"movl 4(%%edx), %%ebp \n\t"
200
		"movl (%%edx), %%edx \n\t"
215
		"movl (%%edx), %%edx \n\t"
Lines 287-294 Link Here
287
		"jnz .Lli1 \n\t"
302
		"jnz .Lli1 \n\t"
288
		"emms \n\t"
303
		"emms \n\t"
289
		"popl %%ebp \n\t"
304
		"popl %%ebp \n\t"
305
#ifdef __PIC__
306
		"popl %%ebx"
307
#endif
290
		: 
308
		: 
309
#ifndef __PIC__
291
		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
310
		: "S" (y), "D" (dst), "a" (u), "b" (v), "d" (&us), "c" (w/16)
311
#else
312
		: "S" (y), "D" (dst), "a" (u), [v] "g" (v), "d" (&us), "c" (w/16)
313
#endif
292
		: "memory"
314
		: "memory"
293
		);
315
		);
294
	pack_li_1_C(dst, y, u, v, (w&15), us, vs);
316
	pack_li_1_C(dst, y, u, v, (w&15), us, vs);
(-)work.orig/MPlayer-1.0pre5/libmpcodecs/vf_ivtc.c (+22 lines)
Lines 62-67 Link Here
62
	short out[24]; // output buffer for the partial metrics from the mmx code
62
	short out[24]; // output buffer for the partial metrics from the mmx code
63
	
63
	
64
	asm (
64
	asm (
65
#ifdef __PIC__
66
		"pushl %%ebx\n\t"
67
		"movl  %[ns],%%ebx\n\t"
68
#endif
65
		"movl $4, %%ecx \n\t"
69
		"movl $4, %%ecx \n\t"
66
		"pxor %%mm4, %%mm4 \n\t" // 4 even difference sums
70
		"pxor %%mm4, %%mm4 \n\t" // 4 even difference sums
67
		"pxor %%mm5, %%mm5 \n\t" // 4 odd difference sums
71
		"pxor %%mm5, %%mm5 \n\t" // 4 odd difference sums
Lines 112-119 Link Here
112
		"jnz 1b \n\t"
116
		"jnz 1b \n\t"
113
		"movq %%mm4, (%%edx) \n\t"
117
		"movq %%mm4, (%%edx) \n\t"
114
		"movq %%mm5, 8(%%edx) \n\t"
118
		"movq %%mm5, 8(%%edx) \n\t"
119
#ifdef __PIC__
120
		"popl %%ebx"
121
#endif
115
		: 
122
		: 
123
#ifndef __PIC__
116
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
124
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
125
#else
126
		: "S" (old), "D" (new), "a" (os), [ns] "g" (ns), "d" (out)
127
#endif
117
		: "memory"
128
		: "memory"
118
		);
129
		);
119
	m->e = out[0]+out[1]+out[2]+out[3];
130
	m->e = out[0]+out[1]+out[2]+out[3];
Lines 121-126 Link Here
121
	m->d = m->e + m->o;
132
	m->d = m->e + m->o;
122
133
123
	asm (
134
	asm (
135
#ifdef __PIC__
136
		"pushl %%ebx\n\t"
137
		"movl  %[ns],%%ebx\n\t"
138
#endif
124
		// First loop to measure first four columns
139
		// First loop to measure first four columns
125
		"movl $4, %%ecx \n\t"
140
		"movl $4, %%ecx \n\t"
126
		"pxor %%mm4, %%mm4 \n\t" // Past spacial noise
141
		"pxor %%mm4, %%mm4 \n\t" // Past spacial noise
Lines 223-230 Link Here
223
		"movq %%mm6, 40(%%edx) \n\t"
238
		"movq %%mm6, 40(%%edx) \n\t"
224
239
225
		"emms \n\t"
240
		"emms \n\t"
241
#ifdef __PIC__
242
		"popl %%ebx"
243
#endif
226
		: 
244
		: 
245
#ifndef __PIC__
227
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
246
		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
247
#else
248
		: "S" (old), "D" (new), "a" (os), [ns] "g" (ns), "d" (out)
249
#endif
228
		: "memory"
250
		: "memory"
229
		);
251
		);
230
	m->p = m->t = m->s = 0;
252
	m->p = m->t = m->s = 0;
(-)work.orig/MPlayer-1.0pre5/libmpcodecs/vf_tfields.c (-1 / +12 lines)
Lines 197-202 Link Here
197
	d += ds; s += ss;
197
	d += ds; s += ss;
198
	for (i=h-3; i; i--) {
198
	for (i=h-3; i; i--) {
199
		asm volatile(
199
		asm volatile(
200
#ifdef __PIC__
201
			"pushl %%ebx\n\t"
202
			"movl  %[nssd],%%ebx\n\t"
203
#endif
200
			"pxor %%mm0, %%mm0 \n\t"
204
			"pxor %%mm0, %%mm0 \n\t"
201
			"movq (%%edx), %%mm4 \n\t"
205
			"movq (%%edx), %%mm4 \n\t"
202
			"movq 8(%%edx), %%mm5 \n\t"
206
			"movq 8(%%edx), %%mm5 \n\t"
Lines 244-251 Link Here
244
			"addl $8, %%edi \n\t"
248
			"addl $8, %%edi \n\t"
245
			"decl %%ecx \n\t"
249
			"decl %%ecx \n\t"
246
			"jnz 4b \n\t"
250
			"jnz 4b \n\t"
251
#ifdef __PIC__
252
			"popl %%ebx"
253
#endif
247
			: "=S"(crap1), "=D"(crap2)
254
			: "=S"(crap1), "=D"(crap2)
248
			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd), "b"(-ssd), "d"(filter)
255
#ifndef __PIC__
256
			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd), "g"(-ssd), "d"(filter)
257
#else
258
			: "c"(w>>3), "S"(s), "D"(d), "a"(ssd), [nssd] "g"(-ssd), "d"(filter)
259
#endif
249
		);
260
		);
250
		for (j=w-(w&7); j<w; j++)
261
		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;
262
			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 (-3 / +3 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),		\
Lines 46-55 Link Here
46
	     : "cc")
46
	     : "cc")
47
#else	/* PIC version : save ebx */
47
#else	/* PIC version : save ebx */
48
#define cpuid(op,eax,ebx,ecx,edx)	\
48
#define cpuid(op,eax,ebx,ecx,edx)	\
49
    __asm__ ("push %%ebx\n\t"		\
49
    __asm__ ("pushl %%ebx\n\t"		\
50
	     "cpuid\n\t"		\
50
	     "cpuid\n\t"		\
51
	     "movl %%ebx,%1\n\t"	\
51
	     "movl %%ebx,%1\n\t"	\
52
	     "pop %%ebx"		\
52
	     "popl %%ebx"		\
53
	     : "=a" (eax),		\
53
	     : "=a" (eax),		\
54
	       "=r" (ebx),		\
54
	       "=r" (ebx),		\
55
	       "=c" (ecx),		\
55
	       "=c" (ecx),		\
(-)work.orig/MPlayer-1.0pre5/mp3lib/dct36_3dnow.c (+11 lines)
Lines 36-41 Link Here
36
#endif
36
#endif
37
{
37
{
38
    __asm__ __volatile__(
38
    __asm__ __volatile__(
39
#ifdef __PIC__
40
	"pushl %%ebx\n\t"
41
	"movl  %[tsbuf],%%ebx\n\t"
42
#endif
39
	"movq (%%eax),%%mm0\n\t"
43
	"movq (%%eax),%%mm0\n\t"
40
	"movq 4(%%eax),%%mm1\n\t"
44
	"movq 4(%%eax),%%mm1\n\t"
41
	"pfadd %%mm1,%%mm0\n\t"
45
	"pfadd %%mm1,%%mm0\n\t"
Lines 491-497 Link Here
491
	"movd %%mm5,1664(%%ebx)\n\t"
495
	"movd %%mm5,1664(%%ebx)\n\t"
492
496
493
	"femms\n\t"
497
	"femms\n\t"
498
#ifdef __PIC__
499
	"popl %%ebx"
500
#endif
494
	:
501
	:
502
#ifndef __PIC__
495
	: "a" (inbuf), "S" (o1), "c" (o2), "d" (wintab), "b" (tsbuf)
503
	: "a" (inbuf), "S" (o1), "c" (o2), "d" (wintab), "b" (tsbuf)
504
#else
505
	: "a" (inbuf), "S" (o1), "c" (o2), "d" (wintab), [tsbuf] "g" (tsbuf)
506
#endif
496
	: "memory");
507
	: "memory");
497
}
508
}
(-)work.orig/MPlayer-1.0pre5/mp3lib/decode_MMX.c (+10 lines)
Lines 54-59 Link Here
54
{
54
{
55
55
56
__asm __volatile(
56
__asm __volatile(
57
#ifdef __PIC__
58
	"pushl %%ebx\n\t"
59
#endif
57
        "movl %1,%%ecx\n\t"
60
        "movl %1,%%ecx\n\t"
58
        "movl %2,%%edi\n\t"
61
        "movl %2,%%edi\n\t"
59
        "movl $15,%%ebx\n\t"
62
        "movl $15,%%ebx\n\t"
Lines 242-248 Link Here
242
        "movd %%mm0,%%eax\n\t"
245
        "movd %%mm0,%%eax\n\t"
243
	"movw %%ax,(%%edi)\n\t"
246
	"movw %%ax,(%%edi)\n\t"
244
	"emms\n\t"
247
	"emms\n\t"
248
#ifdef __PIC__
249
	"popl %%ebx"
250
#endif
245
        :
251
        :
246
	:"m"(bandPtr),"m"(channel),"m"(samples),"m"(buffs),"m"(bo), "m"(temp)
252
	:"m"(bandPtr),"m"(channel),"m"(samples),"m"(buffs),"m"(bo), "m"(temp)
253
#ifndef __PIC__
247
	:"memory","%edi","%esi","%ebx","%esp");
254
	:"memory","%edi","%esi","%ebx","%esp");
255
#else
256
	:"memory","%edi","%esi","%esp");
257
#endif
248
}
258
}
(-)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