2.3.13 VectorZeroPad

Description

VectorZeroPad copies the contents of the source vector into the beginning of the destination vector, and then fills the remaining positions—specified by numZeros — with zeros to complete the destination vector.

dstV[n] = srcV[n], 0 ≤ n < numElems

dstV[n] = 0,  numElems ≤ n < numElems + numZeros

Prototype

fractional* VectorZeroPad (int numElems, int numZeros, fractional* dstV, fractional* srcV1);

Arguments

Parameters

Description

numElems

Number of elements in the source vectors

numZeros

Number of zeros

dstV

Pointer to the destination vector (of size numElems + numZeros)

srcV1

Pointer to the source vector

Returns

Pointer to the base address of the destination vector.

Remarks

The destination vector must already exist with exactly numElems + numZeros number of elements.

This function can be computed in place.

This function uses VectorCopy.

Source File

  • vzpad_aa.s

Function Profile

Device

Program Words

Cycles

PIC32A

9

12 + (numZeros)

Note:
  1. The above-mentioned program word and cycle counts pertain solely to VectorZeroPad. However, as this function inherently utilizes VectorCopy, the respective counts for VectorCopy must also be considered.
  2. In the description of VectorCopy, the number of cycles reported includes four cycles of C-function call overhead. Thus, the number of actual cycles from VectorCopy to add to VectorZeroPad is four less than whatever number is reported for a stand-alone VectorCopy.

System resource usage

  • W0…W5 - used, not restored
  • One REPEAT instruction(s)