mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Read time from timer register on armv6, armv7.
Same improvement as on aarch64.
This commit is contained in:
parent
69a50b04c1
commit
a3f5003f88
@ -23,7 +23,7 @@
|
||||
# define TRACY_HW_TIMER
|
||||
#endif
|
||||
|
||||
#if defined __aarch64__
|
||||
#if defined __aarch64__ || __ARM_ARCH >= 6
|
||||
# define TRACY_HW_TIMER
|
||||
#endif
|
||||
|
||||
@ -68,7 +68,12 @@ public:
|
||||
static tracy_force_inline int64_t GetTime( uint32_t& cpu )
|
||||
{
|
||||
#ifdef TRACY_HW_TIMER
|
||||
# if defined __aarch64__
|
||||
# if __ARM_ARCH >= 6
|
||||
int64_t t;
|
||||
cpu = 0xFFFFFFFF;
|
||||
asm volatile ( "mrrc p15, 1, %Q0, %R0, c14" : "=r" (t) );
|
||||
return t;
|
||||
# elif defined __aarch64__
|
||||
int64_t t;
|
||||
cpu = 0xFFFFFFFF;
|
||||
asm volatile ( "mrs %0, cntvct_el0" : "=r" (t) );
|
||||
@ -90,7 +95,11 @@ public:
|
||||
static tracy_force_inline int64_t GetTime()
|
||||
{
|
||||
#ifdef TRACY_HW_TIMER
|
||||
# if defined __aarch64__
|
||||
# if __ARM_ARCH >= 6
|
||||
int64_t t;
|
||||
asm volatile ( "mrrc p15, 1, %Q0, %R0, c14" : "=r" (t) );
|
||||
return t;
|
||||
# elif defined __aarch64__
|
||||
int64_t t;
|
||||
asm volatile ( "mrs %0, cntvct_el0" : "=r" (t) );
|
||||
return t;
|
||||
|
Loading…
Reference in New Issue
Block a user