summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devel/SDL/distinfo5
-rw-r--r--devel/SDL/patches/patch-at157
-rw-r--r--devel/SDL/patches/patch-au67
-rw-r--r--devel/SDL/patches/patch-av20
4 files changed, 248 insertions, 1 deletions
diff --git a/devel/SDL/distinfo b/devel/SDL/distinfo
index 4e071405e08..b3cbf9c36d3 100644
--- a/devel/SDL/distinfo
+++ b/devel/SDL/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.29 2004/06/22 09:10:12 dillo Exp $
+$NetBSD: distinfo,v 1.30 2004/07/09 18:19:09 drochner Exp $
SHA1 (SDL-1.2.7.tar.gz) = 1a840c50668f230df9e9163ef1a282d9f3355383
Size (SDL-1.2.7.tar.gz) = 2470936 bytes
@@ -10,6 +10,9 @@ SHA1 (patch-al) = 852877c85dd43782dfcf855d43ed6250449aa9fd
SHA1 (patch-am) = f11ac8c5904c00cf73aedfe3d2c2ffb8c8065550
SHA1 (patch-ar) = 61e759bb3eb05890160573dfe63431792f1823bd
SHA1 (patch-as) = 98813c71b10e209df90b5024cf8e6287113563ce
+SHA1 (patch-at) = 5e470473bd9ed1d278b23a06db8af2b346301794
+SHA1 (patch-au) = 7571582ea7654f99f721ef6d1c81a7bee3fb712a
+SHA1 (patch-av) = a19c162dcb85cf0d0d1c1d6ab50651782b60a96f
SHA1 (patch-ba) = 0621af3f2c0abba700c30d7f4809f405a7ffe729
SHA1 (patch-bb) = 48407d4a2d881cb3427b29682fc7e417023d1b99
SHA1 (patch-bc) = 40012e55c20e8c10b575a6de0ac4f3f2a35baf15
diff --git a/devel/SDL/patches/patch-at b/devel/SDL/patches/patch-at
new file mode 100644
index 00000000000..561cf988f1e
--- /dev/null
+++ b/devel/SDL/patches/patch-at
@@ -0,0 +1,157 @@
+$NetBSD: patch-at,v 1.1 2004/07/09 18:19:09 drochner Exp $
+
+--- src/audio/SDL_mixer_MMX.c.orig 2002-11-08 23:13:28.000000000 -0700
++++ src/audio/SDL_mixer_MMX.c
+@@ -15,13 +15,11 @@ void SDL_MixAudio_MMX_S16(char* dst,char
+ {
+ __asm__ __volatile__ (
+
+-" movl %0,%%edi\n" // edi = dst
+-" 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"
+
+@@ -39,14 +37,14 @@ void SDL_MixAudio_MMX_S16(char* dst,char
+ ".align 16\n"
+ " .mixloopS16:\n"
+
+-" movq (%%esi),%%mm1\n" // mm1 = a|b|c|d
++" movq (%1),%%mm1\n" // mm1 = a|b|c|d
+
+ " movq %%mm1,%%mm2\n" // mm2 = a|b|c|d
+
+-" movq 8(%%esi),%%mm4\n" // mm4 = e|f|g|h
++" movq 8(%1),%%mm4\n" // mm4 = e|f|g|h
+
+ // pré charger le buffer dst dans mm7
+-" movq (%%edi),%%mm7\n" // mm7 = dst[0]"
++" movq (%0),%%mm7\n" // mm7 = dst[0]"
+
+ // multiplier par le volume
+ " pmullw %%mm0,%%mm1\n" // mm1 = l(a*v)|l(b*v)|l(c*v)|l(d*v)
+@@ -69,11 +67,11 @@ void SDL_MixAudio_MMX_S16(char* dst,char
+ " punpcklwd %%mm5,%%mm6\n" // mm6 = g*v|h*v
+
+ // pré charger le buffer dst dans mm5
+-" movq 8(%%edi),%%mm5\n" // mm5 = dst[1]
++" movq 8(%0),%%mm5\n" // mm5 = dst[1]
+
+ // diviser par 128
+ " psrad $7,%%mm1\n" // mm1 = a*v/128|b*v/128 , 128 = SDL_MIX_MAXVOLUME
+-" addl $16,%%esi\n"
++" add $16,%1\n"
+
+ " psrad $7,%%mm3\n" // mm3 = c*v/128|d*v/128
+
+@@ -87,15 +85,15 @@ void SDL_MixAudio_MMX_S16(char* dst,char
+
+ // mm4 = le sample avec le volume modifié
+ " packssdw %%mm4,%%mm6\n" // mm6 = s(e*v|f*v|g*v|h*v)
+-" movq %%mm3,(%%edi)\n"
++" movq %%mm3,(%0)\n"
+
+ " paddsw %%mm5,%%mm6\n" // mm6 = adjust_volume(src)+dst
+
+-" movq %%mm6,8(%%edi)\n"
++" movq %%mm6,8(%0)\n"
+
+-" addl $16,%%edi\n"
++" add $16,%0\n"
+
+-" dec %%ebx\n"
++" dec %%edx\n"
+
+ " jnz .mixloopS16\n"
+
+@@ -103,9 +101,9 @@ void SDL_MixAudio_MMX_S16(char* dst,char
+
+ ".endS16:\n"
+ :
+- : "m" (dst), "m"(src),"m"(size),
++ : "r" (dst), "r"(src),"m"(size),
+ "m"(volume)
+- : "eax","ebx", "esi", "edi","memory"
++ : "eax","edx","memory"
+ );
+ }
+
+@@ -119,11 +117,9 @@ void SDL_MixAudio_MMX_S8(char* dst,char*
+ {
+ __asm__ __volatile__ (
+
+-" movl %0,%%edi\n" // edi = dst
+-" 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,17 +128,17 @@ void SDL_MixAudio_MMX_S8(char* dst,char*
+ " 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"
+ " .mixloopS8:\n"
+
+ " pxor %%mm2,%%mm2\n" // mm2 = 0
+-" movq (%%esi),%%mm1\n" // mm1 = a|b|c|d|e|f|g|h
++" movq (%1),%%mm1\n" // mm1 = a|b|c|d|e|f|g|h
+
+ " movq %%mm1,%%mm3\n" // mm3 = a|b|c|d|e|f|g|h
+
+@@ -152,10 +148,10 @@ void SDL_MixAudio_MMX_S8(char* dst,char*
+ " punpckhbw %%mm2,%%mm1\n" // mm1 = 0|a|0|b|0|c|0|d
+
+ " punpcklbw %%mm2,%%mm3\n" // mm3 = 0|e|0|f|0|g|0|h
+-" movq (%%edi),%%mm2\n" // mm2 = destination
++" movq (%0),%%mm2\n" // mm2 = destination
+
+ " pmullw %%mm0,%%mm1\n" // mm1 = v*a|v*b|v*c|v*d
+-" addl $8,%%esi\n"
++" add $8,%1\n"
+
+ " pmullw %%mm0,%%mm3\n" // mm3 = v*e|v*f|v*g|v*h
+ " psraw $7,%%mm1\n" // mm1 = v*a/128|v*b/128|v*c/128|v*d/128
+@@ -166,19 +162,19 @@ void SDL_MixAudio_MMX_S8(char* dst,char*
+
+ " paddsb %%mm2,%%mm3\n" // add to destination buffer
+
+-" movq %%mm3,(%%edi)\n" // store back to ram
+-" addl $8,%%edi\n"
++" movq %%mm3,(%0)\n" // store back to ram
++" add $8,%0\n"
+
+-" dec %%ebx\n"
++" dec %%edx\n"
+
+ " jnz .mixloopS8\n"
+
+ ".endS8:\n"
+ " emms\n"
+ :
+- : "m" (dst), "m"(src),"m"(size),
++ : "r" (dst), "r"(src),"m"(size),
+ "m"(volume)
+- : "eax","ebx", "esi", "edi","memory"
++ : "eax","edx","memory"
+ );
+ }
+ #endif
diff --git a/devel/SDL/patches/patch-au b/devel/SDL/patches/patch-au
new file mode 100644
index 00000000000..f22651040e4
--- /dev/null
+++ b/devel/SDL/patches/patch-au
@@ -0,0 +1,67 @@
+$NetBSD: patch-au,v 1.1 2004/07/09 18:19:09 drochner Exp $
+
+--- src/cpuinfo/SDL_cpuinfo.c.orig 2004-02-10 08:31:35.000000000 -0700
++++ src/cpuinfo/SDL_cpuinfo.c
+@@ -81,6 +81,26 @@ static __inline__ int CPU_haveCPUID()
+ :
+ : "%eax", "%ecx"
+ );
++#elif defined(__GNUC__) && defined(__x86_64__)
++/* Technically, if this is being compiled under __x86_64__ then it has
++CPUid by definition. But it's nice to be able to prove it. :) */
++ __asm__ (
++" pushfq # Get original EFLAGS \n"
++" popq %%rax \n"
++" movq %%rax,%%rcx \n"
++" xorl $0x200000,%%eax # Flip ID bit in EFLAGS \n"
++" pushq %%rax # Save new EFLAGS value on stack \n"
++" popfq # Replace current EFLAGS value \n"
++" pushfq # Get new EFLAGS \n"
++" popq %%rax # Store new EFLAGS in EAX \n"
++" xorl %%ecx,%%eax # Can not toggle ID bit, \n"
++" jz 1f # Processor=80486 \n"
++" movl $1,%0 # We have CPUID support \n"
++"1: \n"
++ : "=m" (has_CPUID)
++ :
++ : "%rax", "%rcx"
++ );
+ #elif defined(_MSC_VER)
+ __asm {
+ pushfd ; Get original EFLAGS
+@@ -103,7 +123,7 @@ done:
+ static __inline__ int CPU_getCPUIDFeatures()
+ {
+ int features = 0;
+-#if defined(__GNUC__) && defined(i386)
++#if defined(__GNUC__) && ( defined(i386) || defined(__x86_64__) )
+ __asm__ (
+ " movl %%ebx,%%edi\n"
+ " xorl %%eax,%%eax # Set up for CPUID instruction \n"
+@@ -118,7 +138,7 @@ static __inline__ int CPU_getCPUIDFeatur
+ " movl %%edi,%%ebx\n"
+ : "=m" (features)
+ :
+- : "%eax", "%ebx", "%ecx", "%edx", "%edi"
++ : "%eax", "%ecx", "%edx", "%edi"
+ );
+ #elif defined(_MSC_VER)
+ __asm {
+@@ -139,7 +159,7 @@ done:
+ static __inline__ int CPU_getCPUIDFeaturesExt()
+ {
+ int features = 0;
+-#if defined(__GNUC__) && defined(i386)
++#if defined(__GNUC__) && (defined(i386) || defined (__x86_64__) )
+ __asm__ (
+ " movl %%ebx,%%edi\n"
+ " movl $0x80000000,%%eax # Query for extended functions \n"
+@@ -153,7 +173,7 @@ static __inline__ int CPU_getCPUIDFeatur
+ " movl %%edi,%%ebx\n"
+ : "=m" (features)
+ :
+- : "%eax", "%ebx", "%ecx", "%edx", "%edi"
++ : "%eax", "%ecx", "%edx", "%edi"
+ );
+ #elif defined(_MSC_VER)
+ __asm {
diff --git a/devel/SDL/patches/patch-av b/devel/SDL/patches/patch-av
new file mode 100644
index 00000000000..05950ad39cc
--- /dev/null
+++ b/devel/SDL/patches/patch-av
@@ -0,0 +1,20 @@
+$NetBSD: patch-av,v 1.1 2004/07/09 18:19:09 drochner Exp $
+
+--- src/video/SDL_yuv_mmx.c.orig 2004-06-30 20:19:04.000000000 +0200
++++ src/video/SDL_yuv_mmx.c
+@@ -239,7 +239,6 @@ void ColorRGBDitherYV12MMX1X( int *color
+ :
+ : "m" (cr), "r"(cb),"r"(lum),
+ "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod)
+- : "%ebx"
+ );
+ }
+
+@@ -414,7 +413,6 @@ void Color565DitherYV12MMX1X( int *color
+ :
+ :"m" (cr), "r"(cb),"r"(lum),
+ "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod)
+- : "%ebx"
+ );
+ }
+