Changes in libcfa/src/bits/defs.hfa [8b73526:8a13c47]
- File:
-
- 1 edited
-
libcfa/src/bits/defs.hfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/defs.hfa
r8b73526 r8a13c47 10 10 // Created On : Thu Nov 9 13:24:10 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Oct 24 10:53:15202013 // Update Count : 2112 // Last Modified On : Tue Jan 28 22:38:27 2020 13 // Update Count : 9 14 14 // 15 15 16 16 #pragma once 17 17 18 #include <stdbool.h> 19 #include <stddef.h> 18 20 #include <stdint.h> 19 #include <assert.h>20 21 21 22 #define likely(x) __builtin_expect(!!(x), 1) … … 29 30 #define __cfa_anonymous_object(x) inline struct x 30 31 #else 31 #define __cfa_anonymous_object(x) structx __cfa_anonymous_object32 #define __cfa_anonymous_object(x) x __cfa_anonymous_object 32 33 #endif 33 34 … … 48 49 #endif 49 50 50 static inline long long int rdtscl(void) { 51 #if defined( __i386 ) || defined( __x86_64 ) 52 unsigned int lo, hi; 53 __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 54 return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); 55 #elif defined( __aarch64__ ) || defined( __arm__ ) 56 // https://github.com/google/benchmark/blob/v1.1.0/src/cycleclock.h#L116 57 long long int virtual_timer_value; 58 asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); 59 return virtual_timer_value; 60 #else 61 #error unsupported hardware architecture 62 #endif 51 static inline long long rdtscl(void) { 52 unsigned int lo, hi; 53 __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 54 return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); 63 55 }
Note:
See TracChangeset
for help on using the changeset viewer.