vec_sts, vec_stsa

Purpose

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

Syntax

vec_sts(a, b, c)
vec_stsa(a, b, c)

Argument types

The following table describes the types of the function arguments.

a b c
vector4double long double* (only for vec_sts)
float* (only for vec_sts)
_Complex double*
_Complex float*

Result

The effective address (EA) is the sum of b and c. If c is a pointer to a complex value, the effective address is truncated to an n-byte alignment depending on the type of c as shown in the following table. The value of a is then stored to the effective address as follows:
  • If c is a pointer to a variable of floating-point type, the first element of a is stored to memory.
  • If c is a pointer to a variable of complex type, the first two elements of a are stored to memory.
  Type of c
  _Complex double* _Complex float*
n 16 8

vec_stsa 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 or single-precision complex type, the elements of a are converted to single precision before being saved to memory.

Formula

The following tables show the formulas depending on the type of c.

  Type of c
  double* _Complex double* float* _Complex float*
Formula Memory[EA] = a[0] Memory[EA] = a[0]
Memory[EA+8] = a[1]
Memory_SP[EA] = (float) a[0] 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* _Complex double* float* _Complex float*
a (10.0, 20.0, 30.0, 40.0)
Memory values 10.0 (10.0, 20.0) 10.0f (10.0f, 20.0f)