]> git.pld-linux.org Git - packages/scummvm.git/blob - scummvm-asm.patch
- don't use belnet.dl, it isn't browsable
[packages/scummvm.git] / scummvm-asm.patch
1 diff -ruN scummvm-0.7.1./backends/midi/mt32/i386.cpp scummvm-0.7.1/backends/midi/mt32/i386.cpp
2 --- scummvm-0.7.1./backends/midi/mt32/i386.cpp  2004-11-14 05:13:14.000000000 +0100
3 +++ scummvm-0.7.1/backends/midi/mt32/i386.cpp   2005-03-29 02:25:25.897230560 +0200
4 @@ -55,10 +55,20 @@
5  
6         /* check cpuid */
7         __asm__ __volatile__(
8 +#ifdef __PIC__
9 +               "pushl  %%ebx            \n"
10 +#endif
11                 "movl   $1, %%eax        \n" \
12                 "cpuid                   \n" \
13 -               "movl   %%edx, %0        \n" \
14 -               : "=r"(result) : : "eax", "ebx", "ecx", "edx");
15 +               "movl   %%edx, %0        \n"
16 +#ifdef __PIC__
17 +               "popl   %%ebx            \n"
18 +#endif
19 +               : "=r"(result) : : "eax", "ecx", "edx"
20 +#ifndef __PIC__
21 +               , "ebx"
22 +#endif
23 +               );
24  
25         if (result & (1 << 25))
26                 return true;
27 @@ -74,10 +84,21 @@
28  
29         // get cpuid
30         __asm__ __volatile__(
31 +#ifdef __PIC__
32 +               "pushl  %%ebx              \n"
33 +#endif
34                 "movl   $0x80000001, %%eax \n" \
35                 "cpuid                     \n" \
36 -               "movl   %%edx, %0          \n" \
37 -               : "=r"(result) : : "eax", "ebx", "ecx", "edx");
38 +               "movl   %%edx, %0          \n"
39 +#ifdef __PIC__
40 +               "popl   %%ebx              \n"
41 +#endif
42 +               : "=r"(result) : : "eax", "ecx", "edx"
43 +#ifndef __PIC__
44 +               , "ebx"
45 +#endif
46 +
47 +               );
48  
49         if (result & 0x80000000)
50                 return true;
51 @@ -148,6 +169,9 @@
52         float tmp;
53  
54         __asm__ __volatile__ (
55 +#ifdef __PIC__
56 +               "pushl %%ebx          \n"
57 +#endif
58                 "movq %0, %%mm1       \n" \
59                 "                     \n" \
60                 "movl  %1, %%ebx      \n" \
61 @@ -208,9 +232,16 @@
62                 "movd %%mm3, 4(%%eax) \n" \
63                 "                     \n" \
64                 "movd %%mm1, %0       \n" \
65 -               "femms                \n" \
66 +               "femms                \n"
67 +#ifdef __PIC__
68 +               "popl %%ebx           \n"
69 +#endif
70                 : "=m"(output) : "g"(coef_ptr), "g"(hist1_ptr), "m"(tmp)
71 -               : "eax", "ebx", "mm1", "mm2", "mm3", "memory");
72 +               : "eax", "mm1", "mm2", "mm3", "memory"
73 +#ifndef __PIC__
74 +               , "ebx"
75 +#endif
76 +               );
77  
78         return output;
79  }
80 @@ -349,6 +380,9 @@
81  
82  static inline void atti386_partialProductOutput(int quadlen, Bit16s leftvol, Bit16s rightvol, Bit16s *partialBuf, Bit16s *p1buf) {
83         __asm__ __volatile__(
84 +#ifdef __PIC__
85 +               "pushl %%ebx          \n"
86 +#endif
87                 "movl %0, %%ecx       \n" \
88                 "movw %1, %%ax        \n" \
89                 "shll $16, %%eax      \n" \
90 @@ -383,9 +417,16 @@
91                 "decl %%ecx           \n" \
92                 "cmpl $0, %%ecx       \n" \
93                 "jg 1b                \n" \
94 -               "emms                 \n"  \
95 +               "emms                 \n"
96 +#ifdef __PIC__
97 +               "popl %%ebx           \n"
98 +#endif
99                 : : "g"(quadlen), "g"(leftvol), "g"(rightvol), "g"(partialBuf), "g"(p1buf)
100 -               : "eax", "ebx", "ecx", "edx", "edi", "esi", "mm1", "mm2", "mm3", "memory");
101 +               : "eax", "ecx", "edx", "edi", "esi", "mm1", "mm2", "mm3", "memory"
102 +#ifndef __PIC__
103 +               , "ebx"
104 +#endif
105 +               );
106  }
107  
108  #endif
This page took 0.090357 seconds and 3 git commands to generate.