Commit 22b4f4e8 authored by diego's avatar diego

prettyprinting cosmetics


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11941 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e6cfc8ba
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
static av_always_inline uint16_t bswap_16(uint16_t x) static av_always_inline uint16_t bswap_16(uint16_t x)
{ {
#if defined(ARCH_X86) #if defined(ARCH_X86)
__asm("rorw $8, %0" : __asm("rorw $8, %0" :
LEGACY_REGS (x) : LEGACY_REGS (x) :
"0" (x)); "0" (x));
#elif defined(ARCH_SH4) #elif defined(ARCH_SH4)
__asm__("swap.b %0,%0":"=r"(x):"0"(x)); __asm__("swap.b %0,%0":"=r"(x):"0"(x));
#else #else
x= (x>>8) | (x<<8); x= (x>>8) | (x<<8);
#endif #endif
...@@ -57,35 +57,33 @@ static av_always_inline uint32_t bswap_32(uint32_t x) ...@@ -57,35 +57,33 @@ static av_always_inline uint32_t bswap_32(uint32_t x)
{ {
#if defined(ARCH_X86) #if defined(ARCH_X86)
#if __CPU__ != 386 #if __CPU__ != 386
__asm("bswap %0": __asm("bswap %0":
"=r" (x) : "=r" (x) :
#else #else
__asm("xchgb %b0,%h0\n" __asm("xchgb %b0,%h0\n"
" rorl $16,%0\n" "rorl $16,%0 \n"
" xchgb %b0,%h0": "xchgb %b0,%h0":
LEGACY_REGS (x) : LEGACY_REGS (x) :
#endif #endif
"0" (x)); "0" (x));
#elif defined(ARCH_SH4) #elif defined(ARCH_SH4)
__asm__( __asm__("swap.b %0,%0\n"
"swap.b %0,%0\n" "swap.w %0,%0\n"
"swap.w %0,%0\n" "swap.b %0,%0\n"
"swap.b %0,%0\n" :"=r"(x):"0"(x));
:"=r"(x):"0"(x));
#elif defined(ARCH_ARM) #elif defined(ARCH_ARM)
uint32_t t; uint32_t t;
__asm__ ( __asm__ ("eor %1, %0, %0, ror #16 \n\t"
"eor %1, %0, %0, ror #16 \n\t" "bic %1, %1, #0xFF0000 \n\t"
"bic %1, %1, #0xFF0000 \n\t" "mov %0, %0, ror #8 \n\t"
"mov %0, %0, ror #8 \n\t" "eor %0, %0, %1, lsr #8 \n\t"
"eor %0, %0, %1, lsr #8 \n\t" : "+r"(x), "+r"(t));
: "+r"(x), "+r"(t));
#elif defined(ARCH_BFIN) #elif defined(ARCH_BFIN)
unsigned tmp; unsigned tmp;
asm("%1 = %0 >> 8 (V);\n\t" asm("%1 = %0 >> 8 (V); \n\t"
"%0 = %0 << 8 (V);\n\t" "%0 = %0 << 8 (V); \n\t"
"%0 = %0 | %1;\n\t" "%0 = %0 | %1; \n\t"
"%0 = PACK(%0.L, %0.H);\n\t" "%0 = PACK(%0.L, %0.H); \n\t"
: "+d"(x), "=&d"(tmp)); : "+d"(x), "=&d"(tmp));
#else #else
x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
......
...@@ -172,7 +172,7 @@ static inline int mid_pred(int a, int b, int c) ...@@ -172,7 +172,7 @@ static inline int mid_pred(int a, int b, int c)
*/ */
static inline int av_clip(int a, int amin, int amax) static inline int av_clip(int a, int amin, int amax)
{ {
if (a < amin) return amin; if (a < amin) return amin;
else if (a > amax) return amax; else if (a > amax) return amax;
else return a; else return a;
} }
...@@ -285,20 +285,18 @@ static inline int ff_get_fourcc(const char *s){ ...@@ -285,20 +285,18 @@ static inline int ff_get_fourcc(const char *s){
#if defined(ARCH_X86_64) #if defined(ARCH_X86_64)
static inline uint64_t read_time(void) static inline uint64_t read_time(void)
{ {
uint64_t a, d; uint64_t a, d;
asm volatile( "rdtsc\n\t" asm volatile("rdtsc\n\t"
: "=a" (a), "=d" (d) : "=a" (a), "=d" (d));
); return (d << 32) | (a & 0xffffffff);
return (d << 32) | (a & 0xffffffff);
} }
#elif defined(ARCH_X86_32) #elif defined(ARCH_X86_32)
static inline long long read_time(void) static inline long long read_time(void)
{ {
long long l; long long l;
asm volatile( "rdtsc\n\t" asm volatile("rdtsc\n\t"
: "=A" (l) : "=A" (l));
); return l;
return l;
} }
#elif ARCH_BFIN #elif ARCH_BFIN
static inline uint64_t read_time(void) static inline uint64_t read_time(void)
...@@ -345,17 +343,18 @@ uint64_t tstart= AV_READ_TIME();\ ...@@ -345,17 +343,18 @@ uint64_t tstart= AV_READ_TIME();\
#define STOP_TIMER(id) \ #define STOP_TIMER(id) \
tend= AV_READ_TIME();\ tend= AV_READ_TIME();\
{\ {\
static uint64_t tsum=0;\ static uint64_t tsum=0;\
static int tcount=0;\ static int tcount=0;\
static int tskip_count=0;\ static int tskip_count=0;\
if(tcount<2 || tend - tstart < FFMAX(8*tsum/tcount, 2000)){\ if(tcount<2 || tend - tstart < FFMAX(8*tsum/tcount, 2000)){\
tsum+= tend - tstart;\ tsum+= tend - tstart;\
tcount++;\ tcount++;\
}else\ }else\
tskip_count++;\ tskip_count++;\
if(((tcount+tskip_count)&(tcount+tskip_count-1))==0){\ if(((tcount+tskip_count)&(tcount+tskip_count-1))==0){\
av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" dezicycles in %s, %d runs, %d skips\n", tsum*10/tcount, id, tcount, tskip_count);\ av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" dezicycles in %s, %d runs, %d skips\n",\
}\ tsum*10/tcount, id, tcount, tskip_count);\
}\
} }
#else #else
#define START_TIMER #define START_TIMER
......
...@@ -22,47 +22,47 @@ ...@@ -22,47 +22,47 @@
#define FFMPEG_X86CPU_H #define FFMPEG_X86CPU_H
#ifdef ARCH_X86_64 #ifdef ARCH_X86_64
# define REG_a "rax" # define REG_a "rax"
# define REG_b "rbx" # define REG_b "rbx"
# define REG_c "rcx" # define REG_c "rcx"
# define REG_d "rdx" # define REG_d "rdx"
# define REG_D "rdi" # define REG_D "rdi"
# define REG_S "rsi" # define REG_S "rsi"
# define PTR_SIZE "8" # define PTR_SIZE "8"
# define REG_SP "rsp" # define REG_SP "rsp"
# define REG_BP "rbp" # define REG_BP "rbp"
# define REGBP rbp # define REGBP rbp
# define REGa rax # define REGa rax
# define REGb rbx # define REGb rbx
# define REGc rcx # define REGc rcx
# define REGSP rsp # define REGSP rsp
#else #else
# define REG_a "eax" # define REG_a "eax"
# define REG_b "ebx" # define REG_b "ebx"
# define REG_c "ecx" # define REG_c "ecx"
# define REG_d "edx" # define REG_d "edx"
# define REG_D "edi" # define REG_D "edi"
# define REG_S "esi" # define REG_S "esi"
# define PTR_SIZE "4" # define PTR_SIZE "4"
# define REG_SP "esp" # define REG_SP "esp"
# define REG_BP "ebp" # define REG_BP "ebp"
# define REGBP ebp # define REGBP ebp
# define REGa eax # define REGa eax
# define REGb ebx # define REGb ebx
# define REGc ecx # define REGc ecx
# define REGSP esp # define REGSP esp
#endif #endif
#if defined(ARCH_X86_64) || (defined(ARCH_X86_32) && defined(HAVE_EBX_AVAILABLE) && defined(HAVE_EBP_AVAILABLE)) #if defined(ARCH_X86_64) || (defined(ARCH_X86_32) && defined(HAVE_EBX_AVAILABLE) && defined(HAVE_EBP_AVAILABLE))
# define HAVE_7REGS 1 # define HAVE_7REGS 1
#endif #endif
#if defined(ARCH_X86_64) && defined(PIC) #if defined(ARCH_X86_64) && defined(PIC)
# define BROKEN_RELOCATIONS 1 # define BROKEN_RELOCATIONS 1
#endif #endif
#endif /* FFMPEG_X86CPU_H */ #endif /* FFMPEG_X86CPU_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment