summaryrefslogtreecommitdiff
path: root/recipes/obsolete/libsdl/libsdl-qpe-1.2.7/gcc34.patch
blob: e3738e961ea98cef607c3376309c2aa4de7dd0f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
diff -ru SDL-1.2.7/src/audio/SDL_mixer_MMX.c SDL-1.2.7.mod/src/audio/SDL_mixer_MMX.c
--- SDL-1.2.7/src/audio/SDL_mixer_MMX.c	2002-11-09 07:13:28.000000000 +0100
+++ SDL-1.2.7.mod/src/audio/SDL_mixer_MMX.c	2004-04-25 18:15:46.335228624 +0200
@@ -19,9 +19,9 @@
 "	movl %1,%%esi\n"	// esi = src
 "	movl %3,%%eax\n"	// eax = volume
 
-"	movl %2,%%ebx\n"	// ebx = size
+"	movl %2,%%edx\n"	// edx = size
 
-"	shrl $4,%%ebx\n"	// process 16 bytes per iteration = 8 samples
+"	shrl $4,%%edx\n"	// process 16 bytes per iteration = 8 samples
 
 "	jz .endS16\n"
 
@@ -95,7 +95,7 @@
 
 "	addl $16,%%edi\n"
 
-"	dec %%ebx\n"
+"	dec %%edx\n"
 
 "	jnz .mixloopS16\n"
 
@@ -105,7 +105,7 @@
 	 :
 	 : "m" (dst), "m"(src),"m"(size),
 	 "m"(volume)
-	 : "eax","ebx", "esi", "edi","memory"
+	 : "eax","edx", "esi", "edi","memory"
 	 );
 }
 
@@ -123,7 +123,7 @@
 "	movl %1,%%esi\n"	// esi = src
 "	movl %3,%%eax\n"	// eax = volume
 
-"	movd %%ebx,%%mm0\n"
+"	movd %%edx,%%mm0\n"
 "	movq %%mm0,%%mm1\n"
 "	psllq $16,%%mm0\n"
 "	por %%mm1,%%mm0\n"
@@ -132,10 +132,10 @@
 "	psllq $16,%%mm0\n"
 "	por %%mm1,%%mm0\n"
 
-"	movl %2,%%ebx\n"	// ebx = size
-"	shr $3,%%ebx\n"	// process 8 bytes per iteration = 8 samples
+"	movl %2,%%edx\n"	// edx = size
+"	shr $3,%%edx\n"	// process 8 bytes per iteration = 8 samples
 
-"	cmp $0,%%ebx\n"
+"	cmp $0,%%edx\n"
 "	je .endS8\n"
 
 ".align 16\n"
@@ -169,7 +169,7 @@
 "	movq %%mm3,(%%edi)\n"	// store back to ram
 "	addl $8,%%edi\n"
 
-"	dec %%ebx\n"
+"	dec %%edx\n"
 
 "	jnz .mixloopS8\n"
 
@@ -178,7 +178,7 @@
 	 :
 	 : "m" (dst), "m"(src),"m"(size),
 	 "m"(volume)
-	 : "eax","ebx", "esi", "edi","memory"
+	 : "eax","edx", "esi", "edi","memory"
 	 );
 }
 #endif
diff -ru SDL-1.2.7/src/cpuinfo/SDL_cpuinfo.c SDL-1.2.7.mod/src/cpuinfo/SDL_cpuinfo.c
--- SDL-1.2.7/src/cpuinfo/SDL_cpuinfo.c	2004-02-10 16:31:35.000000000 +0100
+++ SDL-1.2.7.mod/src/cpuinfo/SDL_cpuinfo.c	2004-04-25 18:15:46.336228472 +0200
@@ -118,7 +118,7 @@
 "        movl    %%edi,%%ebx\n"
 	: "=m" (features)
 	:
-	: "%eax", "%ebx", "%ecx", "%edx", "%edi"
+	: "%eax", "%ecx", "%edx", "%edi"
 	);
 #elif defined(_MSC_VER)
 	__asm {
@@ -153,7 +153,7 @@
 "        movl    %%edi,%%ebx\n"
 	: "=m" (features)
 	:
-	: "%eax", "%ebx", "%ecx", "%edx", "%edi"
+	: "%eax", "%ecx", "%edx", "%edi"
 	);
 #elif defined(_MSC_VER)
 	__asm {
diff -ru SDL-1.2.7/src/video/SDL_yuv_mmx.c SDL-1.2.7.mod/src/video/SDL_yuv_mmx.c
--- SDL-1.2.7/src/video/SDL_yuv_mmx.c	2004-02-18 18:22:04.000000000 +0100
+++ SDL-1.2.7.mod/src/video/SDL_yuv_mmx.c	2004-04-25 18:15:46.337228320 +0200
@@ -120,12 +120,12 @@
 		 "movd (%2), %%mm2\n"           //    0  0  0  0 l3 l2 l1 l0
 		 "punpcklbw %%mm7,%%mm1\n" //         0  v3 0  v2 00 v1 00 v0
 		 "punpckldq %%mm1,%%mm1\n" //         00 v1 00 v0 00 v1 00 v0
-		 "psubw _MMX_0080w,%%mm1\n"  // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 
+		 "psubw %[_MMX_0080w],%%mm1\n"  // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 
 
 		 // create Cr_g (result in mm0)
 		 "movq %%mm1,%%mm0\n"           // r1 r1 r0 r0 r1 r1 r0 r0
-		 "pmullw _MMX_VgrnRGB,%%mm0\n"// red*-46dec=0.7136*64
-		 "pmullw _MMX_VredRGB,%%mm1\n"// red*89dec=1.4013*64
+		 "pmullw %[_MMX_VgrnRGB],%%mm0\n"// red*-46dec=0.7136*64
+		 "pmullw %[_MMX_VredRGB],%%mm1\n"// red*89dec=1.4013*64
 		 "psraw  $6, %%mm0\n"           // red=red/64
 		 "psraw  $6, %%mm1\n"           // red=red/64
 		 
@@ -134,8 +134,8 @@
 		 "movq (%2,%4),%%mm3\n"         //    0  0  0  0 L3 L2 L1 L0
 		 "punpckldq %%mm3,%%mm2\n"      //   L3 L2 L1 L0 l3 l2 l1 l0
 		 "movq %%mm2,%%mm4\n"           //   L3 L2 L1 L0 l3 l2 l1 l0
-		 "pand _MMX_FF00w,%%mm2\n"      //   L3 0  L1  0 l3  0 l1  0
-		 "pand _MMX_00FFw,%%mm4\n"      //   0  L2  0 L0  0 l2  0 l0
+		 "pand %[_MMX_FF00w],%%mm2\n"      //   L3 0  L1  0 l3  0 l1  0
+		 "pand %[_MMX_00FFw],%%mm4\n"      //   0  L2  0 L0  0 l2  0 l0
 		 "psrlw $8,%%mm2\n"             //   0  L3  0 L1  0 l3  0 l1
 
 		 // create R (result in mm6)
@@ -152,11 +152,11 @@
 		 "movd (%1), %%mm1\n"      //         0  0  0  0  u3 u2 u1 u0
 		 "punpcklbw %%mm7,%%mm1\n" //         0  u3 0  u2 00 u1 00 u0
 		 "punpckldq %%mm1,%%mm1\n" //         00 u1 00 u0 00 u1 00 u0
-		 "psubw _MMX_0080w,%%mm1\n"  // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 
+		 "psubw %[_MMX_0080w],%%mm1\n"  // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 
 		 // create Cb_g (result in mm5)
 		 "movq %%mm1,%%mm5\n"            // u1 u1 u0 u0 u1 u1 u0 u0
-		 "pmullw _MMX_UgrnRGB,%%mm5\n"    // blue*-109dec=1.7129*64
-		 "pmullw _MMX_UbluRGB,%%mm1\n"    // blue*114dec=1.78125*64
+		 "pmullw %[_MMX_UgrnRGB],%%mm5\n"    // blue*-109dec=1.7129*64
+		 "pmullw %[_MMX_UbluRGB],%%mm1\n"    // blue*114dec=1.78125*64
 		 "psraw  $6, %%mm5\n"            // blue=red/64
 		 "psraw  $6, %%mm1\n"            // blue=blue/64
 
@@ -238,8 +238,14 @@
 		 "popl %%ebx\n"
 		 :
 		 : "m" (cr), "r"(cb),"r"(lum),
-		 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod)
-		 : "%ebx"
+		 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
+         [_MMX_0080w] "m" (*_MMX_0080w),
+         [_MMX_00FFw] "m" (*_MMX_00FFw),
+         [_MMX_FF00w] "m" (*_MMX_FF00w),
+         [_MMX_VgrnRGB] "m" (*_MMX_VgrnRGB),
+         [_MMX_VredRGB] "m" (*_MMX_VredRGB),
+         [_MMX_UgrnRGB] "m" (*_MMX_UgrnRGB),
+         [_MMX_UbluRGB] "m" (*_MMX_UbluRGB)
 		 );
 }
 
@@ -413,8 +419,16 @@
 	 "popl %%ebx\n"
          :
          :"m" (cr), "r"(cb),"r"(lum),
-	 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod)
-	 : "%ebx"
+	 "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
+     [_MMX_0080w] "m" (*_MMX_0080w),
+ [_MMX_Ugrn565] "m" (*_MMX_Ugrn565),
+ [_MMX_Ublu5x5] "m" (*_MMX_Ublu5x5),
+ [_MMX_00FFw] "m" (*_MMX_00FFw),
+ [_MMX_Vgrn565] "m" (*_MMX_Vgrn565),
+ [_MMX_Vred5x5] "m" (*_MMX_Vred5x5),
+ [_MMX_Ycoeff] "m" (*_MMX_Ycoeff),
+ [_MMX_red565] "m" (*_MMX_red565),
+ [_MMX_grn565] "m" (*_MMX_grn565)
          );
 }