Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
gcc_ia32_common.h File Reference
#include "gcc_itsx.h"
Include dependency graph for gcc_ia32_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tbb::internal::cpu_ctl_env
 

Namespaces

 tbb
 The graph class.
 
 tbb::internal
 Identifiers declared inside namespace internal should never be used directly by client code.
 

Macros

#define __TBB_Log2(V)   __TBB_machine_lg(V)
 
#define __TBB_Pause(V)   __TBB_machine_pause(V)
 
#define __TBB_time_stamp()   __TBB_machine_time_stamp()
 
#define __TBB_CPU_CTL_ENV_PRESENT   1
 

Typedefs

typedef uint64_t tbb::internal::machine_tsc_t
 

Functions

template<typename T >
static intptr_t __TBB_machine_lg (T x)
 
static void __TBB_machine_pause (int32_t delay)
 
static tbb::internal::machine_tsc_t __TBB_machine_time_stamp ()
 

Macro Definition Documentation

◆ __TBB_CPU_CTL_ENV_PRESENT

#define __TBB_CPU_CTL_ENV_PRESENT   1

Definition at line 67 of file gcc_ia32_common.h.

◆ __TBB_Log2

#define __TBB_Log2 (   V)    __TBB_machine_lg(V)

Definition at line 31 of file gcc_ia32_common.h.

◆ __TBB_Pause

#define __TBB_Pause (   V)    __TBB_machine_pause(V)

Definition at line 50 of file gcc_ia32_common.h.

◆ __TBB_time_stamp

#define __TBB_time_stamp ( )    __TBB_machine_time_stamp()

Definition at line 63 of file gcc_ia32_common.h.

Function Documentation

◆ __TBB_machine_lg()

template<typename T >
static intptr_t __TBB_machine_lg ( x)
inlinestatic

Definition at line 25 of file gcc_ia32_common.h.

25  {
26  __TBB_ASSERT(x>0, "The logarithm of a non-positive value is undefined.");
27  uintptr_t j, i = x;
28  __asm__("bsr %1,%0" : "=r"(j) : "r"(i));
29  return j;
30 }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT.

◆ __TBB_machine_pause()

static void __TBB_machine_pause ( int32_t  delay)
inlinestatic

Definition at line 44 of file gcc_ia32_common.h.

44  {
45  for (int32_t i = 0; i < delay; i++) {
46  __asm__ __volatile__("pause;");
47  }
48  return;
49 }

◆ __TBB_machine_time_stamp()

static tbb::internal::machine_tsc_t __TBB_machine_time_stamp ( )
inlinestatic

Definition at line 54 of file gcc_ia32_common.h.

54  {
55 #if __INTEL_COMPILER
56  return _rdtsc();
57 #else
58  tbb::internal::uint32_t hi, lo;
59  __asm__ __volatile__("rdtsc" : "=d"(hi), "=a"(lo));
60  return (tbb::internal::machine_tsc_t( hi ) << 32) | lo;
61 #endif
62 }
uint64_t machine_tsc_t

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.