// // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // defs.hfa -- // // Author : Thierry Delisle // Created On : Thu Nov 9 13:24:10 2017 // Last Modified By : Peter A. Buhr // Last Modified On : Thu Feb 8 16:22:41 2018 // Update Count : 8 // #pragma once #include #include #include #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #define thread_local _Thread_local typedef void (*fptr_t)(); typedef int_fast16_t __lock_size_t; #ifdef __cforall #define __cfa_anonymous_object(x) inline struct x #else #define __cfa_anonymous_object(x) x __cfa_anonymous_object #endif #ifdef __cforall void abort ( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); extern "C" { #endif void __cabi_abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); #ifdef __cforall } #endif #if defined(__cforall_thread__) #define OPTIONAL_THREAD #else #define OPTIONAL_THREAD __attribute__((weak)) #endif static inline long long rdtscl(void) { unsigned int lo, hi; __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); }