Stores a vector to memory at the given address.
vec_st(a, b, c)
vec_sta(a, b, c)
The following table describes the types of the function arguments.
a | b | c |
---|---|---|
vector4double | long | int* |
unsigned* | ||
long* | ||
unsigned long* | ||
long long* | ||
unsigned long long* | ||
float* | ||
_Complex float* | ||
double* | ||
_Complex double* |
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 value of a is then stored at the effective address.
Type of c | n |
---|---|
int* unsigned* |
16 |
long* unsigned long* long long* unsigned long long* |
32 |
float* | 16 |
_Complex float* | |
double* | 32 |
_Complex double* |
vec_sta 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.
If c is a pointer to a variable of 4-byte integer type, the four low-order bytes of the elements of a are saved to memory.
The following table shows the formulas depending on the type of c.
Type of c | Formula |
---|---|
int* unsigned* |
|
long* unsigned long* long long* unsigned long long* |
|
float* |
|
_Complex float* | |
double* |
|
_Complex double* |
Type of c | a | Memory values |
---|---|---|
int* unsigned* |
(10, 20, 30, 40) | 10, 20, 30, 40 |
long* unsigned long* long long* unsigned long long* |
(10.0, 20.0, 30.0, 40.0) | 0x4024000000000000, 0x4034000000000000, 0x403E000000000000, 0x4044000000000000 |
float* | (10.0, 20.0, 30.0, 40.0) | 10.0f, 20.0f, 30.0f, 40.0f |
_Complex float* | (10.0f, 20.0f) (30.0f, 40.0f) | |
double* | 10.0, 20.0, 30.0, 40.0 | |
_Complex double* | (10.0, 20.0) (30.0, 40.0) |