simdpp::splat(scalar)

From cppreference.com
template<class V>
V splat( Arithmetic v0 );
(1)
_DETAIL_ splat( Arithmetic v0 );
(2)

Loads a value from a register and broadcasts it to all elements of a vector. The argument value is converted to the element of the resulting vector using standard conversions.

The implementation behaves as if the following set of overloads is provided:

Arithmetic
int
long
long long
unsigned
unsigned long
unsigned long long
float
double

The first set of overloads loads to given non-mask vector type.

The second set of overloads returns a value of unspecified type with which any non-mask vector can be initialized. E.g. uint32<4> x = splat(19);

Contents

Parameters

v0 - value to initialize all elements within the vector to

Return value

(1) Vector that contains the given value in all its elements.

(2) An value of unspecified type that can initialize a vector with the given value as if the first version of the function was executed.

Equivalent operation

r = [ v0 v0 v0 v0 ... v0 ]

See also