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 constexpr size_t size () noexcept
 
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 522 of file simd.h.

Member Typedef Documentation

the native SIMD type used

Definition at line 529 of file simd.h.

typedef bool simd::vbool4::value_t

Underlying equivalent scalar value type.

Definition at line 525 of file simd.h.

Member Enumeration Documentation

anonymous enum
Enumerator
elements 

Definition at line 526 of file simd.h.

anonymous enum
Enumerator
paddedelements 

Definition at line 527 of file simd.h.

anonymous enum
Enumerator
bits 

Definition at line 528 of file simd.h.

Constructor & Destructor Documentation

simd::vbool4::vbool4 ( )
inline

Default constructor (contents undefined)

Definition at line 533 of file simd.h.

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

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

Definition at line 536 of file simd.h.

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

Definition at line 3315 of file simd.h.

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

Construct from 4 bool values.

Definition at line 541 of file simd.h.

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

Copy construct from another vbool4.

Definition at line 544 of file simd.h.

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

Construct from 4 int values.

Definition at line 547 of file simd.h.

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

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

Definition at line 5051 of file simd.h.

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

Construct from the underlying SIMD type.

Definition at line 555 of file simd.h.

Member Function Documentation

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

Extract the bitmask.

Definition at line 3325 of file simd.h.

OIIO_FORCEINLINE void simd::vbool4::clear ( )

Set all components to false.

Definition at line 3350 of file simd.h.

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

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

Definition at line 3359 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 3344 of file simd.h.

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

Helper: load a single value into all components.

Definition at line 3285 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 3297 of file simd.h.

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

Return the raw SIMD type.

Definition at line 558 of file simd.h.

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

Assign one value to all components.

Definition at line 578 of file simd.h.

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

Assignment of another vbool4.

Definition at line 3319 of file simd.h.

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

Component access (get)

Definition at line 3256 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 3265 of file simd.h.

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

Component access (set).

Definition at line 3271 of file simd.h.

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

Definition at line 559 of file simd.h.

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

Definition at line 560 of file simd.h.

static constexpr size_t simd::vbool4::size ( void  )
inlinestaticnoexcept

Definition at line 530 of file simd.h.

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

Helper: store the values into memory as bools.

Definition at line 3381 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 3385 of file simd.h.

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

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

Definition at line 3367 of file simd.h.

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

Definition at line 524 of file simd.h.

Friends And Related Function Documentation

vbool4 operator! ( const vbool4 a)
friend

Logical/bitwise operators, component-by-component.

Definition at line 3393 of file simd.h.

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

Definition at line 3467 of file simd.h.

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

Definition at line 3403 of file simd.h.

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

Definition at line 3434 of file simd.h.

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

Stream output.

Definition at line 3277 of file simd.h.

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

Comparison operators, component by component.

Definition at line 3457 of file simd.h.

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

Definition at line 3423 of file simd.h.

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

Definition at line 3442 of file simd.h.

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

Definition at line 3413 of file simd.h.

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

Definition at line 3438 of file simd.h.

vbool4 operator~ ( const vbool4 a)
friend

Definition at line 3446 of file simd.h.

Member Data Documentation

simd_t simd::vbool4::m_simd

Definition at line 625 of file simd.h.

int simd::vbool4::m_val[paddedelements]

Definition at line 626 of file simd.h.


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