From 4e3181a1683983c6fc9e6fb81fa4af1f157d7bde Mon Sep 17 00:00:00 2001 From: atmos4 Date: Sat, 19 Jan 2002 05:12:34 +0000 Subject: [PATCH] mangle for win32 in liba52 (includes dummy mangle.h pointing to the one in main) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4248 b3059339-0415-0410-9bf9-f77b7e298cf2 --- liba52/imdct.c | 31 ++++++++++++++++--------------- liba52/mangle.h | 2 ++ liba52/resample.c | 1 + liba52/resample_mmx.c | 26 +++++++++++++------------- 4 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 liba52/mangle.h diff --git a/liba52/imdct.c b/liba52/imdct.c index 63036cb7a6..2553ca8cba 100644 --- a/liba52/imdct.c +++ b/liba52/imdct.c @@ -37,6 +37,7 @@ #include "a52.h" #include "a52_internal.h" #include "mm_accel.h" +#include "mangle.h" #ifdef RUNTIME_CPUDETECT #undef HAVE_3DNOWEX @@ -660,7 +661,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) /* Bit reversed shuffling */ asm volatile( "xorl %%esi, %%esi \n\t" - "leal bit_reverse_512, %%eax \n\t" + "leal "MANGLE(bit_reverse_512)", %%eax \n\t" "movl $1008, %%edi \n\t" "pushl %%ebp \n\t" //use ebp without telling gcc ".balign 16 \n\t" @@ -670,10 +671,10 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) "movlps 8(%0, %%esi), %%xmm1 \n\t" // XXXi "movhps (%0, %%edi), %%xmm1 \n\t" // rXXi "shufps $0x33, %%xmm1, %%xmm0 \n\t" // irIR - "movaps sseSinCos1c(%%esi), %%xmm2 \n\t" + "movaps "MANGLE(sseSinCos1c)"(%%esi), %%xmm2\n\t" "mulps %%xmm0, %%xmm2 \n\t" "shufps $0xB1, %%xmm0, %%xmm0 \n\t" // riRI - "mulps sseSinCos1d(%%esi), %%xmm0 \n\t" + "mulps "MANGLE(sseSinCos1d)"(%%esi), %%xmm0\n\t" "subps %%xmm0, %%xmm2 \n\t" "movzbl (%%eax), %%edx \n\t" "movzbl 1(%%eax), %%ebp \n\t" @@ -741,7 +742,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) /* 2. iteration */ // Note w[1]={{1,0}, {0,-1}} asm volatile( - "movaps ps111_1, %%xmm7 \n\t" // 1,1,1,-1 + "movaps "MANGLE(ps111_1)", %%xmm7\n\t" // 1,1,1,-1 "movl %0, %%esi \n\t" ".balign 16 \n\t" "1: \n\t" @@ -769,8 +770,8 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) Note sseW2+48={1,-1,sqrt(2),-sqrt(2)) */ asm volatile( - "movaps 48+sseW2, %%xmm6 \n\t" - "movaps 16+sseW2, %%xmm7 \n\t" + "movaps 48+"MANGLE(sseW2)", %%xmm6\n\t" + "movaps 16+"MANGLE(sseW2)", %%xmm7\n\t" "xorps %%xmm5, %%xmm5 \n\t" "xorps %%xmm2, %%xmm2 \n\t" "movl %0, %%esi \n\t" @@ -778,8 +779,8 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) "1: \n\t" "movaps 32(%%esi), %%xmm2 \n\t" //r4,i4,r5,i5 "movaps 48(%%esi), %%xmm3 \n\t" //r6,i6,r7,i7 - "movaps sseW2, %%xmm4 \n\t" //r4,i4,r5,i5 - "movaps 32+sseW2, %%xmm5 \n\t" //r6,i6,r7,i7 + "movaps "MANGLE(sseW2)", %%xmm4 \n\t" //r4,i4,r5,i5 + "movaps 32+"MANGLE(sseW2)", %%xmm5\n\t" //r6,i6,r7,i7 "mulps %%xmm2, %%xmm4 \n\t" "mulps %%xmm3, %%xmm5 \n\t" "shufps $0xB1, %%xmm2, %%xmm2 \n\t" //i4,r4,i5,r5 @@ -844,14 +845,14 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) /* Post IFFT complex multiply plus IFFT complex conjugate*/ asm volatile( - "movl $-1024, %%esi \n\t" + "movl $-1024, %%esi \n\t" ".balign 16 \n\t" "1: \n\t" "movaps (%0, %%esi), %%xmm0 \n\t" "movaps (%0, %%esi), %%xmm1 \n\t" "shufps $0xB1, %%xmm0, %%xmm0 \n\t" - "mulps 1024+sseSinCos1c(%%esi), %%xmm1 \n\t" - "mulps 1024+sseSinCos1d(%%esi), %%xmm0 \n\t" + "mulps 1024+"MANGLE(sseSinCos1c)"(%%esi), %%xmm1\n\t" + "mulps 1024+"MANGLE(sseSinCos1d)"(%%esi), %%xmm0\n\t" "addps %%xmm1, %%xmm0 \n\t" "movaps %%xmm0, (%0, %%esi) \n\t" "addl $16, %%esi \n\t" @@ -878,7 +879,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) "movhps -16(%0, %%edi), %%xmm1 \n\t" // ? D C ? "movhps -8(%0, %%edi), %%xmm0 \n\t" // ? B A ? "shufps $0x99, %%xmm1, %%xmm0 \n\t" // D C B A - "mulps sseWindow(%%esi), %%xmm0 \n\t" + "mulps "MANGLE(sseWindow)"(%%esi), %%xmm0\n\t" "addps (%2, %%esi), %%xmm0 \n\t" "addps %%xmm2, %%xmm0 \n\t" "movaps %%xmm0, (%1, %%esi) \n\t" @@ -905,7 +906,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) "movhps -16(%0, %%edi), %%xmm1 \n\t" // D ? ? C "movhps -8(%0, %%edi), %%xmm0 \n\t" // B ? ? A "shufps $0xCC, %%xmm1, %%xmm0 \n\t" // D C B A - "mulps 512+sseWindow(%%esi), %%xmm0 \n\t" + "mulps 512+"MANGLE(sseWindow)"(%%esi), %%xmm0\n\t" "addps (%2, %%esi), %%xmm0 \n\t" "addps %%xmm2, %%xmm0 \n\t" "movaps %%xmm0, (%1, %%esi) \n\t" @@ -932,7 +933,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) "movhps -16(%0, %%edi), %%xmm1 \n\t" // D ? ? C "movhps -8(%0, %%edi), %%xmm0 \n\t" // B ? ? A "shufps $0xCC, %%xmm1, %%xmm0 \n\t" // D C B A - "mulps 1024+sseWindow(%%esi), %%xmm0 \n\t" + "mulps 1024+"MANGLE(sseWindow)"(%%esi), %%xmm0\n\t" "movaps %%xmm0, (%1, %%esi) \n\t" "addl $16, %%esi \n\t" "subl $16, %%edi \n\t" @@ -954,7 +955,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) "movhps -16(%0, %%edi), %%xmm1 \n\t" // ? D C ? "movhps -8(%0, %%edi), %%xmm0 \n\t" // ? B A ? "shufps $0x99, %%xmm1, %%xmm0 \n\t" // D C B A - "mulps 1536+sseWindow(%%esi), %%xmm0 \n\t" + "mulps 1536+"MANGLE(sseWindow)"(%%esi), %%xmm0\n\t" "movaps %%xmm0, (%1, %%esi) \n\t" "addl $16, %%esi \n\t" "subl $16, %%edi \n\t" diff --git a/liba52/mangle.h b/liba52/mangle.h new file mode 100644 index 0000000000..8709cd1543 --- /dev/null +++ b/liba52/mangle.h @@ -0,0 +1,2 @@ +#include "../mangle.h" + diff --git a/liba52/resample.c b/liba52/resample.c index 53b496808e..af3730c2f6 100644 --- a/liba52/resample.c +++ b/liba52/resample.c @@ -9,6 +9,7 @@ #include "a52.h" #include "mm_accel.h" #include "../config.h" +#include "mangle.h" int (* a52_resample) (float * _f, int16_t * s16)=NULL; diff --git a/liba52/resample_mmx.c b/liba52/resample_mmx.c index dcbbbd46eb..7cee365749 100644 --- a/liba52/resample_mmx.c +++ b/liba52/resample_mmx.c @@ -17,10 +17,10 @@ static int a52_resample_MONO_to_5_MMX(float * _f, int16_t * s16){ int32_t * f = (int32_t *) _f; asm volatile( "movl $-512, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" - "movq wm1100, %%mm3 \n\t" - "movq wm0101, %%mm4 \n\t" - "movq wm1010, %%mm5 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" + "movq "MANGLE(wm1100)", %%mm3 \n\t" + "movq "MANGLE(wm0101)", %%mm4 \n\t" + "movq "MANGLE(wm1010)", %%mm5 \n\t" "pxor %%mm6, %%mm6 \n\t" "1: \n\t" "movq (%1, %%esi, 2), %%mm0 \n\t" @@ -73,7 +73,7 @@ static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){ );*/ asm volatile( "movl $-1024, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" "1: \n\t" "movq (%1, %%esi), %%mm0 \n\t" "movq 8(%1, %%esi), %%mm1 \n\t" @@ -104,7 +104,7 @@ static int a52_resample_3F_to_5_MMX(float * _f, int16_t * s16){ int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" "pxor %%mm6, %%mm6 \n\t" "movq %%mm7, %%mm5 \n\t" "punpckldq %%mm6, %%mm5 \n\t" @@ -160,7 +160,7 @@ static int a52_resample_2F_2R_to_4_MMX(float * _f, int16_t * s16){ int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" "1: \n\t" "movq (%1, %%esi), %%mm0 \n\t" "movq 8(%1, %%esi), %%mm1 \n\t" @@ -212,7 +212,7 @@ static int a52_resample_3F_2R_to_5_MMX(float * _f, int16_t * s16){ int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" "1: \n\t" "movd (%1, %%esi), %%mm0 \n\t" "punpckldq 2048(%1, %%esi), %%mm0\n\t" @@ -272,7 +272,7 @@ static int a52_resample_MONO_LFE_to_6_MMX(float * _f, int16_t * s16){ int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" "pxor %%mm6, %%mm6 \n\t" "1: \n\t" "movq 1024(%1, %%esi), %%mm0 \n\t" @@ -313,7 +313,7 @@ static int a52_resample_STEREO_LFE_to_6_MMX(float * _f, int16_t * s16){ int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" "pxor %%mm6, %%mm6 \n\t" "1: \n\t" "movq 1024(%1, %%esi), %%mm0 \n\t" @@ -352,7 +352,7 @@ static int a52_resample_3F_LFE_to_6_MMX(float * _f, int16_t * s16){ int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" "pxor %%mm6, %%mm6 \n\t" "1: \n\t" "movq 1024(%1, %%esi), %%mm0 \n\t" @@ -393,7 +393,7 @@ static int a52_resample_2F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){ int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" // "pxor %%mm6, %%mm6 \n\t" "1: \n\t" "movq 1024(%1, %%esi), %%mm0 \n\t" @@ -440,7 +440,7 @@ static int a52_resample_3F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){ int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" - "movq magicF2W, %%mm7 \n\t" + "movq "MANGLE(magicF2W)", %%mm7 \n\t" // "pxor %%mm6, %%mm6 \n\t" "1: \n\t" "movq 1024(%1, %%esi), %%mm0 \n\t"