vSMC
vSMC: Scalable Monte Carlo
Classes | Namespaces | Macros | Typedefs | Functions
simd.hpp File Reference
#include <vsmc/internal/common.hpp>
#include <emmintrin.h>
#include <immintrin.h>

Go to the source code of this file.

Classes

class  vsmc::internal::M128TypeTrait< RealType >
 
class  vsmc::internal::M128TypeTrait< double >
 
class  vsmc::internal::M128TypeTrait< float >
 
class  vsmc::internal::M256TypeTrait< RealType >
 
class  vsmc::internal::M256TypeTrait< double >
 
class  vsmc::internal::M256TypeTrait< float >
 
class  vsmc::M128
 __m128 More...
 
class  vsmc::M128D
 __m128d More...
 
class  vsmc::M128I< IntType >
 Using __m128i as integer vector. More...
 
class  vsmc::M256
 __m256 More...
 
class  vsmc::M256D
 __m256d More...
 
class  vsmc::M256I< IntType >
 Using __mm256i as integer vector. More...
 

Namespaces

 vsmc
 
 vsmc::internal
 

Macros

#define VSMC_DEFINE_UTILITY_SIMD_INTEGER_BINARY_OP( Type, CType, op, bin, assign)
 
#define VSMC_DEFINE_UTILITY_SIMD_REAL_BINARY_OP(Type, CType, op, bin, assign)
 

Typedefs

template<typename T >
using vsmc::M128Type = typename std::conditional< std::is_integral< T >::value, M128I< T >, typename internal::M128TypeTrait< T >::type >::type
 floating point SSE2 type More...
 
template<typename T >
using vsmc::M256Type = typename std::conditional< std::is_integral< T >::value, M256I< T >, typename internal::M256TypeTrait< T >::type >::type
 floating point SSE2 type More...
 

Functions

template<typename T >
M128I< T > vsmc::internal::m128i_add (const M128I< T > &a, const M128I< T > &b, std::integral_constant< std::size_t, sizeof(std::int8_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_add (const M128I< T > &a, const M128I< T > &b, std::integral_constant< std::size_t, sizeof(std::int16_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_add (const M128I< T > &a, const M128I< T > &b, std::integral_constant< std::size_t, sizeof(std::int32_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_add (const M128I< T > &a, const M128I< T > &b, std::integral_constant< std::size_t, sizeof(std::int64_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_slli (const M128I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int8_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_slli (const M128I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int16_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_slli (const M128I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int32_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_slli (const M128I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int64_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_srli (const M128I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int8_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_srli (const M128I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int16_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_srli (const M128I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int32_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_srli (const M128I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int64_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_sub (const M128I< T > &a, const M128I< T > &b, std::integral_constant< std::size_t, sizeof(std::int8_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_sub (const M128I< T > &a, const M128I< T > &b, std::integral_constant< std::size_t, sizeof(std::int16_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_sub (const M128I< T > &a, const M128I< T > &b, std::integral_constant< std::size_t, sizeof(std::int32_t)>)
 
template<typename T >
M128I< T > vsmc::internal::m128i_sub (const M128I< T > &a, const M128I< T > &b, std::integral_constant< std::size_t, sizeof(std::int64_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_add (const M256I< T > &a, const M256I< T > &b, std::integral_constant< std::size_t, sizeof(std::int8_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_add (const M256I< T > &a, const M256I< T > &b, std::integral_constant< std::size_t, sizeof(std::int16_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_add (const M256I< T > &a, const M256I< T > &b, std::integral_constant< std::size_t, sizeof(std::int32_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_add (const M256I< T > &a, const M256I< T > &b, std::integral_constant< std::size_t, sizeof(std::int64_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_slli (const M256I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int8_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_slli (const M256I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int16_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_slli (const M256I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int32_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_slli (const M256I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int64_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_srli (const M256I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int8_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_srli (const M256I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int16_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_srli (const M256I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int32_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_srli (const M256I< T > &a, int imm8, std::integral_constant< std::size_t, sizeof(std::int64_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_sub (const M256I< T > &a, const M256I< T > &b, std::integral_constant< std::size_t, sizeof(std::int8_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_sub (const M256I< T > &a, const M256I< T > &b, std::integral_constant< std::size_t, sizeof(std::int16_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_sub (const M256I< T > &a, const M256I< T > &b, std::integral_constant< std::size_t, sizeof(std::int32_t)>)
 
template<typename T >
M256I< T > vsmc::internal::m256i_sub (const M256I< T > &a, const M256I< T > &b, std::integral_constant< std::size_t, sizeof(std::int64_t)>)
 
template<typename T >
bool vsmc::operator!= (const M128I< T > &a, const M128I< T > &b)
 
bool vsmc::operator!= (const M128 &a, const M128 &b)
 
bool vsmc::operator!= (const M128D &a, const M128D &b)
 
template<typename T >
bool vsmc::operator!= (const M256I< T > &a, const M256I< T > &b)
 
bool vsmc::operator!= (const M256 &a, const M256 &b)
 
bool vsmc::operator!= (const M256D &a, const M256D &b)
 
template<typename T >
M128I< T > vsmc::operator& (const M128I< T > &a, const M128I< T > &b)
 
template<typename T >
M128I< T > vsmc::operator& (const M128I< T > &a, T b)
 
template<typename T >
M128I< T > vsmc::operator& (T a, const M128I< T > &b)
 
template<typename T >
M256I< T > vsmc::operator& (const M256I< T > &a, const M256I< T > &b)
 
template<typename T >
M256I< T > vsmc::operator& (const M256I< T > &a, T b)
 
template<typename T >
M256I< T > vsmc::operator& (T a, const M256I< T > &b)
 
template<typename T >
M128I< T > & vsmc::operator&= (M128I< T > &a, const M128I< T > &b)
 
template<typename T >
M128I< T > & vsmc::operator&= (M128I< T > &a, T b)
 
template<typename T >
M256I< T > & vsmc::operator&= (M256I< T > &a, const M256I< T > &b)
 
template<typename T >
M256I< T > & vsmc::operator&= (M256I< T > &a, T b)
 
M128 vsmc::operator* (const M128 &a, const M128 &b)
 
M128 vsmc::operator* (const M128 &a, float b)
 
M128 vsmc::operator* (float a, const M128 &b)
 
M128D vsmc::operator* (const M128D &a, const M128D &b)
 
M128D vsmc::operator* (const M128D &a, double b)
 
M128D vsmc::operator* (double a, const M128D &b)
 
M256 vsmc::operator* (const M256 &a, const M256 &b)
 
M256 vsmc::operator* (const M256 &a, float b)
 
M256 vsmc::operator* (float a, const M256 &b)
 
M256D vsmc::operator* (const M256D &a, const M256D &b)
 
M256D vsmc::operator* (const M256D &a, double b)
 
M256D vsmc::operator* (double a, const M256D &b)
 
M128 & vsmc::operator*= (M128 &a, const M128 &b)
 
M128 & vsmc::operator*= (M128 &a, float b)
 
M128D & vsmc::operator*= (M128D &a, const M128D &b)
 
M128D & vsmc::operator*= (M128D &a, double b)
 
M256 & vsmc::operator*= (M256 &a, const M256 &b)
 
M256 & vsmc::operator*= (M256 &a, float b)
 
M256D & vsmc::operator*= (M256D &a, const M256D &b)
 
M256D & vsmc::operator*= (M256D &a, double b)
 
template<typename T >
M128I< T > vsmc::operator+ (const M128I< T > &a, const M128I< T > &b)
 
template<typename T >
M128I< T > vsmc::operator+ (T a, const M128I< T > &b)
 
template<typename T >
M128I< T > vsmc::operator+ (const M128I< T > &a, T b)
 
M128 vsmc::operator+ (const M128 &a, const M128 &b)
 
M128 vsmc::operator+ (const M128 &a, float b)
 
M128 vsmc::operator+ (float a, const M128 &b)
 
M128D vsmc::operator+ (const M128D &a, const M128D &b)
 
M128D vsmc::operator+ (double a, const M128D &b)
 
M128D vsmc::operator+ (const M128D &a, double b)
 
template<typename T >
M256I< T > vsmc::operator+ (const M256I< T > &a, const M256I< T > &b)
 
template<typename T >
M256I< T > vsmc::operator+ (const M256I< T > &a, T b)
 
template<typename T >
M256I< T > vsmc::operator+ (T a, const M256I< T > &b)
 
M256 vsmc::operator+ (const M256 &a, const M256 &b)
 
M256 vsmc::operator+ (float a, const M256 &b)
 
M256 vsmc::operator+ (const M256 &a, float b)
 
M256D vsmc::operator+ (const M256D &a, const M256D &b)
 
M256D vsmc::operator+ (const M256D &a, double b)
 
M256D vsmc::operator+ (double a, const M256D &b)
 
template<typename T >
M128I< T > & vsmc::operator+= (M128I< T > &a, T b)
 
template<typename T >
M128I< T > & vsmc::operator+= (M128I< T > &a, const M128I< T > &b)
 
M128 & vsmc::operator+= (M128 &a, const M128 &b)
 
M128 & vsmc::operator+= (M128 &a, float b)
 
M128D & vsmc::operator+= (M128D &a, double b)
 
M128D & vsmc::operator+= (M128D &a, const M128D &b)
 
template<typename T >
M256I< T > & vsmc::operator+= (M256I< T > &a, T b)
 
template<typename T >
M256I< T > & vsmc::operator+= (M256I< T > &a, const M256I< T > &b)
 
M256 & vsmc::operator+= (M256 &a, const M256 &b)
 
M256 & vsmc::operator+= (M256 &a, float b)
 
M256D & vsmc::operator+= (M256D &a, const M256D &b)
 
M256D & vsmc::operator+= (M256D &a, double b)
 
template<typename T >
M128I< T > vsmc::operator- (const M128I< T > &a, const M128I< T > &b)
 
template<typename T >
M128I< T > vsmc::operator- (const M128I< T > &a, T b)
 
template<typename T >
M128I< T > vsmc::operator- (T a, const M128I< T > &b)
 
M128 vsmc::operator- (const M128 &a, const M128 &b)
 
M128 vsmc::operator- (float a, const M128 &b)
 
M128 vsmc::operator- (const M128 &a, float b)
 
M128D vsmc::operator- (const M128D &a, const M128D &b)
 
M128D vsmc::operator- (const M128D &a, double b)
 
M128D vsmc::operator- (double a, const M128D &b)
 
template<typename T >
M256I< T > vsmc::operator- (const M256I< T > &a, const M256I< T > &b)
 
template<typename T >
M256I< T > vsmc::operator- (const M256I< T > &a, T b)
 
template<typename T >
M256I< T > vsmc::operator- (T a, const M256I< T > &b)
 
M256 vsmc::operator- (const M256 &a, const M256 &b)
 
M256 vsmc::operator- (float a, const M256 &b)
 
M256 vsmc::operator- (const M256 &a, float b)
 
M256D vsmc::operator- (const M256D &a, const M256D &b)
 
M256D vsmc::operator- (const M256D &a, double b)
 
M256D vsmc::operator- (double a, const M256D &b)
 
template<typename T >
M128I< T > & vsmc::operator-= (M128I< T > &a, const M128I< T > &b)
 
template<typename T >
M128I< T > & vsmc::operator-= (M128I< T > &a, T b)
 
M128 & vsmc::operator-= (M128 &a, float b)
 
M128 & vsmc::operator-= (M128 &a, const M128 &b)
 
M128D & vsmc::operator-= (M128D &a, const M128D &b)
 
M128D & vsmc::operator-= (M128D &a, double b)
 
template<typename T >
M256I< T > & vsmc::operator-= (M256I< T > &a, T b)
 
template<typename T >
M256I< T > & vsmc::operator-= (M256I< T > &a, const M256I< T > &b)
 
M256 & vsmc::operator-= (M256 &a, float b)
 
M256 & vsmc::operator-= (M256 &a, const M256 &b)
 
M256D & vsmc::operator-= (M256D &a, const M256D &b)
 
M256D & vsmc::operator-= (M256D &a, double b)
 
M128 vsmc::operator/ (const M128 &a, const M128 &b)
 
M128 vsmc::operator/ (const M128 &a, float b)
 
M128 vsmc::operator/ (float a, const M128 &b)
 
M128D vsmc::operator/ (const M128D &a, const M128D &b)
 
M128D vsmc::operator/ (const M128D &a, double b)
 
M128D vsmc::operator/ (double a, const M128D &b)
 
M256 vsmc::operator/ (const M256 &a, const M256 &b)
 
M256 vsmc::operator/ (float a, const M256 &b)
 
M256 vsmc::operator/ (const M256 &a, float b)
 
M256D vsmc::operator/ (const M256D &a, const M256D &b)
 
M256D vsmc::operator/ (double a, const M256D &b)
 
M256D vsmc::operator/ (const M256D &a, double b)
 
M128 & vsmc::operator/= (M128 &a, const M128 &b)
 
M128 & vsmc::operator/= (M128 &a, float b)
 
M128D & vsmc::operator/= (M128D &a, double b)
 
M128D & vsmc::operator/= (M128D &a, const M128D &b)
 
M256 & vsmc::operator/= (M256 &a, float b)
 
M256 & vsmc::operator/= (M256 &a, const M256 &b)
 
M256D & vsmc::operator/= (M256D &a, double b)
 
M256D & vsmc::operator/= (M256D &a, const M256D &b)
 
template<typename CharT , typename Traits , typename T >
std::basic_ostream< CharT, Traits > & vsmc::operator<< (std::basic_ostream< CharT, Traits > &os, const M128I< T > &a)
 
template<typename T >
M128I< T > vsmc::operator<< (const M128I< T > &a, int imm8)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & vsmc::operator<< (std::basic_ostream< CharT, Traits > &os, const M128 &a)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & vsmc::operator<< (std::basic_ostream< CharT, Traits > &os, const M128D &a)
 
template<typename CharT , typename Traits , typename T >
std::basic_ostream< CharT, Traits > & vsmc::operator<< (std::basic_ostream< CharT, Traits > &os, const M256I< T > &a)
 
template<typename T >
M256I< T > vsmc::operator<< (const M256I< T > &a, int imm8)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & vsmc::operator<< (std::basic_ostream< CharT, Traits > &os, const M256 &a)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & vsmc::operator<< (std::basic_ostream< CharT, Traits > &os, const M256D &a)
 
template<typename T >
M128I< T > vsmc::operator<<= (M128I< T > &a, int imm8)
 
template<typename T >
M256I< T > vsmc::operator<<= (M256I< T > &a, int imm8)
 
template<typename T >
bool vsmc::operator== (const M128I< T > &a, const M128I< T > &b)
 
bool vsmc::operator== (const M128 &a, const M128 &b)
 
bool vsmc::operator== (const M128D &a, const M128D &b)
 
template<typename T >
bool vsmc::operator== (const M256I< T > &a, const M256I< T > &b)
 
bool vsmc::operator== (const M256 &a, const M256 &b)
 
bool vsmc::operator== (const M256D &a, const M256D &b)
 
template<typename CharT , typename Traits , typename T >
std::basic_istream< CharT, Traits > & vsmc::operator>> (std::basic_istream< CharT, Traits > &is, M128I< T > &a)
 
template<typename T >
M128I< T > vsmc::operator>> (const M128I< T > &a, int imm8)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & vsmc::operator>> (std::basic_istream< CharT, Traits > &is, M128 &a)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & vsmc::operator>> (std::basic_istream< CharT, Traits > &is, M128D &a)
 
template<typename CharT , typename Traits , typename T >
std::basic_istream< CharT, Traits > & vsmc::operator>> (std::basic_istream< CharT, Traits > &is, M256I< T > &a)
 
template<typename T >
M256I< T > vsmc::operator>> (const M256I< T > &a, int imm8)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & vsmc::operator>> (std::basic_istream< CharT, Traits > &is, M256 &a)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & vsmc::operator>> (std::basic_istream< CharT, Traits > &is, M256D &a)
 
template<typename T >
M128I< T > vsmc::operator>>= (M128I< T > &a, int imm8)
 
template<typename T >
M256I< T > vsmc::operator>>= (M256I< T > &a, int imm8)
 
template<typename T >
M128I< T > vsmc::operator^ (const M128I< T > &a, const M128I< T > &b)
 
template<typename T >
M128I< T > vsmc::operator^ (T a, const M128I< T > &b)
 
template<typename T >
M128I< T > vsmc::operator^ (const M128I< T > &a, T b)
 
template<typename T >
M256I< T > vsmc::operator^ (const M256I< T > &a, const M256I< T > &b)
 
template<typename T >
M256I< T > vsmc::operator^ (T a, const M256I< T > &b)
 
template<typename T >
M256I< T > vsmc::operator^ (const M256I< T > &a, T b)
 
template<typename T >
M128I< T > & vsmc::operator^= (M128I< T > &a, const M128I< T > &b)
 
template<typename T >
M128I< T > & vsmc::operator^= (M128I< T > &a, T b)
 
template<typename T >
M256I< T > & vsmc::operator^= (M256I< T > &a, T b)
 
template<typename T >
M256I< T > & vsmc::operator^= (M256I< T > &a, const M256I< T > &b)
 
template<typename T >
M128I< T > vsmc::operator| (const M128I< T > &a, const M128I< T > &b)
 
template<typename T >
M128I< T > vsmc::operator| (T a, const M128I< T > &b)
 
template<typename T >
M128I< T > vsmc::operator| (const M128I< T > &a, T b)
 
template<typename T >
M256I< T > vsmc::operator| (const M256I< T > &a, const M256I< T > &b)
 
template<typename T >
M256I< T > vsmc::operator| (T a, const M256I< T > &b)
 
template<typename T >
M256I< T > vsmc::operator| (const M256I< T > &a, T b)
 
template<typename T >
M128I< T > & vsmc::operator|= (M128I< T > &a, T b)
 
template<typename T >
M128I< T > & vsmc::operator|= (M128I< T > &a, const M128I< T > &b)
 
template<typename T >
M256I< T > & vsmc::operator|= (M256I< T > &a, T b)
 
template<typename T >
M256I< T > & vsmc::operator|= (M256I< T > &a, const M256I< T > &b)
 

Macro Definition Documentation

#define VSMC_DEFINE_UTILITY_SIMD_INTEGER_BINARY_OP (   Type,
  CType,
  op,
  bin,
  assign 
)

Definition at line 37 of file simd.hpp.

#define VSMC_DEFINE_UTILITY_SIMD_REAL_BINARY_OP (   Type,
  CType,
  op,
  bin,
  assign 
)
Value:
inline Type &assign(Type &a, const Type &b) \
{ \
a = a op b; \
\
return a; \
} \
\
inline Type bin(const Type &a, CType b) \
{ \
Type x; \
x.set1(b); \
\
return a + x; \
} \
\
inline Type bin(CType a, const Type &b) \
{ \
Type x; \
x.set1(a); \
\
return x + b; \
} \
\
inline Type &assign(Type &a, CType b) \
{ \
a = a + b; \
\
return a; \
}

Definition at line 73 of file simd.hpp.