Vc  1.4.1
SIMD Vector Classes for C++
Vc Namespace Reference

Detailed Description

Vector Classes Namespace.

All functions and types of Vc are defined inside the Vc namespace.

Classes

struct  AlignedBase
 Helper class to ensure a given alignment. More...
 
class  Allocator
 An allocator that uses global new and supports over-aligned types, as per [C++11 20.6.9]. More...
 
struct  array
 This is std::array with additional subscript operators supporting gather and scatter operations. More...
 
class  CpuId
 This class is available for x86 / AMD64 systems to read and interpret information about the CPU's capabilities. More...
 
struct  Exclusive
 Hint for Prefetch to select prefetches that mark the memory as exclusive. More...
 
struct  ImplementationT
 This class identifies the specific implementation Vc uses in the current translation unit in terms of a type. More...
 
class  Mask
 The main SIMD mask class. More...
 
struct  Prefetch
 
struct  Shared
 Hint for Prefetch to select prefetches that mark the memory as shared. More...
 
class  SimdArray
 Data-parallel arithmetic type with user-defined number of elements. More...
 
class  SimdMaskArray
 Data-parallel mask type with user-defined number of boolean elements. More...
 
class  Vector
 The main vector class for expressing data parallelism. More...
 

Typedefs

using CurrentImplementation = ImplementationT< >
 Identifies the Vc implementation used in the current translation unit. More...
 
template<typename T , typename Allocator = std::allocator<T>>
using vector = Common::AdaptSubscriptOperator< std::vector< T, Allocator > >
 An adapted std::vector container with an additional subscript operator which implements gather and scatter operations. More...
 
using VectorAlignedBase = AlignedBase< Detail::max(alignof(Vector< float >), alignof(Vector< double >), alignof(Vector< ullong >), alignof(Vector< llong >), alignof(Vector< ulong >), alignof(Vector< long >), alignof(Vector< uint >), alignof(Vector< int >), alignof(Vector< ushort >), alignof(Vector< short >), alignof(Vector< uchar >), alignof(Vector< schar >))>
 Helper type to ensure suitable alignment for any Vc::Vector<T> type (using the default VectorAbi). More...
 
template<typename V >
using VectorAlignedBaseT = AlignedBase< alignof(V)>
 Variant of the above type ensuring suitable alignment only for the specified vector type V. More...
 
using MemoryAlignedBase = AlignedBase< Detail::max(Vector< float >::MemoryAlignment, Vector< double >::MemoryAlignment, Vector< ullong >::MemoryAlignment, Vector< llong >::MemoryAlignment, Vector< ulong >::MemoryAlignment, Vector< long >::MemoryAlignment, Vector< uint >::MemoryAlignment, Vector< int >::MemoryAlignment, Vector< ushort >::MemoryAlignment, Vector< short >::MemoryAlignment, Vector< uchar >::MemoryAlignment, Vector< schar >::MemoryAlignment)>
 Helper class to ensure suitable alignment for arrays of scalar objects for any Vc::Vector<T> type (using the default VectorAbi). More...
 
template<typename V >
using MemoryAlignedBaseT = AlignedBase< V::MemoryAlignment >
 Variant of the above type ensuring suitable alignment only for the specified vector type V. More...
 
typedef UnalignedTag DefaultLoadTag
 The default load tag type uses unaligned (non-streaming) loads.
 
typedef UnalignedTag DefaultStoreTag
 The default store tag type uses unaligned (non-streaming) stores.
 
template<typename T , size_t N = 0, typename MT = void>
using simdize = SimdizeDetail::simdize< T, N, MT >
 
template<typename T , ptrdiff_t Extent = dynamic_extent>
using span = Common::AdaptSubscriptOperator< Common::span< T, Extent > >
 An adapted std::span with additional subscript operators supporting gather and scatter operations. More...
 
using llong = long long
 long long shorthand
 
using ullong = unsigned long long
 unsigned long long shorthand
 
using ulong = unsigned long
 unsigned long shorthand
 
using uint = unsigned int
 unsigned int shorthand
 
using ushort = unsigned short
 unsigned short shorthand
 
using uchar = unsigned char
 unsigned char shorthand
 
using schar = signed char
 signed char shorthand
 
Vector Type Aliases
using double_v = Vector< double >
 vector of double precision
 
using float_v = Vector< float >
 vector of single precision
 
using int_v = Vector< int >
 vector of signed integers
 
using uint_v = Vector< uint >
 vector of unsigned integers
 
using short_v = Vector< short >
 vector of signed short integers
 
using ushort_v = Vector< ushort >
 vector of unsigned short integers
 
using llong_v = Vector< llong >
 
using ullong_v = Vector< ullong >
 
using long_v = Vector< long >
 
using ulong_v = Vector< ulong >
 
using schar_v = Vector< schar >
 
using uchar_v = Vector< uchar >
 
Mask Type Aliases
using double_m = Mask< double >
 mask type for double_v vectors
 
using float_m = Mask< float >
 mask type for float_v vectors
 
using llong_m = Mask< llong >
 
using ullong_m = Mask< ullong >
 
using long_m = Mask< long >
 
using ulong_m = Mask< ulong >
 
using int_m = Mask< int >
 mask type for int_v vectors
 
using uint_m = Mask< uint >
 mask type for uint_v vectors
 
using short_m = Mask< short >
 mask type for short_v vectors
 
using ushort_m = Mask< ushort >
 mask type for ushort_v vectors
 
using schar_m = Mask< schar >
 
using uchar_m = Mask< uchar >
 

Enumerations

enum  MallocAlignment { AlignOnVector, AlignOnCacheline, AlignOnPage }
 Enum that specifies the alignment and padding restrictions to use for memory allocation with Vc::malloc. More...
 
enum  Implementation : std::uint_least32_t {
  ScalarImpl, SSE2Impl, SSE3Impl, SSSE3Impl,
  SSE41Impl, SSE42Impl, AVXImpl, AVX2Impl,
  MICImpl
}
 Enum to identify a certain SIMD instruction set. More...
 
enum  ExtraInstructions : std::uint_least32_t {
  Float16cInstructions = 0x01000, Fma4Instructions = 0x02000, XopInstructions = 0x04000, PopcntInstructions = 0x08000,
  Sse4aInstructions = 0x10000, FmaInstructions = 0x20000, VexInstructions = 0x40000, Bmi2Instructions = 0x80000
}
 The list of available instructions is not easily described by a linear list of instruction sets. More...
 

Functions

Vc::Vector< T > sqrt (const Vc::Vector< T > &v)
 Returns the square root of v.
 
Vc::Vector< T > rsqrt (const Vc::Vector< T > &v)
 Returns the reciprocal square root of v.
 
Vc::Vector< T > reciprocal (const Vc::Vector< T > &v)
 Returns the reciprocal of v.
 
Vc::Vector< T > abs (const Vc::Vector< T > &v)
 Returns the absolute value of v.
 
Vc::Vector< T > round (const Vc::Vector< T > &v)
 Returns the closest integer to v; 0.5 is rounded to even.
 
Vc::Vector< T > log (const Vc::Vector< T > &v)
 
Vc::Vector< T > log2 (const Vc::Vector< T > &v)
 
Vc::Vector< T > log10 (const Vc::Vector< T > &v)
 
Vc::Vector< T > exp (const Vc::Vector< T > &v)
 
Vc::Vector< T > min (const Vc::Vector< T > &x, const Vc::Vector< T > &y)
 
Vc::Vector< T > max (const Vc::Vector< T > &x, const Vc::Vector< T > &y)
 
Vc::Vector< T > frexp (const Vc::Vector< T > &x, Vc::SimdArray< int, size()> *e)
 Convert floating-point number to fractional and integral components. More...
 
Vc::Vector< T > ldexp (Vc::Vector< T > x, Vc::SimdArray< int, size()> e)
 Multiply floating-point number by integral power of 2. More...
 
Vc::Mask< T > isfinite (const Vc::Vector< T > &x)
 
Vc::Mask< T > isnan (const Vc::Vector< T > &x)
 
Vc::Vector< T > fma (Vc::Vector< T > a, Vc::Vector< T > b, Vc::Vector< T > c)
 Multiplies a with b and then adds c, without rounding between the multiplication and the addition. More...
 
const char * versionString ()
 
constexpr unsigned int versionNumber ()
 
template<typename T , typename Abi >
std::ostream & operator<< (std::ostream &out, const Vc::Vector< T, Abi > &v)
 Prints the contents of a vector into a stream object. More...
 
template<typename T , typename Abi >
std::ostream & operator<< (std::ostream &out, const Vc::Mask< T, Abi > &m)
 Prints the contents of a mask into a stream object. More...
 
template<class InputIt , class UnaryFunction >
UnaryFunction simd_for_each (InputIt first, InputIt last, UnaryFunction f)
 Vc variant of the std::for_each algorithm. More...
 
template<typename V , typename M , typename A >
void deinterleave (V *a, V *b, const M *memory, A align)
 
template<typename Mask , typename T >
enable_if< is_simd_mask< Mask >::value &&is_simd_vector< T >::value, T > iif (const Mask &condition, const T &trueValue, const T &falseValue)
 Function to mimic the ternary operator '?:' (inline-if). More...
 
template<typename Mask , typename T >
enable_if< is_simd_mask< Mask >::value &&!is_simd_vector< T >::value, T > iif (const Mask &, const T &, const T &)=delete
 Function to mimic the ternary operator '?:' (inline-if). More...
 
template<typename T >
constexpr T iif (bool condition, const T &trueValue, const T &falseValue)
 Overload of the above for boolean conditions. More...
 
template<typename V , typename = enable_if<Traits::is_simd_vector<V>::value>>
std::pair< V, V > interleave (const V &a, const V &b)
 Interleaves the entries from a and b into two vectors of the same type. More...
 
template<typename V , typename S >
Common::InterleavedMemoryWrapper< S, V > make_interleave_wrapper (S *s)
 Creates an adapter around a given array of structure (AoS) that enables optimized loads. More...
 
template<typename Container , typename T >
constexpr auto makeContainer (std::initializer_list< T > list) -> decltype(make_container_helper< Container, T >::help(list))
 Construct a container of Vc vectors from a std::initializer_list of scalar entries. More...
 
template<typename T , Vc::MallocAlignment A>
T * malloc (size_t n)
 Allocates memory on the Heap with alignment and padding suitable for vectorized access. More...
 
template<typename T >
void free (T *p)
 Frees memory that was allocated with Vc::malloc. More...
 
template<typename To , typename From >
To simd_cast (From &&x, enable_if< std::is_same< To, Traits::decay< From >>::value >=nullarg)
 Casts the argument x from type From to type To. More...
 
template<typename To >
To simd_cast ()
 A cast from nothing results in default-initialization of To. More...
 
template<typename S , typename T , size_t N>
void assign (SimdizeDetail::Adapter< S, T, N > &a, size_t i, const S &x)
 Assigns one scalar object x to a SIMD slot at offset i in the simdized object a.
 
template<typename S , typename T , size_t N>
extract (const SimdizeDetail::Adapter< S, T, N > &a, size_t i)
 Extracts and returns one scalar object from a SIMD slot at offset i in the simdized object a.
 
template<typename T , typename Abi >
Vector< T, detail::not_fixed_size_abi< Abi > > sin (const Vector< T, Abi > &x)
 Returns the sine of all input values in x. More...
 
template<typename T , typename Abi >
Vector< T, detail::not_fixed_size_abi< Abi > > cos (const Vector< T, Abi > &x)
 Returns the cosine of all input values in x. More...
 
template<typename T , typename Abi >
Vector< T, detail::not_fixed_size_abi< Abi > > asin (const Vector< T, Abi > &x)
 Returns the arcsine of all input values in x. More...
 
template<typename T , typename Abi >
Vector< T, detail::not_fixed_size_abi< Abi > > atan (const Vector< T, Abi > &x)
 Returns the arctangent of all input values in x. More...
 
template<typename T , typename Abi >
Vector< T, detail::not_fixed_size_abi< Abi > > atan2 (const Vector< T, Abi > &y, const Vector< T, Abi > &x)
 Returns the arctangent of all input values in x and y. More...
 
template<typename T , typename Abi >
void sincos (const Vector< T, Abi > &x, Vector< T, detail::not_fixed_size_abi< Abi >> *sin, Vector< T, Abi > *cos)
 
template<typename T , typename Abi , typename = enable_if<std::is_floating_point<T>::value && !detail::is_fixed_size_abi<Abi>::value>>
Vector< T, Abi > copysign (Vector< T, Abi > magnitude, Vector< T, Abi > sign)
 Copies the sign(s) of sign to the value(s) in magnitude and returns the resulting vector. More...
 
template<typename T , typename Abi , typename = enable_if<std::is_floating_point<T>::value && !detail::is_fixed_size_abi<Abi>::value>>
Vector< T, Abi > exponent (Vector< T, Abi > x)
 Extracts the exponent of each floating-point vector component. More...
 
template<typename T , typename Abi >
Vector< T, detail::not_fixed_size_abi< Abi > >::MaskType isnegative (Vector< T, Abi > x)
 Returns for each vector component whether it stores a negative value. More...
 
template<typename V , typename T , typename Abi >
enable_if<(V::size()==Vector< T, Abi >::size() &&sizeof(typename V::VectorEntryType)==sizeof(typename Vector< T, Abi >::VectorEntryType) &&sizeof(V)==sizeof(Vector< T, Abi >) &&alignof(V)<=alignof(Vector< T, Abi >)), V > reinterpret_components_cast (const Vector< T, Abi > &x)
 Constructs a new Vector object of type V from the Vector x, reinterpreting the bits of x for the new type V. More...
 
template<typename M >
constexpr WhereImpl::WhereMask< M > where (const M &mask)
 Conditional assignment. More...
 
Micro-Architecture Feature Tests
unsigned int extraInstructionsSupported ()
 Determines the extra instructions supported by the current CPU. More...
 
bool isImplementationSupported (Vc::Implementation impl)
 Tests whether the given implementation is supported by the system the code is executing on. More...
 
Vc::Implementation bestImplementationSupported ()
 Determines the best supported implementation for the current system. More...
 
bool currentImplementationSupported ()
 Tests that the CPU and Operating System support the vector unit which was compiled for. More...
 
non-member begin & end

Implement the non-member begin & end functions in the Vc namespace so that ADL works and begin(some_vc_array) always works.

template<typename T , std::size_t N>
auto begin (array< T, N > &arr) -> decltype(arr.begin())
 
template<typename T , std::size_t N>
auto begin (const array< T, N > &arr) -> decltype(arr.begin())
 
template<typename T , std::size_t N>
auto end (array< T, N > &arr) -> decltype(arr.end())
 
template<typename T , std::size_t N>
auto end (const array< T, N > &arr) -> decltype(arr.end())
 
Boolean Reductions
template<typename Mask >
constexpr bool all_of (const Mask &m)
 Returns whether all entries in the mask m are true.
 
constexpr bool all_of (bool b)
 Returns b.
 
template<typename Mask >
constexpr bool any_of (const Mask &m)
 Returns whether at least one entry in the mask m is true.
 
constexpr bool any_of (bool b)
 Returns b.
 
template<typename Mask >
constexpr bool none_of (const Mask &m)
 Returns whether all entries in the mask m are false.
 
constexpr bool none_of (bool b)
 Returns !b.
 
template<typename Mask >
constexpr bool some_of (const Mask &m)
 Returns whether at least one entry in m is true and at least one entry in m is false.
 
constexpr bool some_of (bool)
 Returns false.
 
Math functions

These functions evaluate the

template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > min (const SimdArray< T, N, V, M > &x, const SimdArray< T, N, V, M > &y)
 Applies the std:: min function component-wise and concurrently.
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > max (const SimdArray< T, N, V, M > &x, const SimdArray< T, N, V, M > &y)
 Applies the std:: max function component-wise and concurrently.
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > abs (const SimdArray< T, N, V, M > &x)
 Applies the std:: abs function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > abs (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > asin (const SimdArray< T, N, V, M > &x)
 Applies the std:: asin function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > asin (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > atan (const SimdArray< T, N, V, M > &x)
 Applies the std:: atan function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > atan (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > atan2 (const SimdArray< T, N, V, M > &x, const SimdArray< T, N, V, M > &y)
 Applies the std:: atan2 function component-wise and concurrently.
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > ceil (const SimdArray< T, N, V, M > &x)
 Applies the std:: ceil function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > ceil (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > copysign (const SimdArray< T, N, V, M > &x, const SimdArray< T, N, V, M > &y)
 Applies the std:: copysign function component-wise and concurrently.
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > cos (const SimdArray< T, N, V, M > &x)
 Applies the std:: cos function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > cos (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > exp (const SimdArray< T, N, V, M > &x)
 Applies the std:: exp function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > exp (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > exponent (const SimdArray< T, N, V, M > &x)
 Applies the std:: exponent function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > exponent (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > floor (const SimdArray< T, N, V, M > &x)
 Applies the std:: floor function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > floor (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N>
SimdArray< T, N > fma (const SimdArray< T, N > &a, const SimdArray< T, N > &b, const SimdArray< T, N > &c)
 Applies the std::fma function component-wise and concurrently.
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd_mask< T, N > isfinite (const SimdArray< T, N, V, M > &x)
 Applies the std:: isfinite function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd_mask< T, N > isfinite (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd_mask< T, N > isinf (const SimdArray< T, N, V, M > &x)
 Applies the std:: isinf function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd_mask< T, N > isinf (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd_mask< T, N > isnan (const SimdArray< T, N, V, M > &x)
 Applies the std:: isnan function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd_mask< T, N > isnan (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd_mask< T, N > isnegative (const SimdArray< T, N, V, M > &x)
 Applies the std:: isnegative function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd_mask< T, N > isnegative (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N>
SimdArray< T, N > frexp (const SimdArray< T, N > &x, SimdArray< int, N > *e)
 Applies the std::frexp function component-wise and concurrently.
 
template<typename T , std::size_t N>
SimdArray< T, N > ldexp (const SimdArray< T, N > &x, const SimdArray< int, N > &e)
 Applies the std::ldexp function component-wise and concurrently.
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > log (const SimdArray< T, N, V, M > &x)
 Applies the std:: log function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > log (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > log10 (const SimdArray< T, N, V, M > &x)
 Applies the std:: log10 function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > log10 (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > log2 (const SimdArray< T, N, V, M > &x)
 Applies the std:: log2 function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > log2 (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > reciprocal (const SimdArray< T, N, V, M > &x)
 Applies the std:: reciprocal function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > reciprocal (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > round (const SimdArray< T, N, V, M > &x)
 Applies the std:: round function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > round (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > rsqrt (const SimdArray< T, N, V, M > &x)
 Applies the std:: rsqrt function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > rsqrt (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > sin (const SimdArray< T, N, V, M > &x)
 Applies the std:: sin function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > sin (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N>
void sincos (const SimdArray< T, N > &x, SimdArray< T, N > *sin, SimdArray< T, N > *cos)
 Determines sine and cosine concurrently and component-wise on x.
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > sqrt (const SimdArray< T, N, V, M > &x)
 Applies the std:: sqrt function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > sqrt (const fixed_size_simd< T, N > &x)
 
template<typename T , std::size_t N, typename V , std::size_t M>
fixed_size_simd< T, N > trunc (const SimdArray< T, N, V, M > &x)
 Applies the std:: trunc function component-wise and concurrently.
 
template<class T , int N>
fixed_size_simd< T, N > trunc (const fixed_size_simd< T, N > &x)
 
Arithmetic and Bitwise Operators

Applies the operator component-wise and concurrently on lhs and rhs and returns a new SimdArray object containing the result values.

This operator only participates in overload resolution if:

  • At least one of the template parameters L or R is a SimdArray type.
  • Either L or R is a fundamental arithmetic type but not an integral type larger than int
    or
    L or R is a Vc::Vector type with equal number of elements (Vector::size() == SimdArray::size()).

The return type of the operator is a SimdArray type using the more precise EntryType of L or R and the same number of elements as the SimdArray argument(s).

template<typename L , typename R >
result_vector_type< L, R > operator+ (L &&lhs, R &&rhs)
 Applies + component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R > operator- (L &&lhs, R &&rhs)
 Applies - component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R > operator* (L &&lhs, R &&rhs)
 Applies * component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R > operator/ (L &&lhs, R &&rhs)
 Applies / component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R > operator% (L &&lhs, R &&rhs)
 Applies % component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R > operator| (L &&lhs, R &&rhs)
 Applies | component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R > operator& (L &&lhs, R &&rhs)
 Applies & component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R > operator^ (L &&lhs, R &&rhs)
 Applies ^ component-wise and concurrently.
 
Compare Operators

Applies the operator component-wise and concurrently on lhs and rhs and returns a new SimdMaskArray object containing the result values.

This operator only participates in overload resolution if (same rules as above):

  • At least one of the template parameters L or R is a SimdArray type.
  • Either L or R is a fundamental arithmetic type but not an integral type larger than int
    or
    L or R is a Vc::Vector type with equal number of elements (Vector::size() == SimdArray::size()).

The return type of the operator is a SimdMaskArray type using the more precise EntryType of L or R and the same number of elements as the SimdArray argument(s).

template<typename L , typename R >
result_vector_type< L, R >::mask_type operator== (L &&lhs, R &&rhs)
 Applies == component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R >::mask_type operator!= (L &&lhs, R &&rhs)
 Applies != component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R >::mask_type operator<= (L &&lhs, R &&rhs)
 Applies <= component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R >::mask_type operator>= (L &&lhs, R &&rhs)
 Applies >= component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R >::mask_type operator< (L &&lhs, R &&rhs)
 Applies < component-wise and concurrently.
 
template<typename L , typename R >
result_vector_type< L, R >::mask_type operator> (L &&lhs, R &&rhs)
 Applies > component-wise and concurrently.
 

Variables

constexpr std::size_t VectorAlignment = alignof(VectorAlignedBase)
 Specifies the most conservative memory alignment necessary for Vector<T> objects with default VectorAbi. More...
 
constexpr std::size_t MemoryAlignment = alignof(MemoryAlignedBase)
 Specifies the most conservative memory alignment necessary for aligned loads and stores of Vector types. More...
 
constexpr AlignedTag Aligned
 Use this object for a flags parameter to request aligned loads and stores. More...
 
constexpr UnalignedTag Unaligned
 Use this object for a flags parameter to request unaligned loads and stores. More...
 
constexpr StreamingTag Streaming
 Use this object for a flags parameter to request streaming loads and stores. More...
 
constexpr LoadStoreFlags::LoadStoreFlags< PrefetchFlag<> > PrefetchDefault
 Use this object for a flags parameter to request default software prefetches to be emitted.
 
constexpr VectorSpecialInitializerZero Zero = {}
 The special object Vc::Zero can be used to construct Vector and Mask objects initialized to zero/false.
 
constexpr VectorSpecialInitializerOne One = {}
 The special object Vc::One can be used to construct Vector and Mask objects initialized to one/true.
 
constexpr VectorSpecialInitializerIndexesFromZero IndexesFromZero = {}
 The special object Vc::IndexesFromZero can be used to construct Vector objects initialized to values 0, 1, 2, 3, 4, ...
 

Function Documentation

◆ make_interleave_wrapper()

Common::InterleavedMemoryWrapper<S, V> Vc::make_interleave_wrapper ( S *  s)
inline

Creates an adapter around a given array of structure (AoS) that enables optimized loads.

  • deinterleaving operations / interleaving operations + stores for vector access (using V).
Template Parameters
VThe Vc::Vector<T> type to use per element of the structure.
Parameters
sA pointer to an array of structures containing data members of type T.
See also
Vc::Common::InterleavedMemoryWrapper

Definition at line 345 of file interleavedmemory.h.

Referenced by make_interleave_wrapper().

◆ simd_cast() [1/2]

To Vc::simd_cast ( From &&  x,
enable_if< std::is_same< To, Traits::decay< From >>::value >  = nullarg 
)
inline

Casts the argument x from type From to type To.

This function implements the trivial case where To and From are the same type.

Parameters
xThe object of type From to be converted to type To.
Returns
An object of type To with all vector components converted according to standard conversion behavior as mandated by the C++ standard for the underlying arithmetic types.

Definition at line 52 of file simd_cast.h.

◆ simd_cast() [2/2]

To Vc::simd_cast ( )
inline

A cast from nothing results in default-initialization of To.

This function can be useful in generic code where a parameter pack expands to nothing.

Returns
A zero-initialized object of type To.

Definition at line 64 of file simd_cast.h.