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

407 : my_fenv_ptr(NULL) {}

◆ ~cpu_ctl_env()

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

Definition at line 408 of file scheduler_common.h.

408  {
409  if ( my_fenv_ptr )
411  }
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 418 of file scheduler_common.h.

418  : my_fenv_ptr(NULL) {
419  *this = src;
420  }

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

433  {
434  if ( !my_fenv_ptr )
435  my_fenv_ptr = (fenv_t*)tbb::internal::NFS_Allocate(1, sizeof(fenv_t), NULL);
436  fegetenv( my_fenv_ptr );
437  }
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 428 of file scheduler_common.h.

428  {
429  __TBB_ASSERT( my_fenv_ptr, "cpu_ctl_env is not initialized." );
430  __TBB_ASSERT( ctl.my_fenv_ptr, "cpu_ctl_env is not initialized." );
431  return memcmp( (void*)my_fenv_ptr, (void*)ctl.my_fenv_ptr, sizeof(fenv_t) );
432  }
#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 421 of file scheduler_common.h.

421  {
422  __TBB_ASSERT( src.my_fenv_ptr, NULL );
423  if ( !my_fenv_ptr )
424  my_fenv_ptr = (fenv_t*)tbb::internal::NFS_Allocate(1, sizeof(fenv_t), NULL);
425  *my_fenv_ptr = *src.my_fenv_ptr;
426  return *this;
427  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
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_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 438 of file scheduler_common.h.

438  {
439  __TBB_ASSERT( my_fenv_ptr, "cpu_ctl_env is not initialized." );
440  fesetenv( my_fenv_ptr );
441  return *this;
442  }
#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 405 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-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.