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 74 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 411 of file scheduler_common.h.

411 : my_fenv_ptr(NULL) {}

◆ ~cpu_ctl_env()

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

Definition at line 412 of file scheduler_common.h.

412  {
413  if ( my_fenv_ptr )
415  }
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 422 of file scheduler_common.h.

422  : my_fenv_ptr(NULL) {
423  *this = src;
424  }

Member Function Documentation

◆ get_env() [1/4]

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

Definition at line 81 of file gcc_ia32_common.h.

81  {
82  #if __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN
83  cpu_ctl_env loc_ctl;
84  __asm__ __volatile__ (
85  "stmxcsr %0\n\t"
86  "fstcw %1"
87  : "=m"(loc_ctl.mxcsr), "=m"(loc_ctl.x87cw)
88  );
89  *this = loc_ctl;
90  #else
91  __asm__ __volatile__ (
92  "stmxcsr %0\n\t"
93  "fstcw %1"
94  : "=m"(mxcsr), "=m"(x87cw)
95  );
96  #endif
98  }
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 125 of file msvc_armv7.h.

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

References my_ctl.

◆ get_env() [3/4]

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

Definition at line 238 of file msvc_ia32_common.h.

238  {
239  __TBB_get_cpu_ctl_env( this );
241  }
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 437 of file scheduler_common.h.

437  {
438  if ( !my_fenv_ptr )
439  my_fenv_ptr = (fenv_t*)tbb::internal::NFS_Allocate(1, sizeof(fenv_t), NULL);
440  fegetenv( my_fenv_ptr );
441  }
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 80 of file gcc_ia32_common.h.

80 { 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 124 of file msvc_armv7.h.

124 { 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 237 of file msvc_ia32_common.h.

237 { 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 432 of file scheduler_common.h.

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

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 425 of file scheduler_common.h.

425  {
426  __TBB_ASSERT( src.my_fenv_ptr, NULL );
427  if ( !my_fenv_ptr )
428  my_fenv_ptr = (fenv_t*)tbb::internal::NFS_Allocate(1, sizeof(fenv_t), NULL);
429  *my_fenv_ptr = *src.my_fenv_ptr;
430  return *this;
431  }
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:169

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 99 of file gcc_ia32_common.h.

99  {
100  __asm__ __volatile__ (
101  "ldmxcsr %0\n\t"
102  "fldcw %1"
103  : : "m"(mxcsr), "m"(x87cw)
104  );
105  }

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 126 of file msvc_armv7.h.

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

References my_ctl.

◆ set_env() [3/4]

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

Definition at line 242 of file msvc_ia32_common.h.

242 { __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 442 of file scheduler_common.h.

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

References __TBB_ASSERT.

Member Data Documentation

◆ mxcsr

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

Definition at line 76 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 78 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 122 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 409 of file scheduler_common.h.

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

◆ x87cw

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

Definition at line 77 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-2019 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.