Loads a vector from two floating-point values at a given memory address.
d=vec_ld2(a, b)
d=vec_ld2a(a, b)
The following table describes the types of the returned value and the function arguments.
d | a | b |
---|---|---|
vector4double | long | double* |
float* |
The effective address (EA) is the sum of a and b. The effective address is truncated to an n-byte alignment depending on the type of b as shown in the following table. n bytes of memory are loaded from memory starting at the effective address and replicated to fill the result.
Type of b | ||
---|---|---|
double* | float* | |
n | 16 | 8 |
vec_ld2a generates an exception (SIGBUS) if the effective address is not aligned to the appropriate memory boundary indicated in the table.
If b is a pointer to a variable of the single-precision floating-point type, the values loaded from memory are converted to double precision before being saved to the result value.
The following table shows the formulas depending on the type of b.
Type of b | ||
---|---|---|
double* | float* | |
d[0] | Memory[EA] | (double) Memory_SP[EA] |
d[1] | Memory[EA+8] | (double) Memory_SP[EA+4] |
d[2] | Memory[EA] | (double) Memory_SP[EA] |
d[3] | Memory[EA+8] | (double) Memory_SP[EA+4] |
Type of b | ||
---|---|---|
double* | float* | |
Memory values | 10.0, 20.0 | 10.0f, 20.0f |
d | (10.0, 20.0, 10.0, 20.0) |