[MPlayer-users] cpu_state.c on OS/X fails to compile

Magnus Damm damm at opensource.se
Fri Jun 13 10:10:17 CEST 2003


> #ifdef ARCH_PPC
> #ifdef HAVE_ALTIVEC_H   /* gnu */
> #define LI(a,b) "li " #a "," #b "\n\t"
> #define STVX0(a,b,c) "stvx " #a ",0," #c "\n\t"
> #define STVX(a,b,c) "stvx " #a "," #b "," #c "\n\t"
> #define LVX0(a,b,c) "lvx " #a ",0," #c "\n\t"
> #define LVX(a,b,c) "lvx " #a "," #b "," #c "\n\t"
> #else                   /* apple */
> #define LI(a,b) "li r" #a "," #b "\n\t"
> #define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t"
> #define STVX(a,b,c) "stvx v" #a ",r" #b ",r" #c "\n\t"
> #define LVX0(a,b,c) "lvx v" #a ",0,r" #c "\n\t"
> #define LVX(a,b,c) "lvx v" #a ",r" #b ",r" #c "\n\t"
> #endif

Another way to solve it is to define register names
as constants and always use the register names.

I don't know how inline assembly and the preprocessor
are working together, though, and we probably want to stay
compatible with libmpeg2 at sourceforge.

Anyway, below is a snip from linux/include/asm-ppc/ppc_asm.h:

/* Condition Register Bit Fields */
                                                                                
#define cr0     0
[snip 1-6]
#define cr7     7
                                                                                
                                                                                
/* General Purpose Registers (GPRs) */
                                                                                
#define r0      0
[snip 1-30]
#define r31     31
 
 
/* Floating Point Registers (FPRs) */
 
#define fr0     0
[snip 1-30]
#define fr31    31
 
#define vr0     0
[snip 1-30]
#define vr31    31
 



More information about the MPlayer-users mailing list