HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
simd::vbool4 Class Reference

#include <simd.h>

Public Types

enum  { elements = 4 }
 
enum  { paddedelements = 4 }
 
enum  { bits = elements*32 }
 
typedef bool value_t
 Underlying equivalent scalar value type. More...
 
typedef simd_bool_t< 4 >::type simd_t
 the native SIMD type used More...
 

Public Member Functions

 vbool4 ()
 Default constructor (contents undefined) More...
 
 vbool4 (bool a)
 Construct from a single value (store it in all slots) More...
 
 vbool4 (const bool *a)
 
 vbool4 (bool a, bool b, bool c, bool d)
 Construct from 4 bool values. More...
 
 vbool4 (const vbool4 &other)
 Copy construct from another vbool4. More...
 
 vbool4 (int a, int b, int c, int d)
 Construct from 4 int values. More...
 
 vbool4 (const vint4 &i)
 Construct from a SIMD int (is each element nonzero?) More...
 
 vbool4 (const simd_t &m)
 Construct from the underlying SIMD type. More...
 
 operator simd_t () const
 Return the raw SIMD type. More...
 
simd_t simd () const
 
simd_tsimd ()
 
int bitmask () const
 Extract the bitmask. More...
 
void clear ()
 Set all components to false. More...
 
const vbool4operator= (bool a)
 Assign one value to all components. More...
 
const vbool4operator= (const vbool4 &other)
 Assignment of another vbool4. More...
 
int operator[] (int i) const
 Component access (get) More...
 
void setcomp (int i, bool value)
 Component access (set). More...
 
intoperator[] (int i)
 
void load (bool a)
 Helper: load a single value into all components. More...
 
void load (bool a, bool b, bool c, bool d)
 Helper: load separate values into each component. More...
 
void store (bool *values) const
 Helper: store the values into memory as bools. More...
 
void store (bool *values, int n) const
 Store the first n values into memory. More...
 

Static Public Member Functions

static const char * type_name ()
 
static vbool4 from_bitmask (int bitmask)
 Convert from integer bitmask to a true vbool4. More...
 
static const vbool4 False ()
 Return a vbool4 the is 'false' for all values. More...
 
static const vbool4 True ()
 Return a vbool4 the is 'true' for all values. More...
 

Friends

vbool4 operator! (const vbool4 &a)
 Logical/bitwise operators, component-by-component. More...
 
vbool4 operator& (const vbool4 &a, const vbool4 &b)
 
vbool4 operator| (const vbool4 &a, const vbool4 &b)
 
vbool4 operator^ (const vbool4 &a, const vbool4 &b)
 
vbool4 operator~ (const vbool4 &a)
 
const vbool4operator&= (vbool4 &a, const vbool4 &b)
 
const vbool4operator|= (vbool4 &a, const vbool4 &b)
 
const vbool4operator^= (vbool4 &a, const vbool4 &b)
 
vbool4 operator== (const vbool4 &a, const vbool4 &b)
 Comparison operators, component by component. More...
 
vbool4 operator!= (const vbool4 &a, const vbool4 &b)
 
std::ostream & operator<< (std::ostream &cout, const vbool4 &a)
 Stream output. More...
 

Detailed Description

vbool4: An 4-vector whose elements act mostly like bools, accelerated by SIMD instructions when available. This is what is naturally produced by SIMD comparison operators on the vfloat4 and vint4 types.

Definition at line 457 of file simd.h.

Member Typedef Documentation

the native SIMD type used

Definition at line 464 of file simd.h.

typedef bool simd::vbool4::value_t

Underlying equivalent scalar value type.

Definition at line 460 of file simd.h.

Member Enumeration Documentation

anonymous enum
Enumerator
elements 

Definition at line 461 of file simd.h.

anonymous enum
Enumerator
paddedelements 

Definition at line 462 of file simd.h.

anonymous enum
Enumerator
bits 

Definition at line 463 of file simd.h.

Constructor & Destructor Documentation

simd::vbool4::vbool4 ( )
inline

Default constructor (contents undefined)

Definition at line 467 of file simd.h.

simd::vbool4::vbool4 ( bool  a)
inline

Construct from a single value (store it in all slots)

Definition at line 470 of file simd.h.

OIIO_FORCEINLINE simd::vbool4::vbool4 ( const bool *  a)
explicit

Definition at line 3204 of file simd.h.

simd::vbool4::vbool4 ( bool  a,
bool  b,
bool  c,
bool  d 
)
inline

Construct from 4 bool values.

Definition at line 475 of file simd.h.

simd::vbool4::vbool4 ( const vbool4 other)
inline

Copy construct from another vbool4.

Definition at line 478 of file simd.h.

simd::vbool4::vbool4 ( int  a,
int  b,
int  c,
int  d 
)
inline

Construct from 4 int values.

Definition at line 481 of file simd.h.

OIIO_FORCEINLINE simd::vbool4::vbool4 ( const vint4 i)

Construct from a SIMD int (is each element nonzero?)

Definition at line 4884 of file simd.h.

simd::vbool4::vbool4 ( const simd_t m)
inline

Construct from the underlying SIMD type.

Definition at line 489 of file simd.h.

Member Function Documentation

OIIO_FORCEINLINE int simd::vbool4::bitmask ( ) const

Extract the bitmask.

Definition at line 3214 of file simd.h.

OIIO_FORCEINLINE void simd::vbool4::clear ( )

Set all components to false.

Definition at line 3234 of file simd.h.

OIIO_FORCEINLINE const vbool4 simd::vbool4::False ( )
static

Return a vbool4 the is 'false' for all values.

Definition at line 3243 of file simd.h.

OIIO_FORCEINLINE vbool4 simd::vbool4::from_bitmask ( int  bitmask)
static

Convert from integer bitmask to a true vbool4.

Definition at line 3228 of file simd.h.

OIIO_FORCEINLINE void simd::vbool4::load ( bool  a)

Helper: load a single value into all components.

Definition at line 3177 of file simd.h.

OIIO_FORCEINLINE void simd::vbool4::load ( bool  a,
bool  b,
bool  c,
bool  d 
)

Helper: load separate values into each component.

Definition at line 3189 of file simd.h.

simd::vbool4::operator simd_t ( ) const
inline

Return the raw SIMD type.

Definition at line 492 of file simd.h.

const vbool4& simd::vbool4::operator= ( bool  a)
inline

Assign one value to all components.

Definition at line 512 of file simd.h.

OIIO_FORCEINLINE const vbool4 & simd::vbool4::operator= ( const vbool4 other)

Assignment of another vbool4.

Definition at line 3208 of file simd.h.

OIIO_FORCEINLINE int simd::vbool4::operator[] ( int  i) const

Component access (get)

Definition at line 3148 of file simd.h.

OIIO_FORCEINLINE int & simd::vbool4::operator[] ( int  i)

Component access (set). NOTE: avoid this unsafe construct. It will go away some day.

Definition at line 3157 of file simd.h.

OIIO_FORCEINLINE void simd::vbool4::setcomp ( int  i,
bool  value 
)

Component access (set).

Definition at line 3163 of file simd.h.

simd_t simd::vbool4::simd ( ) const
inline

Definition at line 493 of file simd.h.

simd_t& simd::vbool4::simd ( )
inline

Definition at line 494 of file simd.h.

OIIO_FORCEINLINE void simd::vbool4::store ( bool *  values) const

Helper: store the values into memory as bools.

Definition at line 3265 of file simd.h.

OIIO_FORCEINLINE void simd::vbool4::store ( bool *  values,
int  n 
) const

Store the first n values into memory.

Definition at line 3269 of file simd.h.

OIIO_FORCEINLINE const vbool4 simd::vbool4::True ( )
static

Return a vbool4 the is 'true' for all values.

Definition at line 3251 of file simd.h.

static const char* simd::vbool4::type_name ( )
inlinestatic

Definition at line 459 of file simd.h.

Friends And Related Function Documentation

vbool4 operator! ( const vbool4 a)
friend

Logical/bitwise operators, component-by-component.

Definition at line 3277 of file simd.h.

vbool4 operator!= ( const vbool4 a,
const vbool4 b 
)
friend

Definition at line 3351 of file simd.h.

vbool4 operator& ( const vbool4 a,
const vbool4 b 
)
friend

Definition at line 3287 of file simd.h.

const vbool4& operator&= ( vbool4 a,
const vbool4 b 
)
friend

Definition at line 3318 of file simd.h.

std::ostream& operator<< ( std::ostream &  cout,
const vbool4 a 
)
friend

Stream output.

Definition at line 3169 of file simd.h.

vbool4 operator== ( const vbool4 a,
const vbool4 b 
)
friend

Comparison operators, component by component.

Definition at line 3341 of file simd.h.

vbool4 operator^ ( const vbool4 a,
const vbool4 b 
)
friend

Definition at line 3307 of file simd.h.

const vbool4& operator^= ( vbool4 a,
const vbool4 b 
)
friend

Definition at line 3326 of file simd.h.

vbool4 operator| ( const vbool4 a,
const vbool4 b 
)
friend

Definition at line 3297 of file simd.h.

const vbool4& operator|= ( vbool4 a,
const vbool4 b 
)
friend

Definition at line 3322 of file simd.h.

vbool4 operator~ ( const vbool4 a)
friend

Definition at line 3330 of file simd.h.

Member Data Documentation

simd_t simd::vbool4::m_simd

Definition at line 559 of file simd.h.

int simd::vbool4::m_val[paddedelements]

Definition at line 560 of file simd.h.


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