vec_splat

Purpose

Returns a vector that has all of its elements set to a given value.

Syntax

d=vec_splat(a, b)

Result and argument types

The following table describes the types of the returned value and the function arguments.

d a b
vector4double vector4double int, a value in 0 - 3

Result value

The value of each element of the result is the value of the element of a specified by b.

Formula

d[0] = a[b]
d[1] = a[b]
d[2] = a[b]
d[3] = a[b]

Example

a = (10.0, 20.0, 30.0, 40.0)
b = 1
d: (20.0, 20.0, 20.0, 20.0)