]> git.pld-linux.org Git - packages/SDL.git/blame - SDL-gcc34.patch
- fix xlibs bconds
[packages/SDL.git] / SDL-gcc34.patch
CommitLineData
84fb5f2c
PS
1diff -uNr SDL-1.2.7.orig/src/audio/SDL_mixer_MMX.c SDL-1.2.7/src/audio/SDL_mixer_MMX.c
2--- SDL-1.2.7.orig/src/audio/SDL_mixer_MMX.c 2002-11-09 07:13:28.000000000 +0100
3+++ SDL-1.2.7/src/audio/SDL_mixer_MMX.c 2004-03-08 19:07:00.538098528 +0100
05b7f804
PS
4@@ -14,7 +14,9 @@
5 void SDL_MixAudio_MMX_S16(char* dst,char* src,unsigned int size,int volume)
6 {
7 __asm__ __volatile__ (
8-
9+#ifdef __PIC__
10+" pushl %%ebx\n"
11+#endif
12 " movl %0,%%edi\n" // edi = dst
13 " movl %1,%%esi\n" // esi = src
14 " movl %3,%%eax\n" // eax = volume
15@@ -102,10 +104,16 @@
16 " emms\n"
17
18 ".endS16:\n"
19+#ifdef __PIC__
20+" popl %%ebx\n"
21+#endif
22 :
23 : "m" (dst), "m"(src),"m"(size),
24 "m"(volume)
25- : "eax","ebx", "esi", "edi","memory"
26+ : "eax", "esi", "edi", "memory"
27+#ifndef __PIC__
28+ , "ebx"
29+#endif
30 );
31 }
32
33@@ -118,7 +126,9 @@
34 void SDL_MixAudio_MMX_S8(char* dst,char* src,unsigned int size,int volume)
35 {
36 __asm__ __volatile__ (
37-
38+#ifdef __PIC__
39+" pushl %%ebx\n"
40+#endif
41 " movl %0,%%edi\n" // edi = dst
42 " movl %1,%%esi\n" // esi = src
43 " movl %3,%%eax\n" // eax = volume
44@@ -175,10 +185,16 @@
45
46 ".endS8:\n"
47 " emms\n"
48+#ifdef __PIC__
49+" popl %%ebx\n"
50+#endif
51 :
52 : "m" (dst), "m"(src),"m"(size),
53 "m"(volume)
54- : "eax","ebx", "esi", "edi","memory"
55+ : "eax", "esi", "edi", "memory"
56+#ifndef __PIC__
57+ , "ebx"
58+#endif
59 );
60 }
61 #endif
84fb5f2c
PS
62diff -uNr SDL-1.2.7.orig/src/cpuinfo/SDL_cpuinfo.c SDL-1.2.7/src/cpuinfo/SDL_cpuinfo.c
63--- SDL-1.2.7.orig/src/cpuinfo/SDL_cpuinfo.c 2004-02-10 16:31:35.000000000 +0100
64+++ SDL-1.2.7/src/cpuinfo/SDL_cpuinfo.c 2004-03-08 19:07:00.540098224 +0100
05b7f804
PS
65@@ -105,6 +105,9 @@
66 int features = 0;
67 #if defined(__GNUC__) && defined(i386)
68 __asm__ (
69+#ifdef __PIC__
70+" pushl %%ebx\n"
71+#endif
72 " movl %%ebx,%%edi\n"
73 " xorl %%eax,%%eax # Set up for CPUID instruction \n"
74 " cpuid # Get and save vendor ID \n"
75@@ -116,9 +119,15 @@
76 " movl %%edx,%0 \n"
77 "1: \n"
78 " movl %%edi,%%ebx\n"
79+#ifdef __PIC__
80+" popl %%ebx\n"
81+#endif
82 : "=m" (features)
83 :
84- : "%eax", "%ebx", "%ecx", "%edx", "%edi"
85+ : "%eax", "%ecx", "%edx", "%edi"
86+#ifndef __PIC__
87+ , "%ebx"
88+#endif
89 );
90 #elif defined(_MSC_VER)
91 __asm {
92@@ -141,6 +150,9 @@
93 int features = 0;
94 #if defined(__GNUC__) && defined(i386)
95 __asm__ (
96+#ifdef __PIC__
97+" pushl %%ebx\n"
98+#endif
99 " movl %%ebx,%%edi\n"
100 " movl $0x80000000,%%eax # Query for extended functions \n"
101 " cpuid # Get extended function limit \n"
102@@ -151,9 +163,15 @@
103 " movl %%edx,%0 \n"
104 "1: \n"
105 " movl %%edi,%%ebx\n"
106+#ifdef __PIC__
107+" popl %%ebx\n"
108+#endif
109 : "=m" (features)
110 :
111- : "%eax", "%ebx", "%ecx", "%edx", "%edi"
112+ : "%eax", "%ecx", "%edx", "%edi"
113+#ifndef __PIC__
114+ , "%ebx"
115+#endif
116 );
117 #elif defined(_MSC_VER)
118 __asm {
84fb5f2c
PS
119diff -uNr SDL-1.2.7.orig/src/video/SDL_yuv_mmx.c SDL-1.2.7/src/video/SDL_yuv_mmx.c
120--- SDL-1.2.7.orig/src/video/SDL_yuv_mmx.c 2004-02-18 18:22:04.000000000 +0100
121+++ SDL-1.2.7/src/video/SDL_yuv_mmx.c 2004-03-08 19:05:31.000000000 +0100
122@@ -36,29 +36,29 @@
123 #define ASM_VAR(X) X
124 #endif
125
126-static unsigned int ASM_VAR(MMX_0080w)[] = {0x00800080, 0x00800080};
127-static unsigned int ASM_VAR(MMX_00FFw)[] = {0x00ff00ff, 0x00ff00ff};
128-static unsigned int ASM_VAR(MMX_FF00w)[] = {0xff00ff00, 0xff00ff00};
129-
130-static unsigned short ASM_VAR(MMX_Ycoeff)[] = {0x004a, 0x004a, 0x004a, 0x004a};
131-
132-static unsigned short ASM_VAR(MMX_UbluRGB)[] = {0x0072, 0x0072, 0x0072, 0x0072};
133-static unsigned short ASM_VAR(MMX_VredRGB)[] = {0x0059, 0x0059, 0x0059, 0x0059};
134-static unsigned short ASM_VAR(MMX_UgrnRGB)[] = {0xffea, 0xffea, 0xffea, 0xffea};
135-static unsigned short ASM_VAR(MMX_VgrnRGB)[] = {0xffd2, 0xffd2, 0xffd2, 0xffd2};
136-
137-static unsigned short ASM_VAR(MMX_Ublu5x5)[] = {0x0081, 0x0081, 0x0081, 0x0081};
138-static unsigned short ASM_VAR(MMX_Vred5x5)[] = {0x0066, 0x0066, 0x0066, 0x0066};
139-static unsigned short ASM_VAR(MMX_Ugrn555)[] = {0xffe7, 0xffe7, 0xffe7, 0xffe7};
140-static unsigned short ASM_VAR(MMX_Vgrn555)[] = {0xffcc, 0xffcc, 0xffcc, 0xffcc};
141-static unsigned short ASM_VAR(MMX_Ugrn565)[] = {0xffe8, 0xffe8, 0xffe8, 0xffe8};
142-static unsigned short ASM_VAR(MMX_Vgrn565)[] = {0xffcd, 0xffcd, 0xffcd, 0xffcd};
143-
144-static unsigned short ASM_VAR(MMX_red555)[] = {0x7c00, 0x7c00, 0x7c00, 0x7c00};
145-static unsigned short ASM_VAR(MMX_red565)[] = {0xf800, 0xf800, 0xf800, 0xf800};
146-static unsigned short ASM_VAR(MMX_grn555)[] = {0x03e0, 0x03e0, 0x03e0, 0x03e0};
147-static unsigned short ASM_VAR(MMX_grn565)[] = {0x07e0, 0x07e0, 0x07e0, 0x07e0};
148-static unsigned short ASM_VAR(MMX_blu5x5)[] = {0x001f, 0x001f, 0x001f, 0x001f};
149+unsigned int ASM_VAR(MMX_0080w)[] = {0x00800080, 0x00800080};
150+unsigned int ASM_VAR(MMX_00FFw)[] = {0x00ff00ff, 0x00ff00ff};
151+unsigned int ASM_VAR(MMX_FF00w)[] = {0xff00ff00, 0xff00ff00};
152+
153+unsigned short ASM_VAR(MMX_Ycoeff)[] = {0x004a, 0x004a, 0x004a, 0x004a};
154+
155+unsigned short ASM_VAR(MMX_UbluRGB)[] = {0x0072, 0x0072, 0x0072, 0x0072};
156+unsigned short ASM_VAR(MMX_VredRGB)[] = {0x0059, 0x0059, 0x0059, 0x0059};
157+unsigned short ASM_VAR(MMX_UgrnRGB)[] = {0xffea, 0xffea, 0xffea, 0xffea};
158+unsigned short ASM_VAR(MMX_VgrnRGB)[] = {0xffd2, 0xffd2, 0xffd2, 0xffd2};
159+
160+unsigned short ASM_VAR(MMX_Ublu5x5)[] = {0x0081, 0x0081, 0x0081, 0x0081};
161+unsigned short ASM_VAR(MMX_Vred5x5)[] = {0x0066, 0x0066, 0x0066, 0x0066};
162+unsigned short ASM_VAR(MMX_Ugrn555)[] = {0xffe7, 0xffe7, 0xffe7, 0xffe7};
163+unsigned short ASM_VAR(MMX_Vgrn555)[] = {0xffcc, 0xffcc, 0xffcc, 0xffcc};
164+unsigned short ASM_VAR(MMX_Ugrn565)[] = {0xffe8, 0xffe8, 0xffe8, 0xffe8};
165+unsigned short ASM_VAR(MMX_Vgrn565)[] = {0xffcd, 0xffcd, 0xffcd, 0xffcd};
166+
167+unsigned short ASM_VAR(MMX_red555)[] = {0x7c00, 0x7c00, 0x7c00, 0x7c00};
168+unsigned short ASM_VAR(MMX_red565)[] = {0xf800, 0xf800, 0xf800, 0xf800};
169+unsigned short ASM_VAR(MMX_grn555)[] = {0x03e0, 0x03e0, 0x03e0, 0x03e0};
170+unsigned short ASM_VAR(MMX_grn565)[] = {0x07e0, 0x07e0, 0x07e0, 0x07e0};
171+unsigned short ASM_VAR(MMX_blu5x5)[] = {0x001f, 0x001f, 0x001f, 0x001f};
172
173 /**
174 This MMX assembler is my first assembler/MMX program ever.
175@@ -108,7 +108,9 @@
176 relative addressing for the static tables, so right now we take the
177 COW hit on the pages this code resides. Big deal.
178 This spill is just to reduce register pressure in the PIC case. */
179+#ifdef __PIC__
180 "pushl %%ebx\n"
181+#endif
182 "movl %0, %%ebx\n"
183
184 ".align 8\n"
185@@ -235,11 +237,15 @@
186 "cmpl %7, %2\n"
187 "jl 1b\n"
188 "emms\n"
189+#ifdef __PIC__
190 "popl %%ebx\n"
191+#endif
192 :
193 : "m" (cr), "r"(cb),"r"(lum),
194 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod)
195+#ifndef __PIC__
196 : "%ebx"
197+#endif
198 );
199 }
200
201@@ -259,7 +265,9 @@
202
203
204 __asm__ __volatile__(
205+#ifdef __PIC__
206 "pushl %%ebx\n"
207+#endif
208 "movl %0, %%ebx\n"
209
210 ".align 8\n"
211@@ -410,11 +418,15 @@
212 "cmpl %7, %2\n"
213 "jl 1b\n"
214 "emms\n"
215+#ifdef __PIC__
216 "popl %%ebx\n"
217+#endif
218 :
219 :"m" (cr), "r"(cb),"r"(lum),
220 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod)
221+#ifndef __PIC__
222 : "%ebx"
223+#endif
224 );
225 }
226
This page took 0.108509 seconds and 4 git commands to generate.