Operand Pre-fetch

After a pair of words have been pre-fetched, both the pointers may be incremented or decremented by certain fixed amounts (0, 2, 4 or 6). This feature is useful for utilizing different elements of an array for successive MAC instructions. Some examples of such scenarios are when calculating the dot product of 2 vectors, or applying an array of FIR filter coefficients to a data array.

Instead of incrementing or decrementing the pointers after a pre-fetch, a variable offset (either pre-stored or pre-calculated in W12) can be added to the pointer before the pre-fetch. The data being fetched is then the data located at the address given by the sum of the current pointer value and the offset. Note that only W12 can be used as an offset. Also, only W9 or W11, and not W8 or W10, can be used as the pre-fetch pointer if the Register Offset Addressing mode is to be used.

  • Pre-fetch loads the registers that will be needed for subsequent iterations of the instruction
  • Pre-fetch uses indirect addressing mode:
    • Post-modify
      • -6, -4, -2, 0, 2, 4 or 6
    • Indirect with Register offset using W12
      • [W9+W12] in X space
      • [W11+W12] in Y space

Examples

Various examples of MAC instruction usage are shown here. In the first example, only the source operands and target accumulator have been specified, and there is no operand pre-fetch.

In the second example, the result of the multiplication is added to accumulator B instead of A, and only 1 source operand is pre-fetched, from Y data space in this case.

In the third example, a pair of source operands are pre-fetched, from the X and Y data space respectively.

Finally, the fourth example shows the Register Offset Addressing mode being used for pre-fetching an operand from Y data space.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.