aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth/mt32
diff options
context:
space:
mode:
authorEugene Sandulenko2005-10-18 04:26:51 +0000
committerEugene Sandulenko2005-10-18 04:26:51 +0000
commit26ad88ec23157f322521aefd3f632759d1816a4a (patch)
tree245df7e77d5057c23e8a17edea803197b85d2333 /sound/softsynth/mt32
parentb725a206c0c0eda1a508a994ffa28fcd7f3894ac (diff)
downloadscummvm-rg350-26ad88ec23157f322521aefd3f632759d1816a4a.tar.gz
scummvm-rg350-26ad88ec23157f322521aefd3f632759d1816a4a.tar.bz2
scummvm-rg350-26ad88ec23157f322521aefd3f632759d1816a4a.zip
Fix bug #1221549 "MT32emu: doesn't compile under gcc 3.4.2 / i386"
svn-id: r19147
Diffstat (limited to 'sound/softsynth/mt32')
-rw-r--r--sound/softsynth/mt32/i386.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/sound/softsynth/mt32/i386.cpp b/sound/softsynth/mt32/i386.cpp
index a936782ff8..f092189d76 100644
--- a/sound/softsynth/mt32/i386.cpp
+++ b/sound/softsynth/mt32/i386.cpp
@@ -55,10 +55,12 @@ static inline bool atti386_DetectSIMD() {
/* check cpuid */
__asm__ __volatile__(
+ "pushl %%ebx \n" \
"movl $1, %%eax \n" \
"cpuid \n" \
"movl %%edx, %0 \n" \
- : "=r"(result) : : "eax", "ebx", "ecx", "edx");
+ "popl %%ebx \n" \
+ : "=r"(result) : : "eax", "ecx", "edx");
if (result & (1 << 25))
return true;
@@ -74,10 +76,12 @@ static inline bool atti386_Detect3DNow() {
// get cpuid
__asm__ __volatile__(
+ "pushl %%ebx \n" \
"movl $0x80000001, %%eax \n" \
"cpuid \n" \
"movl %%edx, %0 \n" \
- : "=r"(result) : : "eax", "ebx", "ecx", "edx");
+ "popl %%ebx \n" \
+ : "=r"(result) : : "eax", "ecx", "edx");
if (result & 0x80000000)
return true;
@@ -154,8 +158,8 @@ static inline float atti386_iir_filter_3DNow(float output, float *hist1_ptr, flo
__asm__ __volatile__ (
"movq %0, %%mm1 \n" \
" \n" \
- "movl %1, %%ebx \n" \
- "movq 0(%%ebx), %%mm2 \n" \
+ "movl %1, %%edi \n" \
+ "movq 0(%%edi), %%mm2 \n" \
" \n" \
"movl %2, %%eax; \n" \
"movq 0(%%eax), %%mm3 \n" \
@@ -168,8 +172,8 @@ static inline float atti386_iir_filter_3DNow(float output, float *hist1_ptr, flo
" \n" \
"movd %%mm1, %3 \n" \
" \n" \
- "addl $8, %%ebx \n" \
- "movq 0(%%ebx), %%mm2 \n" \
+ "addl $8, %%edi \n" \
+ "movq 0(%%edi), %%mm2 \n" \
"movq 0(%%eax), %%mm3 \n" \
" \n" \
"pfmul %%mm3, %%mm2 \n" \
@@ -183,10 +187,10 @@ static inline float atti386_iir_filter_3DNow(float output, float *hist1_ptr, flo
" \n" \
"movd %%mm3, 4(%%eax) \n" \
" \n" \
- "addl $8, %%ebx \n" \
+ "addl $8, %%edi \n" \
"addl $8, %%eax \n" \
" \n" \
- "movq 0(%%ebx), %%mm2 \n" \
+ "movq 0(%%edi), %%mm2 \n" \
"movq 0(%%eax), %%mm3 \n" \
" \n" \
"pfmul %%mm3, %%mm2 \n" \
@@ -197,8 +201,8 @@ static inline float atti386_iir_filter_3DNow(float output, float *hist1_ptr, flo
" \n" \
"movd %%mm1, %3 \n" \
" \n" \
- "addl $8, %%ebx \n" \
- "movq 0(%%ebx), %%mm2 \n" \
+ "addl $8, %%edi \n" \
+ "movq 0(%%edi), %%mm2 \n" \
"movq 0(%%eax), %%mm3 \n" \
" \n" \
"pfmul %%mm3, %%mm2 \n" \
@@ -214,7 +218,7 @@ static inline float atti386_iir_filter_3DNow(float output, float *hist1_ptr, flo
"movd %%mm1, %0 \n" \
"femms \n" \
: "=m"(output) : "g"(coef_ptr), "g"(hist1_ptr), "m"(tmp)
- : "eax", "ebx", "memory"
+ : "eax", "edi", "memory"
#ifdef __MMX__
, "mm1", "mm2", "mm3"
#endif
@@ -383,6 +387,7 @@ static inline void atti386_partialProductOutput(int quadlen, Bit16s leftvol, Bit
"por %%mm2, %%mm1 \n" \
"movl %3, %%edi \n" \
"movl %4, %%esi \n" \
+ "pushl %%ebx \n" \
"1: \n" \
"movw 0(%%esi), %%bx \n" \
"addl $2, %%esi \n" \
@@ -408,8 +413,9 @@ static inline void atti386_partialProductOutput(int quadlen, Bit16s leftvol, Bit
"cmpl $0, %%ecx \n" \
"jg 1b \n" \
"emms \n" \
+ "popl %%ebx \n" \
: : "g"(quadlen), "g"(leftvol), "g"(rightvol), "g"(partialBuf), "g"(p1buf)
- : "eax", "ebx", "ecx", "edx", "edi", "esi", "memory"
+ : "eax", "ecx", "edx", "edi", "esi", "memory"
#ifdef __MMX__
, "mm1", "mm2", "mm3"
#endif