source: scripts_home/scripts/untested/blfs-patches/DirectFB-0.9.21-simd-amd64.patch@ 1c9c5c3

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 1c9c5c3 was 1c9c5c3, checked in by Jim Gifford <clfs@…>, 19 years ago

r624@server (orig r622): jim | 2005-10-31 12:40:28 -0800
Rearranging Archive

  • Property mode set to 100644
File size: 6.2 KB
RevLine 
[fd5b1fe]1Submitted By: Ryan Oliver <ryan.oliver@pha.com.au>
2Date: 2005-07-31
3Initial Package Version: 0.9.21
4Upstream Status: Unknown
5Origin: Gentoo
6Description: Supposedly fixes simd instructions on amd64. Didn't work here.
7
8diff -urN DirectFB-0.9.21.orig/src/gfx/generic/generic_mmx.h DirectFB-0.9.21/src/gfx/generic/generic_mmx.h
9--- DirectFB-0.9.21.orig/src/gfx/generic/generic_mmx.h 2003-06-30 23:26:04.000000000 +0200
10+++ DirectFB-0.9.21/src/gfx/generic/generic_mmx.h 2004-01-08 23:46:40.000000000 +0100
11@@ -172,15 +172,19 @@
12 "movq %%mm1, (%1)\n\t"
13 "dec %2\n\t"
14 "jz 3f\n\t"
15- "addl $8, %1\n\t"
16- "addl %4, %0\n\t"
17- "testl $0xFFFF0000, %0\n\t"
18+ "add $8, %1\n\t"
19+ "add %4, %0\n\t"
20+ "test $0xFFFF0000, %0\n\t"
21 "jz 2b\n\t"
22- "movl %0, %%edx\n\t"
23- "andl $0xFFFF0000, %%edx\n\t"
24- "shrl $14, %%edx\n\t"
25+ "mov %0, %%edx\n\t"
26+ "and $0xFFFF0000, %%edx\n\t"
27+ "shr $14, %%edx\n\t"
28+#ifdef __x86_64__
29+ "add %%rbx, %3\n\t"
30+#else
31 "add %%edx, %3\n\t"
32- "andl $0xFFFF, %0\n\t"
33+#endif
34+ "and $0xFFFF, %0\n\t"
35 "jmp 1b\n"
36 "3:\n\t"
37 "emms"
38@@ -201,8 +205,8 @@
39 "movd (%2), %%mm1\n\t"
40 "punpcklbw %%mm0, %%mm1\n\t"
41 "movq %%mm1, (%0)\n\t"
42- "addl $4, %2\n\t"
43- "addl $8, %0\n\t"
44+ "add $4, %2\n\t"
45+ "add $8, %0\n\t"
46 "dec %1\n\t"
47 "jnz 1b\n\t"
48 "emms"
49@@ -238,7 +242,7 @@
50 "dec %1\n\t"
51 "jz 2f\n\t"
52 "psrlq $16, %%mm0\n\t"
53- "addl $8, %0\n\t"
54+ "add $8, %0\n\t"
55 /* 2. Konvertierung nach 24 bit interleaved */
56 "movq %%mm0, %%mm3\n\t"
57 "punpcklwd %%mm3, %%mm3\n\t"
58@@ -252,7 +256,7 @@
59 "dec %1\n\t"
60 "jz 2f\n\t"
61 "psrlq $16, %%mm0\n\t"
62- "addl $8, %0\n\t"
63+ "add $8, %0\n\t"
64 /* 3. Konvertierung nach 24 bit interleaved */
65 "movq %%mm0, %%mm3\n\t"
66 "punpcklwd %%mm3, %%mm3\n\t"
67@@ -266,7 +270,7 @@
68 "dec %1\n\t"
69 "jz 2f\n\t"
70 "psrlq $16, %%mm0\n\t"
71- "addl $8, %0\n\t"
72+ "add $8, %0\n\t"
73 /* 4. Konvertierung nach 24 bit interleaved */
74 "movq %%mm0, %%mm3\n\t"
75 "punpcklwd %%mm3, %%mm3\n\t"
76@@ -279,8 +283,8 @@
77 "movq %%mm3, (%0)\n\t"
78 "dec %1\n\t"
79 "jz 2f\n\t"
80- "addl $8, %0\n\t"
81- "addl $8, %2\n\t"
82+ "add $8, %0\n\t"
83+ "add $8, %2\n\t"
84 "jmp 1b\n"
85 "2:\n\t"
86 "emms"
87@@ -304,8 +308,8 @@
88 "punpcklbw %%mm6, %%mm0\n\t"
89 "por %%mm7, %%mm0\n\t"
90 "movq %%mm0, (%0)\n\t"
91- "addl $4, %2\n\t"
92- "addl $8, %0\n\t"
93+ "add $4, %2\n\t"
94+ "add $8, %0\n\t"
95 "dec %1\n\t"
96 "jnz 1b\n\t"
97 "emms"
98@@ -322,7 +326,7 @@
99
100 __asm__ __volatile__ (
101 "movq %3, %%mm7\n\t"
102- "cmpl $0, %2\n\t"
103+ "cmp $0, %2\n\t"
104 "jne 3f\n\t"
105 "movq %4, %%mm6\n\t"
106 "movd %5, %%mm0\n\t"
107@@ -341,7 +345,7 @@
108 "psrlw $8, %%mm0\n\t"
109 "movq %%mm0, (%0)\n"
110 "1:\n\t"
111- "addl $8, %0\n\t"
112+ "add $8, %0\n\t"
113 "dec %1\n\t"
114 "jnz 4b\n\t"
115 "jmp 2f\n\t"
116@@ -360,8 +364,8 @@
117 "psrlw $8, %%mm0\n\t"
118 "movq %%mm0, (%0)\n"
119 "1:\n\t"
120- "addl $8, %2\n\t"
121- "addl $8, %0\n\t"
122+ "add $8, %2\n\t"
123+ "add $8, %0\n\t"
124 "dec %1\n\t"
125 "jnz 3b\n\t"
126 "2:\n\t"
127@@ -379,7 +383,7 @@
128
129 __asm__ __volatile__ (
130 "movq %3, %%mm7\n\t"
131- "cmpl $0, %2\n\t"
132+ "cmp $0, %2\n\t"
133 "jne 3f\n\t"
134 "movq %4, %%mm6\n\t"
135 "movd %5, %%mm0\n\t"
136@@ -397,7 +401,7 @@
137 "psrlw $8, %%mm1\n\t"
138 "movq %%mm1, (%0)\n"
139 "1:\n\t"
140- "addl $8, %0\n\t"
141+ "add $8, %0\n\t"
142 "dec %1\n\t"
143 "jnz 4b\n\t"
144 "jmp 2f\n\t"
145@@ -415,8 +419,8 @@
146 "psrlw $8, %%mm1\n\t"
147 "movq %%mm1, (%0)\n"
148 "1:\n\t"
149- "addl $8, %2\n\t"
150- "addl $8, %0\n\t"
151+ "add $8, %2\n\t"
152+ "add $8, %0\n\t"
153 "dec %1\n\t"
154 "jnz 3b\n\t"
155 "2:\n\t"
156diff -urN DirectFB-0.9.21.orig/src/misc/cpu_accel.c DirectFB-0.9.21/src/misc/cpu_accel.c
157--- DirectFB-0.9.21.orig/lib/direct/cpu_accel.c 2003-08-15 13:32:45.000000000 +0200
158+++ DirectFB-0.9.21/lib/direct/cpu_accel.c 2004-01-08 23:48:05.000000000 +0100
159@@ -57,6 +57,13 @@
160
161 #include "cpu_accel.h"
162
163+#ifdef __x86_64__
164+static __u32 arch_accel (void)
165+{
166+ return MM_ACCEL_X86_MMX | MM_ACCEL_X86_SSE | MM_ACCEL_X86_MMXEXT | MM_ACCEL_X86_SSE2 | MM_ACCEL_X86_3DNOW;
167+}
168+#endif
169+
170 #ifdef ARCH_X86
171 static __u32 arch_accel (void)
172 {
173@@ -175,7 +182,7 @@
174
175 __u32 dfb_mm_accel (void)
176 {
177-#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (ENABLE_ALTIVEC))
178+#if defined(__x86_64__) || defined (ARCH_X86) || (defined (ARCH_PPC) && defined (ENABLE_ALTIVEC))
179 static __u32 accel = ~0U;
180
181 if (accel != ~0U)
182@@ -183,7 +190,7 @@
183
184 accel = arch_accel ();
185
186-#ifdef USE_SSE
187+#if defined(USE_SSE) && !defined(__x86_64__)
188
189 /* test OS support for SSE */
190 if (accel & MM_ACCEL_X86_SSE) {
Note: See TracBrowser for help on using the repository browser.