Changes in libcfa/src/bits/defs.hfa [8a13c47:8b73526]
- File:
-
- 1 edited
-
libcfa/src/bits/defs.hfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/defs.hfa
r8a13c47 r8b73526 10 10 // Created On : Thu Nov 9 13:24:10 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jan 28 22:38:27202013 // Update Count : 912 // Last Modified On : Sat Oct 24 10:53:15 2020 13 // Update Count : 21 14 14 // 15 15 16 16 #pragma once 17 17 18 #include <stdbool.h>19 #include <stddef.h>20 18 #include <stdint.h> 19 #include <assert.h> 21 20 22 21 #define likely(x) __builtin_expect(!!(x), 1) … … 30 29 #define __cfa_anonymous_object(x) inline struct x 31 30 #else 32 #define __cfa_anonymous_object(x) x __cfa_anonymous_object31 #define __cfa_anonymous_object(x) struct x __cfa_anonymous_object 33 32 #endif 34 33 … … 49 48 #endif 50 49 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 ); 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 55 63 }
Note:
See TracChangeset
for help on using the changeset viewer.