vec_lds, vec_ldsa

Purpose

Loads a vector from a single floating-point or complex value at the given memory address.

Syntax

d=vec_lds(a, b)
d=vec_ldsa(a, b)

Result and argument types

The following table describes the types of the returned value and the function arguments.

d a b
vector4double long double* (only for vec_lds)
float* (only for vec_lds)
_Complex double*
_Complex float*

Result value

The effective address (EA) is the sum of a and b. If b is a pointer to a complex value, the effective address is truncated to an n-byte alignment depending on the type of b as shown in the following table. The loaded value or complex value is replicated to fill the result.

  Type of b
  _Complex double* _Complex float*
n 16 8

vec_ldsa 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 or single-precision complex type, the values loaded from memory are converted to double precision before being saved to the result value.

Formula

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

  Type of b
  double* float* _Complex double* _Complex float*
d[0] Memory[EA] (double) Memory_SP[EA] Memory[EA] (double) Memory_SP[EA]
d[1] Memory[EA] (double) Memory_SP[EA] Memory[EA+8] (double) Memory_SP[EA+4]
d[2] Memory[EA] (double) Memory_SP[EA] Memory[EA] (double) Memory_SP[EA]
d[3] Memory[EA] (double) Memory_SP[EA] Memory[EA+8] (double) Memory_SP[EA+4]
Note: Memory_SP[] is a single-precision floating-point array.

Example

  Type of b
  double* float* _Complex double* _Complex float*
Memory values 10.0 10.0f (10.0, 20.0) (10.0f, 20.0f)
d (10.0, 10.0, 10.0, 10.0) (10.0, 20.0, 10.0, 20.0)