Returns a vector that contains some elements of two vectors, in the order specified by a third vector.
d=vec_perm(a, b, c)
The following table describes the types of the returned value and the function arguments.
d | a | b | c |
---|---|---|---|
vector4double | vector4double | vector4double | vector4double |
The value of each element of the result is the element of the concatenation of a and b that is specified by bits 0:2 of the mantissa of the corresponding element of c.
Each element of c must have an exponent equal to 0x400, or the corresponding element of the result is undefined.
Concat = ( a[0], a[1], a[2], a[3],
b[0], b[1], b[2], b[3] )
d[0] = Concat[Mantissa02(c[0])]
d[1] = Concat[Mantissa02(c[1])]
d[2] = Concat[Mantissa02(c[2])]
d[3] = Concat[Mantissa02(c[3])]
If a = (10.0, 20.0, 30.0, 40.0), b = (50.0, 60.0, 70.0, 80.0), and the mantissas of the elements of c = (2,3,4,5), the result value is (30.0, 40.0, 50.0, 60.0).