Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/defs.hfa

    r8b73526 r8a13c47  
    1010// Created On       : Thu Nov  9 13:24:10 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Oct 24 10:53:15 2020
    13 // Update Count     : 21
     12// Last Modified On : Tue Jan 28 22:38:27 2020
     13// Update Count     : 9
    1414//
    1515
    1616#pragma once
    1717
     18#include <stdbool.h>
     19#include <stddef.h>
    1820#include <stdint.h>
    19 #include <assert.h>
    2021
    2122#define likely(x)   __builtin_expect(!!(x), 1)
     
    2930#define __cfa_anonymous_object(x) inline struct x
    3031#else
    31 #define __cfa_anonymous_object(x) struct x __cfa_anonymous_object
     32#define __cfa_anonymous_object(x) x __cfa_anonymous_object
    3233#endif
    3334
     
    4849#endif
    4950
    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
     51static 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 );
    6355}
Note: See TracChangeset for help on using the changeset viewer.