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

#include <simd.h>

Public Types

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

Public Member Functions

 vbool16 ()
 Default constructor (contents undefined) More...
 
 vbool16 (bool a)
 Construct from a single value (store it in all slots) More...
 
 vbool16 (int bitmask)
 
 vbool16 (const bool *values)
 
 vbool16 (bool v0, bool v1, bool v2, bool v3, bool v4, bool v5, bool v6, bool v7, bool v8, bool v9, bool v10, bool v11, bool v12, bool v13, bool v14, bool v15)
 Construct from 16 bool values. More...
 
 vbool16 (const vbool16 &other)
 Copy construct from another vbool16. More...
 
 vbool16 (int v0, int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8, int v9, int v10, int v11, int v12, int v13, int v14, int v15)
 Construct from 16 int values. More...
 
 vbool16 (const vint16 &i)
 Construct from a SIMD int (is each element nonzero?) More...
 
 vbool16 (const vbool8 &lo, const vbool8 &hi)
 Construct from two vbool8's. More...
 
 vbool16 (const vbool4 &b4a, const vbool4 &b4b, const vbool4 &b4c, const vbool4 &b4d)
 Construct from four vbool4's. More...
 
 vbool16 (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
 
void clear ()
 Set all components to false. More...
 
const vbool16operator= (bool a)
 Assign one value to all components. More...
 
const vbool16operator= (const vbool16 &other)
 Assignment of another vbool16. More...
 
int operator[] (int i) const
 Component access (get) More...
 
void setcomp (int i, bool value)
 Component access (set). More...
 
vbool8 lo () const
 Extract the lower precision vbool8. More...
 
vbool8 hi () const
 Extract the higher precision vbool8. More...
 
void load (bool a)
 Helper: load a single value into all components. More...
 
void load (bool v0, bool v1, bool v2, bool v3, bool v4, bool v5, bool v6, bool v7, bool v8, bool v9, bool v10, bool v11, bool v12, bool v13, bool v14, bool v15)
 Helper: load separate values into each component. More...
 
void load_bitmask (int a)
 Helper: load all components from a bitmask in an int. 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 vbool16 from_bitmask (int bitmask)
 Convert from integer bitmask to a true vbool16. More...
 
static const vbool16 False ()
 Return a vbool16 the is 'false' for all values. More...
 
static const vbool16 True ()
 Return a vbool16 the is 'true' for all values. More...
 

Friends

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

Detailed Description

vbool16: An 16-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 vfloat16 and vint16 types.

Definition at line 813 of file simd.h.

Member Typedef Documentation

the native SIMD type used

Definition at line 820 of file simd.h.

typedef bool simd::vbool16::value_t

Underlying equivalent scalar value type.

Definition at line 816 of file simd.h.

Member Enumeration Documentation

anonymous enum
Enumerator
elements 

Definition at line 817 of file simd.h.

anonymous enum
Enumerator
paddedelements 

Definition at line 818 of file simd.h.

anonymous enum
Enumerator
bits 

Definition at line 819 of file simd.h.

Constructor & Destructor Documentation

simd::vbool16::vbool16 ( )
inline

Default constructor (contents undefined)

Definition at line 824 of file simd.h.

simd::vbool16::vbool16 ( bool  a)
inline

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

Definition at line 827 of file simd.h.

simd::vbool16::vbool16 ( int  bitmask)
inlineexplicit

Definition at line 829 of file simd.h.

OIIO_FORCEINLINE simd::vbool16::vbool16 ( const bool *  values)
explicit

Definition at line 4006 of file simd.h.

OIIO_FORCEINLINE simd::vbool16::vbool16 ( bool  v0,
bool  v1,
bool  v2,
bool  v3,
bool  v4,
bool  v5,
bool  v6,
bool  v7,
bool  v8,
bool  v9,
bool  v10,
bool  v11,
bool  v12,
bool  v13,
bool  v14,
bool  v15 
)

Construct from 16 bool values.

Definition at line 3985 of file simd.h.

simd::vbool16::vbool16 ( const vbool16 other)
inline

Copy construct from another vbool16.

Definition at line 838 of file simd.h.

OIIO_FORCEINLINE simd::vbool16::vbool16 ( int  v0,
int  v1,
int  v2,
int  v3,
int  v4,
int  v5,
int  v6,
int  v7,
int  v8,
int  v9,
int  v10,
int  v11,
int  v12,
int  v13,
int  v14,
int  v15 
)

Construct from 16 int values.

Definition at line 3992 of file simd.h.

simd::vbool16::vbool16 ( const vint16 i)

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

OIIO_FORCEINLINE simd::vbool16::vbool16 ( const vbool8 lo,
const vbool8 hi 
)

Construct from two vbool8's.

Definition at line 4002 of file simd.h.

simd::vbool16::vbool16 ( const vbool4 b4a,
const vbool4 b4b,
const vbool4 b4c,
const vbool4 b4d 
)

Construct from four vbool4's.

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

Construct from the underlying SIMD type.

Definition at line 854 of file simd.h.

Member Function Documentation

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

Definition at line 4023 of file simd.h.

OIIO_FORCEINLINE void simd::vbool16::clear ( )

Set all components to false.

Definition at line 4032 of file simd.h.

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

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

Definition at line 4036 of file simd.h.

static vbool16 simd::vbool16::from_bitmask ( int  bitmask)
inlinestatic

Convert from integer bitmask to a true vbool16.

Definition at line 864 of file simd.h.

OIIO_FORCEINLINE vbool8 simd::vbool16::hi ( ) const

Extract the higher precision vbool8.

Definition at line 4066 of file simd.h.

OIIO_FORCEINLINE vbool8 simd::vbool16::lo ( ) const

Extract the lower precision vbool8.

Definition at line 4058 of file simd.h.

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

Helper: load a single value into all components.

Definition at line 3953 of file simd.h.

OIIO_FORCEINLINE void simd::vbool16::load ( bool  v0,
bool  v1,
bool  v2,
bool  v3,
bool  v4,
bool  v5,
bool  v6,
bool  v7,
bool  v8,
bool  v9,
bool  v10,
bool  v11,
bool  v12,
bool  v13,
bool  v14,
bool  v15 
)

Helper: load separate values into each component.

Definition at line 3963 of file simd.h.

OIIO_FORCEINLINE void simd::vbool16::load_bitmask ( int  a)

Helper: load all components from a bitmask in an int.

Definition at line 3958 of file simd.h.

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

Return the raw SIMD type.

Definition at line 857 of file simd.h.

OIIO_FORCEINLINE const vbool16 & simd::vbool16::operator= ( bool  a)

Assign one value to all components.

Definition at line 4012 of file simd.h.

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

Assignment of another vbool16.

Definition at line 4017 of file simd.h.

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

Component access (get)

Definition at line 3927 of file simd.h.

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

Component access (set).

Definition at line 3936 of file simd.h.

simd_t simd::vbool16::simd ( ) const
inline

Definition at line 858 of file simd.h.

simd_t& simd::vbool16::simd ( )
inline

Definition at line 859 of file simd.h.

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

Definition at line 821 of file simd.h.

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

Helper: store the values into memory as bools.

Definition at line 4046 of file simd.h.

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

Store the first n values into memory.

Definition at line 4050 of file simd.h.

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

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

Definition at line 4041 of file simd.h.

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

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

vbool16 operator! ( const vbool16 a)
friend

Definition at line 4075 of file simd.h.

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

Definition at line 4134 of file simd.h.

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

Definition at line 4083 of file simd.h.

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

Definition at line 4108 of file simd.h.

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

Stream output.

Definition at line 3945 of file simd.h.

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

Comparison operators, component by component.

Definition at line 4126 of file simd.h.

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

Definition at line 4099 of file simd.h.

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

Definition at line 4116 of file simd.h.

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

Definition at line 4091 of file simd.h.

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

Definition at line 4112 of file simd.h.

vbool16 operator~ ( const vbool16 a)
friend

Definition at line 4121 of file simd.h.

Member Data Documentation

uint16_t simd::vbool16::m_bits

Definition at line 931 of file simd.h.

simd_t simd::vbool16::m_simd

Definition at line 930 of file simd.h.


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