vec_st2, vec_st2a

Purpose

Stores the first two elements of a quad vector to memory at the given address.

Syntax

vec_st2(a, b, c)
vec_st2a(a, b, c)

Argument types

The following table describes the types of the function arguments.

a b c
vector4double long double*
float*

Result

The effective address (EA) is the sum of b and c. The effective address is truncated to an n-byte alignment depending on the type of c as shown in the following table. The first two elements of a are then stored at the effective address.

  Type of c
  double* float*
n 16 8

vec_st2a generates an exception (SIGBUS) if the effective address is not aligned to the appropriate memory boundary indicated in the table.

If c is a pointer to a variable of single-precision floating-point type, the elements of a are converted to single precision before being saved to memory.

Formula

The following table shows the formulas depending on the type of c.

  Type of c
  double* float*
Formula Memory[EA]=a[0]
Memory[EA+8]=a[1]
Memory_SP[EA]=(float) a[0]
Memory_SP[EA+4]=(float) a[1]
Note: Memory_SP[] is a single-precision floating-point array.

Examples

  Type of c
  double* float*
a (10.0, 20.0, 30.0, 40.0)
Memory values 10.0, 20.0 10.0f, 20.0f