AVIR
High-quality pro image resizing library
 
Loading...
Searching...
No Matches
avir::float8 Class Reference

SIMD packed 8-float type. More...

#include <avir_float8_avx.h>

Public Member Functions

 float8 (const __m256 s)
 
 float8 (const double s)
 
 float8 (const float s)
 
 float8 (const float8 &s)
 
 float8 (const int s)
 
float hadd () const
 Returns horizontal sum of elements.
 
 operator float () const
 
float8 operator* (const float8 &s) const
 
float8operator*= (const float8 &s)
 
float8 operator+ (const float8 &s) const
 
float8operator+= (const float8 &s)
 
float8 operator- (const float8 &s) const
 
float8operator-= (const float8 &s)
 
float8 operator/ (const float8 &s) const
 
float8operator/= (const float8 &s)
 
float8operator= (const __m256 s)
 
float8operator= (const float s)
 
float8operator= (const float8 &s)
 
void store (float *const p) const
 Stores this value to the specified memory location.
 
void storeu (float *const p) const
 Stores this value to the specified memory location.
 
void storeu (float *p, int lim) const
 Stores "lim" lower elements of this value to the specified memory location.
 

Static Public Member Functions

static void addu (float *const p, const float8 &v)
 Performs in-place addition of a value located in memory, and the specified value.
 
static void addu (float *const p, const float8 &v, const int lim)
 Performs in-place addition of a value located in memory, and the specified value. Limited to the specfied number of elements.
 
static float8 load (const float *const p)
 Returns float8 value loaded from the specified memory location.
 
static float8 loadu (const float *const p)
 Returns float8 value loaded from the specified memory location.
 
static float8 loadu (const float *const p, const int lim)
 Returns float8 value loaded from the specified memory location, with elements beyond "lim" set to 0.
 

Public Attributes

__m256 value
 Packed value of 8 floats.
 

Detailed Description

SIMD packed 8-float type.

This class implements a packed 8-float type that can be used to perform parallel computation using SIMD instructions on AVX-enabled processors. This class can be used as the "fptype" argument of the avir::fpclass_def or avir::fpclass_def_dil class.

Member Function Documentation

◆ addu() [1/2]

static void avir::float8::addu ( float *const p,
const float8 & v )
static

Performs in-place addition of a value located in memory, and the specified value.

Parameters
pPointer to value where addition happens. May be unaligned.
vValue to add.

◆ addu() [2/2]

static void avir::float8::addu ( float *const p,
const float8 & v,
const int lim )
static

Performs in-place addition of a value located in memory, and the specified value. Limited to the specfied number of elements.

Parameters
pPointer to value where addition happens. May be unaligned.
vValue to add.
limThe element number limit, greater than 0.

◆ load()

static float8 avir::float8::load ( const float *const p)
static

Returns float8 value loaded from the specified memory location.

Parameters
pPointer to memory from where the value should be loaded, should be 32-byte aligned.
Returns
Loaded value.

◆ loadu() [1/2]

static float8 avir::float8::loadu ( const float *const p)
static

Returns float8 value loaded from the specified memory location.

Parameters
pPointer to memory from where the value should be loaded, may have any alignment.
Returns
Loaded value.

◆ loadu() [2/2]

static float8 avir::float8::loadu ( const float *const p,
const int lim )
static

Returns float8 value loaded from the specified memory location, with elements beyond "lim" set to 0.

Parameters
pPointer to memory from where the value should be loaded, may have any alignment.
limThe maximum number of elements to load, greater than 0.
Returns
Loaded value.

◆ store()

void avir::float8::store ( float *const p) const

Stores this value to the specified memory location.

Parameters
[out]pOutput memory location, should be 32-byte aligned.

◆ storeu() [1/2]

void avir::float8::storeu ( float *const p) const

Stores this value to the specified memory location.

Parameters
[out]pOutput memory location, may have any alignment.

◆ storeu() [2/2]

void avir::float8::storeu ( float * p,
int lim ) const

Stores "lim" lower elements of this value to the specified memory location.

Parameters
[out]pOutput memory location, may have any alignment.
limThe number of lower elements to store, greater than 0.