Changeset d685cb0
- Timestamp:
- Aug 21, 2020, 7:15:27 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 636d115b
- Parents:
- e67a82d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/defs.hfa
re67a82d rd685cb0 10 10 // Created On : Thu Nov 9 13:24:10 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jan 28 22:38:27202013 // Update Count : 912 // Last Modified On : Thu Aug 13 22:00:23 2020 13 // Update Count : 19 14 14 // 15 15 … … 17 17 18 18 #include <stdint.h> 19 #include <assert.h> 19 20 20 21 #define likely(x) __builtin_expect(!!(x), 1) … … 47 48 #endif 48 49 49 static inline long long rdtscl(void) { 50 unsigned int lo, hi; 51 __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 52 return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); 50 static inline long long int rdtscl(void) { 51 #if defined( __aarch64__ ) 52 // https://github.com/google/benchmark/blob/v1.1.0/src/cycleclock.h#L116 53 long long int virtual_timer_value; 54 asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); 55 return virtual_timer_value; 56 #else 57 unsigned int lo, hi; 58 __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 59 return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); 60 #endif // __ARM_ARCH 53 61 }
Note: See TracChangeset
for help on using the changeset viewer.