summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorMarc Hoffman <mmhoffm@gmail.com>2007-06-13 11:09:07 +0000
committerMarc Hoffman <mmhoffm@gmail.com>2007-06-13 11:09:07 +0000
commitf70c2739022ab338611ec034ad7504b3534b650c (patch)
tree2dcb138df7e1b56c014a0d7ac6faaeb360b92c44 /libavutil
parentc9823f05778ca197681a6c9960590d66816ddcfe (diff)
Blackfin - read_time primitive
note this primitive currently uses a union to concatenate 2x32bit registers because of poor compiler support around DImode and asm. Originally committed as revision 9302 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/common.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/libavutil/common.h b/libavutil/common.h
index 313658cf4c..b9fd06d94b 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -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)
static inline uint64_t read_time(void)
{
@@ -286,6 +286,19 @@ static inline long long read_time(void)
);
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
static inline uint64_t read_time(void)
{