Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::cpu_ctl_env Class Reference

#include <gcc_ia32_common.h>

Collaboration diagram for tbb::internal::cpu_ctl_env:

Public Member Functions

bool operator!= (const cpu_ctl_env &ctl) const
 
void get_env ()
 
void set_env () const
 
bool operator!= (const cpu_ctl_env &ctl) const
 
void get_env ()
 
void set_env () const
 
bool operator!= (const cpu_ctl_env &ctl) const
 
void get_env ()
 
void set_env () const
 
 cpu_ctl_env ()
 
 ~cpu_ctl_env ()
 
 cpu_ctl_env (const cpu_ctl_env &src)
 
cpu_ctl_envoperator= (const cpu_ctl_env &src)
 
bool operator!= (const cpu_ctl_env &ctl) const
 
void get_env ()
 
const cpu_ctl_envset_env () const
 

Private Attributes

int mxcsr
 
short x87cw
 
unsigned int my_ctl
 
fenv_t * my_fenv_ptr
 

Static Private Attributes

static const int MXCSR_CONTROL_MASK = ~0x3f
 

Detailed Description

Definition at line 70 of file gcc_ia32_common.h.

Constructor & Destructor Documentation

◆ cpu_ctl_env() [1/2]

tbb::internal::cpu_ctl_env::cpu_ctl_env ( )
inline

Definition at line 413 of file scheduler_common.h.

413 : my_fenv_ptr(NULL) {}

◆ ~cpu_ctl_env()

tbb::internal::cpu_ctl_env::~cpu_ctl_env ( )
inline

Definition at line 414 of file scheduler_common.h.

414  {
415  if ( my_fenv_ptr )
417  }
void __TBB_EXPORTED_FUNC NFS_Free(void *)
Free memory allocated by NFS_Allocate.

References tbb::internal::NFS_Free().

Here is the call graph for this function:

◆ cpu_ctl_env() [2/2]

tbb::internal::cpu_ctl_env::cpu_ctl_env ( const cpu_ctl_env src)
inline

Definition at line 424 of file scheduler_common.h.

424  : my_fenv_ptr(NULL) {
425  *this = src;
426  }

Member Function Documentation

◆ get_env() [1/4]

void tbb::internal::cpu_ctl_env::get_env ( )
inline

Definition at line 77 of file gcc_ia32_common.h.

77  {
78  #if __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN
79  cpu_ctl_env loc_ctl;
80  __asm__ __volatile__ (
81  "stmxcsr %0\n\t"
82  "fstcw %1"
83  : "=m"(loc_ctl.mxcsr), "=m"(loc_ctl.x87cw)
84  );
85  *this = loc_ctl;
86  #else
87  __asm__ __volatile__ (
88  "stmxcsr %0\n\t"
89  "fstcw %1"
90  : "=m"(mxcsr), "=m"(x87cw)
91  );
92  #endif
94  }
static const int MXCSR_CONTROL_MASK

References mxcsr, MXCSR_CONTROL_MASK, and x87cw.

Referenced by tbb::internal::arena::arena().

Here is the caller graph for this function:

◆ get_env() [2/4]

void tbb::internal::cpu_ctl_env::get_env ( )
inline

Definition at line 121 of file msvc_armv7.h.

121 { my_ctl = _control87(0, 0); }

References my_ctl.

◆ get_env() [3/4]

void tbb::internal::cpu_ctl_env::get_env ( )
inline

Definition at line 234 of file msvc_ia32_common.h.

234  {
235  __TBB_get_cpu_ctl_env( this );
237  }
static const int MXCSR_CONTROL_MASK
void __TBB_get_cpu_ctl_env(tbb::internal::cpu_ctl_env *ctl)

References __TBB_get_cpu_ctl_env(), mxcsr, and MXCSR_CONTROL_MASK.

Here is the call graph for this function:

◆ get_env() [4/4]

void tbb::internal::cpu_ctl_env::get_env ( )
inline

Definition at line 439 of file scheduler_common.h.

439  {
440  if ( !my_fenv_ptr )
441  my_fenv_ptr = (fenv_t*)tbb::internal::NFS_Allocate(1, sizeof(fenv_t), NULL);
442  fegetenv( my_fenv_ptr );
443  }
void *__TBB_EXPORTED_FUNC NFS_Allocate(size_t n_element, size_t element_size, void *hint)
Allocate memory on cache/sector line boundary.

References tbb::internal::NFS_Allocate().

Here is the call graph for this function:

◆ operator!=() [1/4]

bool tbb::internal::cpu_ctl_env::operator!= ( const cpu_ctl_env ctl) const
inline

Definition at line 76 of file gcc_ia32_common.h.

76 { return mxcsr != ctl.mxcsr || x87cw != ctl.x87cw; }

References mxcsr, and x87cw.

◆ operator!=() [2/4]

bool tbb::internal::cpu_ctl_env::operator!= ( const cpu_ctl_env ctl) const
inline

Definition at line 120 of file msvc_armv7.h.

120 { return my_ctl != ctl.my_ctl; }

References my_ctl.

◆ operator!=() [3/4]

bool tbb::internal::cpu_ctl_env::operator!= ( const cpu_ctl_env ctl) const
inline

Definition at line 233 of file msvc_ia32_common.h.

233 { return mxcsr != ctl.mxcsr || x87cw != ctl.x87cw; }

References mxcsr, and x87cw.

◆ operator!=() [4/4]

bool tbb::internal::cpu_ctl_env::operator!= ( const cpu_ctl_env ctl) const
inline

Definition at line 434 of file scheduler_common.h.

434  {
435  __TBB_ASSERT( my_fenv_ptr, "cpu_ctl_env is not initialized." );
436  __TBB_ASSERT( ctl.my_fenv_ptr, "cpu_ctl_env is not initialized." );
437  return memcmp( (void*)my_fenv_ptr, (void*)ctl.my_fenv_ptr, sizeof(fenv_t) );
438  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT, and my_fenv_ptr.

◆ operator=()

cpu_ctl_env& tbb::internal::cpu_ctl_env::operator= ( const cpu_ctl_env src)
inline

Definition at line 427 of file scheduler_common.h.

427  {
428  __TBB_ASSERT( src.my_fenv_ptr, NULL );
429  if ( !my_fenv_ptr )
430  my_fenv_ptr = (fenv_t*)tbb::internal::NFS_Allocate(1, sizeof(fenv_t), NULL);
431  *my_fenv_ptr = *src.my_fenv_ptr;
432  return *this;
433  }
void *__TBB_EXPORTED_FUNC NFS_Allocate(size_t n_element, size_t element_size, void *hint)
Allocate memory on cache/sector line boundary.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT, my_fenv_ptr, and tbb::internal::NFS_Allocate().

Here is the call graph for this function:

◆ set_env() [1/4]

void tbb::internal::cpu_ctl_env::set_env ( ) const
inline

Definition at line 95 of file gcc_ia32_common.h.

95  {
96  __asm__ __volatile__ (
97  "ldmxcsr %0\n\t"
98  "fldcw %1"
99  : : "m"(mxcsr), "m"(x87cw)
100  );
101  }

References mxcsr, and x87cw.

Referenced by tbb::internal::arena::process().

Here is the caller graph for this function:

◆ set_env() [2/4]

void tbb::internal::cpu_ctl_env::set_env ( ) const
inline

Definition at line 122 of file msvc_armv7.h.

122 { _control87( my_ctl, ~0U ); }

References my_ctl.

◆ set_env() [3/4]

void tbb::internal::cpu_ctl_env::set_env ( ) const
inline

Definition at line 238 of file msvc_ia32_common.h.

238 { __TBB_set_cpu_ctl_env( this ); }
void __TBB_set_cpu_ctl_env(const tbb::internal::cpu_ctl_env *ctl)

References __TBB_set_cpu_ctl_env().

Here is the call graph for this function:

◆ set_env() [4/4]

const cpu_ctl_env& tbb::internal::cpu_ctl_env::set_env ( ) const
inline

Definition at line 444 of file scheduler_common.h.

444  {
445  __TBB_ASSERT( my_fenv_ptr, "cpu_ctl_env is not initialized." );
446  fesetenv( my_fenv_ptr );
447  return *this;
448  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT.

Member Data Documentation

◆ mxcsr

int tbb::internal::cpu_ctl_env::mxcsr
private

Definition at line 72 of file gcc_ia32_common.h.

Referenced by get_env(), operator!=(), and set_env().

◆ MXCSR_CONTROL_MASK

static const int tbb::internal::cpu_ctl_env::MXCSR_CONTROL_MASK = ~0x3f
staticprivate

Definition at line 74 of file gcc_ia32_common.h.

Referenced by get_env().

◆ my_ctl

unsigned int tbb::internal::cpu_ctl_env::my_ctl
private

Definition at line 118 of file msvc_armv7.h.

Referenced by get_env(), operator!=(), and set_env().

◆ my_fenv_ptr

fenv_t* tbb::internal::cpu_ctl_env::my_fenv_ptr
private

Definition at line 411 of file scheduler_common.h.

Referenced by operator!=(), and operator=().

◆ x87cw

short tbb::internal::cpu_ctl_env::x87cw
private

Definition at line 73 of file gcc_ia32_common.h.

Referenced by get_env(), operator!=(), and set_env().


The documentation for this class was generated from the following files:

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.