Changeset b0b1e15


Ignore:
Timestamp:
Nov 11, 2020, 4:49:40 PM (11 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
ead174a
Parents:
080b0a1
Message:

fix timestamp generation for arm inside the compiler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/Stats/ResolveTime.cc

    r080b0a1 rb0b1e15  
    2727        namespace ResolveTime {
    2828                static inline long long rdtscl(void) {
    29                         unsigned int lo, hi;
    30                         __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
    31                         return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 );
     29                        #if defined( __i386 ) || defined( __x86_64 )
     30                                unsigned int lo, hi;
     31                                __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
     32                                return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 );
     33                        #elif defined( __aarch64__ )
     34                                int64_t value;
     35                                asm volatile("mrs %0, cntvct_el0" : "=r"(value));
     36                                return value;
     37                        #else
     38                                #error unknown hardware architecture
     39                        #endif
    3240                }
    3341
Note: See TracChangeset for help on using the changeset viewer.