vec_ld, vec_lda

Purpose

Loads a vector from the given memory address.

Syntax

d=vec_ld(a, b)
d=vec_lda(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 long*
unsigned long*
long long*
unsigned long long*
float*
_Complex float*
double*
_Complex double*

Result value

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. The result is the content of the n bytes of memory starting at the effective address.

Type of b n
long*
unsigned long*
long long*
unsigned long long*
32
float* 16
_Complex float*
double* 32
_Complex double*

vec_lda 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 Formula
long*
unsigned long*
long long*
unsigned long long*
d[0]=Memory[EA]
d[1]=Memory[EA+8]
d[2]=Memory[EA+16]
d[3]=Memory[EA+24]
float*
d[0]=(double) Memory_SP[EA]
d[1]=(double) Memory_SP[EA+4]
d[2]=(double) Memory_SP[EA+8]
d[3]=(double) Memory_SP[EA+12]
_Complex float*
double*
d[0]=Memory[EA]
d[1]=Memory[EA+8]
d[2]=Memory[EA+16]
d[3]=Memory[EA+24]
_Complex double*
Note: Memory_SP[] is a single-precision floating-point array.

Example

Type of b Memory values d
long*
unsigned long*
long long*
unsigned long long*
0x4024000000000000,
0x4034000000000000,
0x403E000000000000,
0x4044000000000000
(10.0, 20.0, 30.0, 40.0)
float* 10.0f, 20.0f, 30.0f, 40.0f (10.0, 20.0, 30.0, 40.0)
_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)