mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Arm64 also defines __ARM_ARCH.
This commit is contained in:
parent
a3f5003f88
commit
6a2311a7b7
@ -68,16 +68,16 @@ public:
|
|||||||
static tracy_force_inline int64_t GetTime( uint32_t& cpu )
|
static tracy_force_inline int64_t GetTime( uint32_t& cpu )
|
||||||
{
|
{
|
||||||
#ifdef TRACY_HW_TIMER
|
#ifdef TRACY_HW_TIMER
|
||||||
# if __ARM_ARCH >= 6
|
# if defined __aarch64__
|
||||||
int64_t t;
|
|
||||||
cpu = 0xFFFFFFFF;
|
|
||||||
asm volatile ( "mrrc p15, 1, %Q0, %R0, c14" : "=r" (t) );
|
|
||||||
return t;
|
|
||||||
# elif defined __aarch64__
|
|
||||||
int64_t t;
|
int64_t t;
|
||||||
cpu = 0xFFFFFFFF;
|
cpu = 0xFFFFFFFF;
|
||||||
asm volatile ( "mrs %0, cntvct_el0" : "=r" (t) );
|
asm volatile ( "mrs %0, cntvct_el0" : "=r" (t) );
|
||||||
return t;
|
return t;
|
||||||
|
# elif __ARM_ARCH >= 6
|
||||||
|
int64_t t;
|
||||||
|
cpu = 0xFFFFFFFF;
|
||||||
|
asm volatile ( "mrrc p15, 1, %Q0, %R0, c14" : "=r" (t) );
|
||||||
|
return t;
|
||||||
# elif defined _MSC_VER || defined __CYGWIN__
|
# elif defined _MSC_VER || defined __CYGWIN__
|
||||||
const auto t = int64_t( __rdtscp( &cpu ) );
|
const auto t = int64_t( __rdtscp( &cpu ) );
|
||||||
return t;
|
return t;
|
||||||
@ -95,14 +95,14 @@ public:
|
|||||||
static tracy_force_inline int64_t GetTime()
|
static tracy_force_inline int64_t GetTime()
|
||||||
{
|
{
|
||||||
#ifdef TRACY_HW_TIMER
|
#ifdef TRACY_HW_TIMER
|
||||||
# if __ARM_ARCH >= 6
|
# if defined __aarch64__
|
||||||
int64_t t;
|
|
||||||
asm volatile ( "mrrc p15, 1, %Q0, %R0, c14" : "=r" (t) );
|
|
||||||
return t;
|
|
||||||
# elif defined __aarch64__
|
|
||||||
int64_t t;
|
int64_t t;
|
||||||
asm volatile ( "mrs %0, cntvct_el0" : "=r" (t) );
|
asm volatile ( "mrs %0, cntvct_el0" : "=r" (t) );
|
||||||
return t;
|
return t;
|
||||||
|
# elif __ARM_ARCH >= 6
|
||||||
|
int64_t t;
|
||||||
|
asm volatile ( "mrrc p15, 1, %Q0, %R0, c14" : "=r" (t) );
|
||||||
|
return t;
|
||||||
# elif defined _MSC_VER || defined __CYGWIN__
|
# elif defined _MSC_VER || defined __CYGWIN__
|
||||||
unsigned int dontcare;
|
unsigned int dontcare;
|
||||||
const auto t = int64_t( __rdtscp( &dontcare ) );
|
const auto t = int64_t( __rdtscp( &dontcare ) );
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user