2.3.12 VectorSubtract

Description

VectorSubtract subtracts the value of each element in the source one vector with its counterpart in the source two vector and places the result in the destination vector.

Prototype

fractional* VectorSubtract (int numElems, fractional* dstV, fractional* srcV1, fractional* srcV2);

Arguments

Parameters

Description

numElems

Number of elements in the source vectors

dstV

Pointer to the destination vector

srcV1

Pointer to the source one vector

srcV2

Pointer to the source two vector

Returns

Pointer to the base address of the destination vector.

Remarks

If the absolute value of srcV1[n] - srcV2[n] is larger than the maximum value of 1.31 fractional data type, the operation results in saturation for the nth element.

This function can be computed in place.

This function can be self-applicable.

Source File

  • vsub_aa.s

Function Profile

Device

Program Words

Cycles

PIC32A

11

36 + 4*(numElems)

System resource usage

  • W0…W4 - used, not restored
  • ACCA - used, not restored
  • CORCON - saved, used, restored
  • REPEAT instruction(s) usage – None