[cvs] / xvidcore / src / portab.h Repository:
ViewVC logotype

Diff of /xvidcore/src/portab.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2, Sat Mar 16 14:15:10 2002 UTC revision 1.8, Thu Mar 28 12:24:41 2002 UTC
# Line 31  Line 31 
31    
32  #define EMMS() __asm {emms}  #define EMMS() __asm {emms}
33    
34    #define CACHE_LINE  16
35    #if _MSC_VER <= 1200
36    #define CACHE_ALIGN
37    #else
38    #define CACHE_ALIGN __declspec(align(CACHE_LINE))
39    #endif
40    
41  // needed for bitstream.h  // needed for bitstream.h
42  #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax  #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax
43    
# Line 52  Line 59 
59    
60  #elif defined(LINUX) || defined(DJGPP)  #elif defined(LINUX) || defined(DJGPP)
61    
62    
63    #ifdef _DEBUG
64    
65  #include <stdio.h>  #include <stdio.h>
66  #define DEBUG_WHERE             stdout  #define DEBUG_WHERE             stdout
67  #define DEBUG(S)        fprintf(DEBUG_WHERE, "%s\n", (S));  #define DEBUG(S)        fprintf(DEBUG_WHERE, "%s\n", (S));
# Line 59  Line 69 
69  #define DEBUG2(S,A,B)   fprintf(DEBUG_WHERE, "%s%i=%i\n", (S), (A), (B))  #define DEBUG2(S,A,B)   fprintf(DEBUG_WHERE, "%s%i=%i\n", (S), (A), (B))
70  #define DEBUG3(S,A,B,C) fprintf(DEBUG_WHERE, "%s %i %x %x\n", (S), (A), (B), (C))  #define DEBUG3(S,A,B,C) fprintf(DEBUG_WHERE, "%s %i %x %x\n", (S), (A), (B), (C))
71  #define DEBUG8(S,A,B,C,D,E,F,G,H)  #define DEBUG8(S,A,B,C,D,E,F,G,H)
72    #else
73    #define DEBUG(S)
74    #define DEBUG1(S,I)
75    #define DEBUG2(X,A,B)
76    #define DEBUG3(X,A,B,C)
77    #define DEBUG8(X,A,B,C,D,E,F,G,H)
78    #endif
79    
80    #define CACHE_LINE  16
81    
82  #if defined(LINUX)  #if defined(LINUX)
83    
84  #include <stdint.h>  #include <stdint.h>
85    
86    #define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \
87            type name##_storage[(sizex)*(sizey)+(alignment)-1]; \
88            typedef type  name##_sub[sizey]; \
89            name##_sub * name = (void *) (((int32_t) name##_storage+(alignment)) & ~((int32_t)(alignment)-1))
90    
91  #else  #else
92    
93    #define CACHE_ALIGN __attribute__ ((__aligned__(CACHE_LINE)))
94  #define int8_t char  #define int8_t char
95  #define uint8_t unsigned char  #define uint8_t unsigned char
96  #define int16_t short  #define int16_t short
# Line 77  Line 102 
102    
103  #endif  #endif
104    
 #define EMMS() __asm__("emms\n\t")  
105    
106  // needed for bitstream.h  // needed for bitstream.h
107    #ifdef ARCH_PPC
108            #define BSWAP(a) __asm__ ( "lwbrx %0,0,%1; eieio" : "=r" (a) : \
109                    "r" (&(a)), "m" (a));
110            #define EMMS()
111    #else
112  #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) )  #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) )
113            #define EMMS() __asm__("emms\n\t")
114    #endif
115    
116  // needed for timer.c  // needed for timer.c
117  static __inline int64_t read_counter() {  static __inline int64_t read_counter() {
# Line 116  Line 147 
147          return 0;          return 0;
148  }  }
149    
150    #define CACHE_LINE  16
151    #define CACHE_ALIGN
152    
153  #endif  #endif
154    
155  #endif // _PORTAB_H_  #endif // _PORTAB_H_

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.8

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4