[MPlayer-dev-eng] symbol mangling prob on win32

Kim Minh Kaplan kmkaplan at selfoffice.com
Fri Jan 18 16:53:20 CET 2002


Felix Buenemann <atmosfear at users.sourceforge.net> writes:

> Hi,
>
> I just found out, that on win32 there's a prob with the symbol mangling of 
> variables used inside inline asm, here's an example with (one way) to fix:
>
> #include <stdio.h>
> #include <inttypes.h>
> static const uint64_t bFF  __attribute__((aligned(8))) = 
> 0xFFFFFFFFFFFFFFFFULL;
> #ifndef __CYGWIN__
> #define _bFF "bFF"
> #else
> #define _bFF "_bFF"
> #endif
>
> int main(void) {
>   asm volatile("movq "_bFF", %%mm0;":::"memory");
>   printf("bFF: %lld\n", bFF);
>   return 0;
> }
>
> What do you think, is the best way to handle the problem (var in inline asm 
> on win32 must be _var, but outside inline asm stays var)?

How about letting Gcc handle all this by itself?

    #include <stdio.h>
    #include <inttypes.h>
    static const uint64_t bFF  __attribute__((aligned(8))) = 
    0xFFFFFFFFFFFFFFFFULL;

    int main(void) {
      asm volatile("movq %0, %%mm0;"::"m"(bFF):"memory");
      printf("bFF: %lld\n", bFF);
      return 0;
    }

Kim Minh.



More information about the MPlayer-dev-eng mailing list