Commit 6921198e authored by mhoffman's avatar mhoffman

Blackfin - read_time primitive

note this primitive currently uses a union to concatenate 2x32bit registers because of poor compiler support
around DImode and asm.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9302 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 108ed204
...@@ -267,7 +267,7 @@ static inline int ff_get_fourcc(const char *s){ ...@@ -267,7 +267,7 @@ static inline int ff_get_fourcc(const char *s){
}\ }\
} }
#if defined(ARCH_X86) || defined(ARCH_POWERPC) #if defined(ARCH_X86) || defined(ARCH_POWERPC) || defined(ARCH_BFIN)
#if defined(ARCH_X86_64) #if defined(ARCH_X86_64)
static inline uint64_t read_time(void) static inline uint64_t read_time(void)
{ {
...@@ -286,6 +286,19 @@ static inline long long read_time(void) ...@@ -286,6 +286,19 @@ static inline long long read_time(void)
); );
return l; return l;
} }
#elif ARCH_BFIN
static inline uint64_t read_time(void)
{
union {
struct {
unsigned lo;
unsigned hi;
} p;
unsigned long long c;
} t;
asm volatile ("%0=cycles; %1=cycles2;" : "=d" (t.p.lo), "=d" (t.p.hi));
return t.c;
}
#else //FIXME check ppc64 #else //FIXME check ppc64
static inline uint64_t read_time(void) static inline uint64_t read_time(void)
{ {
......
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