HDK
|
#include <simd.h>
Public Types | |
enum | { elements = 8 } |
enum | { paddedelements = 8 } |
enum | { bits = elements*32 } |
typedef float | value_t |
Underlying equivalent scalar value type. More... | |
typedef simd_raw_t< float, 8 > ::type | simd_t |
the native SIMD type used More... | |
typedef vfloat8 | vfloat_t |
SIMD int type. More... | |
typedef vint8 | vint_t |
SIMD int type. More... | |
typedef vbool8 | vbool_t |
SIMD bool type. More... | |
typedef vint8 | int_t |
typedef vbool8 | bool_t |
Public Member Functions | |
vfloat8 () | |
Default constructor (contents undefined) More... | |
vfloat8 (float a) | |
Construct from a single value (store it in all slots) More... | |
vfloat8 (float a, float b, float c, float d, float e, float f, float g, float h) | |
Construct from 8 values. More... | |
vfloat8 (const float *f) | |
Construct from a pointer to 8 values. More... | |
vfloat8 (const vfloat8 &other) | |
Copy construct from another vfloat8. More... | |
vfloat8 (const vint8 &ival) | |
Construct from an int vector (promoting all components to float) More... | |
vfloat8 (const vfloat4 &lo, const vfloat4 &hi) | |
Construct from two vfloat4's. More... | |
vfloat8 (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_t & | simd () |
const value_t * | data () const |
Return a pointer to the underlying scalar type. More... | |
value_t * | data () |
vfloat8 (const unsigned short *vals) | |
Construct from a pointer to unsigned short values. More... | |
vfloat8 (const short *vals) | |
Construct from a pointer to short values. More... | |
vfloat8 (const unsigned char *vals) | |
Construct from a pointer to unsigned char values. More... | |
vfloat8 (const char *vals) | |
Construct from a pointer to char values. More... | |
const vfloat8 & | operator= (float a) |
Assign a single value to all components. More... | |
const vfloat8 & | operator= (vfloat8 other) |
Assign a vfloat8. More... | |
void | clear () |
Set all components to 0.0. More... | |
float | operator[] (int i) const |
Component access (get) More... | |
float & | operator[] (int i) |
Component access (set) More... | |
void | setcomp (int i, float value) |
Component access (set). More... | |
value_t | x () const |
value_t | y () const |
value_t | z () const |
value_t | w () const |
void | set_x (value_t val) |
void | set_y (value_t val) |
void | set_z (value_t val) |
void | set_w (value_t val) |
vfloat4 | lo () const |
Extract the lower precision vfloat4. More... | |
vfloat4 | hi () const |
Extract the higher precision vfloat4. More... | |
void | load (float val) |
Helper: load a single value into all components. More... | |
void | load (float a, float b, float c, float d, float e, float f, float g, float h) |
Helper: load 8 values. More... | |
void | load (const float *values) |
Load from an array of values. More... | |
void | load (const float *values, int n) |
void | load (const unsigned short *values) |
Load from an array of 8 unsigned short values, convert to float. More... | |
void | load (const short *values) |
Load from an array of 8 short values, convert to float. More... | |
void | load (const unsigned char *values) |
Load from an array of 8 unsigned char values, convert to float. More... | |
void | load (const char *values) |
Load from an array of 8 char values, convert to float. More... | |
void | store (float *values) const |
void | store (float *values, int n) const |
Store the first n values into memory. More... | |
void | load_mask (int mask, const value_t *values) |
void | load_mask (const vbool_t &mask, const value_t *values) |
void | store_mask (int mask, value_t *values) const |
void | store_mask (const vbool_t &mask, value_t *values) const |
template<int scale = 4> | |
void | gather (const value_t *baseptr, const vint_t &vindex) |
Load values from addresses (char*)basepatr + vindex[i]*scale. More... | |
template<int scale = 4> | |
void | gather_mask (const vbool_t &mask, const value_t *baseptr, const vint_t &vindex) |
template<int scale = 4> | |
void | gather_mask (int mask, const value_t *baseptr, const vint_t &vindex) |
template<int scale = 4> | |
void | scatter (value_t *baseptr, const vint_t &vindex) const |
Store values at addresses (char*)basepatr + vindex[i]*scale. More... | |
template<int scale = 4> | |
void | scatter_mask (const vbool_t &mask, value_t *baseptr, const vint_t &vindex) const |
Scatter elements defined by the mask. More... | |
template<int scale = 4> | |
void | scatter_mask (int mask, value_t *baseptr, const vint_t &vindex) const |
template<int scale> | |
OIIO_FORCEINLINE void | gather (const value_t *baseptr, const vint_t &vindex) |
template<int scale> | |
OIIO_FORCEINLINE void | gather_mask (const vbool_t &mask, const value_t *baseptr, const vint_t &vindex) |
template<int scale> | |
OIIO_FORCEINLINE void | scatter (value_t *baseptr, const vint_t &vindex) const |
template<int scale> | |
OIIO_FORCEINLINE void | scatter_mask (const vbool_t &mask, value_t *baseptr, const vint_t &vindex) const |
Static Public Member Functions | |
static const char * | type_name () |
static const vfloat8 | Zero () |
Return a vfloat8 with all components set to 0.0. More... | |
static const vfloat8 | One () |
Return a vfloat8 with all components set to 1.0. More... | |
static const vfloat8 | Iota (float start=0.0f, float step=1.0f) |
Protected Attributes | |
union { | |
simd_t m_simd | |
value_t m_val [paddedelements] | |
vfloat4 m_4 [2] | |
}; | |
Floating point 8-vector, accelerated by SIMD instructions when available.
typedef vbool8 simd::vfloat8::bool_t |
typedef vint8 simd::vfloat8::int_t |
typedef simd_raw_t<float,8>::type simd::vfloat8::simd_t |
typedef float simd::vfloat8::value_t |
typedef vbool8 simd::vfloat8::vbool_t |
typedef vfloat8 simd::vfloat8::vfloat_t |
typedef vint8 simd::vfloat8::vint_t |
|
inline |
|
inline |
|
inline |
|
inline |
|
explicit |
OIIO_FORCEINLINE simd::vfloat8::vfloat8 | ( | const vfloat4 & | lo, |
const vfloat4 & | hi | ||
) |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
OIIO_FORCEINLINE void simd::vfloat8::clear | ( | ) |
|
inline |
void simd::vfloat8::gather | ( | const value_t * | baseptr, |
const vint_t & | vindex | ||
) |
Load values from addresses (char*)basepatr + vindex[i]*scale.
OIIO_FORCEINLINE void simd::vfloat8::gather | ( | const value_t * | baseptr, |
const vint_t & | vindex | ||
) |
void simd::vfloat8::gather_mask | ( | const vbool_t & | mask, |
const value_t * | baseptr, | ||
const vint_t & | vindex | ||
) |
void simd::vfloat8::gather_mask | ( | int | mask, |
const value_t * | baseptr, | ||
const vint_t & | vindex | ||
) |
OIIO_FORCEINLINE void simd::vfloat8::gather_mask | ( | const vbool_t & | mask, |
const value_t * | baseptr, | ||
const vint_t & | vindex | ||
) |
OIIO_FORCEINLINE vfloat4 simd::vfloat8::hi | ( | ) | const |
|
static |
OIIO_FORCEINLINE vfloat4 simd::vfloat8::lo | ( | ) | const |
OIIO_FORCEINLINE void simd::vfloat8::load | ( | float | val | ) |
OIIO_FORCEINLINE void simd::vfloat8::load | ( | const float * | values | ) |
OIIO_FORCEINLINE void simd::vfloat8::load | ( | const float * | values, |
int | n | ||
) |
OIIO_FORCEINLINE void simd::vfloat8::load | ( | const unsigned short * | values | ) |
OIIO_FORCEINLINE void simd::vfloat8::load | ( | const short * | values | ) |
OIIO_FORCEINLINE void simd::vfloat8::load | ( | const unsigned char * | values | ) |
OIIO_FORCEINLINE void simd::vfloat8::load | ( | const char * | values | ) |
OIIO_FORCEINLINE void simd::vfloat8::load_mask | ( | int | mask, |
const value_t * | values | ||
) |
OIIO_FORCEINLINE void simd::vfloat8::load_mask | ( | const vbool_t & | mask, |
const value_t * | values | ||
) |
|
static |
|
inline |
OIIO_FORCEINLINE float simd::vfloat8::operator[] | ( | int | i | ) | const |
OIIO_FORCEINLINE float & simd::vfloat8::operator[] | ( | int | i | ) |
void simd::vfloat8::scatter | ( | value_t * | baseptr, |
const vint_t & | vindex | ||
) | const |
Store values at addresses (char*)basepatr + vindex[i]*scale.
OIIO_FORCEINLINE void simd::vfloat8::scatter | ( | value_t * | baseptr, |
const vint_t & | vindex | ||
) | const |
void simd::vfloat8::scatter_mask | ( | const vbool_t & | mask, |
value_t * | baseptr, | ||
const vint_t & | vindex | ||
) | const |
Scatter elements defined by the mask.
void simd::vfloat8::scatter_mask | ( | int | mask, |
value_t * | baseptr, | ||
const vint_t & | vindex | ||
) | const |
OIIO_FORCEINLINE void simd::vfloat8::scatter_mask | ( | const vbool_t & | mask, |
value_t * | baseptr, | ||
const vint_t & | vindex | ||
) | const |
OIIO_FORCEINLINE void simd::vfloat8::set_w | ( | value_t | val | ) |
OIIO_FORCEINLINE void simd::vfloat8::set_x | ( | value_t | val | ) |
OIIO_FORCEINLINE void simd::vfloat8::set_y | ( | value_t | val | ) |
OIIO_FORCEINLINE void simd::vfloat8::set_z | ( | value_t | val | ) |
OIIO_FORCEINLINE void simd::vfloat8::store | ( | float * | values | ) | const |
OIIO_FORCEINLINE void simd::vfloat8::store | ( | float * | values, |
int | n | ||
) | const |
OIIO_FORCEINLINE void simd::vfloat8::store_mask | ( | int | mask, |
value_t * | values | ||
) | const |
OIIO_FORCEINLINE void simd::vfloat8::store_mask | ( | const vbool_t & | mask, |
value_t * | values | ||
) | const |
|
inlinestatic |
OIIO_FORCEINLINE float simd::vfloat8::w | ( | ) | const |
OIIO_FORCEINLINE float simd::vfloat8::x | ( | ) | const |
OIIO_FORCEINLINE float simd::vfloat8::y | ( | ) | const |
OIIO_FORCEINLINE float simd::vfloat8::z | ( | ) | const |
|
static |
|
friend |
union { ... } |
value_t simd::vfloat8::m_val[paddedelements] |