add an AMD64 specific implementation of rdtsc()
Originally committed as revision 4135 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
6c618a263d
commit
8230cf0210
@ -457,6 +457,16 @@ if((y)<(x)){\
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ARCH_X86) || defined(ARCH_X86_64)
|
#if defined(ARCH_X86) || defined(ARCH_X86_64)
|
||||||
|
#if defined(ARCH_X86_64)
|
||||||
|
static inline uint64_t rdtsc(void)
|
||||||
|
{
|
||||||
|
uint64_t a, d;
|
||||||
|
asm volatile( "rdtsc\n\t"
|
||||||
|
: "=a" (a), "=d" (d)
|
||||||
|
);
|
||||||
|
return (d << 32) | (a & 0xffffffff);
|
||||||
|
}
|
||||||
|
#else
|
||||||
static inline long long rdtsc(void)
|
static inline long long rdtsc(void)
|
||||||
{
|
{
|
||||||
long long l;
|
long long l;
|
||||||
@ -465,6 +475,7 @@ static inline long long rdtsc(void)
|
|||||||
);
|
);
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#define START_TIMER \
|
#define START_TIMER \
|
||||||
uint64_t tend;\
|
uint64_t tend;\
|
||||||
|
Loading…
Reference in New Issue
Block a user