Spru 375 G
Spru 375 G
Spru 375 G
IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TIs terms and conditions of sale supplied at the time of order acknowledgment. TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TIs standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed. TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards. TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of that third party, or a license from TI under the patents or other intellectual property of TI. Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation. Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.
Mailing Address: Texas Instruments Post Office Box 655303 Dallas, Texas 75265
Preface
Notational Conventions
This book uses the following conventions.
- In syntax descriptions, the instruction is in a bold typeface. Portions of a
syntax in bold must be entered as shown. Here is an example of an instruction syntax: lms(Xmem, Ymem, ACx, ACy) lms is the instruction, and it has four operands: Xmem, Ymem, ACx, and ACy. When you use lms, the operands should be actual dual datamemory operand values and accumulator values. A comma and a space (optional) must separate the four values.
- Square brackets, [ and ], identify an optional parameter. If you use an
optional parameter, specify the information within the brackets; do not type the brackets themselves.
Contents
iii
Related Related Documentation Documentation From From Texas Texas Instruments Instruments / Trademarks
Trademarks
TMS320, TMS320C54x, TMS320C55x, C54x, and C55x are trademarks of Texas Instruments.
iv
Contents
Contents
1 Terms, Symbols, and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 Lists and defines the terms, symbols, and abbreviations used in the TMS320C55x DSP algebraic instruction set summary and in the individual instruction descriptions. 1.1 1.2 1.3 Instruction Set Terms, Symbols, and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Instruction Set Conditional (cond) Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7 Affect of Status Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.3.1 Accumulator Overflow Status Bit (ACOVx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.3.2 C54CM Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.3.3 CARRY Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.3.4 FRCT Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.3.5 INTM Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.3.6 M40 Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10 1.3.7 RDM Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12 1.3.8 SATA Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12 1.3.9 SATD Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13 1.3.10 SMUL Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13 1.3.11 SXMD Status Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13 1.3.12 Test Control Status Bit (TCx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13 Instruction Set Notes and Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14 1.4.1 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14 1.4.2 Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14 Nonrepeatable Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20
1.4
1.5 2
Parallelism Features and Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 Describes the parallelism features and rules of the TMS320C55x DSP algebraic instruction set. 2.1 2.2 2.3 Parallelism Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parallelism Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Resource Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.2 Address Generation Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.3 Buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Soft-Dual Parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 Soft-Dual Parallelism of MAR Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Execute Conditionally Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2-3 2-4 2-4 2-4 2-5 2-5 2-6 2-6 2-7
v
Contents
Introduction to Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 Provides an introduction to the addressing modes of the TMS320C55x DSP. 3.1 Introduction to the Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 3.2 Absolute Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 3.2.1 k16 Absolute Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 3.2.2 k23 Absolute Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 3.2.3 I/O Absolute Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 3.3 Direct Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.3.1 DP Direct Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.3.2 SP Direct Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 3.3.3 Register-Bit Direct Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 3.3.4 PDP Direct Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 3.4 Indirect Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 3.4.1 AR Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 3.4.2 Dual AR Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 3.4.3 CDP Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16 3.4.4 Coefficient Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 3.5 Circular Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20 Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Provides a summary of the TMS320C55x DSP algebraic instruction set. Instruction Set Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 Detailed information on the TMS320C55x DSP algebraic instruction set. Absolute Distance (abdst) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 Absolute Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 Addition with Absolute Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-27 Addition with Parallel Store Accumulator Content to Memory . . . . . . . . . . . . . . . . . . . . . . . . . . 5-29 Addition or Subtraction Conditionally (adsc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31 Addition or Subtraction Conditionally with Shift (ads2c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33 Addition, Subtraction, or Move Accumulator Content Conditionally (adsc) . . . . . . . . . . . . . . . 5-36 Bitwise AND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-38 Bitwise AND Memory with Immediate Value and Compare to Zero . . . . . . . . . . . . . . . . . . . . . 5-47 Bitwise OR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-48 Bitwise Exclusive OR (XOR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-57 Branch Conditionally (if goto) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-66 Branch Unconditionally (goto) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-70 Branch on Auxiliary Register Not Zero (if goto) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-74 Call Conditionally (if call) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-77 Call Unconditionally (call) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-83 Circular Addressing Qualifier (circular) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-87 Clear Accumulator, Auxiliary, or Temporary Register Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-88 Clear Memory Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-89 Clear Status Register Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-90 Compare Accumulator, Auxiliary, or Temporary Register Content . . . . . . . . . . . . . . . . . . . . . . . 5-93 Compare Accumulator, Auxiliary, or Temporary Register Content with AND . . . . . . . . . . . . . . 5-95 Compare Accumulator, Auxiliary, or Temporary Register Content with OR . . . . . . . . . . . . . . 5-100
4 5
vi
Contents
Compare Accumulator, Auxiliary, or Temporary Register Content Maximum (max) . . . . . . . Compare Accumulator, Auxiliary, or Temporary Register Content Minimum (min) . . . . . . . . Compare and Branch (compare goto) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Compare and Select Accumulator Content Maximum (max_diff) . . . . . . . . . . . . . . . . . . . . . . Compare and Select Accumulator Content Minimum (min_diff) . . . . . . . . . . . . . . . . . . . . . . . Compare Memory with Immediate Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Complement Accumulator, Auxiliary, or Temporary Register Bit (cbit) . . . . . . . . . . . . . . . . . . Complement Accumulator, Auxiliary, or Temporary Register Content . . . . . . . . . . . . . . . . . . Complement Memory Bit (cbit) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Compute Exponent of Accumulator Content (exp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Compute Mantissa and Exponent of Accumulator Content (mant, exp) . . . . . . . . . . . . . . . . . Count Accumulator Bits (count) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dual 16-Bit Additions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dual 16-Bit Addition and Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dual 16-Bit Subtractions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dual 16-Bit Subtraction and Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Execute Conditionally (if execute) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expand Accumulator Bit Field (field_expand) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Extract Accumulator Bit Field (field_extract) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Finite Impulse Response Filter, Antisymmetrical (firsn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Finite Impulse Response Filter, Symmetrical (firs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Idle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Least Mean Square (lms) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Linear Addressing Qualifier (linear) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Load Accumulator from Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Load Accumulator from Memory with Parallel Store Accumulator Content to Memory . . . . Load Accumulator Pair from Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Load Accumulator with Immediate Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Load Accumulator, Auxiliary, or Temporary Register from Memory . . . . . . . . . . . . . . . . . . . . . Load Accumulator, Auxiliary, or Temporary Register with Immediate Value . . . . . . . . . . . . . Load Auxiliary or Temporary Register Pair from Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Load CPU Register from Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Load CPU Register with Immediate Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Load Extended Auxiliary Register from Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Load Extended Auxiliary Register with Immediate Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Load Memory with Immediate Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Memory Delay (delay) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Memory-Mapped Register Access Qualifier (mmap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modify Auxiliary Register Content (mar) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modify Auxiliary Register Content with Parallel Multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modify Auxiliary Register Content with Parallel Multiply and Accumulate . . . . . . . . . . . . . . . Modify Auxiliary Register Content with Parallel Multiply and Subtract . . . . . . . . . . . . . . . . . . Modify Auxiliary or Temporary Register Content (mar) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modify Auxiliary or Temporary Register Content by Addition (mar) . . . . . . . . . . . . . . . . . . . . . Modify Auxiliary or Temporary Register Content by Subtraction (mar) . . . . . . . . . . . . . . . . . . Modify Data Stack Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modify Extended Auxiliary Register Content (mar) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents
5-105 5-108 5-111 5-114 5-120 5-126 5-128 5-129 5-130 5-131 5-132 5-134 5-135 5-140 5-145 5-154 5-159 5-166 5-167 5-168 5-170 5-172 5-173 5-175 5-176 5-185 5-187 5-190 5-193 5-199 5-203 5-204 5-207 5-209 5-210 5-211 5-212 5-213 5-214 5-216 5-218 5-223 5-225 5-229 5-233 5-237 5-238
vii
Contents
Move Accumulator Content to Auxiliary or Temporary Register . . . . . . . . . . . . . . . . . . . . . . . . Move Accumulator, Auxiliary, or Temporary Register Content . . . . . . . . . . . . . . . . . . . . . . . . . Move Auxiliary or Temporary Register Content to Accumulator . . . . . . . . . . . . . . . . . . . . . . . . Move Auxiliary or Temporary Register Content to CPU Register . . . . . . . . . . . . . . . . . . . . . . Move CPU Register Content to Auxiliary or Temporary Register . . . . . . . . . . . . . . . . . . . . . . Move Extended Auxiliary Register Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Move Memory to Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply with Parallel Multiply and Accumulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply with Parallel Store Accumulator Content to Memory . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply and Accumulate (MAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply and Accumulate with Parallel Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply and Accumulate with Parallel Load Accumulator from Memory . . . . . . . . . . . . . . . . Multiply and Accumulate with Parallel Multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply and Accumulate with Parallel Store Accumulator Content to Memory . . . . . . . . . . . Multiply and Subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply and Subtract with Parallel Load Accumulator from Memory . . . . . . . . . . . . . . . . . . . Multiply and Subtract with Parallel Multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply and Subtract with Parallel Multiply and Accumulate . . . . . . . . . . . . . . . . . . . . . . . . . . Multiply and Subtract with Parallel Store Accumulator Content to Memory . . . . . . . . . . . . . . Negate Accumulator, Auxiliary, or Temporary Register Content . . . . . . . . . . . . . . . . . . . . . . . No Operation (nop) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parallel Modify Auxiliary Register Contents (mar) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parallel Multiplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parallel Multiply and Accumulates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parallel Multiply and Subtracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Peripheral Port Register Access Qualifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pop Accumulator or Extended Auxiliary Register Content from Stack Pointers (popboth) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pop Top of Stack (pop) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Push Accumulator or Extended Auxiliary Register Content to Stack Pointers (pshboth) . . Push to Top of Stack (push) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Repeat Block of Instructions Unconditionally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Repeat Single Instruction Conditionally (while/repeat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Repeat Single Instruction Unconditionally (repeat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Repeat Single Instruction Unconditionally and Decrement CSR (repeat) . . . . . . . . . . . . . . . Repeat Single Instruction Unconditionally and Increment CSR (repeat) . . . . . . . . . . . . . . . . Return Conditionally (if return) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Return Unconditionally (return) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Return from Interrupt (return_int) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rotate Left Accumulator, Auxiliary, or Temporary Register Content . . . . . . . . . . . . . . . . . . . . Rotate Right Accumulator, Auxiliary, or Temporary Register Content . . . . . . . . . . . . . . . . . . . Round Accumulator Content (rnd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Saturate Accumulator Content (saturate) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Set Accumulator, Auxiliary, or Temporary Register Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Set Memory Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Set Status Register Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
viii
5-239 5-240 5-242 5-243 5-245 5-247 5-248 5-255 5-267 5-269 5-271 5-286 5-288 5-290 5-292 5-294 5-302 5-304 5-306 5-311 5-313 5-315 5-316 5-317 5-319 5-326 5-328 5-330 5-331 5-338 5-339 5-346 5-357 5-360 5-365 5-367 5-370 5-372 5-374 5-376 5-378 5-380 5-382 5-384 5-385 5-386
Contents
Shift Accumulator Content Conditionally (sftc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Shift Accumulator Content Logically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Shift Accumulator, Auxiliary, or Temporary Register Content Logically . . . . . . . . . . . . . . . . . Signed Shift of Accumulator Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Signed Shift of Accumulator, Auxiliary, or Temporary Register Content . . . . . . . . . . . . . . . . . Software Interrupt (intr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Software Reset (reset) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Software Trap (trap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Square . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Square and Accumulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Square and Subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Square Distance (sqdst) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Store Accumulator Content to Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Store Accumulator Pair Content to Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Store Accumulator, Auxiliary, or Temporary Register Content to Memory . . . . . . . . . . . . . . . Store Auxiliary or Temporary Register Pair Content to Memory . . . . . . . . . . . . . . . . . . . . . . . Store CPU Register Content to Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Store Extended Auxiliary Register Content to Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subtract Conditionally (subc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subtraction with Parallel Store Accumulator Content to Memory . . . . . . . . . . . . . . . . . . . . . . Swap Accumulator Content (swap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Swap Accumulator Pair Content (swap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Swap Auxiliary Register Content (swap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Swap Auxiliary Register Pair Content (swap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Swap Auxiliary and Temporary Register Content (swap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Swap Auxiliary and Temporary Register Pair Content (swap) . . . . . . . . . . . . . . . . . . . . . . . . . Swap Auxiliary and Temporary Register Pairs Content (swap) . . . . . . . . . . . . . . . . . . . . . . . . Swap Temporary Register Content (swap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Swap Temporary Register Pair Content (swap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test Accumulator, Auxiliary, or Temporary Register Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test Accumulator, Auxiliary, or Temporary Register Bit Pair . . . . . . . . . . . . . . . . . . . . . . . . . . . Test Memory Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test and Clear Memory Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test and Complement Memory Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test and Set Memory Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5-389 5-391 5-394 5-397 5-406 5-411 5-413 5-417 5-419 5-422 5-425 5-428 5-430 5-450 5-453 5-457 5-458 5-462 5-463 5-465 5-490 5-492 5-493 5-494 5-495 5-496 5-498 5-500 5-502 5-503 5-504 5-506 5-508 5-511 5-512 5-513
Instruction Opcodes in Sequential Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 The opcode in sequential order for each TMS320C55x DSP instruction syntax. 6.1 6.2 Instruction Set Opcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Instruction Set Opcode Symbols and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
Cross-Reference of Algebraic and Mnemonic Instruction Sets . . . . . . . . . . . . . . . . . . . . . . 7-1 Cross-Reference of TMS320C55x DSP Algebraic and Mnemonic Instruction Sets.
Contents ix
Figures
Figures
51 52 53 54 Status Registers Bit Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-92 Legal Uses of Repeat Block of Instructions Unconditionally (localrepeat) Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-350 Status Registers Bit Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-388 Effects of a Software Reset on Status Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-416
Tables
11 12 13 14 31 32 33 34 35 36 37 38 39 310 41 51 52 53 54 55 56 61 62 71
x
Instruction Set Terms, Symbols, and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Operators Used in Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6 Instruction Set Conditional (cond) Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7 Nonrepeatable Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20 Addressing-Mode Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Absolute Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Direct Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 Indirect Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 DSP Mode Operands for the AR Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 Control Mode Operands for the AR Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . 3-12 Dual AR Indirect Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15 CDP Indirect Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 Coefficient Indirect Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19 Circular Addressing Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20 Algebraic Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 Opcodes for Load CPU Register from Memory Instruction . . . . . . . . . . . . . . . . . . . . . . . . 5-206 Opcodes for Load CPU Register with Immediate Value Instruction . . . . . . . . . . . . . . . . . 5-208 Opcodes for Move Auxiliary or Temporary Register Content to CPU Register Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-244 Opcodes for Move CPU Register Content to Auxiliary or Temporary Register Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-246 Effects of a Software Reset on DSP Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-414 Opcodes for Store CPU Register Content to Memory Instruction . . . . . . . . . . . . . . . . . . 5-461 Instruction Set Opcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Instruction Set Opcode Symbols and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16 Cross-Reference of Algebraic and Mnemonic Instruction Sets . . . . . . . . . . . . . . . . . . . . . . 7-2
Chapter 1
Topic
1.1 1.2 1.3 1.4 1.5
Page
Instruction Set Terms, Symbols, and Abbreviations . . . . . . . . . . . . . . 1-2 Instruction Set Conditional (cond) Fields . . . . . . . . . . . . . . . . . . . . . . . 1-7 Affect of Status Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 Instruction Set Notes and Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14 Nonrepeatable Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20
1-1
1-2
SPRU375G
Px
SPRU375G
1-3
If the optional rnd keyword is applied to the instruction, rounding is performed in the instruction Single-repeat counter register Instruction size in bytes. Stack address generation unit If the optional saturate keyword is applied to the input operand, the 40-bit output of the operation is saturated 4-bit immediate shift value, 0 to 15 6-bit immediate shift value, 32 to +31 Word single data memory access (16-bit data access) Data stack pointer Source accumulator (ACx), lower 16 bits of auxiliary register (ARx), or temporary register (Tx): AC0, AC1, AC2, AC3 AR0, AR1, AR2, AR3, AR4, AR5, AR6, AR7 T0, T1, T2, T3 System stack pointer Status register: ST0, ST1, ST2, ST3 Auxiliary register (ARx) or temporary register (Tx): AR0, AR1, AR2, AR3, AR4, AR5, AR6, AR7 T0, T1, T2, T3 Test control flag: TC1, TC2 Transition register: TRN0, TRN1 Temporary register (Tx): T0, T1, T2, T3
1-4
SPRU375G
XARx XAsrc
xdst
SPRU375G
1-5
Operators ~ % >> >>> <= >= != Unary plus, minus, 1s complement Multiplication, division, modulo Addition, subtraction Signed left shift, right shift Logical left shift, logical right shift Less than, less than or equal to Greater than, greater than or equal to Equal to, not equal to Bitwise AND Bitwise OR Bitwise exclusive OR (XOR)
Evaluation Right to left Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right
1-6
SPRU375G
Tests the accumulator (ACx) content against 0. The comparison against 0 depends on M40 status bit:
-
If M40 = 0, ACx(310) is compared to 0. If M40 = 1, ACx(390) is compared to 0. ACx content is equal to 0 ACx content is less than 0 ACx content is greater than 0 ACx content is not equal to 0 ACx content is less than or equal to 0 ACx content is greater than or equal to 0
ACx == #0 ACx < #0 ACx > #0 ACx != #0 ACx <= #0 ACx >= #0 Accumulator Overflow Status Bit
Tests the accumulator overflow status bit (ACOVx) against 1; when the optional ! symbol is used before the bit designation, the bit can be tested against 0. When this condition is used, the corresponding ACOVx is cleared to 0. overflow(ACx) !overflow(ACx) ACOVx bit is set to 1 ACOVx bit is cleared to 0
Auxiliary Register
Tests the auxiliary register (ARx) content against 0. ARx == #0 ARx < #0 ARx > #0 ARx != #0 ARx <= #0 ARx >= #0 ARx content is equal to 0 ARx content is less than 0 ARx content is greater than 0 ARx content is not equal to 0 ARx content is less than or equal to 0 ARx content is greater than or equal to 0
Tests the CARRY status bit against 1; when the optional ! symbol is used before the bit designation, the bit can be tested against 0. CARRY !CARRY CARRY bit is set to 1 CARRY bit is cleared to 0
SPRU375G
1-7
Tests the temporary register (Tx) content against 0. Tx == #0 Tx < #0 Tx > #0 Tx != #0 Tx <= #0 Tx >= #0 Tx content is equal to 0 Tx content is less than 0 Tx content is greater than 0 Tx content is not equal to 0 Tx content is less than or equal to 0 Tx content is greater than or equal to 0
Tests the test control flags (TC1 and TC2) independently against 1; when the optional ! symbol is used before the flag designation, the flag can be tested independently against 0. TCx !TCx TCx flag is set to 1 TCx flag is cleared to 0
TC1 and TC2 can be combined with an AND (&), OR (|), and XOR (^) logical bit combinations: TC1 & TC2 !TC1 & TC2 TC1 & !TC2 !TC1 & !TC2 TC1 AND TC2 is equal to 1 TC1 AND TC2 is equal to 1 TC1 AND TC2 is equal to 1 TC1 AND TC2 is equal to 1
TC1 OR TC2 is equal to 1 TC1 OR TC2 is equal to 1 TC1 OR TC2 is equal to 1 TC1 OR TC2 is equal to 1
TC1 XOR TC2 is equal to 1 TC1 XOR TC2 is equal to 1 TC1 XOR TC2 is equal to 1 TC1 XOR TC2 is equal to 1
1-8
SPRU375G
1.3.2
- When C54CM = 1, the compatible mode, all the C55x CPU resources
remain available; therefore, as you translate code, you can take advantage of the additional features on the C55x DSP to optimize your code. This mode must be set when you are porting code that was originally developed for a TMS320C54x DSP.
1.3.3
When performing a logical shift or signed shift that affects the CARRY status bit and the shift count is zero, the CARRY status bit is cleared to 0.
1.3.4
1.3.5
SPRU375G
1-9
1.3.6
overflow is detected at bit position 31 the carry/borrow is detected at bit position 31 saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow) TMS320C54x DSP compatibility mode for conditional instructions, the comparison against 0 (zero) is performed on 32 bits, ACx(310)
- When M40 = 1: J J J J
overflow is detected at bit position 39 the carry/borrow is detected at bit position 39 saturation values are 7F FFFF FFFFh (positive overflow) or 80 0000 0000h (negative overflow) for conditional instructions, the comparison against 0 (zero) is performed on 40 bits, ACx(390)
1.3.6.1
when M40 = 0, the input to the shifter is modified according to SXMD and then the modified input is shifted according to the shift quantity: H H if SXMD = 0, 0 is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter if SXMD = 1, bit 31 of the source operand is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter
J J
bit 39 is extended according to SXMD the shifted-out bit is extracted at bit position 0
0 is inserted at bit position 0 if M40 = 0, the shifted-out bit is extracted at bit position 31 if M40 = 1, the shifted-out bit is extracted at bit position 39
SPRU375G
overflow is detected at bit position 31 (if an overflow is detected, the destination ACOVx bit is set) the carry/borrow is detected at bit position 31 if SATD = 1, when an overflow is detected, ACx saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow) TMS320C54x DSP compatibility mode
overflow is detected at bit position 39 (if an overflow is detected, the destination ACOVx bit is set) the carry/borrow is detected at bit position 39 if SATD = 1, when an overflow is detected, ACx saturation values are 7F FFFF FFFFh (positive overflow) or 80 0000 0000h (negative overflow)
In A-unit ALU:
- When shifting to the LSBs, bit 15 is sign extended - When shifting to the MSBs, 0 is inserted at bit position 0 - After shifting, unless otherwise noted: J J
overflow is detected at bit position 15 (if an overflow is detected, the destination ACOVx bit is set) if SATA = 1, when an overflow is detected, register saturation values are 7FFFh (positive overflow) or 8000h (negative overflow)
1.3.6.2
if M40 = 0, 0 is inserted at bit position 31 and the guard bits (3932) of the destination accumulator are cleared if M40 = 1, 0 is inserted at bit position 39 the shifted-out bit is extracted at bit position 0 and stored in the CARRY status bit
Terms, Symbols, and Abbreviations 1-11
SPRU375G
0 is inserted at bit position 0 if M40 = 0, the shifted-out bit is extracted at bit position 31 and stored in the CARRY status bit, and the guard bits (3932) of the destination accumulator are cleared if M40 = 1, the shifted-out bit is extracted at bit position 39 and stored in the CARRY status bit
In A-unit ALU:
- When shifting to the LSBs: J J
0 is inserted at bit position 15 the shifted-out bit is extracted at bit position 0 and stored in the CARRY status bit 0 is inserted at bit position 0 the shifted-out bit is extracted at bit position 15 and stored in the CARRY status bit
1.3.7
According to the value of the 17 LSBs of the 40-bit result of the shift result, 8000h (215) is added:
if( 8000h < bit(150) < 10000h) add 8000h to the 40-bit result of the shift result. else if( bit(150) == 8000h) if( bit(16) == 1) add 8000h to the 40-bit result of the shift result.
If a rounding has been performed, the 16 lowest bits of the result are cleared to 0.
1.3.8
1.3.9
saturated.
and SATD = 1, the result of 18000h 18000h is saturated to 00 7FFF FFFFh (regardless of the value of the M40 bit). This forces the product of the two negative numbers to be a positive number. For multiplyand-accumulate/subtract instructions, the saturation is performed after the multiplication and before the addition/subtraction.
SPRU375G
1-13
or
aBdST(*ar0, *aR1, aC0, Ac1)
- Operands for commutative operations (+, *, &, |, ^) can be arranged in any
order.
- Expression qualifiers can be specified in any order. For example, these
1.4.2
Rules
- Simple instructions are not allowed to span multiple lines. One exception,
single instructions that use the , notation to imply parallelism. These instructions may be split up following the , notation. The following example shows a single instruction (dual multiply) occupying two lines:
ACx = m40(rnd(uns(Xmem) * uns(coef(Cmem)))), ACy = m40(rnd(uns(Ymem) * uns(coef(Cmem))))
- User-defined parallelism instructions (using || notation) are allowed to
span multiple lines. For example, all of the following instructions are legal:
AC0 = AC1 || AC0 = AC1 || AC2 = AC3 AC0 = AC1 || AC2 = AC3 AC0 = AC1 || AC2 = AC3
1-14 Terms, Symbols, and Abbreviations
AC2 = AC3
SPRU375G
- The block repeat syntax uses braces to delimit the block that is to be
repeated:
blockrepeat { instr instr : instr } localrepeat { instr instr : instr }
The left opening brace must appear on the same line as the repeat keyword. The right closing brace must appear alone on a line (trailing comments allowed). Note that a label placed just inside the closing brace of the loop is effectively outside the loop. The following two code sequences are equivalent:
localrepeat { instr1 instr2 Label: } instr3
and
localrepeat { instr1 instr2 } Label: instr3
A label is the address of the first construct following the label that gets assembled into code in the object file. A closing brace does not generate any code and so the label marks the address of the first instruction that generates code, that is, instr3. In this example, goto Label exits the loop, which is somewhat unintuitive:
localrepeat { goto Label instr2 Label: } instr3
SPRU375G Terms, Symbols, and Abbreviations 1-15
1.4.2.1
Reserved Words Register names and algebraic syntax keywords are reserved. They may not be used as names of identifiers, labels, etc.
1.4.2.2
Literal and Address Operands Literals in the algebraic strings are denoted as K or k fields. In the Smem address modes that require an offset, the offset is also a literal (K16 or k3). 8-bit and 16-bit literals are allowed to be linktime-relocatable; for other literals, the value must be known at assembly time. Addresses are the elements of the algebraic strings denoted by P, L, and l. Further, 16-bit and 24-bit absolute address Smem modes are addresses, as is the dma Smem mode, denoted by the @ syntax. Addresses may be assembly-time constants or symbolic linktime-known constants or expressions. Both literals and addresses follow syntax rule 1. For addresses only, rules 2 and 3 also apply.
Rule 1
A valid address or literal is a # followed by one of the following:
- a number (#123) - an identifier (#FOO) - a parenthesized expression (#(FOO + 2))
Rule 2
When an address is used in a dma, the address does not need to have a leading #, be it a number, a symbol or an expression. These are all legal:
@#123 @123 @#foo @foo @#(foo+2) @(foo+2)
1-16
SPRU375G
Rule 3
When used in contexts other than dma (such as branch targets or Smemabsolute address), addresses generally need a leading #. As a convenience, the # may be omitted in front of an identifier. These are all legal: Branch
goto goto goto goto #123 #foo foo #(foo+2)
Absolute Address
*(#123) *(#foo) *(foo) *(#(foo+2))
1.4.2.3
Memory Operands
- Syntax of Smem is the same as that of Lmem or Baddr. - In the following instruction syntaxes, Smem cannot reference to a
memory-mapped register (MMR). No instruction can access a byte within a memory-mapped register. If Smem is an MMR in one of the following syntaxes, the DSP sends a hardware bus-error interrupt (BERRINT) request to the CPU.
dst = uns(high_byte(Smem)) dst = uns(low_byte(Smem)) ACx = low_byte(Smem) << #SHIFTW ACx = high_byte(Smem) << #SHIFTW high_byte(Smem) = src low_byte(Smem) = src
- Syntax of Xmem is the same as that of Ymem. - Syntax of coefficient operands, Cmem:
*CDP *CDP+ *CDP *(CDP + T0), when C54CM = 0 *(CDP + AR0), when C54CM = 1
When an instruction uses a Cmem operand with paralleled instructions, the pointer modification of the Cmem operand must be the same for both instructions of the paralleled pair or the assembler generates an error. For example:
AC0 = AC0 + (*AR2+ * coef(*CDP+)), AC1 = AC1 + (*AR3+ * coef(*CDP+))
SPRU375G Terms, Symbols, and Abbreviations 1-17
operands, for example, mmr(*AR0). This is an assertion by you that this is an access to a memory-mapped register. The assembler checks whether such access is legal in given circumstances. The mmr prefix is supported for Xmem, Ymem, indirect Smem, indirect Lmem, and Cmem operands. It is not supported for direct memory operands; it is expected that an explicit mmap() parallel instruction is used in conjunction with direct memory operands to indicate MMR access. Note that the mmr prefix is part of the syntax. It is an implementation restriction that mmr cannot exchange positions with other prefixes around the memory operand, such as dbl or uns. If several prefixes are specified, mmr must be the innermost prefix. Thus, uns(mmr(*AR0)) is legal, but mmr(uns(*AR0)) is not legal.
- The following indirect operands cannot be used for accesses to I/O
space. An instruction using one of these operands requires a 2-byte extension for the constant. This extension would prevent the use of the port() qualifier needed to indicate an I/O-space access.
*ARn(#K16) *+ARn(#K16) *CDP(#K16) *+CDP(#K16)
Also, the following instructions that include the delay operation cannot be used for accesses to I/O space:
delay(Smem) ACx = rnd(ACx + (Smem * coef(Cmem))) [,T3 = Smem], delay(Smem)
Any illegal access to I/O space will generate a hardware bus-error interrupt (BERRINT) to be handled by the CPU. 1.4.2.4 Operand Modifiers Operand modifiers look like function calls on operands. Note that uns is an operand modifier and an instruction modifier meaning unsigned. The operand modifier uns is used when the operand is modified on the way to the rest of the operation (multiply-and-accumulate). The instruction modifier uns is used when the whole operation is affected (multiply, register compare, compare and branch).
1-18 Terms, Symbols, and Abbreviations SPRU375G
Meaning Access a true 32-bit memory operand Access a 32-bit memory operand for use as two independent 16-bit halves of the given operation Access upper 16 bits of the accumulator Access the high byte of the memory location Access lower 16 bits of the accumulator Access the low byte of the memory location Dual register access Round Saturate Unsigned operand
When an instruction uses a Cmem operand with paralleled instructions and the Cmem operand is defined as unsigned (uns), both Cmem operands of the paralleled pair must be defined as unsigned (and reciprocally). When an instruction uses both Xmem and Ymem operands with paralleled instructions and the Xmem operand is defined as unsigned (uns), Ymem operand must also be defined as unsigned (and reciprocally). 1.4.2.5 Operator Syntax Rules Instructions that read and write the same operand can also be written in op-assign form. For example:
AC0 = AC0 + *AR4
This form is supported for these operations: +=, =, &=, |=, ^= Note that in certain instances use of op-assign notation results in ambiguous algebraic assembly. This happens if the op-assign operator is not delimited by white space, for example: *AR0+=#4 is ambiguous, is it *AR0 += #4 or *AR0+ = #4 ? The assembler always parses adjacent += as plus-assign; therefore, this instructions is parsed as *AR0 += #4. *AR0+=*AR1 is ambiguous, is it *AR0 += *AR1 or *AR0+ =*AR1 ? Once again, the first form, *AR0 += *AR1, is used. This is not a valid instruction an error is printed.
SPRU375G Terms, Symbols, and Abbreviations 1-19
Nonrepeatable Instructions
This instruction may not be repeated when using the *(#k23) absolute addressing mode to access the memory operand Smem.
1-20
SPRU375G
Nonrepeatable Instructions
ACx = rnd(Smem * K8)[, T3 = Smem] ACy = rnd(ACx + (Smem * K8))[, T3 = Smem ] localrepeat{} blockrepeat{}
while (cond && (RPTC < k8)) repeat repeat(k8) repeat(k16) repeat(CSR)
Repeat Single Instruction Unconditionally and Decrement CSR Repeat Single Instruction Unconditionally and Increment CSR Return Conditionally Return Unconditionally Return from Interrupt Round Accumulator Content
repeat(CSR), CSR = k4
repeat(CSR), CSR += TAx repeat(CSR), CSR += k4 if (cond) return return return_int ACy = rnd(ACx)
This instruction may not be repeated when using the *(#k23) absolute addressing mode to access the memory operand Smem.
SPRU375G
1-21
Nonrepeatable Instructions
This instruction may not be repeated when using the *(#k23) absolute addressing mode to access the memory operand Smem.
1-22
SPRU375G
Chapter 2
Topic
2.1 2.2 2.3 2.4 2.5 2.6
Page
Parallelism Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Parallelism Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 Resource Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 Soft-Dual Parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 Execute Conditionally Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6 Other Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
2-1
Parallelism Features
Some instructions perform two different operations in parallel. A comma is used to separate the two operations. This type of parallelism is also called implied parallelism. For example:
AC0 = *AR0 * coef(*CDP), AC1 = *AR1 * coef(*CDP) This is a single instruction. The data referenced by AR0 is multiplied by the coefficient referenced by CDP. At the same time, the data referenced by AR1 is multiplied by the same coefficient (CDP).
Two instructions may be paralleled by you or the C compiler. The parallel bars, ||, are used to separate the two instructions to be executed in parallel. For example:
AC1 = *AR1 * *AR2+ || T1 = T1 ^ AR2 The first instruction performs a multiplication in the D-unit. The second instruction performs a logical operation in the A-unit ALU.
Parenthesis separators can be used to determine boundaries of the two instructions. For example:
(AC2 = *AR3+ * AC1, T3 = *AR3+) || AR1 = #5 The first instruction includes implied parallelism. The second instruction is paralleled by you.
2-2
SPRU375G
Parallelism Basics
if (cond) goto P24 if (cond) call P24 idle intr(k5) reset trap(k5)
- Neither instruction in the parallel pair can use any of these instruction or
operand modifiers:
J J J J J
pipeline phase. Violations of this rule take many forms. Loading the same register twice is a simple case. Other cases include:
J J
Conflicting address mode modifications (for example, *AR2+ versus *AR2) Combining a SWAP instruction (modifies all of its registers) with any other instruction that writes one of the same registers
Parallelism Features and Rules 2-3
SPRU375G
Modifying the data stack pointer (SP) or system stack pointer (SSP) in combination with: H H H H H all Push to Top of Stack (push) instructions all Pop Top of Stack (pop) instructions all Call Conditionally, if (cond) call; and Call Unconditionally, call, instructions all Return Conditionally, if (cond) return; Return Unconditionally, return; and Return from Interrupt, return_int, instructions trap and intr instructions
- When both instructions in a parallel pair modify a status bit, the value of
2.3.1
Operators
You may use each of these operators only once:
-
D Unit ALU D Unit Shift D Unit Swap A Unit Swap A Unit ALU P Unit
For an instruction that uses multiple operators, any other instruction that uses one or more of those same operators may not be placed in parallel.
2.3.2
2-4
SPRU375G
2.3.3
Buses
You may use no more than the indicated number of buses:
-
2 Data Read (DR) Buses 1 Coefficient Read (CR) Bus 2 Data Write (DW) Buses 1 ACB Bus brings D-unit registers to A-unit and P-unit operators 1 KAB Bus Constant Bus 1 KDB Bus Constant Bus
addressing mode (Xmem and Ymem), as described in section 3.4.2. The operands available for the dual AR indirect addressing mode are:
J J J J J J J J J J J
*ARn *ARn+ *ARn *(ARn + AR0) *(ARn + T0) *(ARn AR0) *(ARn T0) *ARn(AR0) *ARn(T0) *(ARn + T1) *(ARn T1)
Instructions embedding high_byte(Smem) and low_byte(Smem). H H H H H H dst = uns(high_byte(Smem)) dst = uns(low_byte(Smem)) ACx = low_byte(Smem) << #SHIFTW ACx = high_byte(Smem) << #SHIFTW high_byte(Smem) = src low_byte(Smem) = src
Parallelism Features and Rules 2-5
SPRU375G
Execute Execute Conditionally Soft-Dual Conditionally Parallelism /Instructions Instructions Execute Conditionally / Other Exceptions Instructions
These instructions that read and write the same memory location: H H H H H H cbit(Smem, src) bit(Smem, src) = #0 bit(Smem, src) = #1 TCx = bit(Smem, k4), bit(Smem, k4) = #1 TCx = bit(Smem, k4), bit(Smem, k4) = #0 TCx = bit(Smem, k4), cbit(Smem, k4)
2.4.1
+ + = =
Note that this is not the full list of MAR instructions; instructions mar(TAx = D16) and mar(Smem) are not included.
2-6
SPRU375G
Other Exceptions
register:
J J
Therefore, they may not be combined with any of these load-the-DP instructions:
J J J
- An instruction that reads the repeat counter register (RPTC) may not be
SPRU375G
2-7
Chapter 3
Topic
3.1 3.2 3.3 3.4 3.5
Page
Introduction to the Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Absolute Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Direct Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 Indirect Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Circular Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
3-1
address offset.
- The indirect addressing mode allows you to reference a location using a
pointer. Each addressing mode provides one or more types of operands. An instruction that supports an addressing-mode operand has one of the following syntax elements listed in Table 31.
Cmem Lmem
Smem
3-2
SPRU375G
3.2.1
3.2.2
3.2.3
SPRU375G
3-3
SP direct
The DP direct and SP direct addressing modes are mutually exclusive. The mode selected depends on the CPL bit in status register ST1_55:
CPL 0 1 Addressing Mode Selected DP direct addressing mode SP direct addressing mode
The register-bit and PDP direct addressing modes are independent of the CPL bit.
3.3.1
of a 128-word local data page within the main data page. This start address can be any address within the selected main data page.
- A 7-bit offset (Doffset) calculated by the assembler. The calculation
depends on whether you are accessing data memory or a memorymapped register (using the mmap() qualifier). The concatenation of DPH and DP is called the extended data page register (XDP). You can load DPH and DP individually, or you can use an instruction that loads XDP.
3-4 Introduction to Addressing Modes SPRU375G
3.3.2
3.3.3
3.3.4
SPRU375G
3-5
Dual AR indirect
CDP indirect
Coefficient indirect
3.4.1
I/O space
3-6
SPRU375G
The AR indirect addressing-mode operand available depends on the ARMS bit of status register ST2_55:
ARMS 0 DSP Mode or Control Mode DSP mode. The CPU can use the list of DSP mode operands (Table 35), which provide efficient execution of DSP-intensive applications. Control mode. The CPU can use the list of control mode operands (Table 36), which enable optimized code size for control system applications.
Table 35 (page 3-8) introduces the DSP operands available for the AR indirect addressing mode. Table 36 (page 3-12) introduces the control mode operands. When using the tables, keep in mind that:
- Both pointer modification and address generation are linear or circular
according to the pointer configuration in status register ST2_55. The content of the appropriate 16-bit buffer start address register (BSA01, BSA23, BSA45, or BSA67) is added only if circular addressing is activated for the chosen pointer.
- All additions to and subtractions from the pointers are done modulo 64K.
You cannot address data across main data pages without changing the value in the extended auxiliary register (XARn).
SPRU375G
3-7
Table 35. DSP Mode Operands for the AR Indirect Addressing Mode
Operand *ARn Pointer Modification ARn is not modified. Supported Access Types Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *ARn+ ARn is incremented after the address is generated: If 16-bit/1-bit operation: ARn = ARn + 1 If 32-bit/2-bit operation: ARn = ARn + 2 Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *ARn ARn is decremented after the address is generated: If 16-bit/1-bit operation: ARn = ARn 1 If 32-bit/2-bit operation: ARn = ARn 2 Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *+ARn ARn is incremented before the address is generated: If 16-bit/1-bit operation: ARn = ARn + 1 If 32-bit/2-bit operation: ARn = ARn + 2 Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *ARn ARn is decremented before the address is generated: If 16-bit/1-bit operation: ARn = ARn 1 If 32-bit/2-bit operation: ARn = ARn 2 Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *(ARn + AR0) The 16-bit signed constant in AR0 is added to ARn after the address is generated: ARn = ARn + AR0 This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time. Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem)
3-8
SPRU375G
Table 35. DSP Mode Operands for the AR Indirect Addressing Mode (Continued)
Operand *(ARn + T0) Pointer Modification The 16-bit signed constant in T0 is added to ARn after the address is generated: ARn = ARn + T0 This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time. *(ARn AR0) The 16-bit signed constant in AR0 is subtracted from ARn after the address is generated: ARn = ARn AR0 This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time. *(ARn T0) The 16-bit signed constant in T0 is subtracted from ARn after the address is generated: ARn = ARn T0 This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time. *ARn(AR0) ARn is not modified. ARn is used as a base pointer. The 16-bit signed constant in AR0 is used as an offset from that base pointer. This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time. *ARn(T0) ARn is not modified. ARn is used as a base pointer. The 16-bit signed constant in T0 is used as an offset from that base pointer. This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time. *ARn(T1) ARn is not modified. ARn is used as a base pointer. The 16-bit signed constant in T1 is used as an offset from that base pointer. Supported Access Types Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem)
SPRU375G
3-9
Table 35. DSP Mode Operands for the AR Indirect Addressing Mode (Continued)
Operand *(ARn + T1) Pointer Modification The 16-bit signed constant in T1 is added to ARn after the address is generated: ARn = ARn + T1 Supported Access Types Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *(ARn T1) The 16-bit signed constant in T1 is subtracted from ARn after the address is generated: ARn = ARn T1 Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *(ARn + AR0B) The 16-bit signed constant in AR0 is added to ARn after the address is generated: ARn = ARn + AR0 (The addition is done with reverse carry propagation) This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time. Note: When this bit-reverse operand is used, ARn cannot be used as a circular pointer. If ARn is configured in ST2_55 for circular addressing, the corresponding buffer start address register value (BSAxx) is added to ARn, but ARn is not modified so as to remain inside a circular buffer. *(ARn + T0B) The 16-bit signed constant in T0 is added to ARn after the address is generated: ARn = ARn + T0 (The addition is done with reverse carry propagation) This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time. Note: When this bit-reverse operand is used, ARn cannot be used as a circular pointer. If ARn is configured in ST2_55 for circular addressing, the corresponding buffer start address register value (BSAxx) is added to ARn, but ARn is not modified so as to remain inside a circular buffer. Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem)
3-10
SPRU375G
Table 35. DSP Mode Operands for the AR Indirect Addressing Mode (Continued)
Operand *(ARn AR0B) Pointer Modification The 16-bit signed constant in AR0 is subtracted from ARn after the address is generated: ARn = ARn AR0 (The subtraction is done with reverse carry propagation) This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time. Note: When this bit-reverse operand is used, ARn cannot be used as a circular pointer. If ARn is configured in ST2_55 for circular addressing, the corresponding buffer start address register value (BSAxx) is added to ARn, but ARn is not modified so as to remain inside a circular buffer. *(ARn T0B) The 16-bit signed constant in T0 is subtracted from ARn after the address is generated: ARn = ARn T0 (The subtraction is done with reverse carry propagation) This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time. Note: When this bit-reverse operand is used, ARn cannot be used as a circular pointer. If ARn is configured in ST2_55 for circular addressing, the corresponding buffer start address register value (BSAxx) is added to ARn, but ARn is not modified so as to remain inside a circular buffer. *ARn(#K16) ARn is not modified. ARn is used as a base pointer. The 16-bit signed constant (K16) is used as an offset from that base pointer. Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Supported Access Types Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem)
Note: When an instruction uses this operand, the constant Register bit (Baddr) is encoded in a 2-byte extension to the instruction. Because of the extension, an instruction using this operand cannot be executed in parallel with another instruction. *+ARn(#K16) The 16-bit signed constant (K16) is added to ARn before the address is generated: ARn = ARn + K16 Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem)
Note: When an instruction uses this operand, the constant Register bit (Baddr) is encoded in a 2-byte extension to the instruction. Because of the extension, an instruction using this operand cannot be executed in parallel with another instruction.
SPRU375G
3-11
Table 36. Control Mode Operands for the AR Indirect Addressing Mode
Operand *ARn Pointer Modification ARn is not modified. Supported Access Types Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *ARn+ ARn is incremented after the address is generated: If 16-bit/1-bit operation: ARn = ARn + 1 If 32-bit/2-bit operation: ARn = ARn + 2 Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *ARn ARn is decremented after the address is generated: If 16-bit/1-bit operation: ARn = ARn 1 If 32-bit/2-bit operation: ARn = ARn 2 Data-memory (Smem, Lmem) Memory-mapped register Smem, Lmem) Register bit (Baddr) I/O-space (Smem) *(ARn + AR0) The 16-bit signed constant in AR0 is added to ARn after the address is generated: ARn = ARn + AR0 This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time. *(ARn + T0) The 16-bit signed constant in T0 is added to ARn after the address is generated: ARn = ARn + T0 This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time. *(ARn AR0) The 16-bit signed constant in AR0 is subtracted from ARn after the address is generated: ARn = ARn AR0 This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time. Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem)
3-12
SPRU375G
Table 36. Control Mode Operands for the AR Indirect Addressing Mode (Continued)
Operand *(ARn T0) Pointer Modification The 16-bit signed constant in T0 is subtracted from ARn after the address is generated: ARn = ARn T0 This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time. *ARn(AR0) ARn is not modified. ARn is used as a base pointer. The 16-bit signed constant in AR0 is used as an offset from that base pointer. This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time. *ARn(T0) ARn is not modified. ARn is used as a base pointer. The 16-bit signed constant in T0 is used as an offset from that base pointer. This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time. *ARn(#K16) ARn is not modified. ARn is used as a base pointer. The 16-bit signed constant (K16) is used as an offset from that base pointer. Note: When an instruction uses this operand, the constant is encoded in a 2-byte extension to the instruction. Because of the extension, an instruction using this operand cannot be executed in parallel with another instruction. *+ARn(#K16) The 16-bit signed constant (K16) is added to ARn before the address is generated: ARn = ARn + K16 Note: When an instruction uses this operand, the constant is encoded in a 2-byte extension to the instruction. Because of the extension, an instruction using this operand cannot be executed in parallel with another instruction. *ARn(short(#k3)) ARn is not modified. ARn is used as a base pointer. The 3-bit unsigned constant (k3) is used as an offset from that base pointer. k3 is in the range 1 to 7. Supported Access Types Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem) Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr)
Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr)
Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem) Register bit (Baddr) I/O-space (Smem)
SPRU375G
3-13
3.4.2
this case, the two data-memory operands are designated in the instruction syntax as Xmem and Ymem. For example:
ACx = (Xmem << #16) + (Ymem << #16)
- Executing two instructions in parallel. In this case, both instructions must
each access a single memory value, designated in the instruction syntaxes as Smem or Lmem. For example:
dst = Smem || dst = src & Smem
The operand of the first instruction is treated as an Xmem operand, and the operand of the second instruction is treated as a Ymem operand. The available dual AR indirect operands are a subset of the AR indirect operands. The ARMS status bit does not affect the set of dual AR indirect operands available. Note: The assembler rejects code in which dual operands use the same auxiliary register with two different auxiliary register modifications. You can use the same ARn for both operands, if one of the operands is *ARn or *ARn(T0); neither modifies ARn. Table 37 (page 3-15) introduces the operands available for the dual AR indirect addressing mode. Note that:
- Both pointer modification and address generation are linear or circular
according to the pointer configuration in status register ST2_55. The content of the appropriate 16-bit buffer start address register (BSA01, BSA23, BSA45, or BSA67) is added only if circular addressing is activated for the chosen pointer.
- All additions to and subtractions from the pointers are done modulo 64K.
You cannot address data across main data pages without changing the value in the extended auxiliary register (XARn).
3-14 Introduction to Addressing Modes SPRU375G
*ARn+
ARn is incremented after the address is generated: If 16-bit operation: ARn = ARn + 1 If 32-bit operation: ARn = ARn + 2 ARn is decremented after the address is generated: If 16-bit operation: ARn = ARn 1 If 32-bit operation: ARn = ARn 2 The 16-bit signed constant in AR0 is added to ARn after the address is generated: ARn = ARn + AR0 This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time.
*ARn
*(ARn + AR0)
*(ARn + T0)
The 16-bit signed constant in T0 is added to ARn after the address is generated: ARn = ARn + T0 This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time.
*(ARn AR0)
The 16-bit signed constant in AR0 is subtracted from ARn after the address is generated: ARn = ARn AR0 This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time.
*(ARn T0)
The 16-bit signed constant in T0 is subtracted from ARn after the address is generated: ARn = ARn T0 This operand is available when C54CM = 0. This operand is usable when .c54cm_off is active at assembly time.
*ARn(AR0)
ARn is not modified. ARn is used as a base pointer. The 16-bit signed constant in AR0 is used as an offset from that base pointer. This operand is available when C54CM = 1. This operand is usable when .c54cm_on is active at assembly time.
SPRU375G
3-15
*(ARn T1)
3.4.3
I/O space
Table 38 (page 3-17) introduces the operands available for the CDP indirect addressing mode. Note that:
- Both pointer modification and address generation are linear or circular
according to the pointer configuration in status register ST2_55. The content of the 16-bit buffer start address register BSAC is added only if circular addressing is activated for CDP.
3-16 Introduction to Addressing Modes SPRU375G
- All additions to and subtractions from CDP are done modulo 64K. You can-
not address data across main data pages without changing the value of CDPH (the high part of the extended coefficient data pointer).
Note: When an instruction uses this operand, the constant Register-bit (Baddr) is encoded in a 2-byte extension to the instruction. Because of the extension, an instruction using this operand cannot be executed in parallel with another instruction. *+CDP(#K16) The 16-bit signed constant (K16) is added to CDP before the address is generated: CDP = CDP + K16 Data-memory (Smem, Lmem) Memory-mapped register (Smem, Lmem)
Note: When an instruction uses this operand, the constant Register-bit (Baddr) is encoded in a 2-byte extension to the instruction. Because of the extension, an instruction using this operand cannot be executed in parallel with another instruction.
SPRU375G
3-17
3.4.4
Dual multiply (accumulate/subtract) Finite impulse response filter Multiply Multiply and accumulate Multiply and subtract
Instructions using the coefficient indirect addressing mode to access data are mainly instructions performing operations with three memory operands per cycle. Two of these operands (Xmem and Ymem) are accessed with the dual AR indirect addressing mode. The third operand (Cmem) is accessed with the coefficient indirect addressing mode. The Cmem operand is carried on the BB bus. Keep the following facts about the BB bus in mind as you use the coefficient indirect addressing mode:
- The BB bus is not connected to external memory. If a Cmem operand is
dbl(Cmem) = Lmem
3-18
SPRU375G
Consider the following instruction syntax. In one cycle, two multiplications can be performed in parallel. One memory operand (Cmem) is common to both multiplications, while dual AR indirect operands (Xmem and Ymem) are used for the other values in the multiplication.
ACx = Xmem * Cmem, ACy = Ymem * Cmem
To access three memory values (as in the above example) in a single cycle, the value referenced by Cmem must be located in a memory bank different from the one containing the Xmem and Ymem values. Table 39 introduces the operands available for the coefficient indirect addressing mode. Note that:
- Both pointer modification and address generation are linear or circular
according to the pointer configuration in status register ST2_55. The content of the 16-bit buffer start address register BSAC is added only if circular addressing is activated for CDP.
- All additions to and subtractions from CDP are done modulo 64K. You can-
not address data across main data pages without changing the value of CDPH (the high part of the extended coefficient data pointer).
*CDP
Data-memory
*(CDP + AR0)
Data-memory
SPRU375G
3-19
Circular Addressing
Each auxiliary register ARn has its own linear/circular configuration bit in ST2_55:
ARnLC 0 1 ARn Is Used For ... Linear addressing Circular addressing
The CDPLC bit in status register ST2_55 configures the DSP to use CDP for linear addressing or circular addressing:
CDPLC 0 1 CDP Is Used For ... Linear addressing Circular addressing
You can use the circular addressing instruction qualifier, circular(), if you want every pointer used by the instruction to be modified circularly, just add the circular() qualifier in parallel with the instruction. The circular addressing instruction qualifier overrides the linear/circular configuration in ST2_55.
3-20 Introduction to Addressing Modes SPRU375G
Chapter 4
with the kinds of registers, you see the notation <name>-AU for A-unit registers and <name>-DU for D-unit registers. So, dst-AU is a destination that is an A-unit register and src-DU is a source that is a D-unit register. In the few cases where that notation is insufficient, you see the cases listed in the Notes column.
- E: Whether that instruction has a parallel enable bit - S: The size of the instruction in bytes - C: Number of cycles required for the instruction - Pipe: The pipeline phase in which the instruction executes: Name AD D R X Phase Address Decode Read Execute
tion uses multiple operators, any other instruction that uses one or more of those same operators may not be placed in parallel.
4-1
- Buses: How many of each bus is used. The buses are: Name DR CR DW ACB KAB KDB Bus Data Read Coefficient Read Data Write Brings D unit registers to A unit and P unit operators Constants Constants
4-2
SPRU375G
[6]
[7] [8]
ACy = ACx + (K16 << #16) ACy = ACx + (K16 << #SHFT)
N N
4 4
1 1
X X
. .
. .
. .
. .
. .
. .
. .
. .
1 1
[9]
Notes:
Notes:
Bitwise AND Memory with Immediate Value and Compare to Zero (page 5-47)
[1] [2] TC1 = Smem & k16 TC2 = Smem & k16 N N 4 4 1 1 X X AU_ALU AU_ALU 1 1 . . . . 1 1 . . . . . . . . 1 1
Notes:
Notes:
. .
Notes:
These instructions execute in 3 cycles if the addressed instruction is in the instruction buffer unit.
Notes:
When this instruction is decoded to modify status bit CAFRZ (15), CAEN (14), or CACLR (13), the CPU pipeline is flushed and the instruction is executed in 5 cycles regardless of the instruction context.
Compare Accumulator, Auxiliary, or Temporary Register Content with AND (page 5-95)
[1] TCx = TCy & uns(src-AU RELOP dst-AU) TCx = TCy & uns(src RELOP dst) TCx = TCy & uns(src-DU RELOP dst-DU) [2] TCx = !TCy & uns(src-AU RELOP dst-AU) TCx = !TCy & uns(src RELOP dst) TCx = !TCy & uns(src-DU RELOP dst-DU) Y Y Y Y Y Y 3 3 3 3 3 3 1 1 1 1 1 1 X X X X X X AU_ALU AU_ALU DU_ALU AU_ALU AU_ALU DU_ALU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 . . 1 . . . . . . . . . . . . . See Note 2. See Note 2.
Notes:
Notes:
[2]
[2]
DU_ALU
Notes:
Notes:
[2]
[3]
ACx = Smem << #16 ACx = uns(Smem) ACx = uns(Smem) << #SHIFTW
N N N
2 3 4
1 1 1
X X X
1 1
. . .
. . .
1 1 1
. . .
. . .
. . .
. . .
. . .
DU_ALU + DU_SHIFT
[7]
ACx = M40(dbl(Lmem))
Notes:
Load Accumulator from Memory with Parallel Store Accumulator Content to Memory (page 5-185)
ACy = Xmem << #16, Ymem = HI(ACx << T2) N 4 1 X DU_ALU + DU_SHIFT 2 . . 2 . 2 . . .
Load Accumulator, Auxiliary, or Temporary Register with Immediate Value (page 5-199)
[1] [2] [3] dst = k4 dst = k4 dst = K16 Y Y N 2 2 4 1 1 1 X X X . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1
Notes:
Notes:
Notes:
Modify Auxiliary Register Content with Parallel Multiply and Accumulate (page 5-218)
[1] [2] mar(Xmem), ACx = M40(rnd(ACx + (uns(Ymem) * uns(coef(Cmem))))) mar(Xmem), ACx = M40(rnd((ACx >> #16) + (uns(Ymem) * uns(coef(Cmem))))) N N 4 4 1 1 X X DU_ALU DU_ALU 2 2 1 1 . . 2 2 1 1 . . . . . . . .
Modify Auxiliary Register Content with Parallel Multiply and Subtract (page 5-223)
mar(Xmem), ACx = M40(rnd(ACx (uns(Ymem) * uns(coef(Cmem))))) N 4 1 X DU_ALU 2 1 . 2 1 . . . .
Notes:
Notes:
. 1 1 . .
Notes:
Multiply and Accumulate with Parallel Load Accumulator from Memory (page 5-288)
ACx = rnd(ACx + (Tx * Xmem)), ACy = Ymem << #16 [, T3 = Xmem] N 4 1 X DU_ALU 2 . . 2 . . . . .
Notes:
Multiply and Accumulate with Parallel Store Accumulator Content to Memory (page 5-292)
ACy = rnd(ACy + (Tx * Xmem)), Ymem = HI(ACx << T2) [, T3 = Xmem] N 4 1 X DU_ALU + DU_SHIFT 2 . . 2 . 2 . . .
Multiply and Subtract with Parallel Load Accumulator from Memory (page 5-302)
ACx = rnd(ACx (Tx * Xmem)), ACy = Ymem << #16 [, T3 = Xmem] N 4 1 X DU_ALU 2 . . 2 . . . . .
Multiply and Subtract with Parallel Multiply and Accumulate (page 5-306)
[1] [2] ACx = M40(rnd(ACx (uns(Xmem) * uns(coef(Cmem))))), ACy = M40(rnd(ACy + (uns(Ymem) * uns(coef(Cmem))))) ACx = M40(rnd(ACx (uns(Xmem) * uns(coef(Cmem))))), ACy = M40(rnd((ACy >> #16) + (uns(Ymem) * uns(coef(Cmem))))) N N 4 4 1 1 X X DU_ALU DU_ALU 2 2 1 1 . . 2 2 1 1 . . . . . . . .
Multiply and Subtract with Parallel Store Accumulator Content to Memory (page 5-311)
ACy = rnd(ACy (Tx * Xmem)), Ymem = HI(ACx << T2) [, T3 = Xmem] N 4 1 X DU_ALU + DU_SHIFT 2 . . 2 . 2 . . .
Notes:
Pop Accumulator or Extended Auxiliary Register Content from Stack Pointers (page 5-330)
xdst = popboth() Y 2 1 X 1 . 1 2 . . . . .
Notes:
Push Accumulator or Extended Auxiliary Register Content to Stack Pointers (page 5-338)
pushboth(xsrc) Y 2 1 X 1 . 1 . . 2 . . .
Notes:
Notes:
When this instruction is decoded to modify status bit CAFRZ (15), CAEN (14), or CACLR (13), the CPU pipeline is flushed and the instruction is executed in 5 cycles regardless of the instruction context.
Notes:
Notes:
. . . . .
Notes:
[14]
Notes:
Notes:
Notes:
Notes:
Notes:
Chapter 5
5-1
Absolute Distance
Syntax Characteristics
No. [1] Syntax abdst(Xmem, Ymem, ACx, ACy) Parallel Enable Bit No Size 4 Cycles 1 Pipeline X
1000 0110 XXXM MMYY YMMM DDDD 1111 xxn% ACx, ACy, Xmem, Ymem This instruction executes two operations in parallel: one in the D-unit MAC and one in the D-unit ALU:
ACy = ACy + |HI(ACx)| ACx = (Xmem << #16) (Ymem << #16)
The absolute value of accumulator ACx content is computed and added to accumulator ACy content through the D-unit MAC. When an overflow is detected according to M40:
- the destination accumulator overflow status bit (ACOVy) is set - the destination register (ACy) is saturated according to SATD
The Ymem content shifted left 16 bits is subtracted from the Xmem content shifted left 16 bits in the D-unit ALU.
- Input operands (Xmem and Ymem) are sign extended to 40 bits according
to SXMD.
- CARRY status bit depends on M40. Subtraction borrow bit is reported in
the destination accumulator overflow status bit (ACOVx) is set the destination register (ACx) is saturated according to SATD
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, the subtract operation does not have any overflow detection, report, and saturation after the shifting operation. Status Bits Affected by Affects Repeat
5-2
See Also
Example
Syntax abdst(*AR0+, *AR1, AC0, AC1) Description The absolute value of the content of AC0 is added to the content of AC1 and the result is stored in AC1. The content addressed by AR1 is subtracted from the content addressed by AR0 and the result is stored in AC0. The content of AR0 is incremented by 1.
After 00 0000 0000 00 E800 0000 202 302 3400 EF00 0 0 0 1 1 AC0 AC1 AR0 AR1 202 302 ACOV0 ACOV1 CARRY M40 SXMD 00 4500 0000 00 E800 0000 203 302 3400 EF00 0 0 0 1 1
Before AC0 AC1 AR0 AR1 202 302 ACOV0 ACOV1 CARRY M40 SXMD
SPRU375G
5-3
Absolute Value
Absolute Value
Syntax Characteristics
No. [1] Syntax dst = |src| Parallel Enable Bit Yes Size 2 Cycles 1 Pipeline X
This instruction computes the absolute value of the source register (src).
- When the destination register (dst) is an accumulator: J J
The operation is performed on 40 bits in the D-unit ALU. If an auxiliary or temporary register is the source operand of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended to 40 bits according to SXMD. If M40 = 0, the sign of the source register is extracted at bit position 31. If src(31) = 1, the source register content is negated. If src(31) = 0, the source register content is moved to the destination accumulator. If M40 = 1, the sign of the source register is extracted at bit position 39. If src(39) = 1, the source register content is negated. If src(39) = 0, the source register content is moved to the destination accumulator. During the 40-bit move operation, an overflow and CARRY bit status are detected according to M40: H H H The destination accumulator overflow status bit (ACOVx) is set. The destination register is saturated according to SATD. The CARRY status bit is updated as follows: If the result of the operation stored in the destination register is 0, CARRY is set; otherwise, CARRY is cleared.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. The sign of the source register is extracted at bit position 15. If src(15) = 1, the source register content is negated. If src(15) = 0, the source register content is moved to the destination register. Overflow is detected at bit position 15. The destination register is saturated according to SATA.
SPRU375G
J 5-4
Absolute Value
Compatibility with C54x devices (C54CM = 1) When C54CM =1, this instruction is executed as if M40 status bit was locally set to 1. To ensure compatibility versus overflow detection and saturation of destination accumulator, this instruction must be executed with M40 = 0. Status Bits Affected by Affects Repeat See Also C54CM, M40, SATA, SATD, SXMD ACOVx, CARRY
This instruction can be repeated. See the following other related instructions:
- Addition with Absolute Value
Example 1
Syntax AC1 = |AC0|
Before AC1 AC0 M40 00 0000 2000 82 0000 1234 1
Example 2
Syntax AC1 = |AR1|
Before AC1 AR1 CARRY 00 0000 2000 0000 0
Example 3
Syntax AC1 = |AR1| Description The absolute value of the content of AR1 is stored in AC1. Since SXMD = 1, AR1 content is sign extended. The resulting 40-bit data is negated since M40 = 0 and AR1(31) = 1.
After 00 0000 2000 8700 0 1 AC1 AR1 M40 SXMD 00 0000 7900 8700 0 1
SPRU375G
5-5
Absolute Value
Example 4
Syntax T1 = |AC0| Description The absolute value of the content of AC0(150) is stored in T1. The sign bit is extracted at AC0(15). Since AC0(15) = 0, T1 = AC0(150).
After 2000 80 0002 1234 T1 AC0 1234 80 0002 1234
Before T1 AC0
Example 5
Syntax T1 = |AC0| Description The absolute value of the content of AC0(150) is stored in T1. The sign bit is extracted at AC0(15). Since AC0(15) = 1, T1 equals the negated value of AC0(150).
After 2000 80 0002 9234 T1 AC0 6DCC 80 0002 9234
Before T1 AC0
5-6
SPRU375G
Addition
Addition
Syntax Characteristics
No. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] Syntax dst = dst + src dst = dst + k4 dst = src + K16 dst = src + Smem ACy = ACy + (ACx << Tx) ACy = ACy + (ACx << #SHIFTW) ACy = ACx + (K16 << #16) ACy = ACx + (K16 << #SHFT) ACy = ACx + (Smem << Tx) ACy = ACx + (Smem << #16) ACy = ACx + uns(Smem) + CARRY ACy = ACx + uns(Smem) ACy = ACx + (uns(Smem) << #SHIFTW) ACy = ACx + dbl(Lmem) ACx = (Xmem << #16) + (Ymem << #16) Smem = Smem + K16 Parallel Enable Bit Yes Yes No No Yes Yes No No No No No No No No No No Size 2 2 4 3 2 3 4 4 3 3 3 3 4 3 3 4 Cycles 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Pipeline X X X X X X X X X X X X X X X X
These instructions perform an addition operation. Affected by Affects CARRY, C54CM, M40, SATA, SATD, SXMD ACOVx, ACOVy, CARRY
SPRU375G
5-7
Addition
See Also
5-8
SPRU375G
Addition
Addition
Syntax Characteristics
No. [1] Syntax dst = dst + src Parallel Enable Bit Yes Size 2 Cycles 1 Pipeline X
The operation is performed on 40 bits in the D-unit ALU. Input operands are sign extended to 40 bits according to SXMD. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended according to SXMD. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD.
J J
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. Addition overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 + AC1 Description The content of AC1 is added to the content of AC0 and the result is stored in AC0.
SPRU375G
5-9
Addition
Addition
Syntax Characteristics
No. [2] Syntax dst = dst + k4 Parallel Enable Bit Yes Size 2 Cycles 1 Pipeline X
This instruction performs an addition operation between a register content and a 4-bit unsigned constant, k4.
- When the destination (dst) operand is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD.
The operation is performed on 16 bits in the A-unit ALU. Addition overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 + k4 Description The content of AC0 is added to an unsigned 4-bit value and the result is stored in AC0.
5-10
SPRU375G
Addition
Addition
Syntax Characteristics
No. [3] Syntax dst = src + K16 Parallel Enable Bit No Size 4 Cycles 1 Pipeline X
This instruction performs an addition operation between a register content and a 16-bit signed constant, K16.
- When the destination (dst) operand is an accumulator: J J
The operation is performed on 40 bits in the D-unit ALU. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended according to SXMD. The 16-bit constant, K16, is sign extended to 40 bits according to SXMD. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD. The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. Addition overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
J J J
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC1 = AC0 + #2E00h Description The content of AC0 is added to the signed 16-bit value (2E00h) and the result is stored in AC1.
SPRU375G
5-11
Addition
Addition
Syntax Characteristics
No. [4] Syntax dst = src + Smem Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction performs an addition operation between a register content and the content of a memory (Smem) location.
- When the destination (dst) operand is an accumulator: J J
The operation is performed on 40 bits in the D-unit ALU. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended according to SXMD. The content of the memory location is sign extended to 40 bits according to SXMD. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD.
J J J
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. Addition overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects
5-12 Instruction Set Descriptions
Addition
Repeat Example
Syntax T1 = T0 + *AR3+
Description The content of T0 is added to the content addressed by AR3 and the result is stored in T1. AR3 is incremented by 1.
After 0302 EF00 3300 0 0 AR3 302 T0 T1 CARRY 0303 EF00 3300 2200 1
SPRU375G
5-13
Addition
Addition
Syntax Characteristics
No. [5] Syntax ACy = ACy + (ACx << Tx) Parallel Enable Bit Yes Size 2 Cycles 1 Pipeline X
This instruction performs an addition operation between an accumulator content ACy and an accumulator content ACx shifted by the content of Tx.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1:
- An intermediary shift operation is performed as if M40 is locally set to 1 and
no overflow detection, report, and saturation is done after the shifting operation.
- The 6 LSBs of Tx are used to determine the shift quantity. The 6 LSBs of
Tx define a shift quantity within 32 to +31. When the value is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 + (AC1 << T0) Description The content of AC1 shifted by the content of T0 is added to the content of AC0 and the result is stored in AC0.
5-14
SPRU375G
Addition
Addition
Syntax Characteristics
No. [6] Syntax ACy = ACy + (ACx << #SHIFTW) Parallel Enable Bit Yes Size 3 Cycles 1 Pipeline X
This instruction performs an addition operation between an accumulator content ACy and an accumulator content ACx shifted by the 6-bit value, SHIFTW.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 + (AC1 << #31) Description The content of AC1 shifted left by 31 bits is added to the content of AC0 and the result is stored in AC0.
SPRU375G
5-15
Addition
Addition
Syntax Characteristics
No. [7] Syntax ACy = ACx + (K16 << #16) Parallel Enable Bit No Size 4 Cycles 1 Pipeline X
This instruction performs an addition operation between an accumulator content ACx and a 16-bit signed constant, K16, shifted left by 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + (#2E00h << #16) Description A signed 16-bit value (2E00h) shifted left by 16 bits is added to the content of AC1 and the result is stored in AC0.
5-16
SPRU375G
Addition
Addition
Syntax Characteristics
No. [8] Syntax ACy = ACx + (K16 << #SHFT) Parallel Enable Bit No Size 4 Cycles 1 Pipeline X
0111 0000 KKKK KKKK KKKK KKKK SSDD SHFT ACx, ACy, K16, SHFT This instruction performs an addition operation between an accumulator content ACx and a 16-bit signed constant, K16, shifted left by the 4-bit value, SHFT.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + (#2E00h << #15) Description A signed 16-bit value (2E00h) shifted left by 15 bits is added to the content of AC1 and the result is stored in AC0.
SPRU375G
5-17
Addition
Addition
Syntax Characteristics
No. [9] Syntax ACy = ACx + (Smem << Tx) Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction performs an addition operation between an accumulator content ACx and the content of a memory (Smem) location shifted by the content of Tx.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1:
- An intermediary shift operation is performed as if M40 is locally set to 1 and
no overflow detection, report, and saturation is done after the shifting operation.
- The 6 LSBs of Tx are used to determine the shift quantity. The 6 LSBs of
Tx define a shift quantity within 32 to +31. When the value is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat
5-18
Addition
Example
Syntax AC0 = AC1 + (*AR1 << T0) Description The content addressed by AR1 shifted left by the content of T0 is added to the content of AC1 and the result is stored in AC0.
After 00 0000 0000 00 2300 0000 000C 0200 0300 0 0 0 0 AC0 AC1 T0 AR1 200 SXMD M40 ACOV0 CARRY 00 2330 0000 00 2300 0000 000C 0200 0300 0 0 0 1
SPRU375G
5-19
Addition
Addition
Syntax Characteristics
No. [10] Syntax ACy = ACx + (Smem << #16) Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction performs an addition operation between an accumulator content ACx and the content of a memory (Smem) location shifted left by 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. If the result
of the addition generates a carry, the CARRY status bit is set; otherwise, the CARRY status bit is not affected.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + (*AR3 << #16) Description The content addressed by AR3 shifted left by 16 bits is added to the content of AC1 and the result is stored in AC0.
5-20
SPRU375G
Addition
Addition
Syntax Characteristics
No. [11] Syntax ACy = ACx + uns(Smem) + CARRY Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction performs an addition operation of the accumulator content ACx, the content of a memory (Smem) location, and the value of the CARRY status bit.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are extended to 40 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
- Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + uns(*AR3) + CARRY Description The CARRY status bit and the unsigned content addressed by AR3 are added to the content of AC1 and the result is stored in AC0.
SPRU375G
5-21
Addition
Addition
Syntax Characteristics
No. [12] Syntax ACy = ACx + uns(Smem) Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction performs an addition operation between an accumulator content ACx and the content of a memory (Smem) location.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are extended to 40 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
- Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + uns(*AR3) Description The unsigned content addressed by AR3 is added to the content of AC1 and the result is stored in AC0.
5-22
SPRU375G
Addition
Addition
Syntax Characteristics
No. [13] Syntax ACy = ACx + (uns(Smem) << #SHIFTW) Parallel Enable Bit No Size 4 Cycles 1 Pipeline X
1111 1001 AAAA AAAI uxSH IFTW SSDD 00xx ACx, ACy, SHIFTW, Smem This instruction performs an addition operation between an accumulator content ACx and the content of a memory (Smem) location shifted by the 6-bit value, SHIFTW.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are extended to 40 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
- The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat C54CM, M40, SATD, SXMD ACOVy, CARRY
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax AC0 = AC1 + (uns(*AR3) << #31) Description The unsigned content addressed by AR3 shifted left by 31 bits is added to the content of AC1 and the result is stored in AC0.
SPRU375G
5-23
Addition
Addition
Syntax Characteristics
No. [14] Syntax ACy = ACx + dbl(Lmem) Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction performs an addition operation between an accumulator content ACx and the content of data memory operand dbl(Lmem).
- The data memory operand dbl(Lmem) addresses are aligned: J J
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + dbl(*AR3+) Description The content (long word) addressed by AR3 and AR3 + 1 is added to the content of AC1 and the result is stored in AC0. Because this instruction is a long-operand instruction, AR3 is incremented by 2 after the execution.
5-24
SPRU375G
Addition
Addition
Syntax Characteristics
No. [15] Syntax ACx = (Xmem << #16) + (Ymem << #16) Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction performs an addition operation between the content of data memory operand Xmem shifted left 16 bits, and the content of data memory operand Ymem shifted left 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = (*AR3 << #16) + (*AR4 << #16) Description The content addressed by AR3 shifted left by 16 bits is added to the content addressed by AR4 shifted left by 16 bits and the result is stored in AC0.
SPRU375G
5-25
Addition
Addition
Syntax Characteristics
No. [16] Syntax Smem = Smem + K16 Parallel Enable Bit No Size 4 Cycles 1 Pipeline X
This instruction performs an addition operation between a 16-bit signed constant, K16, and the content of a memory (Smem) location.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD and
being stored in memory. Saturation values are 7FFFh or 8000h. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat SATD, SXMD ACOV0, CARRY
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax *AR3 = *AR3 + #2E00h Description The content addressed by AR3 is added to a signed 16-bit value (2E00h) and the result is stored back into the location addressed by AR3.
5-26
SPRU375G
This instruction computes the absolute value of accumulator ACx and adds the result to accumulator ACy. This instruction is performed in the D-unit MAC:
- The absolute value of accumulator ACx is computed by multiplying
according to SATD.
- The result of the absolute value of the higher part of ACx is in the lower
part of ACy. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat FRCT, M40, RDM, SATD, SMUL ACOVy
SPRU375G
5-27
See Also
Example
Syntax AC0 = AC0 + |AC1| Description The absolute value of AC1 is added to the content of AC0 and the result is stored in AC0.
5-28
SPRU375G
1000 0111 XXXM MMYY YMMM SSDD 100x xxxx ACx, ACy, T2, Xmem, Ymem This instruction performs two operations in parallel: addition and store. The first operation performs an addition between an accumulator content ACx and the content of data memory operand Xmem shifted left by 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. When
C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation.
- When an overflow is detected, the accumulator is saturated according to
SATD. The second operation shifts the accumulator ACy by the content of T2 and stores ACy(3116) to data memory operand Ymem. If the 16-bit value in T2 is not within 32 to +31, the shift is saturated to 32 or +31 and the shift is performed with this value.
- The input operand is shifted in the D-unit shifter according to SXMD. - After the shift, the high part of the accumulator, ACy(3116), is stored to
the memory location. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When this instruction is executed with C54CM = 1, the 6 LSBs of T2 are used to determine the shift quantity. The 6 LSBs of T2 define a shift quantity within 32 to +31. When the 16-bit value in T2 is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1.
SPRU375G Instruction Set Descriptions 5-29
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Addition - Store Accumulator Content to Memory - Subtraction with Parallel Store Accumulator Content to Memory
Example
Syntax AC0 = AC1 + (*AR3 << #16), *AR4 = HI(AC0 << T2) Description Both instructions are performed in parallel. The content addressed by AR3 shifted left by 16 bits is added to the content of AC1 and the result is stored in AC0. The content of AC0 is shifted by the content of T2, and AC0(3116) is stored at the address of AR4.
5-30
SPRU375G
Opcode
TC1 TC2
1101 1110 AAAA AAAI SSDD 0000 1101 1110 AAAA AAAI SSDD 0001
Operands Description
ACx, ACy, Smem, TCx This instruction evaluates the selected TCx status bit and based on the result of the test, either an addition or a subtraction is performed. Evaluation of the condition on the TCx status bit is performed during the Execute phase of the instruction.
TC1 or TC2 0 1 Operation ACy = ACx (Smem << #16) ACy = ACx + (Smem << #16)
This instruction subtracts the content of a memory (Smem) location shifted left by 16 bits from accumulator ACx and stores the result in accumulator ACy.
J J J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are sign extended to 40 bits according to SXMD. The shift operation is equivalent to the signed shift instruction. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD.
This instruction performs an addition operation between accumulator ACx and the content of a memory (Smem) location shifted left by 16 bits and stores the result in accumulator ACy.
J J SPRU375G
The operation is performed on 40 bits in the D-unit ALU. Input operands are sign extended to 40 bits according to SXMD.
Instruction Set Descriptions 5-31
J J J
The shift operation is equivalent to the signed shift instruction. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat See Also C54CM, M40, SATD, SXMD, TCx ACOVy, CARRY
This instruction can be repeated. See the following other related instructions:
- Addition or Subtraction Conditionally with Shift - Addition, Subtraction, or Move Accumulator Content Conditionally
Example 1
Syntax AC0 = adsc(*AR3, AC1, TC1) Description If TC1 = 1, the content addressed by AR3 shifted left by 16 bits is added to the content of AC1 and the result is stored in AC0. If TC1 = 0, the content addressed by AR3 shifted left by 16 bits is subtracted from the content of AC1 and the result is stored in AC0.
Example 2
Syntax AC1 = adsc(*AR1, AC0, TC2) Description TC2 = 1, the content addressed by AR1 shifted left by 16 bits is added to the content of AC0 and the result is stored in AC1. The result generated an overflow and a carry.
After AC0 AC1 AR1 200 TC2 SXMD M40 ACOV1 CARRY
Before AC0 AC1 AR1 200 TC2 SXMD M40 ACOV1 CARRY
5-32
SPRU375G
1101 1101 AAAA AAAI SSDD ss10 ACx, ACy, Tx, Smem, TC1, TC2 This instruction evaluates the TC1 status bit and based on the result of the test, either an addition or a subtraction is performed; this instruction evaluates the TC2 status bit and based on the result of the test, either a shift left by 16 bits or the content of Tx is performed. Evaluation of the condition on the TCx status bits is performed during the Execute phase of the instruction.
TC1 0 0 1 1 TC2 0 1 0 1 Operation ACy = ACx (Smem << Tx) ACy = ACx (Smem << #16) ACy = ACx + (Smem << Tx) ACy = ACx + (Smem << #16)
This instruction subtracts the content of a memory (Smem) location shifted left by the content of Tx from an accumulator ACx and stores the result in accumulator ACy.
- TC1 = 0 and TC2 = 1, then ACy = ACx (Smem << #16):
This instruction subtracts the content of a memory (Smem) location shifted left by 16 bits from an accumulator ACx and stores the result in accumulator ACy.
J J J J
The operation is performed on 40 bits in the D-unit shifter. Input operands are sign extended to 40 bits according to SXMD. The shift operation is equivalent to the signed shift instruction. Overflow detection and CARRY status bit depends on M40. The subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit. When an overflow is detected, the accumulator is saturated according to SATD.
Instruction Set Descriptions 5-33
SPRU375G
This instruction performs an addition operation between an accumulator ACx and the content of a memory (Smem) location shifted left by the content of Tx and stores the result in accumulator ACy.
- TC1 = 1 and TC2 = 1, then ACy = ACx + (Smem << #16):
This instruction performs an addition operation between an accumulator ACx and the content of a memory (Smem) location shifted left by 16 bits and stores the result in accumulator ACy.
J J J J J
The operation is performed on 40 bits in the D-unit shifter. Input operands are sign extended to 40 bits according to SXMD. The shift operation is equivalent to the signed shift instruction. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1:
- An intermediary shift operation is performed as if M40 is locally set to 1 and
no overflow detection, report, and saturation is done after the shifting operation.
- The 6 LSBs of Tx are used to determine the shift quantity. The 6 LSBs of
Tx define a shift quantity within 32 to +31. When the value is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat See Also C54CM, M40, SATD, SXMD, TC1, TC2 ACOVy, CARRY
This instruction can be repeated. See the following other related instructions:
- Addition or Subtraction Conditionally - Addition, Subtraction, or Move Accumulator Content Conditionally
5-34
SPRU375G
Example
Syntax AC2 = ads2c(*AR2, AC0, T1, TC1, TC2) Description TC1 = 1 and TC2 = 0, the content addressed by AR2 shifted left by the content of T1 is added to the content of AC0 and the result is stored in AC2. The result generated an overflow.
Before AC0 AC2 AR2 201 T1 TC1 TC2 M40 ACOV2 CARRY
After AC0 AC2 AR2 201 T1 TC1 TC2 M40 ACOV2 CARRY
SPRU375G
5-35
This instruction evaluates the TCx status bits and based on the result of the test, an addition, a move, or a subtraction is performed. Evaluation of the condition on the TCx status bits is performed during the Execute phase of the instruction.
TC1 0 0 1 1 TC2 0 1 0 1 Operation ACy = ACx (Smem << #16) ACy = ACx ACy = ACx + (Smem << #16) ACy = ACx
The 40-bit move operation is performed in the D-unit ALU. During the 40-bit move operation, an overflow is detected according to M40: H H the destination accumulator overflow status bit (ACOVy) is set. the destination register (ACy) is saturated according to SATD.
This instruction subtracts the content of a memory (Smem) location shifted left by 16 bits from accumulator ACx and stores the result in accumulator ACy.
J J J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are sign extended to 40 bits according to SXMD. The shift operation is equivalent to the signed shift instruction. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD.
SPRU375G
5-36
This instruction performs an addition operation between accumulator ACx and the content of a memory (Smem) location shifted left by 16 bits and stores the result in accumulator ACy.
J J J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are sign extended to 40 bits according to SXMD. The shift operation is equivalent to the signed shift instruction. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat See Also C54CM, M40, SATD, SXMD, TC1, TC2 ACOVy, CARRY
This instruction can be repeated. See the following other related instructions:
- Addition or Subtraction Conditionally - Addition or Subtraction Conditionally with Shift
Example
Syntax AC0 = adsc(*AR3, AC1, TC1, TC2) Description If TC2 = 1, the content of AC1 is stored in AC0. If TC2 = 0 and TC1 = 1, the content addressed by AR3 shifted left by 16 bits is added to the content of AC1 and the result is stored in AC0. If TC2 = 0 and TC1 = 0, the content addressed by AR3 shifted left by 16 bits is subtracted from the content of AC1 and the result is stored in AC0.
SPRU375G
5-37
Bitwise AND
Bitwise AND
Syntax Characteristics
Parallel Enable Bit Yes Yes No No Yes No No No
Syntax dst = dst & src dst = src & k8 dst = src & k16 dst = src & Smem ACy = ACy & (ACx <<< #SHIFTW) ACy = ACx & (k16 <<< #16) ACy = ACx & (k16 <<< #SHFT) Smem = Smem & k16
Size 2 3 4 3 3 4 4 4
Cycles 1 1 1 1 1 1 1 1
Pipeline X X X X X X X X
Description
register.
- In the A-unit ALU, if the destination operand is the memory.
Status Bits
Affected by Affects
C54CM none
See Also
5-38
SPRU375G
Bitwise AND
Bitwise AND
Syntax Characteristics
Parallel Enable Bit Yes
No. [1]
Size 2
Cycles 1
Pipeline X
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC1 = AC1 & AC0
Description The content of AC0 is ANDed with the content of AC1 and the result is stored in AC1.
SPRU375G
5-39
Bitwise AND
Bitwise AND
Syntax Characteristics
Parallel Enable Bit Yes
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction performs a bitwise AND operation between a source (src) register content and an 8-bit value, k8.
- When the destination (dst) operand is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 & #FFh
Description The content of AC1 is ANDed with the unsigned 8-bit value (FFh) and the result is stored in AC0.
5-40
SPRU375G
Bitwise AND
Bitwise AND
Syntax Characteristics
Parallel Enable Bit No
No. [3]
Size 4
Cycles 1
Pipeline X
This instruction performs a bitwise AND operation between a source (src) register content and a 16-bit unsigned constant, k16.
-
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 & #FFFFh
Description The content of AC1 is ANDed with the unsigned 16-bit value (FFFFh) and the result is stored in AC0.
SPRU375G
5-41
Bitwise AND
Bitwise AND
Syntax Characteristics
Parallel Enable Bit No
No. [4]
Size 3
Cycles 1
Pipeline X
This instruction performs a bitwise AND operation between a source (src) register content and a memory (Smem) location.
- When the destination (dst) operand is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 & *AR3
Description The content of AC1 is ANDed with the content addressed by AR3 and the result is stored in AC0.
5-42
SPRU375G
Bitwise AND
Bitwise AND
Syntax Characteristics
Parallel Enable Bit Yes
No. [5]
Size 3
Cycles 1
Pipeline X
This instruction performs a bitwise AND operation between an accumulator (ACy) content and an accumulator (ACx) content shifted by the 6-bit value, SHIFTW.
- The shift and AND operations are performed in one cycle in the D-unit
shifter.
- Input operands are zero extended to 40 bits. - The input operand (ACx) is shifted by a 6-bit immediate value in the D-unit
shifter.
- The CARRY status bit is not affected by the logical shift operation.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the intermediary logical shift is performed as if M40 is locally set to 1. The 8 upper bits of the 40-bit intermediary result are not cleared. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 & (AC1 <<< #30) Description The content of AC0 is ANDed with the content of AC1 logically shifted left by 30 bits and the result is stored in AC0.
C54CM none
SPRU375G
5-43
Bitwise AND
Bitwise AND
Syntax Characteristics
Parallel Enable Bit No
No. [6]
Size 4
Cycles 1
Pipeline X
This instruction performs a bitwise AND operation between an accumulator (ACx) content and a 16-bit unsigned constant, k16, shifted left by 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are zero extended to 40 bits. - The input operand (k16) is shifted 16 bits to the MSBs.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax
Description The content of AC1 is ANDed with the unsigned 16-bit value (FFFFh) logically shifted left by 16 bits and the result is stored in AC0.
5-44
SPRU375G
Bitwise AND
Bitwise AND
Syntax Characteristics
Parallel Enable Bit No
No. [7]
Size 4
Cycles 1
Pipeline X
0111 0010 kkkk kkkk kkkk kkkk SSDD SHFT ACx, ACy, k16, SHFT This instruction performs a bitwise AND operation between an accumulator (ACx) content and a 16-bit unsigned constant, k16, shifted left by the 4-bit value, SHFT.
- The shift and AND operations are performed in one cycle in the D-unit
shifter.
- Input operands are zero extended to 40 bits. - The input operand (k16) is shifted by a 4-bit immediate value in the D-unit
shifter.
- The CARRY status bit is not affected by the logical shift operation.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax
Description The content of AC1 is ANDed with the unsigned 16-bit value (FFFFh) logically shifted left by 15 bits and the result is stored in AC0.
SPRU375G
5-45
Bitwise AND
Bitwise AND
Syntax Characteristics
Parallel Enable Bit No
No. [8]
Size 4
Cycles 1
Pipeline X
This instruction performs a bitwise AND operation between a memory (Smem) location and a 16-bit unsigned constant, k16.
- The operation is performed on 16 bits in the A-unit ALU. - The result is stored in memory.
Status Bits
Affected by Affects
none none
Repeat
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax *AR1 = *AR1 & #0FC0 Description The content addressed by AR1 is ANDed with the unsigned 16-bit value (FC0h) and the result is stored in the location addressed by AR1.
After 5678 *AR1 0640
Before *AR1
5-46
SPRU375G
Size 4 4
Cycles 1 1
Pipeline X X
Opcode
TC1 TC2
1111 0010 AAAA AAAI kkkk kkkk kkkk kkkk 1111 0011 AAAA AAAI kkkk kkkk kkkk kkkk
Operands Description
k16, Smem, TCx This instruction performs a bit field manipulation in the A-unit ALU. The 16-bit field mask, k16, is ANDed with the memory (Smem) operand and the result is compared to 0:
if( ((Smem) AND k16 ) == 0) TCx = 0 else TCx = 1
Status Bits
Affected by Affects
none TCx
Repeat
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated. See the following other related instructions:
- Bitwise AND
See Also
Example
Syntax TC1 = *AR0 & #0060h Description The unsigned 16-bit value (0060h) is ANDed with the content addressed by AR0. The result is 1, TC1 is set to 1.
SPRU375G
5-47
Bitwise OR
Bitwise OR
Syntax Characteristics
Parallel Enable Bit Yes Yes No No Yes No No No
Syntax dst = dst | src dst = src | k8 dst = src | k16 dst = src | Smem ACy = ACy | (ACx <<< #SHIFTW) ACy = ACx | (k16 <<< #16) ACy = ACx | (k16 <<< #SHFT) Smem = Smem | k16
Size 2 3 4 3 3 4 4 4
Cycles 1 1 1 1 1 1 1 1
Pipeline X X X X X X X X
Description
register.
- In the A-unit ALU, if the destination operand is the memory.
Status Bits
Affected by Affects
C54CM none
See Also
5-48
SPRU375G
Bitwise OR
Bitwise OR
Syntax Characteristics
Parallel Enable Bit Yes
No. [1]
Size 2
Cycles 1
Pipeline X
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC0 | AC1
Description The content of AC0 is ORed with the content of AC1 and the result is stored in AC0.
SPRU375G
5-49
Bitwise OR
Bitwise OR
Syntax Characteristics
Parallel Enable Bit Yes
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction performs a bitwise OR operation between a source (src) register content and an 8-bit value, k8.
- When the destination (dst) operand is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 | #FFh
Description The content of AC1 is ORed with the unsigned 8-bit value (FFh) and the result is stored in AC0.
5-50
SPRU375G
Bitwise OR
Bitwise OR
Syntax Characteristics
Parallel Enable Bit No
No. [3]
Size 4
Cycles 1
Pipeline X
This instruction performs a bitwise OR operation between a source (src) register content and a 16-bit unsigned constantk16.
-
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 | #FFFFh
Description The content of AC1 is ORed with the unsigned 16-bit value (FFFFh) and the result is stored in AC0.
SPRU375G
5-51
Bitwise OR
Bitwise OR
Syntax Characteristics
Parallel Enable Bit No
No. [4]
Size 3
Cycles 1
Pipeline X
This instruction performs a bitwise OR operation between a source (src) register content and a memory (Smem) location.
- When the destination (dst) operand is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 | *AR3
Description The content of AC1 is ORed with the content addressed by AR3 and the result is stored in AC0.
5-52
SPRU375G
Bitwise OR
Bitwise OR
Syntax Characteristics
Parallel Enable Bit Yes
No. [5]
Size 3
Cycles 1
Pipeline X
This instruction performs a bitwise OR operation between an accumulator (ACy) content and and an accumulator (ACx) content shifted by the 6-bit value, SHIFTW.
- The shift and OR operations are performed in one cycle in the D-unit
shifter.
- Input operands are zero extended to 40 bits. - The input operand (ACx) is shifted by a 6-bit immediate value in the D-unit
shifter.
- The CARRY status bit is not affected by the logical shift operation.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the intermediary logical shift is performed as if M40 is locally set to 1. The 8 upper bits of the 40-bit intermediary result are not cleared. Status Bits Affected by Affects Repeat Example
Syntax AC1 = AC1 | (AC0 <<< #4) Description The content of AC1 is ORed with the content of AC0 logically shifted left by 4 bits and the result is stored in AC1.
C54CM none
SPRU375G
5-53
Bitwise OR
Bitwise OR
Syntax Characteristics
Parallel Enable Bit No
No. [6]
Size 4
Cycles 1
Pipeline X
This instruction performs a bitwise OR operation between an accumulator (ACx) content and a 16-bit unsigned constant, k16, shifted left by 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are zero extended to 40 bits. - The input operand (k16) is shifted 16 bits to the MSBs.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax
Description The content of AC1 is ORed with the unsigned 16-bit value (FFFFh) logically shifted left by 16 bits and the result is stored in AC0.
5-54
SPRU375G
Bitwise OR
Bitwise OR
Syntax Characteristics
Parallel Enable Bit No
No. [7]
Size 4
Cycles 1
Pipeline X
0111 0011 kkkk kkkk kkkk kkkk SSDD SHFT ACx, ACy, k16, SHFT This instruction performs a bitwise OR operation between an accumulator (ACx) content and a 16-bit unsigned constant, k16, shifted left by the 4-bit value, SHFT.
- The shift and OR operations are performed in one cycle in the D-unit
shifter.
- Input operands are zero extended to 40 bits. - The input operand (k16) is shifted by a 4-bit immediate value in the D-unit
shifter.
- The CARRY status bit is not affected by the logical shift operation
Status Bits
Affected by Affects
none none
Repeat Example
Syntax
Description The content of AC1 is ORed with the unsigned 16-bit value (FFFFh) logically shifted left by 15 bits and the result is stored in AC0.
SPRU375G
5-55
Bitwise OR
Bitwise OR
Syntax Characteristics
Parallel Enable Bit No
No. [8]
Size 4
Cycles 1
Pipeline X
This instruction performs a bitwise OR operation between a memory (Smem) location and a 16-bit unsigned constant, k16.
- The operation is performed on 16 bits in the A-unit ALU. - The result is stored in memory.
Status Bits
Affected by Affects
none none
Repeat
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax *AR1 = *AR1 | #0FC0h Description The content addressed by AR1 is ORed with the unsigned 16-bit value (FC0h) and the result is stored in the location addressed by AR1.
After 5678 *AR1 5FF8
Before *AR1
5-56
SPRU375G
Syntax dst = dst ^ src dst = src ^ k8 dst = src ^ k16 dst = src ^ Smem ACy = ACy ^ (ACx <<< #SHIFTW) ACy = ACx ^ (k16 <<< #16) ACy = ACx ^ (k16 <<< #SHFT) Smem = Smem ^ k16
Size 2 3 4 3 3 4 4 4
Cycles 1 1 1 1 1 1 1 1
Pipeline X X X X X X X X
Description
register.
- In the A-unit ALU, if the destination operand is the memory.
Status Bits
Affected by Affects
C54CM none
See Also
SPRU375G
5-57
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction performs a bitwise exclusive-OR (XOR) operation between two registers.
- When the destination (dst) operand is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC1 = AC1 ^ AC0
Description The content of AC0 is XORed with the content of AC1 and the result is stored in AC1.
5-58
SPRU375G
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction performs a bitwise exclusive-OR (XOR) operation between a source (src) register content and an 8-bit value, k8.
- When the destination (dst) operand is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 ^ #FFh
Description The content of AC1 is XORed with the unsigned 8-bit value (FFh) and the result is stored in AC0.
SPRU375G
5-59
No. [3]
Size 4
Cycles 1
Pipeline X
This instruction performs a bitwise exclusive-OR (XOR) operation between a source (src) register content and a 16-bit unsigned constant, k16.
- When the destination (dst) operand is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 ^ #FFFFh
Description The content of AC1 is XORed with the unsigned 16-bit value (FFFFh) and the result is stored in AC0.
5-60
SPRU375G
No. [4]
Size 3
Cycles 1
Pipeline X
This instruction performs a bitwise exclusive-OR (XOR) operation between a source (src) register content and a memory (Smem) location.
- When the destination (dst) operand is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are zero extended to 40 bits. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 ^ *AR3
Description The content of AC1 is XORed with the content addressed by AR3 and the result is stored in AC0.
SPRU375G
5-61
No. [5]
Size 3
Cycles 1
Pipeline X
This instruction performs a bitwise exclusive-OR (XOR) operation between an accumulator (ACy) content and an accumulator (ACx) content shifted by the 6-bit value, SHIFTW.
- The shift and XOR operations are performed in one cycle in the D-unit
shifter.
- Input operands are zero extended to 40 bits. - The input operand (ACx) is shifted by a 6-bit immediate value in the D-unit
shifter.
- The CARRY status bit is not affected by the logical shift operation.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the intermediary logical shift is performed as if M40 is locally set to 1. The 8 upper bits of the 40-bit intermediary result are not cleared. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 ^ (AC1 <<< #30) Description The content of AC0 is XORed with the content of AC1 logically shifted left by 30 bits and the result is stored in AC0.
C54CM none
5-62
SPRU375G
No. [6]
Size 4
Cycles 1
Pipeline X
This instruction performs a bitwise exclusive-OR (XOR) operation between an accumulator (ACx) content and a 16-bit unsigned constant, k16, shifted left by 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are zero extended to 40 bits. - The input operand (k16) is shifted 16 bits to the MSBs.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax
Description The content of AC1 is XORed with the unsigned 16-bit value (FFFFh) logically shifted left by 16 bits and the result is stored in AC0.
SPRU375G
5-63
No. [7]
Size 4
Cycles 1
Pipeline X
0111 0100 kkkk kkkk kkkk kkkk SSDD SHFT ACx, ACy, k16, SHFT This instruction performs a bitwise exclusive-OR (XOR) operation between an accumulator (ACx) content and a 16-bit unsigned constant, k16, shifted left by the 4-bit value, SHFT.
- The shift and XOR operations are performed in one cycle in the D-unit
shifter.
- Input operands are zero extended to 40 bits. - The input operand (k16) is shifted by a 4-bit immediate value in the D-unit
shifter.
- The CARRY status bit is not affected by the logical shift operation.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax
Description The content of AC1 is XORed with the unsigned 16-bit value (FFFFh) logically shifted left by 15 bits and the result is stored in AC0.
5-64
SPRU375G
No. [8]
Size 4
Cycles 1
Pipeline X
This instruction performs a bitwise exclusive-OR (XOR) operation between a memory (Smem) location and a 16-bit unsigned constant, k16.
- The operation is performed on 16 bits in the A-unit ALU. - The result is stored in memory.
Status Bits
Affected by Affects
none none
Repeat
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax *AR3 = *AR3 ^ #FFFFh Description The content addressed by AR3 is XORed with the unsigned 16-bit value (FFFFh) and the result is stored in the location addressed by AR3.
SPRU375G
5-65
Branch Conditionally
Syntax Characteristics
Parallel Enable Bit No Yes No No Cycles 6/5 6/5 6/5 5/5
Syntax if (cond) goto l4 if (cond) goto L8 if (cond) goto L16 if (cond) goto P24
Size 2 3 4 5
Pipeline R R R R
Description
These instructions evaluate a single condition defined by the cond field in the read phase of the pipeline. If the condition is true, a branch occurs to the program address label assembled into l4, Lx, or P24. There is a 1-cycle latency on the condition setting. A single condition can be tested as determined by the cond field of the instruction. See Table 13 for a list of conditions. The instruction selection depends on the branch offset between the current PC value and the program branch address specified by the label. These instructions cannot be repeated.
Status Bits
Affected by Affects
See Also
5-66
SPRU375G
Branch Conditionally
Syntax Characteristics
Parallel Enable Bit No Cycles 6/5
No. [1]
Size 2
Pipeline R
This instruction evaluates a single condition defined by the cond field in the read phase of the pipeline. If the condition is true, a branch occurs to the program address label assembled into l4. There is a 1-cycle latency on the condition setting. A single condition can be tested as determined by the cond field of the instruction. See Table 13 for a list of conditions. Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the comparison of accumulators to 0 is performed as if M40 was set to 1.
Status Bits
Affected by Affects
Repeat Example
Syntax if (AC0 != #0) goto branch
Description The content of AC0 is not equal to 0, control is passed to the program address label defined by branch.
SPRU375G
5-67
Branch Conditionally
Syntax Characteristics
No. [2] [3] Syntax if (cond) goto L8 if (cond) goto L16 Parallel Enable Bit Yes No Size 3 4 Cycles 6/5 6/5 Pipeline R R
Opcode
L8 L16
0000 010E xCCC CCCC LLLL LLLL 0110 1101 xCCC CCCC LLLL LLLL LLLL LLLL
Operands Description
cond, Lx This instruction evaluates a single condition defined by the cond field in the read phase of the pipeline. If the condition is true, a branch occurs to the program address label assembled into Lx. There is a 1-cycle latency on the condition setting. A single condition can be tested as determined by the cond field of the instruction. See Table 13 for a list of conditions. Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the comparison of accumulators to 0 is performed as if M40 was set to 1.
Status Bits
Affected by Affects
Repeat Example
Syntax if (AC0 != #0) goto branch branch :
Description The content of AC0 is not equal to 0, control is passed to the program address label defined by branch. 00305A
address: 004057
5-68
SPRU375G
Branch Conditionally
Syntax Characteristics
No. [4] Syntax if (cond) goto P24 Parallel Enable Bit No Size 5 Cycles 5/5 Pipeline R
0110 1000 xCCC CCCC PPPP PPPP PPPP PPPP PPPP PPPP cond, P24 This instruction evaluates a single condition defined by the cond field in the read phase of the pipeline. If the condition is true, a branch occurs to the program address label assembled into P24. There is a 1-cycle latency on the condition setting. A single condition can be tested as determined by the cond field of the instruction. See Table 13 for a list of conditions. Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the comparison of accumulators to 0 is performed as if M40 was set to 1.
Status Bits
Affected by Affects
Repeat Example
Syntax if (AC0 != #0) goto branch
Description The content of AC0 is not equal to 0, control is passed to the program address label defined by branch.
SPRU375G
5-69
Branch Unconditionally
Syntax Characteristics
Parallel Enable Bit No Yes Yes No
Size 2 2 3 4
Cycles 10 6 6 5
Pipeline X AD AD D
This instruction executes in 3 cycles if the addressed instruction is in the instruction buffer unit.
Description
This instruction branches to a 24-bit program address defined by the content of the 24 lowest bits of an accumulator (ACx), or to a program address defined by the program address label assembled into Lx or P24. These instructions cannot be repeated.
Status Bits
Affected by Affects
none none
See Also
5-70
SPRU375G
Branch Unconditionally
Syntax Characteristics
Parallel Enable Bit No
No. [1]
Size 2
Cycles 10
Pipeline X
This instruction branches to a 24-bit program address defined by the content of the 24 lowest bits of an accumulator (ACx). Affected by Affects none none
Status Bits
Repeat Example
Syntax goto AC0
Before AC0 PC
Description Program control is passed to the program address defined by the content of AC0(230).
After 00 0000 403D 001F0A AC0 PC 00 0000 403D 00403D
SPRU375G
5-71
Branch Unconditionally
Syntax Characteristics
Parallel Enable Bit Yes Yes Cycles 6 6
Size 2 3
Pipeline AD AD
Opcode
L7 L16
0100 101E 0LLL LLLL 0000 011E LLLL LLLL LLLL LLLL
Operands Description
Lx This instruction branches to a program address defined by a program address label assembled into Lx. Affected by Affects none none
Status Bits
Repeat Example
Syntax goto branch goto branch AC0 = #1 branch: AC0 = #0
5-72
SPRU375G
Branch Unconditionally
Syntax Characteristics
Parallel Enable Bit No
No. [4]
Size 4
Cycles 5
Pipeline D
This instruction branches to a program address defined by a program address label assembled into P24. Affected by Affects none none
Status Bits
Repeat Example
Syntax goto branch goto branch AC0 = #1 branch: AC0 = #0
SPRU375G
5-73
No. [1]
Size 4
Pipeline AD
This instruction performs a conditional branch (selected auxiliary register content not equal to 0) of the program counter (PC). The program branch address is specified as a 16-bit signed offset, L16, relative to PC. Use this instruction to branch within a 64K-byte window centered on the current PC value. The possible addressing operands can be grouped into three categories:
- ARx not modified (ARx as base pointer), some examples:
*AR1; No modification or offset *AR1(#15); Use 16-bit immediate value (15) as offset *AR1(T0); Use content of T0 as offset *AR1(short(#4)); Use 3-bit immediate value (4) as offset
- ARx modified before being compared to 0, some examples:
*AR1; Decrement by 1 before comparison *+AR1(#20); Add 16-bit immediate value (20) before comparison
- ARx modified after being compared to 0, some examples:
*AR1+; Increment by 1 after comparison *(AR1 T1); Subtract content of T1 after comparison 1) The content of the selected auxiliary register (ARn) is premodified in the address generation unit. 2) The (premodified) content of ARn is compared to 0 and sets the condition in the address phase of the pipeline. 3) If the condition is not true, a branch occurs. If the condition is true, the instructions are executed in sequence. 4) The content of ARn is postmodified in the address generation unit.
5-74 Instruction Set Descriptions SPRU375G
Compatibility with C54x devices (C54CM = 1) When C54CM = 1: The premodifier *ARn(T0) is not available; *ARn(AR0) is available. The postmodifiers *(ARn + T0) and *(ARn T0) are not available; *(ARn + AR0) and *(ARn AR0) are available. The legality of the modifier usage is checked by the assembler when using the .c54cm_on and .c54cm_off assembler directives. Status Bits Affected by Affects Repeat See Also C54CM none
This instruction cannot be repeated. See the following other related instructions:
- Branch Conditionally - Branch Unconditionally - Compare and Branch
Example 1
Syntax Description if (*AR1(#6) != #0) goto branch The content of AR1 is compared to 0. The content is not 0, program control is passed to the program address label defined by branch. If (*AR1(#6) != #0) goto branch branch :
Before AR1 PC 0005 004004 After AR1 PC 0005 00400C
00400C
SPRU375G
5-75
Example 2
Syntax if (*AR3 != #0) goto branch Description The content of AR3 is compared to 0. The content is 0, program control is passed to the next instruction (the branch is not taken). AR3 is decremented by 1 after the comparison. address: 00400F ; ; 004013 004015
FFFF 004013
5-76
SPRU375G
Call Conditionally
Syntax Characteristics
Parallel Enable Bit No No
Size 4 5
Pipeline R R
Description
These instructions evaluate a single condition defined by the cond field in the read phase of the pipeline. If the condition is true, a subroutine call occurs to the program address defined by the program address label assembled into L16 or P24. There is a 1-cycle latency on the condition setting. A single condition can be tested as determined by the cond field of the instruction. See Table 13 for a list of conditions. Before beginning a called subroutine, the CPU automatically saves the value of two internal registers: the program counter (PC) and a loop context register. The CPU can use these values to re-establish the context of the interrupted program sequence when the subroutine is done. In the slow-return process (default), the return address (from the PC) and the loop context bits are stored to the stacks (in memory). When the CPU returns from a subroutine, the speed at which these values are restored is dependent on the speed of the memory accesses. In the fast-return process, the return address (from the PC) and the loop context bits are saved to registers, so that these values can always be restored quickly. These special registers are the return address register (RETA) and the control-flow context register (CFCT). You can read from or write to RETA and CFCT as a pair with dedicated, 32-bit load and store instructions. The instruction selection depends on the branch offset between the current PC value and program subroutine address specified by the label. These instructions cannot be repeated.
Status Bits
Affected by Affects
SPRU375G
See Also
5-78
SPRU375G
Call Conditionally
Syntax Characteristics
No. [1] Syntax if (cond) call L16 Parallel Enable Bit No Size 4 Cycles 6/5 Pipeline R
This instruction evaluates a single condition defined by the cond field in the read phase of the pipeline. If the condition is true, a subroutine call occurs to the program address defined by the program address label assembled into L16. There is a 1-cycle latency on the condition setting. A single condition can be tested as determined by the cond field of the instruction. See Table 13 for a list of conditions. When a subroutine call occurs in the slow-return process (default), the return address (from the PC) and the loop context bits are stored to the stacks. For fast-return mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371).
- The data stack pointer (SP) is decremented by 1 word in the read phase
of the pipeline. The 16 LSBs of the return address, from the program counter (PC), of the called subroutine are pushed to the top of SP.
- The system stack pointer (SSP) is decremented by 1 word in the read
phase of the pipeline. The loop context bits concatenated with the 8 MSBs of the return address are pushed to the top of SSP.
- The PC is loaded with the subroutine program address. The active control
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the comparison of accumulators to 0 is performed as if M40 was set to 1.
SPRU375G Instruction Set Descriptions 5-79
Status Bits
Affected by Affects
Repeat Example
Syntax
Description The content of AC1 is equal to or greater than 2000h, control is passed to the program address label, subroutine. The program counter (PC) is loaded with the subroutine program address.
5-80
SPRU375G
Call Conditionally
Syntax Characteristics
No. [2] Syntax if (cond) call P24 Parallel Enable Bit No Size 5 Cycles 5/5 Pipeline R
0110 1001 xCCC CCCC PPPP PPPP PPPP PPPP PPPP PPPP cond, P24 This instruction evaluates a single condition defined by the cond field in the read phase of the pipeline. If the condition is true, a subroutine call occurs to the program address defined by the program address label assembled into P24. There is a 1-cycle latency on the condition setting. A single condition can be tested as determined by the cond field of the instruction. See Table 13 for a list of conditions. When a subroutine call occurs in the slow-return process (default), the return address (from the PC) and the loop context bits are stored to the stacks. For fast-return mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371).
- The data stack pointer (SP) is decremented by 1 word in the read phase
of the pipeline. The 16 LSBs of the return address, from the program counter (PC), of the called subroutine are pushed to the top of SP.
- The system stack pointer (SSP) is decremented by 1 word in the read
phase of the pipeline. The loop context bits concatenated with the 8 MSBs of the return address are pushed to the top of SSP.
- The PC is loaded with the subroutine program address. The active control
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the comparison of accumulators to 0 is performed as if M40 was set to 1.
SPRU375G Instruction Set Descriptions 5-81
Status Bits
Affected by Affects
Repeat Example
Syntax if (TC1) call FOO
Description If TC1 is set to 1, control is passed to the program address label (FOO) assembled into an absolute address defined by the 24-bit value. If TC1 is cleared to 0, the program counter is incremented by 6 and the next instruction is executed.
5-82
SPRU375G
Call Unconditionally
Syntax Characteristics
Parallel Enable Bit No Yes No
Size 2 3 4
Cycles 10 6 5
Pipeline X AD D
Description
This instruction passes control to a specified subroutine program address defined by the content of the 24 lowest bits of the accumulator, ACx, or a program address label assembled into L16 or P24. Before beginning a called subroutine, the CPU automatically saves the value of two internal registers: the program counter (PC) and a loop context register. The CPU can use these values to re-establish the context of the interrupted program sequence when the subroutine is done. In the slow-return process (default), the return address (from the PC) and the loop context bits are stored to the stacks (in memory). When the CPU returns from a subroutine, the speed at which these values are restored is dependent on the speed of the memory accesses. In the fast-return process, the return address (from the PC) and the loop context bits are saved to registers, so that these values can always be restored quickly. These special registers are the return address register (RETA) and the control-flow context register (CFCT). You can read from or write to RETA and CFCT as a pair with dedicated, 32-bit load and store instructions. These instructions cannot be repeated.
Status Bits
Affected by Affects
none none
See Also
SPRU375G
5-83
Call Unconditionally
Syntax Characteristics
No. [1] Syntax call ACx Parallel Enable Bit No Size 2 Cycles 10 Pipeline X
This instruction passes control to a specified subroutine program address defined by the content of the 24 lowest bits of the accumulator, ACx. In the slow-return process (default), the return address (from the PC) and the loop context bits are stored to the stacks. For fast-return mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371).
- The data stack pointer (SP) is decremented by 1 word in the address
phase of the pipeline. The 16 LSBs of the return address, from the program counter (PC), of the called subroutine are pushed to the top of SP.
- The system stack pointer (SSP) is decremented by 1 word in the address
phase of the pipeline. The loop context bits concatenated with the 8 MSBs of the return address are pushed to the top of SSP.
- The PC is loaded with the subroutine program address. The active control
Status Bits
Affected by Affects
none none
Repeat Example
Syntax call AC0
Description Program control is passed to the program address defined by the content of AC0(230).
5-84
SPRU375G
Call Unconditionally
Syntax Characteristics
No. [2] Syntax call L16 Parallel Enable Bit Yes Size 3 Cycles 6 Pipeline AD
This instruction passes control to a specified subroutine program address defined by a program address label assembled into L16. In the slow-return process (default), the return address (from the PC) and the loop context bits are stored to the stacks. For fast-return mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371).
- The data stack pointer (SP) is decremented by 1 word in the address
phase of the pipeline. The 16 LSBs of the return address, from the program counter (PC), of the called subroutine are pushed to the top of SP.
- The system stack pointer (SSP) is decremented by 1 word in the address
phase of the pipeline. The loop context bits concatenated with the 8 MSBs of the return address are pushed to the top of SSP.
- The PC is loaded with the subroutine program address. The active control
Status Bits
Affected by Affects
none none
Repeat Example
Syntax call FOO
Description Program control is passed to the program address label (FOO) assembled into the signed 16-bit offset value relative to the program counter register.
SPRU375G
5-85
Call Unconditionally
Syntax Characteristics
No. [3] Syntax call P24 Parallel Enable Bit No Size 4 Cycles 5 Pipeline D
This instruction passes control to a specified subroutine program address defined by a program address label assembled into P24. In the slow-return process (default), the return address (from the PC) and the loop context bits are stored to the stacks. For fast-return mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371).
- The data stack pointer (SP) is decremented by 1 word in the address
phase of the pipeline. The 16 LSBs of the return address, from the program counter (PC), of the called subroutine are pushed to the top of SP.
- The system stack pointer (SSP) is decremented by 1 word in the address
phase of the pipeline. The loop context bits concatenated with the 8 MSBs of the return address are pushed to the top of SSP.
- The PC is loaded with the subroutine program address. The active control
Status Bits
Affected by Affects
none none
Repeat Example
Syntax call FOO
Description Program control is passed to the program address label (FOO) assembled into an absolute address defined by the 24-bit value.
5-86
SPRU375G
No. [1]
Syntax circular()
Size 1
Cycles 1
Pipeline AD
1001 1101
This instruction is an instruction qualifier that can be paralleled only with any instruction making an indirect Smem, Xmem, Ymem, Lmem, Baddr, or Cmem addressing. This instruction cannot be executed in parallel with any other types of instructions and it cannot be executed as a stand-alone instruction (assembler generates an error message). When this instruction is used in parallel, all modifications of ARx and CDP pointer registers used in the indirect addressing mode are done circularly (as if ST2_55 register bits 0 to 8 were set to 1).
Status Bits
Affected by Affects
none none
Repeat
SPRU375G
5-87
temporary register. The instruction clears to 0 a single bit, as defined by the bit addressing mode, Baddr, of the source register. The generated bit address must be within:
- 039 when accessing accumulator bits (only the 6 LSBs of the generated
bit address are used to determine the bit position). If the generated bit address is not within 039, the selected register bit value does not change.
- 015 when accessing auxiliary or temporary register bits (only the 4 LSBs
of the generated address are used to determine the bit position). Status Bits Affected by Affects Repeat See Also none none
This instruction can be repeated. See the following other related instructions:
- Clear Memory Bit - Clear Status Register Bit - Complement Accumulator, Auxiliary, or Temporary Register Bit - Set Accumulator, Auxiliary, or Temporary Register Bit
Example
Syntax bit(AC0, AR3) = #0 Description The bit at the position defined by the content of AR3(40) in AC0 is cleared to 0.
5-88
SPRU375G
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction performs a bit manipulation in the A-unit ALU. The instruction clears to 0 a single bit, as defined by the content of the source (src) operand, of a memory (Smem) location. The generated bit address must be within 015 (only the 4 LSBs of the register are used to determine the bit position).
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Clear Accumulator, Auxiliary, or Temporary Register Bit - Clear Status Register Bit - Complement Memory Bit - Set Memory Bit
Example
Syntax bit(*AR3, AC0) = #0 Description The bit at the position defined by AC0(30) in the content addressed by AR3 is cleared to 0.
SPRU375G
5-89
Size 2 2 2 2
Cycles 1 1 1 1
Pipeline X X X X
When this instruction is decoded to modify status bit CAFRZ (15), CAEN (14), or CACLR (13), the CPU pipeline is flushed and the instruction is executed in 5 cycles regardless of the instruction context.
Opcode
0100 011E kkkk 0000 0100 011E kkkk 0010 0100 011E kkkk 0100 0100 011E kkkk 0110
Operands Description
k4, STx These instructions perform a bit manipulation in the A-unit ALU. These instructions clear to 0 a single bit, as defined by a 4-bit immediate value, k4, in the selected status register (ST0, ST1, ST2, or ST3). Compatibility with C54x devices (C54CM = 1) C55x DSP status registers bit mapping (Figure 51, page 5-92) does not correspond to C54x DSP status register bits.
Status Bits
Affected by Affects
This instruction cannot be repeated. See the following other related instructions:
- Clear Accumulator, Auxiliary, or Temporary Register Bit - Clear Memory Bit - Set Status Register Bit
5-90
SPRU375G
Example
Syntax bit(ST2, #ST2_AR2LC) = #0; AR2LC = bit 2 Description The ST2 bit position defined by the label (ST2_AR2LC, bit 2) is cleared to 0.
SPRU375G
5-91
Legend: R = Read; W = Write; -n = Value after reset Highlighted bit: If you write to the protected address of the status register, a write to this bit has no effect, and the bit always appears as a 0 during read operations. The HINT bit is not used for all C55x host port interfaces (HPIs). Consult the documentation for the specific C55x DSP. The reset value of MPNMC may be dependent on the state of predefined pins at reset. To check this for a particular C55x DSP, see the boot loader section of its data sheet.
5-92
SPRU375G
Opcode
TC1 TC2
0001 001E FSSS cc00 FDDD xux0 0001 001E FSSS cc00 FDDD xux1
Operands Description
dst, RELOP, src, TCx This instruction performs a comparison in the D-unit ALU or in the A-unit ALU. Two accumulator, auxiliary registers, and temporary registers contents are compared. When an accumulator ACx is compared with an auxiliary or temporary register TAx, the 16 lowest bits of ACx are compared with TAx in the A-unit ALU. If the comparison is true, the TCx status bit is set to 1; otherwise, it is cleared to 0. The comparison depends on the optional uns keyword and on M40 for accumulator comparisons. As the following table shows, the uns keyword specifies an unsigned comparison and M40 defines the comparison bit width for accumulator comparisons.
uns no no no no yes yes yes yes src TAx TAx ACx ACx TAx TAx ACx ACx dst TAy ACy TAy ACy TAy ACy TAy ACy Comparison Type 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU if M40 = 0, 32-bit signed comparison in D-unit ALU if M40 = 1, 40-bit signed comparison in D-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU if M40 = 0, 32-bit unsigned comparison in D-unit ALU if M40 = 1, 40-bit unsigned comparison in D-unit ALU
Compatibility with C54x devices (C54CM = 1) Contrary to the corresponding C54x instruction, the C55x register comparison instruction is performed in execute phase of the pipeline. When C54CM = 1, the conditions testing the accumulators content are all performed as if M40 was set to 1.
SPRU375G Instruction Set Descriptions 5-93
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Compare Accumulator, Auxiliary, or Temporary Register Content with AND - Compare Accumulator, Auxiliary, or Temporary Register Content with OR - Compare Accumulator, Auxiliary, or Temporary Register Content Maximum - Compare Accumulator, Auxiliary, or Temporary Register Content Minimum - Compare Memory with Immediate Value
Example 1
Syntax TC1= AC1 = = T1 Description The signed content of AC1(150) is compared to the content of T1 and because they are equal, TC1 is set to 1.
After 00 0028 0400 0400 0 AC1 T1 TC1 00 0028 0400 0400 1
Example 2
Syntax TC1= T1 > = AC1 Description The content of T1 is compared to the signed content of AC1(150). The content of T1 is greater than the content of AC1, TC1 is set to 1.
After 0500 80 0000 0400 0 T1 AC1 TC1 0500 80 0000 0400 1
5-94
SPRU375G
Syntax TCx = TCy & uns(src RELOP dst) TCx = !TCy & uns(src RELOP dst)
Size 3 3
Cycles 1 1
Pipeline X X
Description
These instructions perform a comparison in the D-unit ALU or in the A-unit ALU. Two accumulator, auxiliary registers, and temporary registers contents are compared. When an accumulator ACx is compared with an auxiliary or temporary register TAx, the 16 lowest bits of ACx are compared with TAx in the A-unit ALU. Affected by Affects C54CM, M40, TCy TCx
Status Bits
See Also
SPRU375G
5-95
Syntax Characteristics
Parallel Enable Bit
No.
Size
Cycles
Pipeline
[1a] [1b]
TC1 = TC2 & uns(src RELOP dst) TC2 = TC1 & uns(src RELOP dst)
Yes Yes
3 3
1 1
X X
This instruction performs a comparison in the D-unit ALU or in the A-unit ALU. Two accumulator, auxiliary registers, and temporary registers contents are compared. When an accumulator ACx is compared with an auxiliary or temporary register TAx, the 16 lowest bits of ACx are compared with TAx in the A-unit ALU. If the comparison is true, the TCx status bit is set to 1; otherwise, it is cleared to 0. The result of the comparison is ANDed with TCy; TCx is updated with this operation. The comparison depends on the optional uns keyword and on M40 for accumulator comparisons. As the following table shows, the uns keyword specifies an unsigned comparison and M40 defines the comparison bit width for accumulator comparisons.
uns no no no no yes yes yes yes src TAx TAx ACx ACx TAx TAx ACx ACx dst TAy ACy TAy ACy TAy ACy TAy ACy Comparison Type 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU If M40 = 0, 32-bit signed comparison in D-unit ALU if M40 = 1, 40-bit signed comparison in D-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU If M40 = 0, 32-bit unsigned comparison in D-unit ALU if M40 = 1, 40-bit unsigned comparison in D-unit ALU
5-96
SPRU375G
Compatibility with C54x devices (C54CM = 1) Contrary to the corresponding C54x instruction, the C55x register comparison instruction is performed in execute phase of the pipeline. When C54CM = 1, the conditions testing the accumulators content are all performed as if M40 was set to 1. Status Bits Affected by Affects Repeat Example
Syntax TC2 = TC1 & AC1 == AC2 Description The content of AC1(310) is compared to the content of AC2(310). The contents are equal (true), TC2 = TC1 & 1.
After 80 0028 0400 00 0028 0400 0 1 0 AC1 AC2 M40 TC1 TC2 80 0028 0400 00 0028 0400 0 1 1
SPRU375G
5-97
Syntax Characteristics
Parallel Enable Bit
No.
Size
Cycles
Pipeline
[2a] [2b]
TC1 = !TC2 & uns(src RELOP dst) TC2 = !TC1 & uns(src RELOP dst)
Yes Yes
3 3
1 1
X X
This instruction performs a comparison in the D-unit ALU or in the A-unit ALU. Two accumulator, auxiliary registers, and temporary registers contents are compared. When an accumulator ACx is compared with an auxiliary or temporary register TAx, the 16 lowest bits of ACx are compared with TAx in the A-unit ALU. If the comparison is true, the TCx status bit is set to 1; otherwise, it is cleared to 0. The result of the comparison is ANDed with the complement of TCy; TCx is updated with this operation. The comparison depends on the optional uns keyword and on M40 for accumulator comparisons. As the following table shows, the uns keyword specifies an unsigned comparison and M40 defines the comparison bit width for accumulator comparisons.
uns no no no no yes yes yes yes src TAx TAx ACx ACx TAx TAx ACx ACx dst TAy ACy TAy ACy TAy ACy TAy ACy Comparison Type 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU if M40 = 0, 32-bit signed comparison in D-unit ALU if M40 = 1, 40-bit signed comparison in D-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU if M40 = 0, 32-bit unsigned comparison in D-unit ALU if M40 = 1, 40-bit unsigned comparison in D-unit ALU
5-98
SPRU375G
Compatibility with C54x devices (C54CM = 1) Contrary to the corresponding C54x instruction, the C55x register comparison instruction is performed in execute phase of the pipeline. When C54CM = 1, the conditions testing the accumulators content are all performed as if M40 was set to 1. Status Bits Affected by Affects Repeat Example
Syntax TC2 = !TC1 & AC1 == AC2 Description The content of AC1(310) is compared to the content of AC2(310). The contents are equal (true), TC2 = !TC1 & 1.
After 80 0028 0400 00 0028 0400 0 1 0 AC1 AC2 M40 TC1 TC2 80 0028 0400 00 0028 0400 0 1 0
SPRU375G
5-99
Syntax TCx = TCy | uns(src RELOP dst) TCx = !TCy | uns(src RELOP dst)
Size 3 3
Cycles 1 1
Pipeline X X
Description
These instructions perform a comparison in the D-unit ALU or in the A-unit ALU. Two accumulator, auxiliary registers, and temporary registers contents are compared. When an accumulator ACx is compared with an auxiliary or temporary register TAx, the 16 lowest bits of ACx are compared with TAx in the A-unit ALU. Affected by Affects C54CM, M40, TCy TCx
Status Bits
See Also
5-100
SPRU375G
Syntax Characteristics
Parallel Enable Bit
No.
Size
Cycles
Pipeline
[1a] [1b]
TC1 = TC2 | uns(src RELOP dst) TC2 = TC1 | uns(src RELOP dst)
Yes Yes
3 3
1 1
X X
This instruction performs a comparison in the D-unit ALU or in the A-unit ALU. Two accumulator, auxiliary registers, and temporary registers contents are compared. When an accumulator ACx is compared with an auxiliary or temporary register TAx, the 16 lowest bits of ACx are compared with TAx in the A-unit ALU. If the comparison is true, the TCx status bit is set to 1; otherwise, it is cleared to 0. The result of the comparison is ORed with TCy; TCx is updated with this operation. The comparison depends on the optional uns keyword and on M40 for accumulator comparisons. As the following table shows, the uns keyword specifies an unsigned comparison and M40 defines the comparison bit width for accumulator comparisons.
uns no no no no yes yes yes yes src TAx TAx ACx ACx TAx TAx ACx ACx dst TAy ACy TAy ACy TAy ACy TAy ACy Comparison Type 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU if M40 = 0, 32-bit signed comparison in D-unit ALU if M40 = 1, 40-bit signed comparison in D-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU if M40 = 0, 32-bit unsigned comparison in D-unit ALU if M40 = 1, 40-bit unsigned comparison in D-unit ALU
SPRU375G
5-101
Compatibility with C54x devices (C54CM = 1) Contrary to the corresponding C54x instruction, the C55x register comparison instruction is performed in execute phase of the pipeline. When C54CM = 1, the conditions testing the accumulators content are all performed as if M40 was set to 1. Status Bits Affected by Affects Repeat Example
Syntax TC2 = TC1 | uns(AC1 != AR1) Description The unsigned content of AC1(150) is compared to the unsigned content of AR1. The contents are equal (false), TC2 = TC1 | 0.
After 00 8028 0400 0400 1 0 AC1 AR1 TC1 TC2 00 8028 0400 0400 1 1
5-102
SPRU375G
Syntax Characteristics
Parallel Enable Bit
No.
Size
Cycles
Pipeline
[2a] [2b]
TC1 = !TC2 | uns(src RELOP dst) TC2 = !TC1 | uns(src RELOP dst)
Yes Yes
3 3
1 1
X X
This instruction performs a comparison in the D-unit ALU or in the A-unit ALU. Two accumulator, auxiliary registers, and temporary registers contents are compared. When an accumulator ACx is compared with an auxiliary or temporary register TAx, the 16 lowest bits of ACx are compared with TAx in the A-unit ALU. If the comparison is true, the TCx status bit is set to 1; otherwise, it is cleared to 0. The result of the comparison is ORed with the complement of TCy; TCx is updated with this operation. The comparison depends on the optional uns keyword and on M40 for accumulator comparisons. As the following table shows, the uns keyword specifies an unsigned comparison and M40 defines the comparison bit width for accumulator comparisons.
uns no no no no yes yes yes yes src TAx TAx ACx ACx TAx TAx ACx ACx dst TAy ACy TAy ACy TAy ACy TAy ACy Comparison Type 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU 16-bit signed comparison in A-unit ALU if M40 = 0, 32-bit signed comparison in D-unit ALU if M40 = 1, 40-bit signed comparison in D-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU 16-bit unsigned comparison in A-unit ALU if M40 = 0, 32-bit unsigned comparison in D-unit ALU if M40 = 1, 40-bit unsigned comparison in D-unit ALU
SPRU375G
5-103
Compatibility with C54x devices (C54CM = 1) Contrary to the corresponding C54x instruction, the C55x register comparison instruction is performed in execute phase of the pipeline. When C54CM = 1, the conditions testing the accumulators content are all performed as if M40 was set to 1. Status Bits Affected by Affects Repeat Example
Syntax TC2 = !TC1 | uns(AC1 != AR1) Description The unsigned content of AC1(150) is compared to the unsigned content of AR1. The contents are equal (false), TC2 = !TC1 | 0.
After 00 8028 0400 0400 1 1 AC1 AR1 TC1 TC2 00 8028 0400 0400 1 0
5-104
SPRU375G
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction performs a maximum comparison in the D-unit ALU or in the A-unit ALU. Two accumulator, auxiliary registers, and temporary registers contents are compared. When an accumulator ACx is compared with an auxiliary or temporary register TAx, the 16 lowest bits of ACx are compared with TAx in the A-unit ALU. If the comparison is true, the TCx status bit is set to 1; otherwise, it is cleared to 0.
- When the destination operand (dst) is an accumulator: J
If an auxiliary or temporary register is the source operand (src) of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended to 40 bits according to SXMD. The operation is performed on 40 bits in the D-unit ALU: If M40 = 0, src(310) content is compared to dst(310) content. The extremum value is stored in dst. If the extremum value is the src content, the CARRY status bit is cleared to 0; otherwise, it is set to 1.
step1: if (src(310) > dst(310)) step2: { CARRY = 0; dst(390) = src(390) } else step3: CARRY = 1
If M40 = 1, src(390) content is compared to dst(390) content. The extremum value is stored in dst. If the extremum value is the src content, the CARRY status bit is cleared to 0; otherwise, it is set to 1.
step1: if (src(390) > dst(390)) step2: { CARRY = 0; dst(390) = src(390) } else step3: CARRY = 1
J SPRU375G
If an accumulator is the source operand (src) of the instruction, the 16 LSBs of the accumulator are used to perform the operation. The operation is performed on 16 bits in the A-unit ALU: The src(150) content is compared to the dst(150) content. The extremum value is stored in dst.
step1: if (src(150) > dst(150)) step2: dst = src
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if M40 status bit was locally set to 1. When the destination operand (dst) is an auxiliary or temporary register, the instruction execution is not impacted by the C54CM status bit. When the destination operand (dst) is an accumulator, this instruction always compares the source operand (src) with AC1 as follows:
- If an auxiliary or temporary register is the source operand (src) of the
instruction, the 16 LSBs of the auxiliary or temporary register are sign extended to 40 bits according to SXMD
- The operation is performed on 40 bits in the D-unit ALU:
The src(390) content is compared to AC1(390) content. The extremum value is stored in dst. If the extremum value is the src content, the CARRY status bit is cleared to 0; otherwise, it is set to 1.
step1: if (src(390) > AC1(390)) step2: { CARRY = 0; dst(390) = src(390) } else step3: { CARRY = 1; dst(390) = AC1(390) }
There is no overflow detection, overflow report, and saturation. Status Bits Affected by Affects Repeat C54CM, M40, SXMD CARRY
5-106
SPRU375G
See Also
Minimum
- Compare and Select Accumulator Content Maximum - Compare Memory with Immediate Value
Example 1
Syntax AC1 = max(AC2, AC1)
Before AC2 AC1 SXMD M40 CARRY
Description The content of AC2 is less than the content of AC1, the content of AC1 remains the same and the CARRY status bit is set to 1.
After AC2 AC1 SXMD M40 CARRY 00 0000 0000 00 8500 0000 1 0 1
Example 2
Syntax AC1 = max(AR1, AC1)
Before AR1 AC1 CARRY
Description The content of AR1 is less than the content of AC1, the content of AC1 remains the same and the CARRY status bit is set to 1.
After AR1 AC1 CARRY 8020 00 0000 0040 1
Example 3
Syntax T1 = max(AC1, T1)
Before AC1 T1 CARRY
Description The content of AC1(150) is greater than the content of T1, the content of AC1(150) is stored in T1 and the CARRY status bit is cleared to 0.
After AC1 T1 CARRY 00 0000 8020 8020 0
SPRU375G
5-107
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction performs a minimum comparison in the D-unit ALU or in the A-unit ALU. Two accumulator, auxiliary registers, and temporary registers contents are compared. When an accumulator ACx is compared with an auxiliary or temporary register TAx, the 16 lowest bits of ACx are compared with TAx in the A-unit ALU. If the comparison is true, the TCx status bit is set to 1; otherwise, it is cleared to 0.
- When the destination operand (dst) is an accumulator: J
If an auxiliary or temporary register is the source operand (src) of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended to 40 bits according to SXMD. The operation is performed on 40 bits in the D-unit ALU: If M40 = 0, src(310) content is compared to dst(310) content. The extremum value is stored in dst. If the extremum value is the src content, the CARRY status bit is cleared to 0; otherwise, it is set to 1.
step1: if (src(310) < dst(310)) step2: { CARRY = 0; dst(390) = src(390) } else step3: CARRY = 1
If M40 = 1, src(390) content is compared to dst(390) content. The extremum value is stored in dst. If the extremum value is the src content, the CARRY status bit is cleared to 0; otherwise, it is set to 1.
step1: if (src(390) < dst(390)) step2: { CARRY = 0; dst(390) = src(390) } else step3: CARRY = 1
J 5-108
If an accumulator is the source operand (src) of the instruction, the 16 LSBs of the accumulator are used to perform the operation. The operation is performed on 16 bits in the A-unit ALU: The src(150) content is compared to the dst(150) content. The extremum value is stored in dst.
step1: if (src(150) < dst(150)) step2: dst = src
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if M40 status bit was locally set to 1. When the destination operand (dst) is an auxiliary or temporary register, the instruction execution is not impacted by the C54CM status bit. When the destination operand (dst) is an accumulator, this instruction always compares the source operand (src) with AC1 as follows:
- If an auxiliary or temporary register is the source operand (src) of the
instruction, the 16 LSBs of the auxiliary or temporary register are sign extended to 40 bits according to SXMD
- The operation is performed on 40 bits in the D-unit ALU:
The src(390) content is compared to AC1(390) content. The extremum value is stored in dst. If the extremum value is the src content, the CARRY status bit is cleared to 0; otherwise, it is set to 1.
step1: if (src(390) < AC1(390)) step2: { CARRY = 0; dst(390) = src(390) } else step3: { CARRY = 1; dst(390) = AC1(390) }
There is no overflow detection, overflow report, and saturation. Status Bits Affected by Affects Repeat C54CM, M40, SXMD CARRY
SPRU375G
5-109
See Also
Maximum
- Compare and Select Accumulator Content Minimum - Compare Memory with Immediate Value
Example
Syntax T1 = min(AC1, T1)
Before AC1 T1 CARRY
Description The content of AC1(150) is greater than the content of T1, the content of T1 remains the same and the CARRY status bit is set to 1.
After AC1 T1 CARRY 00 8000 0000 8020 1
5-110
SPRU375G
0110 1111 FSSS ccxu KKKK KKKK LLLL LLLL K8, L8, RELOP, src This instruction performs a comparison operation between a source (src) register content and an 8-bit signed value, K8. The instruction performs a comparison in the D-unit ALU or in the A-unit ALU. The comparison is performed in the execute phase of the pipeline. If the result of the comparison is true, a branch occurs. The program branch address is specified as an 8-bit signed offset, L8, relative to the program counter (PC). Use this instruction to branch within a 256-byte window centered on the current PC value. The comparison depends on the optional uns keyword and, for accumulator comparisons, on M40.
- In the case of an unsigned comparison, the 8-bit constant, K8, is zero
extended to:
J J
16 bits, if the source (src) operand is an auxiliary or temporary register. 40 bits, if the source (src) operand is an accumulator.
extended to:
J J
16 bits, if the source (src) operand is an auxiliary or temporary register. 40 bits, if the source (src) operand is an accumulator.
As the following table shows, the uns keyword specifies an unsigned comparison; M40 defines the comparison bit width of the accumulator.
uns no no yes yes src TAx ACx TAx ACx Comparison Type 16-bit signed comparison in A-unit ALU if M40 = 0, 32-bit signed comparison in D-unit ALU if M40 = 1, 40-bit signed comparison in D-unit ALU 16-bit unsigned comparison in A-unit ALU if M40 = 0, 32-bit unsigned comparison in D-unit ALU if M40 = 1, 40-bit unsigned comparison in D-unit ALU
SPRU375G
5-111
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the conditions testing the accumulator contents are all performed as if M40 was set to 1. Status Bits Affected by Affects Repeat See Also C54CM, M40 none
This instruction can be repeated. See the following other related instructions:
- Branch Conditionally - Branch Unconditionally - Branch on Auxiliary Register Not Zero
Example 1
Syntax compare (AC0 >= #12) goto branch Description The signed content of AC0 is compared to the sign-extended 8-bit value (12). Because the content of AC0 is greater than or equal to 12, program control is passed to the program address label defined by branch (004078h).
5-112
SPRU375G
Example 2
Syntax compare (T1 != #1) goto branch Description The content of T1 is not equal to 1, program control is passed to the next instruction (the branch is not taken).
SPRU375G
5-113
Syntax max_diff(ACx, ACy, ACz, ACw) max_diff_dbl(ACx, ACy, ACz, ACw, TRNx)
Size 3 3
Cycles 1 1
Pipeline X X
Description
Instruction [1] performs two paralleled 16-bit extremum selections in the D-unit ALU. Instruction [2] performs a single 40-bit extremum selection in the D-unit ALU. Affected by Affects C54CM, M40, SATD ACOVw, CARRY
Status Bits
See Also
5-114
SPRU375G
This instruction performs two paralleled 16-bit extremum selections in the D-unit ALU in one cycle. This instruction performs a dual maximum search. The two operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulators are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit data path). For each datapath (high and low):
- ACx and ACy are the source accumulators. - The differences are stored in accumulator ACw. - The subtraction computation is equivalent to the dual 16-bit subtractions
instruction.
- For each of the two computations performed in the ALU, an overflow
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVw) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
- Independently on each data path, if SATD = 1 when an overflow is
For the operations performed in the ALU low part, saturation values are 7FFFh (positive) and 8000h (negative). For the operations performed in the ALU high part, saturation values are 00 7FFFh (positive) and FF 8000h (negative).
Instruction Set Descriptions 5-115
SPRU375G
- The extremum is stored in accumulator ACz. - The extremum is searched considering the selected bit width of the
accumulators:
J J
for the lower 16-bit data path, the sign bit is extracted at bit position 15 for the higher 24-bit data path, the sign bit is extracted at bit position 31
TRN0 tracks the decision for the high part data path TRN1 tracks the decision for the low part data path If the extremum value is the ACx high or low part, the decision bit is cleared to 0; otherwise, it is set to 1:
TRN0 = TRN0 >> #1 TRN1 = TRN1 >> #1 ACw(3916) = ACy(3916) ACx(3916) ACw(150) = ACy(150) ACx(150) If (ACx(3116) > ACy(3116)) { bit(TRN0, 15) = #0 ; ACz(3916) = ACx(3916) } else { bit(TRN0, 15) = #1 ; ACz(3916) = ACy(3916) } if (ACx(150) > ACy(150)) { bit(TRN1, 15) = #0 ; ACz(150) = ACx(150) } else { bit(TRN1, 15) = #1 ; ACz(150) = ACy(150) }
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit data path (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat
5-116
Example
Syntax max_diff(AC0, AC1, AC2, AC1) Description The difference is stored in AC1. The content of AC0(3916) is subtracted from the content of AC1(3916) and the result is stored in AC1(3916). Since SATD = 1 and an overflow is detected, AC1(3916) = FF 8000h (saturation). The content of AC0(150) is subtracted from the content of AC1(150) and the result is stored in AC1(150). The maximum is stored in AC2. The content of TRN0 and TRN1 is shifted right 1 bit. AC0(3116) is greater than AC1(3116), AC0(3916) is stored in AC2(3916) and TRN0(15) is cleared to 0. AC0(150) is greater than AC1(150), AC0(150) is stored in AC2(150) and TRN1(15) is cleared to 0.
After AC0 AC1 AC2 SATD TRN0 TRN1 ACOV1 CARRY
SPRU375G
5-117
Syntax max_diff_dbl(ACx, ACy, ACz, ACw, TRN0) max_diff_dbl(ACx, ACy, ACz, ACw, TRN1)
Size 3 3
Cycles 1 1
Pipeline X X
Opcode
TRN0 TRN1
0001 000E DDSS 1101 SSDD xxx0 0001 000E DDSS 1101 SSDD xxx1
Operands Description
ACw, ACx, ACy, ACz, TRNx This instruction performs a single 40-bit extremum selection in the D-unit ALU. This instruction performs a maximum search.
- ACx and ACy are the two source accumulators. - The difference between the source accumulators is stored in accumulator
ACw.
- The subtraction computation is equivalent to the subtraction instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD.
- The extremum between the source accumulators is stored in accumulator
ACz.
- The extremum computation is similar to the compare register content
maximum instruction. However, the CARRY status bit is not updated by the extremum search but by the subtraction instruction.
- According to the extremum found, a decision bit is shifted in TRNx from
the MSBs to the LSBs. If the extremum value is ACx, the decision bit is cleared to 0; otherwise, it is set to 1.
5-118
SPRU375G
If M40 = 0:
TRNx = TRNx >> #1 ACw(390) = ACy(390) ACx(390) If (ACx(310) > ACy(310)) { bit(TRNx, 15) = #0 ; ACz(390) = ACx(390) } else { bit(TRNx, 15) = #1 ; ACz(390) = ACy(390) }
If M40 = 1:
TRNx = TRNx >> #1 ACw(390) = ACy(390) ACx(390) If (ACx(390) > ACy(390)) { bit(TRNx, 15) = #0 ; ACz(390) = ACx(390) } else { bit(TRNx, 15) = #1 ; ACz(390) = ACy(390) }
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if M40 status bit was locally set to 1. However to ensure compatibility versus overflow detection and saturation of the destination accumulator, this instruction must be executed with M40 = 0. Status Bits Affected by Affects Repeat Example
Syntax max_diff_dbl(AC0, AC1, AC2, AC3, TRN1) Description The difference is stored in AC3. The content of AC0 is subtracted from the content of AC1 and the result is stored in AC3. The maximum is stored in AC2. The content of TRN1 is shifted right 1 bit. AC0 is greater than AC1, AC0 is stored in AC2 and TRN1(15) is cleared to 0.
10 00 10 F0 2400 8000 2400 5C00 2222 DDDE 2222 BBBC 1 1 0040 0 0
Before AC0 AC1 AC2 AC3 M40 SATD TRN1 ACOV3 CARRY
10 00 00 00
After AC0 AC1 AC2 AC3 M40 SATD TRN1 ACOV3 CARRY
SPRU375G
5-119
Syntax min_diff(ACx, ACy, ACz, ACw) min_diff_dbl(ACx, ACy, ACz, ACw, TRNx)
Size 3 3
Cycles 1 1
Pipeline X X
Description
Instruction [1] performs two paralleled 16-bit extremum selections in the D-unit ALU. Instruction [2] performs a single 40-bit extremum selection in the D-unit ALU. Affected by Affects C54CM, M40, SATD ACOVw, CARRY
Status Bits
See Also
5-120
SPRU375G
This instruction performs two paralleled 16-bit extremum selections in the D-unit ALU in one cycle. This instruction performs a dual minimum search. The two operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulators are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit data path). For each datapath (high and low):
- ACx and ACy are the source accumulators. - The differences are stored in accumulator ACw. - The subtraction computation is equivalent to the dual 16-bit subtractions
instruction.
- For each of the two computations performed in the ALU, an overflow
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVw) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
- Independently on each data path, if SATD = 1 when an overflow is
For the operations performed in the ALU low part, saturation values are 7FFFh (positive) and 8000h (negative). For the operations performed in the ALU high part, saturation values are 00 7FFFh (positive) and FF 8000h (negative).
Instruction Set Descriptions 5-121
SPRU375G
- The extremum is stored in accumulator ACz. - The extremum is searched considering the selected bit width of the
accumulators:
J J
for the lower 16-bit data path, the sign bit is extracted at bit position 15 for the higher 24-bit data path, the sign bit is extracted at bit position 31
TRN0 tracks the decision for the high part data path TRN1 tracks the decision for the low part data path If the extremum value is the ACx high or low part, the decision bit is cleared to 0; otherwise, it is set to 1:
TRN0 = TRN0 >> #1 TRN1 = TRN1 >> #1 ACw(3916) = ACy(3916) ACx(3916) ACw(150) = ACy(150) ACx(150) If (ACx(3116) < ACy(3116)) { bit(TRN0, 15) = #0 ; ACz(3916) = ACx(3916) } else { bit(TRN0, 15) = #1 ; ACz(3916) = ACy(3916) } if (ACx(150) < ACy(150)) { bit(TRN1, 15) = #0 ; ACz(150) = ACx(150) } else { bit(TRN1, 15) = #1 ; ACz(150) = ACy(150) }
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit data path (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat
5-122
Example
Syntax min_diff(AC0, AC1, AC2, AC1) Description The difference is stored in AC1. The content of AC0(3916) is subtracted from the content of AC1(3916) and the result is stored in AC1(3916). Since SATD = 1 and an overflow is detected, AC1(3916) = FF 8000h (saturation). The content of AC0(150) is subtracted from the content of AC1(150) and the result is stored in AC1(150). The minimum is stored in AC2 (sign bit extracted at bits 31 and 15). The content of TRN0 and TRN1 is shifted right 1 bit. AC0(3116) is greater than or equal to AC1(3116), AC1(3916) is stored in AC2(3916) and TRN0(15) is set to 1. AC0(150) is greater than or equal to AC1(150), AC1(150) is stored in AC2(150) and TRN1(15) is set to 1.
After AC0 AC1 AC2 SATD TRN0 TRN1 ACOV1 CARRY
SPRU375G
5-123
Syntax min_diff_dbl(ACx, ACy, ACz, ACw, TRN0) min_diff_dbl(ACx, ACy, ACz, ACw, TRN1)
Size 3 3
Cycles 1 1
Pipeline X X
Opcode
TRN0 TRN1
0001 000E DDSS 1111 SSDD xxx0 0001 000E DDSS 1111 SSDD xxx1
Operands Description
ACw, ACx, ACy, ACz, TRNx This instruction performs a single 40-bit extremum selection in the D-unit ALU. This instruction performs a minimum search.
- ACx and ACy are the two source accumulators. - The difference between the source accumulators is stored in accumulator
ACw.
- The subtraction computation is equivalent to the subtraction instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD.
- The extremum between the source accumulators is stored in accumulator
ACz.
- The extremum computation is similar to the compare register content
maximum instruction. However, the CARRY status bit is not updated by the extremum search but by the subtraction instruction.
- According to the extremum found, a decision bit is shifted in TRNx from
the MSBs to the LSBs. If the extremum value is ACx, the decision bit is cleared to 0; otherwise, it is set to 1.
5-124
SPRU375G
If M40 = 0:
TRNx = TRNx >> #1 ACw(390) = ACy(390) ACx(390) If (ACx(310) < ACy(310)) { bit(TRNx, 15) = #0 ; ACz(390) = ACx(390) } else { bit(TRNx, 15) = #1 ; ACz(390) = ACy(390) }
If M40 = 1:
TRNx = TRNx >> #1 ACw(390) = ACy(390) ACx(390) If (ACx(390) < ACy(390)) { bit(TRNx, 15) = #0 ; ACz(390) = ACx(390) } else { bit(TRNx, 15) = #1 ; ACz(390) = ACy(390) }
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if M40 status bit was locally set to 1. However to ensure compatibility versus overflow detection and saturation of the destination accumulator, this instruction must be executed with M40 = 0. Status Bits Affected by Affects Repeat Example
Syntax min_diff_dbl(AC0, AC1, AC2, AC3, TRN0) Description The difference is stored in AC3. The content of AC0 is subtracted from the content of AC1 and the result is stored in AC3. The minimum is stored in AC2. The content of TRN0 is shifted right 1 bit. If AC0 is less than AC1, AC0 is stored in AC2 and TRN0(15) is cleared to 0; otherwise, AC1 is stored in AC2 and TRN0(15) is set to 1.
SPRU375G
5-125
Size 4 4
Cycles 1 1
Pipeline X X
Opcode
TC1 TC2
1111 0000 AAAA AAAI KKKK KKKK KKKK KKKK 1111 0001 AAAA AAAI KKKK KKKK KKKK KKKK
Operands Description
K16, Smem, TCx This instruction performs a comparison in the A-unit ALU. The data memory operand Smem is compared to the 16-bit signed constant, K16. If they are equal, the TCx status bit is set to 1; otherwise, it is cleared to 0.
if((Smem) == K16) TCx = 1 else TCx = 0
Status Bits
Affected by Affects
none TCx
Repeat
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated. See the following other related instructions:
- Compare Accumulator, Auxiliary, or Temporary Register Content
See Also
5-126
SPRU375G
Example 1
Syntax TC1 = (*AR1+ == #400h)
Before AR1 0285 TC1
Description The content addressed by AR1 is compared to the signed 16-bit value (400h). Because they are equal, TC1 is set to 1. AR1 is incremented by 1.
After AR1 0285 TC1 0286 0400 1
0285 0400 0
Example 2
Syntax TC2 = (*AR1 == #400h)
Before AR1 0285 TC2
Description The content addressed by AR1 is compared to the signed 16-bit value (400h). Because they are not equal, TC2 is cleared to 0.
After AR1 0285 TC2 0285 0000 0
0285 0000 0
SPRU375G
5-127
temporary register. The instruction complements a single bit, as defined by the bit addressing mode, Baddr, of the source register. The generated bit address must be within:
- 039 when accessing accumulator bits (only the 6 LSBs of the generated
bit address are used to determine the bit position). If the generated bit address is not within 039, the selected register bit value does not change.
- 015 when accessing auxiliary or temporary register bits (only the 4 LSBs
of the generated address are used to determine the bit position). Status Bits Affected by Affects Repeat See Also none none
This instruction can be repeated. See the following other related instructions:
- Clear Accumulator, Auxiliary, or Temporary Register Bit - Complement Accumulator, Auxiliary, or Temporary Register Content - Complement Memory Bit - Set Accumulator, Auxiliary, or Temporary Register Bit
Example
Syntax cbit(T0, AR1)
Before T0 AR1 E000 000C
Description The bit at the position defined by the content of AR1(30) in T0 is complemented.
After T0 AR1 F000 000C
5-128
SPRU375G
This instruction computes the 1s complement (bitwise complement) of the content of the source register (src).
- When the destination (dst) operand is an accumulator: J J
The bit inversion is performed on 40 bits in the D-unit ALU and the result is stored in the destination accumulator. If an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the auxiliary or temporary register are zero extended.
The bit inversion is performed on 16 bits in the A-unit ALU and the result is stored in the destination auxiliary or temporary register. If an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation. none none
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Complement Accumulator, Auxiliary, or Temporary Register Bit - Negate Accumulator, Auxiliary, or Temporary Register Content
Example
Syntax AC1 = ~AC0
Before AC0 AC1 7E 2355 4FC0 00 2300 5678
Description The content of AC0 is complemented and the result is stored in AC1.
After AC0 AC1 7E 2355 4FC0 81 DCAA B03F
SPRU375G
5-129
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction performs a bit manipulation in the A-unit ALU. The instruction complements a single bit, as defined by the content of the source (src) operand, of a memory (Smem) location. The generated bit address must be within 015 (only the 4 LSBs of the register are used to determine the bit position).
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Clear Memory Bit - Complement Accumulator, Auxiliary, or Temporary Register Bit - Complement Accumulator, Auxiliary, or Temporary Register Content - Set Memory Bit
Example
Syntax cbit(*AR3, AC0) Description The bit at the position defined by AC0(30) in the content addressed by AR3 is complemented.
5-130
SPRU375G
No. [1]
Syntax Tx = exp(ACx)
Size 3
Cycles 1
Pipeline X
This instruction computes the exponent of the source accumulator ACx in the D-unit shifter. The result of the operation is stored in the temporary register Tx. The A-unit ALU is used to make the move operation. This exponent is a signed 2s-complement value in the 8 to 31 range. The exponent is computed by calculating the number of leading bits in ACx and subtracting 8 from this value. The number of leading bits is the number of shifts to the MSBs needed to align the accumulator content on a signed 40-bit representation. ACx is not modified after the execution of this instruction. If ACx is equal to 0, Tx is loaded with 0. This instruction produces in Tx the opposite result than computed by the Compute Mantissa and Exponent of Accumulator Content instruction (page 5-132).
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Compute Mantissa and Exponent of Accumulator Content
Example
Syntax T1 = exp(AC0) Description The exponent is computed by subtracting 8 from the number of leading bits in the content of AC0. The exponent value is a signed 2s-complement value in the 8 to 31 range and is stored in T1.
After AC0 T1
Before AC0 T1
SPRU375G
5-131
No. [1]
Size 3
Cycles 1
Pipeline X2
This instruction computes the exponent and mantissa of the source accumulator ACx. The computation of the exponent and the mantissa is executed in the D-unit shifter. The exponent is computed and stored in the temporary register Tx. The A-unit is used to make the move operation. The mantissa is stored in the accumulator ACy. The exponent is a signed 2s-complement value in the 31 to 8 range. The exponent is computed by calculating the number of leading bits in ACx and subtracting this value from 8. The number of leading bits is the number of shifts to the MSBs needed to align the accumulator content on a signed 40-bit representation. The mantissa is obtained by aligning the ACx content on a signed 32-bit representation. The mantissa is computed and stored in ACy.
- The shift operation is performed on 40 bits. J J
When shifting to the LSBs, bit 39 of ACx is extended to bit 31. When shifting to the MSBs, 0 is inserted at bit position 0.
This instruction produces in Tx the opposite result than computed by the Compute Exponent of Accumulator Content instruction (page 5-131). Status Bits Affected by Affects Repeat See Also none none
This instruction can be repeated. See the following other related instructions:
- Compute Exponent of Accumulator Content
5-132
SPRU375G
Example 1
Syntax AC1 = mant(AC0), T1 = exp(AC0) Description The exponent is computed by subtracting the number of leading bits in the content of AC0 from 8. The exponent value is a signed 2s-complement value in the 31 to 8 range and is stored in T1. The mantissa is computed by aligning the content of AC0 on a signed 32-bit representation. The mantissa value is stored in AC1.
After AC0 AC1 T1
Example 2
Syntax AC1 = mant(AC0), T1 = exp(AC0) Description The exponent is computed by subtracting the number of leading bits in the content of AC0 from 8. The exponent value is a signed 2s-complement value in the 31 to 8 range and is stored in T1. The mantissa is computed by aligning the content of AC0 on a signed 32-bit representation. The mantissa value is stored in AC1.
After AC0 AC1 T1
SPRU375G
5-133
Size 3 3
Cycles 1 1
Pipeline X X
Opcode
TC1 TC2
0001 000E xxSS 1010 SSdd xxx0 0001 000E XXSS 1010 SSdd xxx1
Operands Description
ACx, ACy, Tx, TCx This instruction performs bit field manipulation in the D-unit shifter. The result is stored in the selected temporary register (Tx). The A-unit ALU is used to make the move operation. Accumulator ACx is ANDed with accumulator ACy. The number of bits set to 1 in the intermediary result is evaluated and stored in the selected temporary register (Tx). If the number of bits is even, the selected TCx status bit is cleared to 0. If the number of bits is odd, the selected TCx status bit is set to 1.
Status Bits
Affected by Affects
none TCx
Repeat Example
Syntax
Description The content of AC1 is ANDed with the content of AC2, the number of bits set to 1 in the result is evaluated and stored in T1. The number of bits set to 1 is odd, TC1 is set to 1.
After 7E 2355 4FC0 0F E340 5678 0000 0 AC1 AC2 T1 TC1 7E 2355 4FC0 0F E340 5678 000B 1
5-134
SPRU375G
Syntax HI(ACy) = HI(Lmem) + HI(ACx), LO(ACy) = LO(Lmem) + LO(ACx) HI(ACx) = HI(Lmem) + Tx, LO(ACx) = LO(Lmem) + Tx
Size 3 3
Cycles 1 1
Pipeline X X
Description
These instructions perform two paralleled addition operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
Status Bits
Affected by Affects
See Also
SPRU375G
5-135
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction performs two paralleled addition operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
- The data memory operand dbl(Lmem) is divided into two 16-bit parts: J J
the lower part is used as one of the 16-bit operands of the ALU low part the higher part is sign extended to 24 bits according to SXMD and is used in the ALU high part
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVy) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
5-136 Instruction Set Descriptions SPRU375G
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC0) = HI(*AR3) + HI(AC1), LO(AC0) = LO(*AR3) + LO(AC1) Description Both instructions are performed in parallel. When the Lmem address is even (AR3 = even): The content of AC1(3916) is added to the content addressed by AR3 and the result is stored in AC0(3916). The content of AC1(150) is added to the content addressed by AR3 + 1 and the result is stored in AC0(150).
SPRU375G
5-137
This instruction performs two paralleled addition operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
- The temporary register Tx: J J
is used as one of the 16-bit operands of the ALU low part is duplicated and, according to SXMD, sign extended to 24 bits to be used in the ALU high part
- The data memory operand dbl(Lmem) is divided into two 16-bit parts: J J
the lower part is used as one of the 16-bit operands of the ALU low part the higher part is sign extended to 24 bits according to SXMD and is used in the ALU high part
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVx) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
SPRU375G
5-138
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
- Independently on each data path, if SATD = 1 when an overflow is
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC0) = HI(*AR3) + T0, LO(AC0) = LO(*AR3) + T0 Description Both instructions are performed in parallel. When the Lmem address is even (AR3 = even): The content of T0 is added to the content addressed by AR3 and the result is stored in AC0(3916). The duplicated content of T0 is added to the content addressed by AR3 + 1 and the result is stored in AC0(150).
SPRU375G
5-139
Syntax HI(ACx) = Smem + Tx, LO(ACx) = Smem Tx HI(ACx) = HI(Lmem) + Tx, LO(ACx) = LO(Lmem) Tx
Size 3 3
Cycles 1 1
Pipeline X X
Description
These instructions perform two paralleled addition and subtraction operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
Status Bits
Affected by Affects
See Also
5-140
SPRU375G
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction performs two paralleled arithmetical operations in one cycle: an addition and subtraction. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
- The data memory operand Smem: J J
is used as one of the 16-bit operands of the ALU low part is duplicated and, according to SXMD, sign extended to 24 bits to be used in the ALU high part
is used as one of the 16-bit operands of the ALU low part is duplicated and, according to SXMD, sign extended to 24 bits to be used in the ALU high part
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVx) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
SPRU375G Instruction Set Descriptions 5-141
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC1) = *AR1 + T1, LO(AC1) = *AR1 T1 Description Both instructions are performed in parallel. The content addressed by AR1 is added to the content of T1 and the result is stored in AC1(3916). The duplicated content of T1 is subtracted from the duplicated content addressed by AR1 and the result is stored in AC1(150).
After 00 2300 0000 4000 0201 E300 1 1 0 0 AC1 T1 AR1 201 SXMD M40 ACOV0 CARRY 00 2300 A300 4000 0201 E300 1 1 0 1
5-142
SPRU375G
This instruction performs two paralleled arithmetical operations in one cycle: an addition and subtraction. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
- The temporary register Tx: J J
is used as one of the 16-bit operands of the ALU low part is duplicated and, according to SXMD, sign extended to 24 bits to be used in the ALU high part
- The data memory operand dbl(Lmem) is divided into two 16-bit parts: J J
the lower part is used as one of the 16-bit operands of the ALU low part the higher part is sign extended to 24 bits according to SXMD and is used in the ALU high part
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVx) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
Instruction Set Descriptions 5-143
SPRU375G
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
- Independently on each data path, if SATD = 1 when an overflow is
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC0) = HI(*AR3) + T0, LO(AC0) = LO(*AR3) T0 Description Both instructions are performed in parallel. When the Lmem address is even (AR3 = even): The content of T0 is added to the content addressed by AR3 and the result is stored in AC0(3916). The duplicated content of T0 is subtracted from the content addressed by AR3 + 1 and the result is stored in AC0(150).
5-144
SPRU375G
Syntax HI(ACy) = HI(ACx) HI(Lmem), LO(ACy) = LO(ACx) LO(Lmem) HI(ACy) = HI(Lmem) HI(ACx), LO(ACy) = LO(Lmem) LO(ACx) HI(ACx) = Tx HI(Lmem), LO(ACx) = Tx LO(Lmem) HI(ACx) = HI(Lmem) Tx, LO(ACx) = LO(Lmem) Tx
Size 3 3 3 3
Cycles 1 1 1 1
Pipeline X X X X
Description
These instructions perform two paralleled subtraction operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
Status Bits
Affected by Affects
See Also
SPRU375G
5-145
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction performs two paralleled subtraction operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit data path).
- The data memory operand dbl(Lmem) is divided into two 16-bit parts: J J
the lower part is used as one of the 16-bit operands of the ALU low part the higher part is sign extended to 24 bits according to SXMD and is used in the ALU high part
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVy) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
5-146 Instruction Set Descriptions SPRU375G
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC0) = HI(AC1) HI(*AR3), LO(AC0) = LO(AC1) LO(*AR3) Description Both instructions are performed in parallel. When the Lmem address is even (AR3 = even): The content addressed by AR3 (sign extended to 24 bits) is subtracted from the content of AC1(3916) and the result is stored in AC0(3916). The content addressed by AR3 + 1 is subtracted from the content of AC1(150) and the result is stored in AC0(150).
SPRU375G
5-147
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction performs two paralleled subtraction operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
- The data memory operand dbl(Lmem) is divided into two 16-bit parts: J J
the lower part is used as one of the 16-bit operands of the ALU low part the higher part is sign extended to 24 bits according to SXMD and is used in the ALU high part
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVy) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
5-148 Instruction Set Descriptions SPRU375G
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC0) = HI(*AR3) HI(AC1), LO(AC0) = LO(*AR3) LO(AC1) Description Both instructions are performed in parallel. When the Lmem address is even (AR3 = even): The content of AC1(3916) is subtracted from the content addressed by AR3 and the result is stored in AC0(3916). The content of AC1(150) is subtracted from the content addressed by AR3 + 1 and the result is stored in AC0(150).
SPRU375G
5-149
This instruction performs two paralleled subtraction operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
- The temporary register Tx: J J
is used as one of the 16-bit operands of the ALU low part is duplicated and, according to SXMD, sign extended to 24 bits to be used in the ALU high part
- The data memory operand dbl(Lmem) is divided into two 16-bit parts: J J
the lower part is used as one of the 16-bit operands of the ALU low part the higher part is sign extended to 24 bits according to SXMD and is used in the ALU high part
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVx) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
SPRU375G
5-150
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
- Independently on each data path, if SATD = 1 when an overflow is
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC0) = T0 HI(*AR3), LO(AC0) = T0 LO(*AR3) Description Both instructions are performed in parallel. When the Lmem address is even (AR3 = even): The content addressed by AR3 is subtracted from the content of T0 and the result is stored in AC0(3916). The content addressed by AR3 + 1 is subtracted from the duplicated content of T0 and the result is stored in AC0(150).
SPRU375G
5-151
This instruction performs two paralleled subtraction operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
- The temporary register Tx: J J
is used as one of the 16-bit operands of the ALU low part is duplicated and, according to SXMD, sign extended to 24 bits to be used in the ALU high part
- The data memory operand dbl(Lmem) is divided into two 16-bit parts: J J
the lower part is used as one of the 16-bit operands of the ALU low part the higher part is sign extended to 24 bits according to SXMD and is used in the ALU high part
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVx) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
SPRU375G
5-152
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
- Independently on each data path, if SATD = 1 when an overflow is
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC0) = HI(*AR3) T0, LO(AC0) = LO(*AR3) T0 Description Both instructions are performed in parallel. When the Lmem address is even (AR3 = even): The content of T0 is subtracted from the content addressed by AR3 and the result is stored in AC0(3916). The duplicated content of T0 is subtracted from the content addressed by AR3 + 1 and the result is stored in AC0(150).
SPRU375G
5-153
Syntax HI(ACx) = Smem Tx, LO(ACx) = Smem + Tx HI(ACx) = HI(Lmem) Tx, LO(ACx) = LO(Lmem) + Tx
Size 3 3
Cycles 1 1
Pipeline X X
Description
These instructions perform two paralleled subtraction and addition operations in one cycle. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
Status Bits
Affected by Affects
See Also
5-154
SPRU375G
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction performs two paralleled arithmetical operations in one cycle: a subtraction and addition. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
- The data memory operand Smem: J J
is used as one of the 16-bit operands of the ALU low part is duplicated and, according to SXMD, sign extended to 24 bits to be used in the ALU high part
is used as one of the 16-bit operands of the ALU low part is duplicated and, according to SXMD, sign extended to 24 bits to be used in the ALU high part
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVx) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
SPRU375G Instruction Set Descriptions 5-155
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC0) = *AR3 T0, LO(AC0) = *AR3 + T0 Description Both instructions are performed in parallel. The content of T0 is subtracted from the content addressed by AR3 and the result is stored in AC0(3916). The duplicated content of T0 is added to the duplicated content addressed by AR3 and the result is stored in AC0(150).
5-156
SPRU375G
This instruction performs two paralleled arithmetical operations in one cycle: a subtraction and addition. The operations are executed on 40 bits in the D-unit ALU that is configured locally in dual 16-bit mode. The 16 lower bits of both the ALU and the accumulator are separated from their higher 24 bits (the 8 guard bits are attached to the higher 16-bit datapath).
- The temporary register Tx: J J
is used as one of the 16-bit operands of the ALU low part is duplicated and, according to SXMD, sign extended to 24 bits to be used in the ALU high part
- The data memory operand dbl(Lmem) is divided into two 16-bit parts: J J
the lower part is used as one of the 16-bit operands of the ALU low part the higher part is sign extended to 24 bits according to SXMD and is used in the ALU high part
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
detection is made. If an overflow is detected on any of the data paths, the destination accumulator overflow status bit (ACOVx) is set.
J J
For the operations performed in the ALU low part, overflow is detected at bit position 15. For the operations performed in the ALU high part, overflow is detected at bit position 31.
Instruction Set Descriptions 5-157
SPRU375G
- For all instructions, the carry of the operation performed in the ALU high
part is reported in the CARRY status bit. The CARRY status bit is always extracted at bit position 31.
- Independently on each data path, if SATD = 1 when an overflow is
For the operations performed in the ALU low part, saturation values are 7FFFh and 8000h. For the operations performed in the ALU high part, saturation values are 00 7FFFh and FF 8000h.
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, this instruction is executed as if SATD is locally cleared to 0. Overflow is only detected and reported for the computation performed in the higher 24-bit datapath (overflow is detected at bit position 31). Status Bits Affected by Affects Repeat Example
Syntax HI(AC0) = HI(*AR3) T0, LO(AC0) = LO(*AR3) + T0 Description Both instructions are performed in parallel. When the Lmem address is even (AR3 = even): The content of T0 is subtracted from the content addressed by AR3 and the result is stored in AC0(3916). The duplicated content of T0 is added to the content addressed by AR3 + 1 and the result is stored in AC0(150).
5-158
SPRU375G
Execute Conditionally
Syntax Characteristics
Parallel Enable Bit No No
Size 2 2
Cycles 1 1
Pipeline AD X
Description
These instructions evaluate a single condition defined by the cond field and allow you to control execution of all operations implied by the instruction or part of the instruction. See Table 13 for a list of conditions. Instruction [1] allows you to control the entire execution flow from the address phase to the execute phase of the pipeline. Instruction [2] allows you to only control the execution flow from the execute phase of the pipeline. The use of a label, where control of the execute conditionally instruction ends, is optional.
- These instructions may be executed alone. - These instructions may be executed with two paralleled instructions. - These instructions may be executed with the instruction with which it is
paralleled.
- These instructions may be executed with the previous instruction. - These instructions may be executed with the previous instruction and two
paralleled instructions.
- These instructions cannot be repeated. - These instructions cannot be used as the last instruction in a repeat loop
structure.
- These instructions cannot control the execution of the following program
control instructions:
goto call return trap (cond) goto (cond) call (cond) return localrepeat intr idle reset repeat blockrepeat (cond) execute(AD_unit) (cond) execute(D_unit) while (cond) repeat return_int
Status Bits
Affected by Affects
SPRU375G
Execute Conditionally
Syntax Characteristics
No. [1] Syntax if (cond) execute(AD_Unit) Parallel Enable Bit No Size 2 Cycles 1 Pipeline AD
Opcode
1001 0110 0CCC CCCC 1001 1110 0CCC CCCC 1001 1111 0CCC CCCC The assembler selects the opcode depending on the instruction position in a paralleled pair.
Operands Description
cond This instruction evaluates a single condition defined by the cond field and allows you to control the execution flow of an instruction, or instructions, from the address phase to the execute phase of the pipeline. See Table 13 for a list of conditions. When this instruction moves into the address phase of the pipeline, the condition specified in the cond field is evaluated. If the tested condition is true, the conditional instruction(s) is read and executed; if the tested condition is false, the conditional instruction(s) is not read and program control is passed to the instruction following the conditional instruction(s) or to the program address defined by label. There is a 3-cycle latency for the condition testing.
- This instruction may be executed alone:
paralleled:
if(cond) execute(AD_unit) || instruction_executes_conditionally label:
5-160 Instruction Set Descriptions SPRU375G
paralleled instructions:
previous_instruction || if(cond) execute(AD_unit) instruction_1_executes_conditionally || instruction_2_executes_conditionally label:
This instruction cannot be used as the last instruction in a repeat loop structure. This instruction cannot control the execution of the following program control instructions:
goto call return trap (cond) goto (cond) call (cond) return localrepeat intr idle reset repeat blockrepeat (cond) execute(AD_unit) (cond) execute(D_unit) while (cond) repeat return_int
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the comparison of accumulators to 0 is performed as if M40 was set to 1. Status Bits Affected by Affects Repeat Example 1
Syntax if (TC1) execute(AD_unit) mar(*AR1+) AC1 = AC1 + *AR1
Before AC1 TC1 CARRY AR1 200 201 00 0000 4300 1 1 0200 2020 2021 After AC1 TC1 CARRY AR1 200 201 00 0000 6321 1 0 0201 2020 2021
Description TC1 is equal to 1, the next instruction is executed (AR1 is incremented by 1). The content of AC1 is added to the content addressed by AR1 + 1 (2021h) and the result is stored in AC1.
SPRU375G
5-161
Example 2
Syntax if (TC1) execute(AD_unit) mar(*AR1+) AC1 = AC1 + *AR1
Before AC1 TC1 CARRY AR1 200 201 00 0000 4300 0 1 0200 2020 2021 After AC1 TC1 CARRY AR1 200 201 00 0000 6320 0 0 0200 2020 2021
Description TC1 is not equal to 1, the next instruction is not executed (AR1 is not incremented). The content of AC1 is added to the content addressed by AR1 (2020h) and the result is stored in AC1.
5-162
SPRU375G
Execute Conditionally
Syntax Characteristics
No. [2] Syntax if (cond) execute(D_Unit) Parallel Enable Bit No Size 2 Cycles 1 Pipeline X
Opcode
1001 0110 1CCC CCCC 1001 1110 1CCC CCCC 1001 1111 1CCC CCCC The assembler selects the opcode depending on the instruction position in a paralleled pair.
Operands Description
cond This instruction evaluates a single condition defined by the cond field and allows you to control the execution flow of an instruction, or instructions, from the execute phase of the pipeline. This instruction differs from instruction [1] because in this instruction operations performed in the address phase are always executed. See Table 13 for a list of conditions. When this instruction moves into the execute phase of the pipeline, the condition specified in the cond field is evaluated. If the tested condition is true, the conditional instruction(s) is read and executed; if the tested condition is false, the conditional instruction(s) is not read and program control is passed to the instruction following the conditional instruction(s) or to the program address defined by label. There is a 0-cycle latency for the condition testing.
- This instruction may be executed alone:
paralleled. When this instruction syntax is used and the instruction to be executed conditionally is a store-to-memory instruction, there is a 1-cycle latency for the condition setting.
if(cond) execute(D_unit) || instruction_executes_conditionally label:
SPRU375G Instruction Set Descriptions 5-163
paralleled instructions:
previous_instruction || if(cond) execute(D_unit) instruction_1_executes_conditionally || instruction_2_executes_conditionally label:
This instruction cannot be used as the last instruction in a repeat loop structure. This instruction cannot control the execution of the following program control instructions:
goto call return trap (cond) goto (cond) call (cond) return localrepeat intr idle reset repeat blockrepeat (cond) execute(AD_unit) (cond) execute(D_unit) while (cond) repeat return_int
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the comparison of accumulators to 0 is performed as if M40 was set to 1. Status Bits Affected by Affects Repeat Example 1
Syntax if (TC1) execute(D_unit) mar(*AR1+) AC1 = AC1 + *AR1
Before AC1 TC1 CARRY AR1 200 201 00 0000 4300 1 1 0200 2020 2021 After AC1 TC1 CARRY AR1 200 201 00 0000 6321 1 0 0201 2020 2021
Description TC1 is equal to 1, the next instruction is executed (AR1 is incremented by 1). The content of AC1 is added to the content addressed by AR1 + 1 (2021h) and the result is stored in AC1.
5-164
SPRU375G
Example 2
Syntax if (TC1) execute(D_unit) mar(*AR1+) AC1 = AC1 + *AR1
Before AC1 TC1 CARRY AR1 200 201 00 0000 4300 0 1 0200 2020 2021
Description TC1 is not equal to 1, the next instruction would not be executed; however, since the next instruction is a pointer modification, AR1 is incremented by 1 in the address phase. The content of AC1 is added to the content addressed by AR1 + 1 (2021h) and the result is stored in AC1.
After AC1 TC1 CARRY AR1 200 201 00 0000 6321 0 0 0201 2020 2021
SPRU375G
5-165
This instruction performs a bit field manipulation in the D-unit shifter. When the destination register (dst) is an A-unit register (ARx or Tx), a dedicated bus carries the output of the D-unit shifter directly into dst. The 16-bit field mask, k16, is scanned from the least significant bits (LSBs) to the most significant bits (MSBs). According to the bit set to 1 in the bit field mask, the 16 LSBs of the source accumulator (ACx) bits are extracted and separated with 0 toward the MSBs. The result is stored in the dst.
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Extract Accumulator Bit Field
Example
Syntax T2 = field_expand(AC0,#8024h) Description Each bit of the unsigned 16-bit value (8024h) is scanned from the LSB to the MSB to test for a 1. If the bit is set to 1, the bit in AC0 is extracted and separated with 0 toward the MSB in T2; otherwise, the corresponding bit in AC0 is not extracted. The result is stored in T2.
Execution #k16 (8024h) AC0(150) T2 1000 0000 0010 0100 0010 1011 0110 0101 1000 0000 0000 0100
5-166
SPRU375G
This instruction performs a bit field manipulation in the D-unit shifter. When the destination register (dst) is an A-unit register (ARx or Tx), a dedicated bus carries the output of the D-unit shifter directly into dst. The 16-bit field mask, k16, is scanned from the least significant bits (LSBs) to the most significant bits (MSBs). According to the bit set to 1 in the bit field mask, the corresponding 16 LSBs of the source accumulator (ACx) bits are extracted and packed toward the LSBs. The result is stored in the dst.
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Expand Accumulator Bit Field
Example
Syntax T2 = field_extract(AC0,#8024h) Description Each bit of the unsigned 16-bit value (8024h) is scanned from the LSB to the MSB to test for a 1. If the bit is set to 1, the corresponding bit in AC0 is extracted and packed toward the LSB in T2; otherwise, the corresponding bit in AC0 is not extracted. The result is stored in T2.
Execution #k16 (8024h) AC0(150) T2 1000 0000 0010 0100 0101 0101 1010 1010 0000 0000 0000 0010
SPRU375G
5-167
No. [1]
Size 4
Cycles 1
Pipeline X
1000 0101 XXXM MMYY YMMM 11mm DDx1 DDU% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel operations: multiply and accumulate (MAC), and subtraction. The firsn() operation is executed:
ACy = ACy + (ACx * Cmem), ACx = (Xmem << #16) (Ymem << #16)
The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of ACx(3216) and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. The second operation subtracts the content of data memory operand Ymem, shifted left 16 bits, from the content of data memory operand Xmem, shifted left 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. 5-168 Instruction Set Descriptions SPRU375G
- The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat See Also C54CM, FRCT, M40, SATD, SMUL, SXMD ACOVx, ACOVy, CARRY
This instruction can be repeated. See the following other related instructions:
- Finite Impulse Response Filter, Symmetrical
Example
Syntax firsn(*AR0, *AR1, coef(*CDP), AC0, AC1) Description The content of AC0(3216) multiplied by the content addressed by the coefficient data pointer register (CDP) is added to the content of AC1 and the result is stored in AC1. The content addressed by AR1 shifted left by 16 bits is subtracted from the content addressed by AR0 shifted left by 16 bits and the result is stored in AC0.
Before AC0 AC1 *AR0 *AR1 *CDP ACOV0 ACOV1 CARRY FRCT SXMD
After AC0 AC1 *AR0 *AR1 *CDP ACOV0 ACOV1 CARRY FRCT SXMD
SPRU375G
5-169
No. [1]
Size 4
Cycles 1
Pipeline X
1000 0101 XXXM MMYY YMMM 11mm DDx0 DDU% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel operations: multiply and accumulate (MAC), and addition. The firs() operation is executed:
ACy = ACy + (ACx * Cmem), ACx = (Xmem << #16) + (Ymem << #16)
The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of ACx(3216) and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. The second operation performs an addition operation between the content of data memory operand Xmem, shifted left 16 bits, and the content of data memory operand Ymem, shifted left 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. 5-170 Instruction Set Descriptions SPRU375G
- The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. - When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat See Also C54CM, FRCT, M40, SATD, SMUL, SXMD ACOVx, ACOVy, CARRY
This instruction can be repeated. See the following other related instructions:
- Finite Impulse Response Filter, Antisymmetrical
Example
Syntax firs(*AR0, *AR1, coef(*CDP), AC0, AC1) Description The content of AC0(3216) multiplied by the content addressed by the coefficient data pointer register (CDP) is added to the content of AC1 and the result is stored in AC1. The content addressed by AR0 shifted left by 16 bits is added to the content addressed by AR1 shifted left by 16 bits and the result is stored in AC0.
Before AC0 AC1 *AR0 *AR1 *CDP ACOV0 ACOV1 CARRY FRCT SXMD
After AC0 AC1 *AR0 *AR1 *CDP ACOV0 ACOV1 CARRY FRCT SXMD
SPRU375G
5-171
idle
Idle
Syntax Characteristics
Parallel Enable Bit No
No. [1]
Syntax idle
Size 4
Cycles ?
Pipeline D
This instruction forces the program being executed to wait until an interrupt or a reset occurs. The power-down mode that the processor operates in depends on a configuration register accessible through the peripheral access mechanism. Affected by Affects INTM none
Status Bits
Repeat
5-172
SPRU375G
1000 0110 XXXM MMYY YMMM DDDD 110x xxx% ACx, ACy, Xmem, Ymem This instruction performs two paralleled operations in one cycle: multiply and accumulate (MAC), and addition. The instruction is executed:
ACy = ACy + (Xmem * Ymem), ACx = rnd(ACx + (Xmem << #16))
The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, sign extended to 17 bits, and the content of data memory operand Ymem, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. The second operation performs an addition between an accumulator content and the content of data memory operand Xmem shifted left by 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. When an
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, the rounding is performed without clearing the 16 lowest bits of ACx. The addition operation has no overflow detection, report, and saturation after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax lms(*AR0, *AR1, AC0, AC1) Description The content addressed by AR0 multiplied by the content addressed by AR1 is added to the content of AC1 and the result is stored in AC1. The content addressed by AR0 shifted left by 16 bits is added to the content of AC0. The result is rounded and stored in AC0.
After AC0 AC1 *AR0 *AR1 ACOV0 ACOV1 CARRY FRCT
C54CM, FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy, CARRY
5-174
SPRU375G
No. [1]
Syntax linear()
Size 1
Cycles 1
Pipeline AD
1001 1100
This instruction is an instruction qualifier that can be paralleled only with any instruction making an indirect Smem, Xmem, Ymem, Lmem, Baddr, or Cmem addressing. This instruction cannot be executed in parallel with any other types of instructions and it cannot be executed as a stand-alone instruction (assembler generates an error message). When this instruction is used in parallel, all modifications of ARx and CDP pointer registers used in the indirect addressing mode are done linearly (as if ST2_55 register bits 0 to 8 were cleared to 0).
Status Bits
Affected by Affects
none none
Repeat
SPRU375G
5-175
Syntax ACx = rnd(Smem << Tx) ACx = low_byte(Smem) << #SHIFTW ACx = high_byte(Smem) << #SHIFTW ACx = Smem << #16 ACx = uns(Smem) ACx = uns(Smem) << #SHIFTW ACx = M40(dbl(Lmem)) LO(ACx) = Xmem, HI(ACx) = Ymem
Size 3 3 3 2 3 4 3 3
Cycles 1 1 1 1 1 1 1 1
Pipeline X X X X X X X X
Description
This instruction loads a 16-bit signed constant, K16, the content of a memory (Smem) location, the content of a data memory operand (Lmem), or the content of dual data memory operands (Xmem and Ymem) to a selected accumulator (ACx). Affected by Affects C54CM, M40, RDM, SATD, SXMD ACOVx
Status Bits
See Also
to Memory
- Load Accumulator Pair from Memory - Load Accumulator with Immediate Value - Load Accumulator, Auxiliary, or Temporary Register from Memory - Load Accumulator, Auxiliary, or Temporary Register with Immediate Value - Load Auxiliary or Temporary Register Pair from Memory - Multiply and Accumulate with Parallel Load Accumulator from Memory - Multiply and Subtract with Parallel Load Accumulator from Memory 5-176 Instruction Set Descriptions SPRU375G
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction loads the content of a memory (Smem) location shifted by the content of Tx to the accumulator (ACx):
- The input operand is sign extended to 40 bits according to SXMD. - The input operand is shifted by the 4-bit value in the D-unit shifter. The shift
optional rnd keyword is applied to the input operand. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, no overflow detection, report, and saturation is done after the shifting operation. The 6 LSBs of Tx are used to determine the shift quantity. The 6 LSBs of Tx define a shift quantity within 32 to +31. When the value is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat Example
Syntax AC0 = *AR3 << T0 Description AC0 is loaded with the content addressed by AR3 shifted by the content of T0.
SPRU375G
5-177
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction loads the low-byte content of a memory (Smem) location shifted by the 6-bit value, SHIFTW, to the accumulator (ACx):
- The content of the memory location is sign extended to 40 bits according
to SXMD.
- The input operand is shifted by the 6-bit value in the D-unit shifter. The shift
(MMR). This instruction cannot access a byte within an MMR. If Smem is an MMR, the DSP sends a hardware bus-error interrupt (BERRINT) request to the CPU. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = low_byte(*AR3) << #31 Description The low-byte content addressed by AR3 is shifted left by 31 bits and loaded into AC0.
5-178
SPRU375G
No. [3]
Size 3
Cycles 1
Pipeline X
This instruction loads the high-byte content of a memory (Smem) location shifted by the 6-bit value, SHIFTW, to the accumulator (ACx):
- The content of the memory location is sign extended to 40 bits according
to SXMD.
- The input operand is shifted by the 6-bit value in the D-unit shifter. The shift
(MMR). This instruction cannot access a byte within an MMR. If Smem is an MMR, the DSP sends a hardware bus-error interrupt (BERRINT) request to the CPU. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = high_byte(*AR3) << #31 Description The high-byte content addressed by AR3 is shifted left by 31 bits and loaded into AC0.
SPRU375G
5-179
No. [4]
Size 2
Cycles 1
Pipeline X
This instruction loads the content of a memory (Smem) location shifted left by 16 bits to the accumulator (ACx):
- The input operand is sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - The input operand is shifted left by 16 bits according to M40.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, overflow detection, report, and saturation is done after the shifting operation Status Bits Affected by Affects Repeat Example
Syntax AC1 = *AR3+ << #16 Description The content addressed by AR3 shifted left by 16 bits is loaded into AC1. AR3 is incremented by 1.
After 00 0200 FC00 0200 3400 AC1 AR3 200 00 3400 0000 0201 3400
5-180
SPRU375G
No. [5]
Size 3
Cycles 1
Pipeline X
This instruction loads the content of a memory (Smem) location to the accumulator (ACx):
- The memory operand is extended to 40 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
of the D-unit ALU, the D-unit shifter, and the D-unit MACs. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = uns(*AR3) Description The content addressed by AR3 is zero extended to 40 bits and loaded into AC0.
SXMD none
SPRU375G
5-181
No. [6]
Size 4
Cycles 1
Pipeline X
1111 1001 AAAA AAAI uxSH IFTW xxDD 10xx ACx, SHIFTW, Smem This instruction loads the content of a memory (Smem) location, shifted by the 6-bit value, SHIFTW, to the accumulator (ACx):
- The memory operand is extended to 40 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
- The input operand is shifted by the 6-bit value in the D-unit shifter. The shift
operation is equivalent to the signed shift instruction. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat C54CM, M40, SATD, SXMD ACOVx
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax AC0 = uns(*AR3) << #31 Description The content addressed by AR3 is zero extended to 40 bits, shifted left by 31 bits, and loaded into AC0.
5-182
SPRU375G
No. [7]
Size 3
Cycles 1
Pipeline X
This instruction loads the content of data memory operand (Lmem) to the accumulator (ACx):
- The input operand is sign extended to 40 bits according to SXMD. - The load operation in the accumulator uses a dedicated path independent
of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
- Status bit M40 is locally set to 1, if the optional M40 keyword is applied to
the input operand. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = dbl(*AR3) Description The content (long word) addressed by AR3 and AR3 + 1 is loaded into AC0. Because this instruction is a longoperand instruction, AR3 is decremented by 2 after the execution.
SPRU375G
5-183
This instruction performs a dual 16-bit load of accumulator high and low parts. The operation is executed in dual 16-bit mode; however, it is independent of the 40-bit D-unit ALU. The 16 lower bits of the accumulator are separated from the higher 24 bits and the 8 guard bits are attached to the higher 16-bit datapath.
- The data memory operand Xmem is loaded as a 16-bit operand to the
destination accumulator (ACx) low part. And, according to SXMD the data memory operand Ymem is sign extended to 24 bits and is loaded to the destination accumulator (ACx) high part.
- For the load operations in higher accumulator bits, overflow detection is
performed at bit position 31. If an overflow is detected, the destination accumulator overflow status bit (ACOVx) is set.
- If SATD is 1 when an overflow is detected on the higher data path, a
saturation is performed with saturation value of 00 7FFFh. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, this instruction is executed as if SATD was locally cleared to 0. Status Bits Affected by Affects Repeat Example
Syntax LO(AC0) = *AR3, HI(AC0) = *AR4 Description The content at the location addressed by AR4, sign extended to 24 bits, is loaded into AC0(3916) and the content at the location addressed by AR3 is loaded into AC0(150).
5-184
SPRU375G
Load Accumulator from Memory with Parallel Store Accumulator Content to Memory
Load Accumulator from Memory with Parallel Store Accumulator Content to Memory
Syntax Characteristics
Parallel Enable Bit No
No. [1]
Size 4
Cycles 1
Pipeline X
1000 0111 XXXM MMYY YMMM SSDD 110x xxxx ACx, ACy, T2, Xmem, Ymem This instruction performs two operations in parallel: load and store. The first operation loads the content of data memory operand Xmem shifted left by 16 bits to the accumulator ACy.
- The input operand is sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - The input operand is shifted left by 16 bits according to M40.
The second operation shifts the accumulator ACx by the content of T2 and stores ACx(3116) to data memory operand Ymem. If the 16-bit value in T2 is not within 32 to +31, the shift is saturated to 32 or +31 and the shift is performed with this value.
- The input operand is shifted in the D-unit shifter according to SXMD. - After the shift, the high part of the accumulator, ACx(3116), is stored to
the memory location. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When this instruction is executed with C54CM = 1, the 6 LSBs of T2 are used to determine the shift quantity. The 6 LSBs of T2 define a shift quantity within 32 to +31. When the 16-bit value in T2 is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat
SPRU375G
Load Accumulator from Memory with Parallel Store Accumulator Content to Memory
See Also
Example
Syntax AC0 = *AR3 << #16, *AR4 = HI(AC1 << T2) Description Both instructions are performed in parallel. The content addressed by AR3 shifted left by 16 bits is stored in AC0. The content of AC1 is shifted by the content of T2, and AC1(3116) is stored at the address of AR4.
5-186
SPRU375G
Size 3 3
Cycles 1 1
Pipeline X X
Description
This instruction loads the content of a data memory operand (Lmem) to the selected accumulator pair, ACx and AC(x + 1). Affected by Affects C54CM, M40, SATD, SXMD ACOVx, ACOV(x + 1)
Status Bits
See Also
to Memory
- Load Accumulator with Immediate Value - Load Accumulator, Auxiliary, or Temporary Register from Memory - Load Accumulator, Auxiliary, or Temporary Register with Immediate Value - Load Auxiliary or Temporary Register Pair from Memory - Multiply and Accumulate with Parallel Load Accumulator from Memory - Multiply and Subtract with Parallel Load Accumulator from Memory
SPRU375G
5-187
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction loads the 16 highest bits of data memory operand (Lmem) to the 16 highest bits of the accumulator (ACx) and loads the 16 lowest bits of data memory operand (Lmem) to the 16 highest bits of accumulator AC(x + 1):
- The load operation in the accumulator uses a dedicated path independent
of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
- Valid accumulators are AC0 and AC2.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, overflow detection, report, and saturation is done after the operation. Status Bits Affected by Affects Repeat Example
Syntax pair(HI(AC2)) = *AR3+ Description The 16 highest bits of the content at the location addressed by AR3 are loaded into AC2(3116) and the 16 lowest bits of the content at the location addressed by AR3 + 1 are loaded into AC3(3116). AR3 is incremented by 1.
After 00 0200 FC00 00 0000 0000 0200 3400 0FD3 AC2 AC3 AR3 200 201 00 3400 0000 00 0FD3 0000 0201 3400 0FD3
5-188
SPRU375G
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction loads the 16 highest bits of data memory operand (Lmem) to the 16 lowest bits of the accumulator (ACx) and loads the 16 lowest bits of data memory operand (Lmem) to the 16 lowest bits of accumulator AC(x + 1):
- The load operation in the accumulator uses a dedicated path independent
of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
- Valid accumulators are AC0 and AC2.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured Status Bits Affected by Affects Repeat Example
Syntax pair(LO(AC0)) = *AR3 Description The 16 highest bits of the content at the location addressed by AR3 are loaded into AC0(150) and the 16 lowest bits of the content at the location addressed by AR3 + 1 are loaded into AC1(150).
SPRU375G
5-189
Size 4 4
Cycles 1 1
Pipeline X X
Description
This instruction loads a 16-bit signed constant, K16, to a selected accumulator (ACx). Affected by Affects C54CM, M40, SATD, SXMD ACOVx
Status Bits
See Also
to Memory
- Load Accumulator Pair from Memory - Load Accumulator, Auxiliary, or Temporary Register from Memory - Load Accumulator, Auxiliary, or Temporary Register with Immediate Value - Load Auxiliary or Temporary Register Pair from Memory - Multiply and Accumulate with Parallel Load Accumulator from Memory - Multiply and Subtract with Parallel Load Accumulator from Memory
5-190
SPRU375G
No. [1]
Size 4
Cycles 1
Pipeline X
This instruction loads the 16-bit signed constant, K16, shifted left by 16 bits to the accumulator (ACx):
- The 16-bit constant, K16, is sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - The input operand is shifted left by 16 bits according to M40.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = #2 << #16 Description AC0 is loaded with the signed 16-bit value (2) shifted left by 16 bits.
SPRU375G
5-191
No. [2]
Size 4
Cycles 1
Pipeline X
0111 0101 KKKK KKKK KKKK KKKK xxDD SHFT ACx, K16, SHFT This instruction loads the 16-bit signed constant, K16, shifted left by the 4-bit value, SHFT, to the accumulator (ACx):
- The 16-bit constant, K16, is sign extended to 40 bits according to SXMD. - The input operand is shifted by the 4-bit value in the D-unit shifter. The shift
operation is equivalent to the signed shift instruction. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = #2 << #15 Description AC0 is loaded with the signed 16-bit value (2) shifted left by 15 bits.
5-192
SPRU375G
Size 2 3 3
Cycles 1 1 1
Pipeline X X X
Description
This instruction loads the content of a memory (Smem) location to a selected destination (dst) register. Affected by Affects M40, SXMD none
Status Bits
See Also
to Memory
- Load Accumulator Pair from Memory - Load Accumulator with Immediate Value - Load Accumulator, Auxiliary, or Temporary Register with Immediate Value - Load Auxiliary or Temporary Register Pair from Memory - Multiply and Accumulate with Parallel Load Accumulator from Memory - Multiply and Subtract with Parallel Load Accumulator from Memory - Store Accumulator, Auxiliary, or Temporary Register Content to Memory
SPRU375G
5-193
This instruction loads the content of a memory (Smem) location to the destination (dst) register.
- When the destination register is an accumulator: J J
The content of the memory location is sign extended to 40 bits according to SXMD. The load operation in the destination register uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
The content of the memory location is sign extended to 16 bits. The load operation in the destination register uses a dedicated path independent of the A-unit ALU.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AR1 = *AR3+
Before AR1 AR3 200 FC00 0200 3400
Description AR1 is loaded with the content addressed by AR3. AR3 is incremented by 1.
After AR1 AR3 200 3400 0201 3400
5-194
SPRU375G
This instruction loads the high-byte content of a memory (Smem) location to the destination (dst) register.
- When the destination register is an accumulator: J
The memory operand is extended to 40 bits according to uns. H H If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
The load operation in the destination register uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
The memory operand is extended to 16 bits according to uns. H H If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 16 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 16 bits regardless of SXMD.
The load operation in the destination register uses a dedicated path independent of the A-unit ALU.
(MMR). This instruction cannot access a byte within an MMR. If Smem is an MMR, the DSP sends a hardware bus-error interrupt (BERRINT) request to the CPU. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
SPRU375G Instruction Set Descriptions 5-195
Status Bits
Affected by Affects
Repeat Example
Syntax
Description The high-byte content addressed by AR3 is zero extended to 40 bits and loaded into AC0.
AC0 = uns(high_byte(*AR3))
5-196
SPRU375G
This instruction loads the low-byte content of a memory (Smem) location to the destination (dst) register.
- When the destination register is an accumulator: J
The memory operand is extended to 40 bits according to uns. H H If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
The load operation in the destination register uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
The memory operand is extended to 16 bits according to uns. H H If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 16 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 16 bits regardless of SXMD.
The load operation in the destination register uses a dedicated path independent of the A-unit ALU.
(MMR). This instruction cannot access a byte within an MMR. If Smem is an MMR, the DSP sends a hardware bus-error interrupt (BERRINT) request to the CPU. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
SPRU375G Instruction Set Descriptions 5-197
Status Bits
Affected by Affects
Repeat Example
Syntax
Description The low-byte content addressed by AR3 is zero extended to 40 bits and loaded into AC0.
AC0 = uns(low_byte(*AR3))
5-198
SPRU375G
Size 2 2 4
Cycles 1 1 1
Pipeline X X X
Description
This instruction loads a 4-bit unsigned constant, k4; the 2s complement representation of the 4-bit unsigned constant; or a 16-bit signed constant, K16, to a selected destination (dst) register. Affected by Affects M40, SXMD none
Status Bits
See Also
to Memory
- Load Accumulator Pair from Memory - Load Accumulator with Immediate Value - Load Accumulator, Auxiliary, or Temporary Register from Memory - Load Auxiliary or Temporary Register Pair from Memory - Multiply and Accumulate with Parallel Load Accumulator from Memory - Multiply and Subtract with Parallel Load Accumulator from Memory
SPRU375G
5-199
No. [1]
Syntax dst = k4
Size 2
Cycles 1
Pipeline X
This instruction loads the 4-bit unsigned constant, k4, to the destination (dst) register.
- When the destination register is an accumulator: J J
The 4-bit constant, k4, is zero extended to 40 bits. The load operation in the destination register uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
The 4-bit constant, k4, is zero extended to 16 bits. The load operation in the destination register uses a dedicated path independent of the A-unit ALU.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = #2 Description AC0 is loaded with the unsigned 4-bit value (2).
M40 none
5-200
SPRU375G
No. [2]
Syntax dst = k4
Size 2
Cycles 1
Pipeline X
This instruction loads the 2s complement representation of the 4-bit unsigned constant, k4, to the destination (dst) register.
- When the destination register is an accumulator: J
The 4-bit constant, k4, is negated in the I-unit, loaded into the accumulator, and sign extended to 40 bits before being processed by the D-unit as a signed constant. The load operation in the destination register uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
The 4-bit constant, k4, is zero extended to 16 bits and negated in the I-unit before being processed by the A-unit as a signed K16 constant. The load operation in the destination register uses a dedicated path independent of the A-unit ALU.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = #2 Description AC0 is loaded with a 2s complement representation of the unsigned 4-bit value (2).
M40 none
SPRU375G
5-201
No. [3]
Size 4
Cycles 1
Pipeline X
This instruction loads the 16-bit signed constant, K16, to the destination (dst) register.
- When the destination register is an accumulator, the 16-bit constant, K16,
operation in the destination register uses a dedicated path independent of the A-unit ALU. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC1 = #248
Before AC1 00 0200 FC00
5-202
SPRU375G
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction loads the 16 highest bits of data memory operand (Lmem) to the temporary or auxiliary register (TAx) and loads the 16 lowest bits of data memory operand (Lmem) to temporary or auxiliary register TA(x + 1):
- The load operation in the temporary or auxiliary register uses a dedicated
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat See Also M40 none
This instruction can be repeated. See the following other related instructions:
- Load Accumulator, Auxiliary, or Temporary Register from Memory - Load Accumulator, Auxiliary, or Temporary Register with Immediate Value - Modify Auxiliary or Temporary Register Content
Example
Syntax pair(T0) = *AR2 Description The 16 highest bits of the content at the location addressed by AR2 are loaded into T0 and the 16 lowest bits of the content at the location addressed by AR2 + 1 are loaded into T1.
SPRU375G
5-203
No. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]
Syntax BK03 = Smem BK47 = Smem BKC = Smem BSA01 = Smem BSA23 = Smem BSA45 = Smem BSA67 = Smem BSAC = Smem BRC0 = Smem BRC1 = Smem CDP = Smem CSR = Smem DP = Smem DPH = Smem PDP = Smem SP = Smem SSP = Smem TRN0 = Smem TRN1 = Smem RETA = dbl(Lmem)
Size 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
Cycles 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5
Pipeline X X X X X X X X X X X X X X X X X X X X
Opcode Operands
5-204
SPRU375G
Description
Instructions [1] through [19] load the content of a memory (Smem) location to the destination CPU register. This instruction uses a dedicated datapath independent of the A-unit ALU and the D-unit operators to perform the operation. The content of the memory location is zero extended to the bitwidth of the destination CPU register. The operation is performed in the execute phase of the pipeline. There is a 3-cycle latency between PDP, DP, SP, SSP, CDP, BSAx, BKx, BRCx, and CSR loads and their use in the address phase by the A-unit address generator units or by the P-unit loop control management. For instruction [10], when BRC1 is loaded, the block repeat save register (BRS1) is also loaded with the same value. Instruction [20] loads the content of data memory operand (Lmem) to the 24-bit RETA register (the return address of the calling subroutine) and to the 8-bit CFCT register (active control flow execution context flags of the calling subroutine):
- The 16 highest bits of Lmem are loaded into the CFCT register and into
register. When instruction [20] is decoded, the CPU pipeline is flushed and the instruction is executed in 5 cycles, regardless of the instruction context. Status Bits Affected by Affects Repeat none none
Instructions [13] and [20] cannot be repeated; all other instructions can be repeated. See the following other related instructions:
- Load CPU Register with Immediate Value
See Also
SPRU375G
5-205
Table 51. Opcodes for Load CPU Register from Memory Instruction
No. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Syntax BK03 = Smem BK47 = Smem BKC = Smem BSA01 = Smem BSA23 = Smem BSA45 = Smem BSA67 = Smem BSAC = Smem BRC0 = Smem BRC1 = Smem CDP = Smem CSR = Smem DP = Smem DPH = Smem PDP = Smem SP = Smem SSP = Smem TRN0 = Smem TRN1 = Smem RETA = dbl(Lmem) Opcode
1101 1100 AAAA AAAI 1001 xx10 1101 1100 AAAA AAAI 1010 xx10 1101 1100 AAAA AAAI 1011 xx10 1101 1100 AAAA AAAI 0010 xx10 1101 1100 AAAA AAAI 0011 xx10 1101 1100 AAAA AAAI 0100 xx10 1101 1100 AAAA AAAI 0101 xx10 1101 1100 AAAA AAAI 0110 xx10 1101 1100 AAAA AAAI x001 xx11 1101 1100 AAAA AAAI x010 xx11 1101 1100 AAAA AAAI 0001 xx10 1101 1100 AAAA AAAI x000 xx11 1101 1100 AAAA AAAI 0000 xx10 1101 1100 AAAA AAAI 1100 xx10 1101 1100 AAAA AAAI 1111 xx10 1101 1100 AAAA AAAI 0111 xx10 1101 1100 AAAA AAAI 1000 xx10 1101 1100 AAAA AAAI x011 xx11 1101 1100 AAAA AAAI x100 xx11 1110 1101 AAAA AAAI xxxx 011x
5-206
SPRU375G
See Table 52 (page 5-208). kx This instruction loads the unsigned constant, kx, to the destination CPU register. This instruction uses a dedicated datapath independent of the A-unit ALU and the D-unit operators to perform the operation. The constant is zero extended to the bitwidth of the destination CPU register. For instruction [5], when BRC1 is loaded, the block repeat save register (BRS1) is also loaded with the same value. The operation is performed in the address phase of the pipeline.
SPRU375G
5-207
Status Bits
Affected by Affects
none none
Instruction [15] cannot be repeated; all other instructions can be repeated. See the following other related instructions:
- Load CPU Register from Memory
Table 52. Opcodes for Load CPU Register with Immediate Value Instruction
No. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] Syntax BK03 = k12 BK47 = k12 BKC = k12 BRC0 = k12 BRC1 = k12 CSR = k12 DPH = k7 PDP = k9 BSA01 = k16 BSA23 = k16 BSA45 = k16 BSA67 = k16 BSAC = k16 CDP = k16 DP = k16 SP = k16 SSP = k16 Opcode
0001 011E kkkk kkkk kkkk 0100 0001 011E kkkk kkkk kkkk 0101 0001 011E kkkk kkkk kkkk 0110 0001 011E kkkk kkkk kkkk 1001 0001 011E kkkk kkkk kkkk 1010 0001 011E kkkk kkkk kkkk 1000 0001 011E xxxx xkkk kkkk 0000 0001 011E xxxk kkkk kkkk 0011 0111 1000 kkkk kkkk kkkk kkkk xxx0 011x 0111 1000 kkkk kkkk kkkk kkkk xxx0 100x 0111 1000 kkkk kkkk kkkk kkkk xxx0 101x 0111 1000 kkkk kkkk kkkk kkkk xxx0 110x 0111 1000 kkkk kkkk kkkk kkkk xxx0 111x 0111 1000 kkkk kkkk kkkk kkkk xxx0 010x 0111 1000 kkkk kkkk kkkk kkkk xxx0 000x 0111 1000 kkkk kkkk kkkk kkkk xxx1 000x 0111 1000 kkkk kkkk kkkk kkkk xxx0 001x
5-208
SPRU375G
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction loads the lower 23 bits of the data addressed by data memory operand (Lmem) to the 23-bit destination register (XARx, XSP, XSSP, XDP, or XCDP). Affected by Affects none none
Status Bits
This instruction can be repeated. See the following other related instructions:
- Load Extended Auxiliary Register with Immediate Value - Modify Extended Auxiliary Register Content - Move Extended Auxiliary Register Content - Store Extended Auxiliary Register Content to Memory
Example
Syntax XAR1 = dbl(*AR3) Description The 7 lowest bits of the content at the location addressed by AR3 and the 16 bits of the content at the location addressed by AR3 + 1 are loaded into XAR1.
After 00 0000 0200 3492 0FD3 XAR1 AR3 200 201 12 0FD3 0200 3492 0FD3
SPRU375G
5-209
No. [1]
Size 6
Cycles 1
Pipeline AD
This instruction loads a 23-bit unsigned constant (k23) into the 23-bit destination register (XARx, XSP, XSSP, XDP, or XCDP). This operation is completed in the address phase of the pipeline by the A-unit address generator. Data memory is not accessed. The premodification or postmodification of the auxiliary register (ARx), the use of *port(#K), and the use of the readport() or writeport() qualifier is not supported for this instruction. The use of auxiliary register offset operations is supported. If the corresponding bit (ARnLC) in status register ST2_55 is set to 1, the circular buffer management also controls the result stored in XAdst.
Status Bits
Affected by Affects
ST2_55 none
This instruction can be repeated. See the following other related instructions:
- Load Extended Auxiliary Register from Memory - Modify Extended Auxiliary Register Content - Move Extended Auxiliary Register Content - Store Extended Auxiliary Register Content to Memory
Example
Syntax XAR0 = #7FFFFFh Description The 23-bit value (7FFFFFh) is loaded into XAR0.
5-210
SPRU375G
Size 3 4
Cycles 1 1
Pipeline X X
Opcode
K8 K16
1110 0110 AAAA AAAI KKKK KKKK 1111 1011 AAAA AAAI KKKK KKKK KKKK KKKK
Operands Description
Kx, Smem These instructions initialize a data memory location. These instructions store an 8-bit signed constant, K8, or a 16-bit signed constant, K16, to a memory (Smem) location. They use a dedicated datapath to perform the operation. For instruction [1], the immediate value is always signed extended to 16 bits before being stored in memory.
Status Bits
Affected by Affects
none none
Repeat
Instruction [1] can be repeated. Instruction [2] cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated. See the following other related instructions:
- Move Memory to Memory
See Also
Example
Syntax *(#0501h) = #248
Before 0501 FC00
SPRU375G
5-211
Memory Delay
Syntax Characteristics
No. [1] Syntax delay(Smem) Parallel Enable Bit No Size 2 Cycles 1 Pipeline X
This instruction copies the content of the memory (Smem) location into the next higher address (Smem + 1). When the data is copied, the content of the addressed location remains the same. A dedicated datapath is used to make this memory move. When this instruction is executed, the two address register arithmetic units ARAU X and Y, of the A-unit data address generator unit, are used to compute the two addresses Smem and Smem + 1. The address generation is not affected by circular addressing; if Smem points to the end of a circular buffer, Smem + 1 will point to an address outside the circular buffer. The soft dual memory addressing mode mechanism cannot be applied to this instruction. This instruction cannot use the *port(#k16) addressing mode or be paralleled with the readport() or writeport() operand qualifier. This instruction cannot be used for accesses to I/O space. Any illegal access to I/O space generates a hardware bus-error interrupt (BERRINT) to be handled by the CPU.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax delay(*AR1+)
Description The content addressed by AR1 is copied to the next higher address, AR1 + 1. AR1 is incremented by 1.
After 0200 3400 0D80 2030 AR1 200 201 202 0201 3400 3400 2030
5-212
SPRU375G
1001 1000
This is an operand qualifier that can be paralleled with any instruction making a Smem or Lmem direct memory access (dma). This operand qualifier allows you to locally prevent the dma access from being relative to the data stack pointer (SP) or the local data page register (DP). It forces the dma access to be relative to the memory-mapped register (MMR) data page start address, 00 0000h. This operand qualifier cannot be executed:
- as a stand-alone instruction (assembler generates an error message) - in parallel with instructions not embedding an Smem or Lmem data
memory operand
- in parallel with instructions loading or storing a byte to a register (see Load
Accumulator, Auxiliary, or Temporary Register from Memory instructions [2] and [3]; Load Accumulator from Memory instructions [2] and [3]; and Store Accumulator, Auxiliary, or Temporary Register Content to Memory instructions [2] and [3]) The MMRs are mapped as 16-bit data entities between addresses 0h and 5Fh. The scratch-pad memory that is mapped between addresses 60h and 7Fh of each main data pages of 64K words cannot be accessed through this mechanism. Any instruction using the mmap() modifier cannot be combined with any other user-defined parallelism instruction. Status Bits Affected by Affects Repeat Example
Syntax T2 = @(AC0_L)) || mmap() Description AC0_L is a keyword representing AC0(150). The content of AC0(150) is copied into T2.
none none
SPRU375G
5-213
No. [1]
Syntax mar(Smem)
Size 2
Cycles 1
Pipeline AD
This instruction performs, in the A-unit address generation units, the auxiliary register modification specified by Smem as if a word single data memory operand access was made. The operation is performed in the address phase of the pipeline; however, data memory is not accessed. If the destination register is an auxiliary register and the corresponding bit (ARnLC) in status register ST2_55 is set to 1, the circular buffer management controls the result stored in the destination register. Compatibility with C54x devices (C54CM = 1) In the translated code section, the mar() instruction must be executed with C54CM set to 1. When circular modification is selected for the destination auxiliary register, this instruction modifies the selected destination auxiliary register by using BK03 as the circular buffer size register; BK47 is not used.
Status Bits
Affected by Affects
ST2_55 none
Repeat
5-214
SPRU375G
See Also
Example
Syntax mar(*AR3+) Description The content of AR3 is incremented by 1.
SPRU375G
5-215
1000 0010 XXXM MMYY YMMM 11mm uuxx DDg% ACx, Cmem, Xmem, Ymem This instruction performs two parallel operations in one cycle: modify auxiliary register (MAR) and multiply. The operations are executed in the two D-unit MACs. The first operation performs an auxiliary register modification. The auxiliary register modification is specified by the content of data memory operand Xmem. The second operation performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD.
5-216 Instruction Set Descriptions SPRU375G
- This instruction provides the option to locally set M40 to 1 for the execution
on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content - Modify Auxiliary Register Content with Parallel Multiply and Accumulate - Modify Auxiliary Register Content with Parallel Multiply and Subtract - Multiply
Example
Syntax mar(*AR3+), AC0 = uns(*AR4) * uns(coef(*CDP)) Description Both instructions are performed in parallel. AR3 is incremented by 1. The unsigned content addressed by AR4 is multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) and the result is stored in AC0.
SPRU375G
5-217
Syntax mar(Xmem), ACx = M40(rnd(ACx + (uns(Ymem) * uns(coef(Cmem))))) mar(Xmem), ACx = M40(rnd((ACx >> #16) + (uns(Ymem) * uns(coef(Cmem)))))
Size 4 4
Cycles 1 1
Pipeline X X
Description
These instructions perform two parallel operations in one cycle: modify auxiliary register (MAR), and multiply and accumulate (MAC). The operations are executed in the two D-unit MACs. Affected by Affects FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
See Also
5-218
SPRU375G
1000 0011 XXXM MMYY YMMM 11mm uuxx DDg% ACx, Cmem, Xmem, Ymem This instruction performs two parallel operations in one cycle: modify auxiliary register (MAR), and multiply and accumulate (MAC). The operations are executed in the two D-unit MACs. The first operation performs an auxiliary register modification. The auxiliary register modification is specified by the content of data memory operand Xmem. The second operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
SATD.
- This instruction provides the option to locally set M40 to 1 for the execution
on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx
Status Bits
Affected by Affects
Repeat Example
Syntax
Description
mar(*AR3+), Both instructions are performed in parallel. AR3 is incremented AC0 = AC0 + (uns(*AR4) * uns(coef(*CDP))) by 1. The unsigned content addressed by AR4 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is added to the content of AC0 and the result is stored in AC0.
5-220
SPRU375G
1000 0100 XXXM MMYY YMMM 01mm uuxx DDg% ACx, Cmem, Xmem, Ymem This instruction performs two parallel operations in one cycle: modify auxiliary register (MAR), and multiply and accumulate (MAC). The operations are executed in the two D-unit MACs. The first operation performs an auxiliary register modification. The auxiliary register modification is specified by the content of data memory operand Xmem. The second operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
to the source accumulator ACx shifted right by 16 bits. The shifting operation is performed with a sign extension of source accumulator ACx(39).
- Rounding is performed according to RDM, if the optional rnd keyword is
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx
Status Bits
Affected by Affects
Repeat Example
Syntax
Description Both instructions are performed in parallel. AR2 is incremented by 1. The unsigned content addressed by AR1 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is added to the content of AC0 shifted right by 16 bits and the result is stored in AC0. An overflow is detected in AC0.
Before AC0 AC1 *AR1 AR2 *CDP ACOV0 ACOV1 CARRY M40 FRCT SATD
After AC0 AC1 *AR1 AR2 *CDP ACOV0 ACOV1 CARRY M40 FRCT SATD
5-222
SPRU375G
1000 0101 XXXM MMYY YMMM 00mm uuxx DDg% ACx, Cmem, Xmem, Ymem This instruction performs two parallel operations in one cycle: modify auxiliary register (MAR), and multiply and subtract (MAS). The operations are executed in the two D-unit MACs. The first operation performs an auxiliary register modification. The auxiliary register modification is specified by the content of data memory operand Xmem. The second operation performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD.
- This instruction provides the option to locally set M40 to 1 for the execution
on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content - Modify Auxiliary Register Content with Parallel Multiply - Modify Auxiliary Register Content with Parallel Multiply and Accumulate - Multiply and Subtract
Example
Syntax mar(*AR3+), AC0 = AC0 (uns(*AR4) * uns(coef(*CDP))) Description Both instructions are performed in parallel. AR3 is incremented by 1. The unsigned content addressed by AR4 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is subtracted from the content of AC0 and the result is stored in AC0.
5-224
SPRU375G
Size 3 3 4
Cycles 1 1 1
Pipeline AD AD AD
Description
register TAy
- a load in the auxiliary or temporary registers TAx of a program address
address signed constant D16 The operation is performed in the address phase of the pipeline, however data memory is not accessed. Status Bits Affected by Affects See Also none none
SPRU375G
5-225
No. [1]
Size 3
Cycles 1
Pipeline AD
Opcode
0001 010E FSSS xxxx FDDD 0001 0001 010E FSSS xxxx FDDD 1001 The assembler selects the opcode depending on the instruction position in a paralleled pair.
Operands Description
TAx, TAy This instruction performs, in the A-unit address generation units, a move from the auxiliary or temporary register TAx to auxiliary or temporary register TAy. The operation is performed in the address phase of the pipeline; however, data memory is not accessed. Affected by Affects none none
Status Bits
Repeat Example 1
Syntax mar(AR0 = AR1)
Example 2
Syntax mar(T0 = T1) Description The content of T1 is copied to T0.
5-226
SPRU375G
No. [2]
Size 3
Cycles 1
Pipeline AD
Opcode
0001 010E PPPP PPPP FDDD 0101 0001 010E PPPP PPPP FDDD 1101 The assembler selects the opcode depending on the instruction position in a paralleled pair.
Operands Description
TAx, P8 This instruction performs, in the A-unit address generation units, a load in the auxiliary or temporary registers TAx of a program address defined by a program address label assembled into P8. The operation is performed in the address phase of the pipeline; however, data memory is not accessed. Affected by Affects none none
Status Bits
Repeat Example 1
Syntax mar(AR0 = #255)
Example 2
Syntax mar(T0 = #255) Description The unsigned 8-bit value (255) is copied to T0.
SPRU375G
5-227
No. [3]
Size 4
Cycles 1
Pipeline AD
This instruction performs, in the A-unit address generation units, a load in the auxiliary or temporary registers TAx of the absolute data address signed constant D16. The operation is performed in the address phase of the pipeline; however, data memory is not accessed. Affected by Affects none none
Status Bits
Repeat Example
Syntax mar(T1 = #FFFFh)
5-228
SPRU375G
Size 3 3
Cycles 1 1
Pipeline AD AD
Description
program address defined by a program address label assembled into unsigned P8, and stores the result in TAx The operation is performed in the address phase of the pipeline, however data memory is not accessed. If the destination register is an auxiliary register and the corresponding bit (ARnLC) in status register ST2_55 is set to 1, the circular buffer management controls the result stored in the destination register. Status Bits Affected by Affects See Also ST2_55 none
SPRU375G
5-229
No. [1]
Size 3
Cycles 1
Pipeline AD
Opcode
0001 010E FSSS xxxx FDDD 0000 0001 010E FSSS xxxx FDDD 1000 The assembler selects the opcode depending on the instruction position in a paralleled pair.
Operands Description
TAx, TAy This instruction performs, in the A-unit address generation units, an addition between two auxiliary or temporary registers, TAy and TAx, and stores the result in TAy. The content of TAx is considered signed. The operation is performed in the address phase of the pipeline; however, data memory is not accessed. If the destination register is an auxiliary register and the corresponding bit (ARnLC) in status register ST2_55 is set to 1, the circular buffer management controls the result stored in the destination register. Compatibility with C54x devices (C54CM = 1) In the translated code section, the mar() instruction must be executed with C54CM set to 1. When circular modification is selected for the destination auxiliary register, this instruction modifies the selected destination auxiliary register by using BK03 as the circular buffer size register; BK47 is not used.
Status Bits
Affected by Affects
ST2_55 none
Repeat
5-230
SPRU375G
Example 1
Syntax mar(AR0 + T0)
Before XAR0 T0
Description The content of AR0 is added to the signed content of T0 and the result is stored in AR0.
After XAR0 T0
01 0000 8000
01 8000 8000
Example 2
Syntax mar(T0 + T1) Description The content of T0 is added to the content of T1 and the result is stored in T0.
SPRU375G
5-231
No. [2]
Size 3
Cycles 1
Pipeline AD
Opcode
0001 010E PPPP PPPP FDDD 0100 0001 010E PPPP PPPP FDDD 1100 The assembler selects the opcode depending on the instruction position in a paralleled pair.
Operands Description
TAx, P8 This instruction performs, in the A-unit address generation units, an addition between the auxiliary or temporary register TAx and a program address defined by a program address label assembled into unsigned P8, and stores the result in TAx. The operation is performed in the address phase of the pipeline; however, data memory is not accessed. If the destination register is an auxiliary register and the corresponding bit (ARnLC) in status register ST2_55 is set to 1, the circular buffer management controls the result stored in the destination register. Compatibility with C54x devices (C54CM = 1) In the translated code section, the mar() instruction must be executed with C54CM set to 1. When circular modification is selected for the destination auxiliary register, this instruction modifies the selected destination auxiliary register by using BK03 as the circular buffer size register; BK47 is not used.
Status Bits
Affected by Affects
ST2_55 none
Repeat Example
Syntax mar(T0 + #255)
Description The unsigned 8-bit value (255) is added to the content of T0 and the result is stored in T0.
5-232
SPRU375G
Size 3 3
Cycles 1 1
Pipeline AD AD
Description
program address defined by a program address label assembled into unsigned P8, and stores the result in TAx The operation is performed in the address phase of the pipeline, however data memory is not accessed. If the destination register is an auxiliary register and the corresponding bit (ARnLC) in status register ST2_55 is set to 1, the circular buffer management controls the result stored in the destination register. Status Bits Affected by Affects See Also ST2_55 none
SPRU375G
5-233
No. [1]
Size 3
Cycles 1
Pipeline AD
Opcode
0001 010E FSSS xxxx FDDD 0010 0001 010E FSSS xxxx FDDD 1010 The assembler selects the opcode depending on the instruction position in a paralleled pair.
Operands Description
TAx, TAy This instruction performs, in the A-unit address generation units, a subtraction between two auxiliary or temporary registers, TAy and TAx, and stores the result in TAy. The content of TAx is considered signed. The operation is performed in the address phase of the pipeline; however, data memory is not accessed. If the destination register is an auxiliary register and the corresponding bit (ARnLC) in status register ST2_55 is set to 1, the circular buffer management controls the result stored in the destination register. Compatibility with C54x devices (C54CM = 1) In the translated code section, the mar() instruction must be executed with C54CM set to 1. When circular modification is selected for the destination auxiliary register, this instruction modifies the selected destination auxiliary register by using BK03 as the circular buffer size register; BK47 is not used.
Status Bits
Affected by Affects
ST2_55 none
Repeat
5-234
SPRU375G
Example 1
Syntax mar(AR0 T0) Description The signed content of T0 is subtracted from the content of AR0 and the result is stored in AR0.
After XAR0 T0
Before XAR0 T0
01 8000 8000
01 0000 8000
Example 2
Syntax mar(T0 T1) Description The content of T1 is subtracted from the content of T0 and the result is stored in T0.
SPRU375G
5-235
No. [2]
Size 3
Cycles 1
Pipeline AD
Opcode
0001 010E PPPP PPPP FDDD 0110 0001 010E PPPP PPPP FDDD 1110 The assembler selects the opcode depending on the instruction position in a paralleled pair.
Operands Description
TAx, P8 This instruction performs, in the A-unit address generation units, a subtraction between the auxiliary or temporary register TAx and a program address defined by a program address label assembled into unsigned P8, and stores the result in TAx. The operation is performed in the address phase of the pipeline; however, data memory is not accessed. If the destination register is an auxiliary register and the corresponding bit (ARnLC) in status register ST2_55 is set to 1, the circular buffer management controls the result stored in the destination register. Compatibility with C54x devices (C54CM = 1) In the translated code section, the mar() instruction must be executed with C54CM set to 1. When circular modification is selected for the destination auxiliary register, this instruction modifies the selected destination auxiliary register by using BK03 as the circular buffer size register; BK47 is not used.
Status Bits
Affected by Affects
ST2_55 none
Repeat Example
Syntax mar(AR0 #255)
Description The unsigned 8-bit value (255) is subtracted from the signed content of AR0 and the result is stored in AR0.
5-236
SPRU375G
No. [1]
Syntax SP = SP + K8
Size 2
Cycles 1
Pipeline AD
This instruction performs an addition in the A-unit data-address generation unit (DAGEN) in the address phase of the pipeline. The 8-bit signed constant, K8, is sign extended to 16 bits and added to the data stack pointer (SP). When in 32-bit stack configuration, the system stack pointer (SSP) is also modified. Updates of the SP and SSP (depending on the stack configuration) should not be executed in parallel with this instruction. Affected by Affects none none
Status Bits
Repeat Example
Syntax SP = SP + #127
Description The 8-bit value (127) is sign extended to 16 bits and added to the stack pointer (SP).
SPRU375G
5-237
No. [1]
Size 3
Cycles 1
Pipeline AD
This instruction computes the effective address specified by the Smem operand field and modifies the 23-bit destination register (XARx, XSP, XSSP, XDP, or XCDP). This operation is completed in the address phase of the pipeline by the A-unit address generator. Data memory is not accessed. The premodification or postmodification of the auxiliary register (ARx), the use of *port(#K), and the use of the readport() or writeport() qualifier is not supported for this instruction. The use of auxiliary register offset operations is supported. If the corresponding bit (ARnLC) in status register ST2_55 is set to 1, the circular buffer management also controls the result stored in XAdst.
Status Bits
Affected by Affects
ST2_55 none
This instruction can be repeated. See the following other related instructions:
- Load Extended Auxiliary Register from Memory - Load Extended Auxiliary Register with Immediate Value - Modify Auxiliary Register Content - Move Extended Auxiliary Register Content - Store Extended Auxiliary Register Content to Memory
Example
Syntax XAR0 = mar(*AR1) Description The content of AR1 is loaded into XAR0.
5-238
SPRU375G
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction moves the high part of the accumulator, ACx(3116), to the destination auxiliary or temporary register (TAx). The 16-bit move operation is performed in the A-unit ALU. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
Status Bits
Affected by Affects
M40 none
This instruction can be repeated. See the following other related instructions:
- Move Accumulator, Auxiliary, or Temporary Register Content - Move Auxiliary or Temporary Register Content to Accumulator
Example
Syntax AR2 = HI(AC0)
Before AC0 AR2 01 E500 0030 0200
SPRU375G
5-239
This instruction moves the content of the source (src) register to the destination (dst) register:
- When the destination (dst) register is an accumulator: J J
The 40-bit move operation is performed in the D-unit ALU. During the 40-bit move operation, an overflow is detected according to M40: H H the destination accumulator overflow status bit (ACOVx) is set. the destination register (ACx) is saturated according to SATD.
If the source (src) register is an auxiliary or temporary register, the 16 LSBs of the source register are sign extended to 40 bits according to SXMD.
The 16-bit move operation is performed in the A-unit ALU. If the source (src) register is an accumulator, the 16 LSBs of the accumulator are used to perform the operation.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat See Also M40, SATD, SXMD ACOVx
This instruction can be repeated. See the following other related instructions:
- Move Accumulator Content to Auxiliary or Temporary Register - Move Auxiliary or Temporary Register Content to Accumulator - Move Auxiliary or Temporary Register Content to CPU Register - Move Extended Auxiliary Register Content
5-240
SPRU375G
Example
Syntax AC1 = AC0
Before AC0 AC1 M40 SATD ACOV1 01 E500 0030 00 2800 0200 0 0 0
Description The content of AC0 is copied to AC1. Because an overflow occurred, ACOV1 is set to 1.
After AC0 AC1 M40 SATD ACOV1 01 E500 0030 01 E500 0030 0 0 1
SPRU375G
5-241
This instruction moves the content of the auxiliary or temporary register (TAx) to the high part of the accumulator, ACx(3116):
- The 16-bit move operation is performed in the D-unit ALU. - During the 16-bit move operation, an overflow is detected according to
M40:
J J
the destination accumulator overflow status bit (ACOVx) is set. the destination register (ACx) is saturated according to SATD.
16 LSBs of the source register are sign extended to 40 bits according to SXMD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat See Also M40, SATD, SXMD ACOVx
This instruction can be repeated. See the following other related instructions:
- Move Accumulator Content to Auxiliary or Temporary Register - Move Accumulator, Auxiliary, or Temporary Register Content - Move Auxiliary or Temporary Register Content to CPU Register - Move Extended Auxiliary Register Content
Example
Syntax HI(AC0) = T0 Description The content of T0 is copied to AC0(3116).
5-242
SPRU375G
See Table 53 (page 5-244). TAx This instruction moves the content of the auxiliary or temporary register (TAx) to the selected CPU register. All the move operations are performed in the execute phase of the pipeline and the A-unit ALU is used to transfer the content of the registers. There is a 3-cycle latency between SP, SSP, CDP, TAx, CSR, and BRCx update and their use in the address phase by the A-unit address generator units or by the P-unit loop control management. For instruction [2] when BRC1 is loaded with the content of TAx, the block repeat save register (BRS1) is also loaded with the same value.
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Move Accumulator Content to Auxiliary or Temporary Register - Move Accumulator, Auxiliary, or Temporary Register Content - Move Auxiliary or Temporary Register Content to Accumulator - Move CPU Register Content to Auxiliary or Temporary Register - Move Extended Auxiliary Register Content
SPRU375G
5-243
Example
Syntax BRC1 = T1 Description The content of T1 is copied to the block repeat register (BRC1) and to the block repeat save register (BRS1).
After 0034 00EA 00EA T1 BRC1 BRS1 0034 0034 0034
Table 53. Opcodes for Move Auxiliary or Temporary Register Content to CPU Register Instruction
No. [1] [2] [3] [4] [5] [6] Syntax BRC0 = TAx BRC1 = TAx CDP = TAx CSR = TAx SP = TAx SSP = TAx Opcode
0101 001E FSSS 1110 0101 001E FSSS 1101 0101 001E FSSS 1010 0101 001E FSSS 1100 0101 001E FSSS 1000 0101 001E FSSS 1001
5-244
SPRU375G
Syntax TAx = BRC0 TAx = BRC1 TAx = CDP TAx = SP TAx = SSP TAx = RPTC
Size 2 2 2 2 2 2
Cycles 1 1 1 1 1 1
Pipeline X X X X X X
See Table 54 (page 5-246). TAx This instruction moves the content of the selected CPU register to the auxiliary or temporary register (TAx). All the move operations are performed in the execute phase of the pipeline and the A-unit ALU is used to transfer the content of the registers. For instructions [1] and [2], BRCx is decremented in the address phase of the last instruction of a loop. These instructions have a 3-cycle latency requirement versus the last instruction of a loop. For instructions [3], [4], and [5], there is a 3-cycle latency between SP, SSP, CDP, and TAx update and their use in the address phase by the A-unit address generator units or by the P-unit loop control management.
Status Bits
Affected by Affects
none none
Instruction [6] cannot be repeated; all other instructions can be repeated. See the following other related instructions:
- Move Accumulator Content to Auxiliary or Temporary Register - Move Auxiliary or Temporary Register Content to CPU Register - Store CPU Register Content to Memory
SPRU375G
5-245
Example
Syntax T1 = BRC1
Before T1 BRC1 0034 00EA
Table 54. Opcodes for Move CPU Register Content to Auxiliary or Temporary Register Instruction
No. [1] [2] [3] [4] [5] [6] Syntax TAx = BRC0 TAx = BRC1 TAx = CDP TAx = SP TAx = SSP TAx = RPTC Opcode
0100 010E 1100 FDDD 0100 010E 1101 FDDD 0100 010E 1010 FDDD 0100 010E 1000 FDDD 0100 010E 1001 FDDD 0100 010E 1110 FDDD
5-246
SPRU375G
This instruction moves the content of the source register (xsrc) to the destination register (xdst):
- When the destination register (xdst) is an accumulator (ACx) and the
source register (xsrc) is a 23-bit register (XARx, XSP, XSSP, XDP, or XCDP):
J J
The 23-bit move operation is performed in the D-unit ALU. The upper bits of ACx are filled with 0.
destination register (xdst) is a 23-bit register (XARx, XSP, XSSP, XDP, or XCDP):
J J
The 23-bit move operation is performed in the A-unit ALU. The lower 23 bits of ACx are loaded into xdst.
- When both the source register (xsrc) and the destination register (xdst) are
accumulators, the Move Accumulator Content instruction (dst = src) is assembled. Status Bits Affected by Affects Repeat See Also none none
This instruction can be repeated. See the following other related instructions:
- Load Extended Auxiliary Register from Memory - Load Extended Auxiliary Register with Immediate Value - Modify Extended Auxiliary Register Content - Store Extended Auxiliary Register Content to Memory
Example
Syntax XAR1 = AC0 Description The lower 23 bits of AC0 are loaded into XAR1.
SPRU375G
5-247
Syntax Smem = coef(Cmem) coef(Cmem) = Smem Lmem = dbl(coef(Cmem)) dbl(coef(Cmem)) = Lmem dbl(Ymem) = dbl(Xmem) Ymem = Xmem
Size 3 3 3 3 3 3
Cycles 1 1 1 1 1 1
Pipeline X X X X X X
Description
These instructions store the content of a memory location to a memory location. They use a dedicated datapath to perform the operation. Affected by Affects none none
Status Bits
See Also
5-248
SPRU375G
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction stores the content of a data memory operand Cmem, addressed using the coefficient addressing mode, to a memory (Smem) location. For this instruction, the Cmem operand is not accessed through the BB bus. On all C55x-based devices, the Cmem operand may be mapped in external or internal memory space.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax *(#0500h) = coef(*CDP)
Description The content addressed by the coefficient data pointer register (CDP) is copied to address 0500h.
After 3400 0000 *CDP 500 3400 3400
SPRU375G
5-249
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction stores the content of a memory (Smem) location to a data memory (Cmem) location addressed using the coefficient addressing mode. For this instruction, the Cmem operand is not accessed through the BB bus. On all C55x-based devices, the Cmem operand may be mapped in external or internal memory space.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax coef(*CDP) = *AR3
Description The content addressed by AR3 is copied in the location addressed by the coefficient data pointer register (CDP).
5-250
SPRU375G
No. [3]
Size 3
Cycles 1
Pipeline X
This instruction stores the content of two consecutive data memory (Cmem) locations, addressed using the coefficient addressing mode, to two consecutive data memory (Lmem) locations. For this instruction, the Cmem operand is not accessed through the BB bus. On all C55x-based devices, the Cmem operand may be mapped in external or internal memory space.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax
Description The content (long word) addressed by the coefficient data pointer register (CDP) and CDP + 1 is copied in the location addressed by AR1 and AR1 + 1, respectively. After the memory store, CDP is incremented by the content of T0 (5).
After 0005 0200 0300 3400 0FD3 0000 0000 T0 CDP AR1 200 201 300 301 0005 0205 0300 3400 0FD3 3400 0FD3
SPRU375G
5-251
No. [4]
Size 3
Cycles 1
Pipeline X
This instruction stores the content of two consecutive data memory (Lmem) locations to two consecutive data memory (Cmem) locations addressed using the coefficient addressing mode. For this instruction, the Cmem operand is not accessed through the BB bus. On all C55x-based devices, the Cmem operand may be mapped in external or internal memory space.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax dbl(coef(*CDP)) = *AR3+
Description The content (long word) addressed by AR3 and AR3 + 1 is copied in the location addressed by the coefficient data pointer register (CDP) and CDP + 1, respectively. Because this instruction is a long-operand instruction, AR3 is incremented by 2 after the execution.
5-252
SPRU375G
No. [5]
Size 3
Cycles 1
Pipeline X
This instruction stores the content of two consecutive data memory (Xmem) locations, addressed using the dual addressing mode, to two consecutive data memory (Ymem) locations. Affected by Affects none none
Status Bits
Repeat Example
Syntax dbl(*AR1) = dbl(*AR0)
Description The content addressed by AR0 is copied in the location addressed by AR1 and the content addressed by AR0 + 1 is copied in the location addressed by AR1 + 1.
After 0300 0400 3400 0FD3 0000 0000 AR0 AR1 300 301 400 401 0300 0400 3400 0FD3 3400 0FD3
SPRU375G
5-253
No. [6]
Size 3
Cycles 1
Pipeline X
This instruction stores the content of data memory (Xmem) location, addressed using the dual addressing mode, to data memory (Ymem) location. Affected by Affects none none
Status Bits
Repeat Example
Syntax *AR3 = *AR5
Description The content addressed by AR5 is copied in the location addressed by AR3.
5-254
SPRU375G
Multiply
Multiply
Syntax Characteristics
Parallel Enable Bit Yes Yes Yes No No No No No No
No. [1] [2] [3] [4] [5] [6] [7] [8] [9]
Syntax ACy = rnd(ACy * ACx) ACy = rnd(ACx * Tx) ACy = rnd(ACx * K8) ACy = rnd(ACx * K16) ACx = rnd(Smem * coef(Cmem))[, T3 = Smem] ACy = rnd(Smem * ACx)[, T3 = Smem] ACx = rnd(Smem * K8)[, T3 = Smem] ACx = M40(rnd(uns(Xmem) * uns(Ymem)))[, T3 = Xmem] ACx = rnd(uns(Tx * Smem))[, T3 = Smem]
Size 2 2 3 4 3 3 4 4 3
Cycles 1 1 1 1 1 1 1 1 1
Pipeline X X X X X X X X X
Description
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are:
- ACx(3216) - the content of Tx, sign extended to 17 bits - the 8-bit signed constant, K8, sign extended to 17 bits - the 16-bit signed constant, K16, sign extended to 17 bits - the content of a memory (Smem) location, sign extended to 17 bits - the content of a data memory operand Cmem, addressed using the
content of data memory operand Ymem, extended to 17 bits Status Bits Affected by Affects FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
SPRU375G
5-255
Multiply
See Also
5-256
SPRU375G
Multiply
Multiply
Syntax Characteristics
No. [1] Syntax ACy = rnd(ACy * ACx) Parallel Enable Bit Yes Size 2 Cycles 1 Pipeline X
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are ACx(3216) and ACy(3216).
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC1 = AC1 * AC0
Before AC0 AC1 M40 FRCT ACOV1
Description The content of AC1 is multiplied by the content of AC0 and the result is stored in AC1.
After AC0 AC1 M40 FRCT ACOV1
SPRU375G
5-257
Multiply
Multiply
Syntax Characteristics
Parallel Enable Bit Yes
No. [2]
Size 2
Cycles 1
Pipeline X
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are ACx(3216) and the content of Tx, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 * T0 Description The content of AC1 is multiplied by the content of T0 and the result is stored in AC0.
5-258
SPRU375G
Multiply
Multiply
Syntax Characteristics
Parallel Enable Bit Yes
No. [3]
Size 3
Cycles 1
Pipeline X
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are ACx(3216) and the 8-bit signed constant, K8, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
applied to the instruction. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 * #2 Description The content of AC1 is multiplied by a signed 8-bit value (2) and the result is stored in AC0.
SPRU375G
5-259
Multiply
Multiply
Syntax Characteristics
Parallel Enable Bit No
No. [4]
Size 4
Cycles 1
Pipeline X
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are ACx(3216) and the 16-bit signed constant, K16, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 * #64 Description The content of AC1 is multiplied by a signed 16-bit value (64) and the result is stored in AC0.
5-260
SPRU375G
Multiply
Multiply
Syntax Characteristics
No. [5] Syntax ACx = rnd(Smem * coef(Cmem))[, T3 = Smem] Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
1101 0001 AAAA AAAI U%DD 00mm This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of a memory (Smem) location, sign extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Repeat Example
Syntax AC0 = *AR3 * coef(*CDP) Description The content addressed by AR3 is multiplied by the content addressed by the coefficient data pointer register (CDP) and the result is stored in AC0.
Affected by Affects
SPRU375G
5-261
Multiply
Multiply
Syntax Characteristics
Parallel Enable Bit No
No. [6]
Size 3
Cycles 1
Pipeline X
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are ACx(3216) and the content of a memory (Smem) location, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = *AR3 * AC1 Description The content addressed by AR3 is multiplied by the content of AC1 and the result is stored in AC0.
5-262
SPRU375G
Multiply
Multiply
Syntax Characteristics
Parallel Enable Bit No
No. [7]
Size 4
Cycles 1
Pipeline X
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of a memory (Smem) location, sign extended to 17 bits, and the 8-bit signed constant, K8, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
applied to the instruction. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat FRCT, M40, RDM none
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax AC0 = *AR3 * #2 Description The content addressed by AR3 is multiplied a signed 8-bit value (2) and the result is stored in AC0.
SPRU375G
5-263
Multiply
Multiply
Syntax Characteristics
No. [8] Syntax ACx = M40(rnd(uns(Xmem) * uns(Ymem)))[, T3 = Xmem] Parallel Enable Bit No Size 4 Cycles 1 Pipeline X
1000 0110 XXXM MMYY YMMM xxDD 000g uuU% ACx, Xmem, Ymem This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of data memory operand Ymem, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. This instruction provides the option to store the 16-bit data memory operand Xmem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
5-264 Instruction Set Descriptions SPRU375G
Multiply
Status Bits
Affected by Affects
Repeat Example
Syntax
Description The unsigned content addressed by AR3 is multiplied by the unsigned content addressed by AR4 and the result is stored in AC0.
SPRU375G
5-265
Multiply
Multiply
Syntax Characteristics
No. [9] Syntax ACx = rnd(uns(Tx * Smem)) [,T3 = Smem] Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the content of a memory (Smem) location, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is extended to 40 bits according to uns. J J
If the optional uns keyword is applied to the instruction, the 32-bit result is zero extended to 40 bits. If the optional uns keyword is not applied to the instruction, the 32-bit result is sign extended to 40 bits.
SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = uns(T0 * *AR3) Description The content addressed by AR3 is multiplied by the content of T0 and the unsigned result is stored in AC0.
5-266
SPRU375G
1000 0100 XXXM MMYY YMMM 10mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel operations in one cycle: multiply, and multiply and accumulate (MAC). The operations are executed in the two D-unit MACs. The first operation performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. The second operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - For the first operation, the 32-bit result of the multiplication is sign
extended to 40 bits.
- For the second operation, the 32-bit result of the multiplication is sign
extended to 40 bits and added to the source accumulator ACy shifted right by 16 bits. The shifting operation is performed with a sign extension of source accumulator ACy(39).
SPRU375G Instruction Set Descriptions 5-267
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Multiply - Multiply and Accumulate - Parallel Multiply and Accumulates
Example
Syntax AC0 = uns(*AR3) * uns(coef(*CDP)), AC1 = (AC1 >> #16) + (uns(*AR4) * uns(coef(*CDP))) Description Both instructions are performed in parallel. The unsigned content addressed by AR3 is multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) and the result is stored in AC0. The unsigned content addressed by AR4 multiplied by the unsigned content addressed by CDP is added to the content of AC1 shifted right by 16 bits and the result is stored in AC1.
5-268
SPRU375G
No. [1]
Syntax ACy = rnd(Tx * Xmem), Ymem = HI(ACx << T2) [,T3 = Xmem]
Size 4
Cycles 1
Pipeline X
1000 0111 XXXM MMYY YMMM SSDD 000x ssU% ACx, ACy, Tx, Xmem, Ymem This instruction performs two operations in parallel: multiply and store. The first operation performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the content of data memory operand Xmem, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD.
- This instruction provides the option to store the 16-bit data memory
operand Xmem in temporary register T3. The second operation shifts the accumulator ACx by the content of T2 and stores ACx(3116) to data memory operand Ymem. If the 16-bit value in T2 is not within 32 to +31, the shift is saturated to 32 or +31 and the shift is performed with this value.
- The input operand is shifted in the D-unit shifter according to SXMD. - After the shift, the high part of the accumulator, ACx(3116), is stored to
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When this instruction is executed with C54CM = 1, the 6 LSBs of T2 are used to determine the shift quantity. The 6 LSBs of T2 define a shift quantity within 32 to +31. When the 16-bit value in T2 is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat See Also C54CM, FRCT, M40, RDM, SATD, SMUL, SXMD ACOVy
This instruction can be repeated. See the following other related instructions:
- Addition with Parallel Store Accumulator Content to Memory - Multiply - Multiply and Accumulate with Parallel Store Accumulator Content to
Memory
- Multiply and Subtract with Parallel Store Accumulator Content to Memory - Store Accumulator Content to Memory - Subtraction with Parallel Store Accumulator Content to Memory
Example
Syntax AC1 = rnd(T0 * *AR0+), *AR1+ = HI(AC0 << T2) Description Both instructions are performed in parallel. The content addressed by AR0 is multiplied by the content of T0. Since FRCT = 1, the result is multiplied by 2, rounded, and stored in AC1. The content of AC0 is shifted by the content of T2, and AC0(3116) is stored at the address of AR1. AR0 and AR1 are both incremented by 1.
After AC0 AC1 AR0 AR1 T0 T2 200 300 FRCT ACOV1 CARRY
Before AC0 AC1 AR0 AR1 T0 T2 200 300 FRCT ACOV1 CARRY
FF 8421 1234 00 0000 0000 0200 0300 4000 0004 4000 1111 1 0 0
FF 8421 1234 00 2000 0000 0201 0301 4000 0004 4000 4211 1 0 0
5-270
SPRU375G
No. [1] [2] [3] [4] [5] [6] [7] [8] [9]
Syntax ACy = rnd(ACy + (ACx * Tx)) ACy = rnd((ACy * Tx) + ACx) ACy = rnd(ACx + (Tx * K8)) ACy = rnd(ACx + (Tx * K16)) ACx = rnd(ACx + (Smem * coef(Cmem)))[, T3 = Smem] ACy = rnd(ACy + (Smem * ACx))[, T3 = Smem] ACy = rnd(ACx + (Tx * Smem))[, T3 = Smem] ACy = rnd(ACx + (Smem * K8))[, T3 = Smem ] ACy = M40(rnd(ACx + (uns(Xmem) * uns(Ymem)))) [, T3 = Xmem]
Size 2 2 3 4 3 3 3 4 4 4
Cycles 1 1 1 1 1 1 1 1 1 1
Pipeline X X X X X X X X X X
Description
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are:
- ACx(3216) - the content of Tx, sign extended to 17 bits - the 8-bit signed constant, K8, sign extended to 17 bits - the 16-bit signed constant, K16, sign extended to 17 bits - the content of a memory (Smem) location, sign extended to 17 bits - the content of a data memory operand Cmem, addressed using the
content of data memory operand Ymem, extended to 17 bits Status Bits Affected by Affects
SPRU375G
See Also
Memory
- Multiply and Subtract - Multiply and Subtract with Parallel Multiply and Accumulate - Multiply with Parallel Multiply and Accumulate - Parallel Multiply and Accumulates
5-272
SPRU375G
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are ACx(3216) and the content of Tx, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 + (AC1 * T0) Description The content of AC1 multiplied by the content of T0 is added to the content of AC0 and the result is stored in AC0.
SPRU375G
5-273
No. [2]
Size 2
Cycles 1
Pipeline X
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are ACy(3216) and the content of Tx, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC1 = rnd((AC1 * T1) + AC0) Description The content of AC1 multiplied by the content of T1 is added to the content of AC0. The result is rounded and stored in AC1.
5-274
SPRU375G
No. [3]
Size 3
Cycles 1
Pipeline X
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the 8-bit signed constant, K8, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + (T0 * K8) Description The content of T0 multiplied by a signed 8-bit value is added to the content of AC1 and the result is stored in AC0.
SPRU375G
5-275
No. [4]
Size 4
Cycles 1
Pipeline X
0111 1001 KKKK KKKK KKKK KKKK SSDD ss1% ACx, ACy, K16, Tx This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the 16-bit signed constant, K16, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + (T0 * #FFFFh) Description The content of T0 multiplied by a signed 16-bit value (FFFFh) is added to the content of AC1 and the result is stored in AC0.
5-276
SPRU375G
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of a memory (Smem) location, sign extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat
SPRU375G
Example
Syntax AC2 = rnd(AC2 + (*AR1 * coef(*CDP))) Description The content addressed by AR1 multiplied by the content addressed by the coefficient data pointer register (CDP) is added to the content of AC2. The result is rounded and stored in AC2. The result generated an overflow.
5-278
SPRU375G
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are ACx(3216) and the content of a memory (Smem) location, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC1 = AC1 + (*AR3 * AC0) Description The content addressed by AR3 multiplied by the content of AC0 is added to the content of AC1 and the result is stored in AC1.
SPRU375G
5-279
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the content of a memory (Smem) location, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + (T0 * *AR3) Description The content addressed by AR3 multiplied by the content of T0 is added to the content of AC1 and the result is stored in AC0.
5-280
SPRU375G
1111 1000 AAAA AAAI KKKK KKKK SSDD x1U% ACx, ACy, K8, Smem This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of a memory (Smem) location, sign extended to 17 bits, and the 8-bit signed constant, K8, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat FRCT, M40, RDM, SATD ACOVy
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax AC0 = AC1 + (*AR3 * #FFh) Description The content addressed by AR3 multiplied by a signed 8-bit value (FFh) is added to the content of AC1 and the result is stored in AC0.
SPRU375G
5-281
1000 0110 XXXM MMYY YMMM SSDD 001g uuU% ACx, ACy, Xmem, Ymem This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of data memory operand Ymem, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. This instruction provides the option to store the 16-bit data memory operand Xmem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
5-282 Instruction Set Descriptions SPRU375G
Status Bits
Affected by Affects
Repeat Example
Syntax
Description The unsigned content addressed by AR2 multiplied by the unsigned content addressed by AR3 is added to the content of AC3. The result is rounded and stored in AC3. The result generated an overflow. AR2 and AR3 are both incremented by 1.
Before AC3 AR2 AR3 ACOV3 302 202 M40 SATD FRCT
After AC3 AR2 AR3 ACOV3 302 202 M40 SATD FRCT
SPRU375G
5-283
1000 0110 XXXM MMYY YMMM SSDD 010g uuU% ACx, ACy, Xmem, Ymem This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of data memory operand Ymem, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
to the source accumulator ACx shifted right by 16 bits. The shifting operation is performed with a sign extension of source accumulator ACx(39).
- Rounding is performed according to RDM, if the optional rnd keyword is
according to SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. This instruction provides the option to store the 16-bit data memory operand Xmem in temporary register T3.
5-284 Instruction Set Descriptions SPRU375G
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = (AC1 >> #16) + (uns(*AR3) * uns(*AR4)) Description The unsigned content addressed by AR3 multiplied by the unsigned content addressed by AR4 is added to the content of AC1 shifted right by 16 bits and the result is stored in AC0.
SPRU375G
5-285
This instruction performs a multiplication and an accumulation in the D-unit MAC in parallel with the delay memory instruction. The input operands of the multiplier are the content of a memory (Smem) location, sign extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. The soft dual memory addressing mode mechanism cannot be applied to this instruction. This instruction cannot use the *port(#k16) addressing mode or be paralleled with the readport() or writeport() operand qualifier. This instruction cannot be used for accesses to I/O space. Any illegal access to I/O space generates a hardware bus-error interrupt (BERRINT) to be handled by the CPU.
5-286 Instruction Set Descriptions SPRU375G
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 set to 0, compatibility is ensured. Status Bits Affected by Affects Repeat See Also FRCT, M40, RDM, SATD, SMUL ACOVx
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content with Parallel Multiply and Accumulate - Multiply and Accumulate - Multiply and Accumulate with Parallel Load Accumulator from Memory - Multiply and Accumulate with Parallel Multiply - Multiply and Accumulate with Parallel Store Accumulator Content to
Memory
- Multiply and Subtract with Parallel Multiply and Accumulate - Multiply with Parallel Multiply and Accumulate - Parallel Multiply and Accumulates
Example
Syntax AC0 = AC0 + (*AR3 * coef(*CDP)), delay(*AR3) Description The content addressed by AR3 multiplied by the content addressed by the coefficient data pointer register (CDP) is added to the content of AC0 and the result is stored in AC0. The content addressed by AR3 is copied into the next higher address.
SPRU375G
5-287
No. [1]
Syntax ACx = rnd(ACx + (Tx * Xmem)), ACy = Ymem << #16 [,T3 = Xmem]
Size 4
Cycles 1
Pipeline X
1000 0110 XXXM MMYY YMMM DDDD 101x ssU% ACx, ACy, Tx, Xmem, Ymem This instruction performs two operations in parallel: multiply and accumulate (MAC), and load. The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the content of data memory operand Xmem, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD.
- This instruction provides the option to store the 16-bit data memory
operand Xmem in temporary register T3. The second operation loads the content of data memory operand Ymem shifted left by 16 bits to the accumulator ACy.
- The input operand is sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - The input operand is shifted left by 16 bits according to M40. 5-288 Instruction Set Descriptions SPRU375G
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat See Also FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content with Parallel Multiply and Accumulate - Multiply and Accumulate - Multiply and Accumulate with Parallel Delay - Multiply and Accumulate with Parallel Multiply - Multiply and Accumulate with Parallel Store Accumulator Content to
Memory
- Multiply and Subtract with Parallel Load Accumulator from Memory - Multiply with Parallel Multiply and Accumulate - Parallel Multiply and Accumulates
Example
Syntax AC0 = AC0 + (T0 * *AR3), AC1 = *AR4 << #16 Description Both instructions are performed in parallel. The content addressed by AR3 multiplied by the content of T0 is added to the content of AC0 and the result is stored in AC0. The content addressed by AR4 shifted left by 16 bits is stored in AC1.
SPRU375G
5-289
1000 0010 XXXM MMYY YMMM 01mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel operations in one cycle: multiply and accumulate (MAC), and multiply. The operations are executed in the two D-unit MACs. The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, sign extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. This second operation performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - For the first operation, the 32-bit result of the multiplication is sign
extended to 40 bits.
- Rounding is performed according to RDM, if the optional rnd keyword is
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content with Parallel Multiply and Accumulate - Multiply and Accumulate - Multiply and Accumulate with Parallel Delay - Multiply and Accumulate with Parallel Load Accumulator from Memory - Multiply and Accumulate with Parallel Store Accumulator Content to Memory - Multiply and Subtract with Parallel Multiply - Multiply with Parallel Multiply and Accumulate - Parallel Multiply and Accumulates
Example
Syntax AC0 = AC0 + (uns(*AR3) * uns(coef(*CDP))), AC1 = uns(*AR4) * uns(coef(*CDP)) Description Both instructions are performed in parallel. The unsigned content addressed by AR3 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is added to the content of AC0 and the result is stored in AC0. The unsigned content addressed by AR4 is multiplied by the unsigned content addressed by CDP and the result is stored in AC1.
SPRU375G
5-291
1000 0111 XXXM MMYY YMMM SSDD 001x ssU% ACx, ACy, Tx, Xmem, Ymem This instruction performs two operations in parallel: multiply and accumulate (MAC), and store. The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the content of data memory operand Xmem, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD.
- This instruction provides the option to store the 16-bit data memory
operand Xmem in temporary register T3. The second operation shifts the accumulator ACx by the content of T2 and stores ACx(3116) to data memory operand Ymem. If the 16-bit value in T2 is not within 32 to +31, the shift is saturated to 32 or +31 and the shift is performed with this value.
- The input operand is shifted in the D-unit shifter according to SXMD. - After the shift, the high part of the accumulator, ACx(3116), is stored to
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When this instruction is executed with C54CM = 1, the 6 LSBs of T2 are used to determine the shift quantity. The 6 LSBs of T2 define a shift quantity within 32 to +31. When the 16-bit value in T2 is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat See Also C54CM, FRCT, M40, RDM, SATD, SMUL, SXMD ACOVy
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content with Parallel Multiply and Accumulate - Multiply and Accumulate - Multiply and Accumulate with Parallel Delay - Multiply and Accumulate with Parallel Load Accumulator from Memory - Multiply and Accumulate with Parallel Multiply - Multiply and Subtract with Parallel Store Accumulator Content to Memory - Multiply with Parallel Multiply and Accumulate - Parallel Multiply and Accumulates
Example
Syntax AC0 = AC0 + (T0 * *AR3), *AR4 = HI(AC1 << T2) Description Both instructions are performed in parallel. The content addressed by AR3 multiplied by the content of T0 is added to the content of AC0 and the result is stored in AC0. The content of AC1 is shifted by the content of T2, and AC1(3116) is stored at the address of AR4.
SPRU375G
5-293
Description
This instruction performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are:
- ACx(3216) - the content of Tx, sign extended to 17 bits - the content of a memory (Smem) location, sign extended to 17 bits - the content of a data memory operand Cmem, addressed using the
content of data memory operand Ymem, extended to 17 bits Status Bits Affected by Affects See Also FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
5-294
SPRU375G
0101 011E DDSS ss1% This instruction performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are ACx(3216) and the content of Tx, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Repeat Example
Syntax AC1 = rnd(AC1 (AC0 * T1))
Before AC0 AC1 T1 M40 ACOV1 FRCT
Affected by Affects
Description The content of AC0 multiplied by the content of T1 is subtracted from the content of AC1. The result is rounded and stored in AC1.
After AC0 AC1 T1 M40 ACOV1 FRCT 00 EC00 0000 00 1680 0000 2000 0 0 0
SPRU375G
5-295
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of a memory (Smem) location, sign extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
5-296 Instruction Set Descriptions SPRU375G
Status Bits
Affected by Affects
Repeat Example
Syntax
Description The content addressed by AR1 multiplied by the content addressed by the coefficient data pointer register (CDP) is subtracted from the content of AC2. The result is rounded and stored in AC2.
Before AC2 AR1 CDP 302 202 ACOV2 SATD RDM FRCT
After AC2 AR2 CDP 302 202 ACOV2 SATD RDM FRCT
SPRU375G
5-297
This instruction performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are ACx(3216) and the content of a memory (Smem) location, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 (*AR3 * AC1) Description The content addressed by AR3 multiplied by the content of AC1 is subtracted from the content of AC0 and the result is stored in AC0.
5-298
SPRU375G
This instruction performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the content of a memory (Smem) location, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 (T0 * *AR3) Description The content addressed by AR3 multiplied by the content of T0 is subtracted from the content of AC1 and the result is stored in AC0.
SPRU375G
5-299
1000 0110 XXXM MMYY YMMM SSDD 011g uuU% ACx, ACy, Xmem, Ymem This instruction performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of data memory operand Ymem, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. This instruction provides the option to store the 16-bit data memory operand Xmem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
5-300 Instruction Set Descriptions SPRU375G
Status Bits
Affected by Affects
Repeat Example
Syntax
Description The unsigned content addressed by AR2 multiplied by the unsigned content addressed by AR3 is subtracted from the content of AC3 and the result is stored in AC3. AR2 and AR3 are both incremented by 1.
SPRU375G
5-301
1000 0110 XXXM MMYY YMMM DDDD 100x ssU% ACx, ACy, Tx, Xmem, Ymem This instruction performs two operations in parallel: multiply and subtract (MAS), and load. The first operation performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the content of data memory operand Xmem, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD.
- This instruction provides the option to store the 16-bit data memory
operand Xmem in temporary register T3. The second operation loads the content of data memory operand Ymem shifted left by 16 bits to the accumulator ACy.
- The input operand is sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - The input operand is shifted left by 16 bits according to M40.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
5-302 Instruction Set Descriptions SPRU375G
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content with Parallel Multiply and Subtract - Multiply and Accumulate with Parallel Load Accumulator from Memory - Multiply and Subtract - Multiply and Subtract with Parallel Multiply - Multiply and Subtract with Parallel Multiply and Accumulate - Multiply and Subtract with Parallel Store Accumulator Content to Memory - Parallel Multiply and Subtracts
Example
Syntax AC0 = AC0 (T0 * *AR3), AC1 = *AR4 << #16 Description Both instructions are performed in parallel. The content addressed by AR3 multiplied by the content of T0 is subtracted from the content of AC0 and the result is stored in AC0. The content addressed by AR4 shifted left by 16 bits is stored in AC1.
SPRU375G
5-303
1000 0010 XXXM MMYY YMMM 10mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel operations in one cycle: multiply and subtract (MAS), and multiply. The operations are executed in the two D-unit MACs. The first operation performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. The second operation performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - For the first operation, the 32-bit result of the multiplication is sign
extended to 40 bits.
- Rounding is performed according to RDM, if the optional rnd keyword is
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content with Parallel Multiply and Subtract - Multiply and Accumulate with Parallel Multiply - Multiply and Subtract - Multiply and Subtract with Parallel Load Accumulator from Memory - Multiply and Subtract with Parallel Multiply and Accumulate - Multiply and Subtract with Parallel Store Accumulator Content to Memory - Parallel Multiply and Subtracts
Example
Syntax AC0 = AC0 (uns(*AR3) * uns(coef(*CDP))), AC1 = uns(*AR4) * uns(coef(*CDP)) Description Both instructions are performed in parallel. The unsigned content addressed by AR3 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is subtracted from the content of AC0 and the result is stored in AC0. The unsigned content addressed by AR4 is multiplied by the unsigned content addressed by CDP and the result is stored in AC1.
SPRU375G
5-305
Syntax ACx = M40(rnd(ACx (uns(Xmem) * uns(coef(Cmem))))), ACy = M40(rnd(ACy + (uns(Ymem) * uns(coef(Cmem))))) ACx = M40(rnd(ACx (uns(Xmem) * uns(coef(Cmem))))), ACy = M40(rnd((ACy >> #16) + (uns(Ymem) * uns(coef(Cmem)))))
Size 4 4
Cycles 1 1
Pipeline X X
Description
These instructions perform two parallel operations in one cycle: multiply and subtract (MAS), and multiply and accumulate (MAC). The operations are executed in the two D-unit MACs. Affected by Affects FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
See Also
5-306
SPRU375G
1000 0011 XXXM MMYY YMMM 01mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel operations in one cycle: multiply and subtract (MAS), and multiply and accumulate (MAC). The operations are executed in the two D-unit MACs. The first operation performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. The second operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - For the first operation, the 32-bit result of the multiplication is sign
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
Affected by Affects
Repeat Example
Syntax
Description Both instructions are performed in parallel. The unsigned content addressed by AR0 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is subtracted from the content of AC0. The result is rounded and stored in AC0. The unsigned content addressed by AR1 multiplied by the unsigned content addressed by CDP is added to the content of AC1. The result is rounded and stored in AC1.
Before AC0 AC1 *AR0 *AR1 *CDP ACOV0 ACOV1 CARRY FRCT
After AC0 AC1 *AR0 *AR1 *CDP ACOV0 ACOV1 CARRY FRCT
5-308
SPRU375G
1000 0100 XXXM MMYY YMMM 00mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel operations in one cycle: multiply and subtract (MAS), and multiply and accumulate (MAC). The operations are executed in the two D-unit MACs. The first operation performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. The second operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - For the first operation, the 32-bit result of the multiplication is sign
extended to 40 bits and added to the source accumulator ACy shifted right by 16 bits. The shifting operation is performed with a sign extension of source accumulator ACy(39).
SPRU375G Instruction Set Descriptions 5-309
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
Affected by Affects
Repeat Example
Syntax
Description Both instructions are performed in parallel. The unsigned content addressed by AR3 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is subtracted from the content of AC0 and the result is stored in AC0. The unsigned content addressed by AR4 multiplied by the unsigned content addressed by CDP is added to the content of AC1 shifted right by 16 bits and the result is stored in AC1.
AC0 = AC0 (uns(*AR3) * uns(coef(*CDP))), AC1 = (AC1 >> #16) + (uns(*AR4) * uns(coef(*CDP)))
5-310
SPRU375G
1000 0111 XXXM MMYY YMMM SSDD 010x ssU% ACx, ACy, Tx, Xmem, Ymem This instruction performs two operations in parallel: multiply and subtract (MAS), and store. The first operation performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of Tx, sign extended to 17 bits, and the content of data memory operand Xmem, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD.
- This instruction provides the option to store the 16-bit data memory
operand Xmem in temporary register T3. The second operation shifts the accumulator ACx by the content of T2 and stores ACx(3116) to data memory operand Ymem. If the 16-bit value in T2 is not within 32 to +31, the shift is saturated to 32 or +31 and the shift is performed with this value.
- The input operand is shifted in the D-unit shifter according to SXMD. - After the shift, the high part of the accumulator, ACx(3116), is stored to
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When this instruction is executed with C54CM = 1, the 6 LSBs of T2 are used to determine the shift quantity. The 6 LSBs of T2 define a shift quantity within 32 to +31. When the 16-bit value in T2 is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat See Also C54CM, FRCT, M40, RDM, SATD, SMUL, SXMD ACOVy
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content with Parallel Multiply and Subtract - Multiply and Accumulate with Parallel Store Accumulator Content to
Memory
- Multiply and Subtract - Multiply and Subtract with Parallel Load Accumulator from Memory - Multiply and Subtract with Parallel Multiply - Multiply and Subtract with Parallel Multiply and Accumulate - Parallel Multiply and Subtracts
Example
Syntax AC0 = AC0 (T0 * *AR3), *AR4 = HI(AC1 << T2) Description Both instructions are performed in parallel. The content addressed by AR3 multiplied by the content of T0 is subtracted from the content of AC0 and the result is stored in AC0. The content of AC1 is shifted by the content of T2, and AC1(3116) is stored at the address of AR4.
5-312
SPRU375G
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction computes the 2s complement of the content of the source register (src). This instruction clears the CARRY status bit to 0 for all nonzero values of src. If src equals 0, the CARRY status bit is set to 1.
- When the destination operand (dst) is an accumulator: J J J
The operation is performed on 40 bits in the D-unit ALU. Input operands are sign extended to 40 bits according to SXMD. If an auxiliary or temporary register is the source operand (src) of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended according to SXMD. Overflow detection and CARRY status bit depends on M40. When an overflow is detected, the accumulator is saturated according to SATD.
J J
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source operand (src) of the instruction, the 16 LSBs of the accumulator are used to perform the operation. Overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
SPRU375G
5-313
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Complement Accumulator, Auxiliary, or Temporary Register Bit - Complement Accumulator, Auxiliary, or Temporary Register Content
Example
Syntax AC0 = AC1 Description The 2s complement of the content of AC1 is stored in AC0.
5-314
SPRU375G
No Operation (nop)
No Operation (nop)
Syntax Characteristics
Parallel Enable Bit Yes Yes
Size 1 2
Cycles 1 1
Pipeline D D
0010 000E
Instruction [1] increments the program counter register (PC) by 1 byte. Instruction [2] increments the PC by 2 bytes. Affected by Affects none none
Status Bits
Repeat Example
Syntax nop
SPRU375G
5-315
No. [1]
Size 4
Cycles 1
Pipeline X
1000 0101 XXXM MMYY YMMM 10mm xxxx xxxx Cmem, Xmem, Ymem This instruction performs three parallel modify auxiliary register (MAR) operations in one cycle. The auxiliary register modification is specified by:
- the content of data memory operand Xmem - the content of data memory operand Ymem - the content of a data memory operand Cmem, addressed using the
coefficient addressing mode Status Bits Affected by Affects Repeat See Also none none
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content - Modify Extended Auxiliary Register Content
Example
Syntax mar(*AR3+), mar(*AR4), mar(coef(*CDP)) Description AR3 is incremented by 1. AR4 is decremented by 1. CDP is not modified.
5-316
SPRU375G
Parallel Multiplies
Parallel Multiplies
Syntax Characteristics
No. [1] Syntax ACx = M40(rnd(uns(Xmem) * uns(coef(Cmem)))), ACy = M40(rnd(uns(Ymem) * uns(coef(Cmem)))) Parallel Enable Bit No Size 4 Cycles 1 Pipeline X
1000 0010 XXXM MMYY YMMM 00mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel multiply operations in one cycle. The operations are executed in the two D-unit MACs. The first operation performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. This second operation performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD.
SPRU375G Instruction Set Descriptions 5-317
Parallel Multiplies
This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content with Parallel Multiply - Multiply - Multiply and Accumulate with Parallel Multiply - Multiply and Subtract with Parallel Multiply - Parallel Multiply and Accumulates - Parallel Multiply and Subtracts
Example
Syntax AC0 = uns(*AR3) * uns(coef(*CDP)), AC1 = uns(*AR4) * uns(coef(*CDP)) Description Both instructions are performed in parallel. The unsigned content addressed by AR3 is multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) and the result is stored in AC0. The unsigned content addressed by AR4 is multiplied by the unsigned content addressed by CDP and the result is stored in AC1.
5-318
SPRU375G
Syntax ACx = M40(rnd(ACx + (uns(Xmem) * uns(coef(Cmem))))), ACy = M40(rnd(ACy + (uns(Ymem) * uns(coef(Cmem))))) ACx = M40(rnd((ACx >> #16) + (uns(Xmem) * uns(coef(Cmem))))), ACy = M4(rnd(ACy + (uns(Ymem) * uns(coef(Cmem))))) ACx = M40(rnd((ACx >> #16) + (uns(Xmem) * uns(coef(Cmem))))), ACy = M40(rnd((ACy >> #16) + (uns(Ymem) * uns(coef(Cmem)))))
Size 4 4
Cycles 1 1
Pipeline X X
[3]
No
Description
These instructions perform two parallel multiply and accumulate (MAC) operations in one cycle. The operations are executed in the two D-unit MACs. Affected by Affects FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
See Also
SPRU375G
5-319
1000 0011 XXXM MMYY YMMM 00mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel multiply and accumulate (MAC) operations in one cycle. The operations are executed in the two D-unit MACs. The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. The second operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
SATD.
5-320 Instruction Set Descriptions SPRU375G
This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
Affected by Affects
Repeat Example
Syntax
Description Both instructions are performed in parallel. The unsigned content addressed by AR3 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is added to the content of AC0 and the result is stored in AC0. The unsigned content addressed by AR4 multiplied by the unsigned content addressed by CDP is added to the content of AC1 and the result is stored in AC1.
SPRU375G
5-321
1000 0011 XXXM MMYY YMMM 10mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel multiply and accumulate (MAC) operations in one cycle. The operations are executed in the two D-unit MACs. The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. The second operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - For the first operation, the 32-bit result of the multiplication is sign
extended to 40 bits and added to the source accumulator ACx shifted right by 16 bits. The shifting operation is performed with a sign extension of source accumulator ACx(39).
- For the second operation, the 32-bit result of the multiplication is sign
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
Affected by Affects
Repeat Example
Syntax
Description Both instructions are performed in parallel. The unsigned content addressed by AR3 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is added to the content of AC0 shifted right by 16 bits and the result is stored in AC0. The unsigned content addressed by AR4 multiplied by the unsigned content addressed by CDP is added to the content of AC1 and the result is stored in AC1.
AC0 = (AC0 >> #16) + (uns(*AR3) * uns(coef(*CDP))), AC1 = AC1 + (uns(*AR4) * uns(coef(*CDP)))
SPRU375G
5-323
1000 0100 XXXM MMYY YMMM 11mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel multiply and accumulate (MAC) operations in one cycle. The operations are executed in the two D-unit MACs. The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. The second operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
to the source accumulator shifted right by 16 bits. The shifting operation is performed with a sign extension of source accumulator bit 39.
- Rounding is performed according to RDM, if the optional rnd keyword is
SATD. This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
Affected by Affects
Repeat Example
Syntax
Description Both instructions are performed in parallel. The unsigned content addressed by AR3 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is added to the content of AC0 shifted right by 16 bits and the result is stored in AC0. The unsigned content addressed by AR4 multiplied by the unsigned content addressed by CDP is added to the content of AC1 shifted right by 16 bits and the result is stored in AC1.
AC0 = (AC0 >> #16) + (uns(*AR3) * uns(coef(*CDP))), AC1 = (AC1 >> #16) + (uns(*AR4) * uns(coef(*CDP)))
SPRU375G
5-325
1000 0101 XXXM MMYY YMMM 01mm uuDD DDg% ACx, ACy, Cmem, Xmem, Ymem This instruction performs two parallel multiply and subtract (MAS) operations in one cycle. The operations are executed in the two D-unit MACs. The first operation performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Xmem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits. The second operation performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of data memory operand Ymem, extended to 17 bits, and the content of a data memory operand Cmem, addressed using the coefficient addressing mode, extended to 17 bits.
- Input operands are extended to 17 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 17 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 17 bits according to SXMD.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD.
5-326 Instruction Set Descriptions SPRU375G
This instruction provides the option to locally set M40 to 1 for the execution of the instruction, if the optional M40 keyword is applied to the instruction. For this instruction, the Cmem operand is accessed through the BB bus; on some C55x-based devices, the BB bus is only connected to internal memory and not to external memory. To prevent the generation of a bus error, the Cmem operand must not be mapped on external memory. Each data flow can also disable the usage of the corresponding MAC unit, while allowing the modification of auxiliary registers in the three address generation units through the following instructions:
J J J
mar(Xmem) mar(Ymem) mar(Cmem) FRCT, M40, RDM, SATD, SMUL, SXMD ACOVx, ACOVy
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Modify Auxiliary Register Content with Parallel Multiply and Subtract - Multiply and Subtract - Multiply and Subtract with Parallel Load Accumulator from Memory - Multiply and Subtract with Parallel Multiply - Multiply and Subtract with Parallel Multiply and Accumulate - Multiply and Subtract with Parallel Store Accumulator Content to Memory - Parallel Multiplies - Parallel Multiply and Accumulates
Example
Syntax AC0 = AC0 (uns(*AR3) * uns(coef(*CDP))), AC1 = AC1 (uns(*AR4) * uns(coef(*CDP))) Description Both instructions are performed in parallel. The unsigned content addressed by AR3 multiplied by the unsigned content addressed by the coefficient data pointer register (CDP) is subtracted from the content of AC0 and the result is stored in AC0. The unsigned content addressed by AR4 multiplied by the unsigned content addressed by CDP is subtracted from the content of AC1 and the result is stored in AC1.
SPRU375G
5-327
Opcode
readport writeport
Operands Description
none These operand qualifiers allow you to locally disable access toward the data memory and enable access to the 64K-word I/O space. The I/O data location is specified by the Smem, Xmem, or Ymem fields.
- A readport() operand qualifier may be included in any instruction making
a word single data memory access Smem or Xmem that is used in a read operation, except instructions using delay().
- A writeport() operand qualifier may be included in any instruction making
a word single data memory access Smem or Ymem that is used in a write operation, except instructions using the delay().
- A readport() or writeport() operand qualifier cannot be used as a
stand-alone instruction (the assembler generates an error message). Any instruction making a word single data memory access Smem (except those listed above) can use the *port(#k16) addressing mode to access the 64K-word I/O space with an immediate address. When an instruction uses *port(#k16), the 16-bit unsigned constant, k16, is encoded in a 2-byte extension to the instruction. Because of the extension, an instruction using *port(#k16) cannot be executed in parallel with another instruction. The following indirect operands cannot be used for accesses to I/O space. An instruction using one of these operands requires a 2-byte extension to the instruction. Because of the extension, an instruction using one of the following indirect operands cannot be executed with these operand qualifiers.
- *ARn(#K16) - *+ARn(#K16) - *CDP(#K16) - *+CDP(#K16) 5-328 Instruction Set Descriptions SPRU375G
Status Bits
Affected by Affects
none none
Repeat Example 1
Syntax T2 = *AR3 || readport()
Description The content addressed by AR3 (I/O address) is loaded into T2.
Example 2
Syntax *AR3 = T2 || writeport() Description The content of T2 is written to the location addressed by AR3 (I/O address).
SPRU375G
5-329
Pop Accumulator or Extended Auxiliary Register Content from Stack Pointers (popboth)
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction moves the content of two 16-bit data memory locations addressed by the data stack pointer (SP) and system stack pointer (SSP) to accumulator ACx or to the 23-bit destination register (XARx, XSP, XSSP, XDP, or XCDP). The content of xdst(150) is loaded from the location addressed by SP and the content of xdst(3116) is loaded from the location addressed by SSP. When xdst is a 23-bit register, the upper 9 bits of the data memory addressed by SSP are discarded and only the 7 lower bits of the data memory are loaded into the high part of xdst(2216). When xdst is an accumulator, the guard bits, ACx(3932), are reloaded (unchanged) with the current value and are not modified by this instruction.
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Pop Top of Stack - Push to Top of Stack - Push Accumulator or Extended Auxiliary Register Content to Stack Pointers
5-330
SPRU375G
Syntax dst1, dst2 = pop() dst = pop() dst, Smem = pop() ACx = dbl(pop()) Smem = pop() dbl(Lmem) = pop()
Size 2 2 3 2 2 2
Cycles 1 1 1 1 1 1
Pipeline X X X X X X
Description
These instructions move the content of the data memory location addressed by the data stack pointer (SP) to:
- an accumulator, auxiliary, or temporary register - a data memory location
When the destination register is an accumulator, the guard bits and the 16 higher bits of the accumulator, ACx(3916), are reloaded (unchanged) with the current value and are not modified by these instructions. The increment operation performed on SP is done by the A-unit address generator dedicated to the stack addressing management. Status Bits Affected by Affects See Also none none
SPRU375G
5-331
No. [1]
Size 2
Cycles 1
Pipeline X
Opcode
Note: FSSS = dst1, FDDD = dst2
0011 101E FSSS FDDD dst1, dst2 This instruction moves the content of the 16-bit data memory location pointed by SP to destination register dst1 and moves the content of the 16-bit data memory location pointed by SP + 1 to destination register dst2. When the destination register, dst1 or dst2, is an accumulator, the content of the 16-bit data memory operand is moved to the destination accumulator low part, ACx(150). The guard bits and the 16 higher bits of the accumulator, ACx(3916), are reloaded (unchanged) with the current value and are not modified by this instruction. SP is incremented by 2.
Operands Description
Status Bits
Affected by Affects
none none
Repeat Example
Syntax AC0, AC1 = pop()
Description The content of the memory location pointed by the data stack pointer (SP) is copied to AC0(150) and the content of the memory location pointed by SP + 1 is copied to AC1(150). Bits 3916 of the accumulators are unchanged. The SP is incremented by 2.
After 00 4500 0000 F7 5678 9432 0300 4890 2300 AC0 AC1 SP 300 301 00 4500 4890 F7 5678 2300 0302 4890 2300
5-332
SPRU375G
No. [2]
Size 2
Cycles 1
Pipeline X
This instruction moves the content of the 16-bit data memory location pointed by SP to destination register dst. When the destination register, dst, is an accumulator, the content of the 16-bit data memory operand is moved to the destination accumulator low part, ACx(150). The guard bits and the 16 higher bits of the accumulator, ACx(3916), are reloaded (unchanged) with the current value and are not modified by this instruction. SP is incremented by 1.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax AC0 = pop()
Description The content of the memory location pointed by the data stack pointer (SP) is copied to AC0(150). Bits 3916 of AC0 are unchanged. The SP is incremented by 1.
SPRU375G
5-333
No. [3]
Size 3
Cycles 1
Pipeline X
This instruction moves the content of the 16-bit data memory location pointed by SP to destination register dst and moves the content of the 16-bit data memory location pointed by SP + 1 to data memory (Smem) location. When the destination register, dst, is an accumulator, the content of the 16-bit data memory operand is moved to the destination accumulator low part, ACx(150). The guard bits and the 16 higher bits of the accumulator, ACx(3916), are reloaded (unchanged) with the current value and are not modified by this instruction. SP is incremented by 2.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax AC0, *AR3 = pop()
Description The content of the memory location pointed by the data stack pointer (SP) is copied to AC0(150) and the content of the memory location pointed by SP + 1 is copied to the location addressed by AR3. Bits 3916 of AC0 are unchanged. The SP is incremented by 2.
5-334
SPRU375G
No. [4]
Size 2
Cycles 1
Pipeline X
This instruction moves the content of the 16-bit data memory location pointed by SP to the accumulator high part ACx(3116) and moves the content of the 16-bit data memory location pointed by SP + 1 to the accumulator low part ACx(150). The guard bits of the accumulator, ACx(3932), are reloaded (unchanged) with the current value and are not modified by this instruction. SP is incremented by 2.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax AC1 = dbl(pop())
Description The content of the memory location pointed by the data stack pointer (SP) is copied to AC1(3116) and the content of the memory location pointed by SP + 1 is copied to AC1(150). Bits 3932 of AC1 are unchanged. The SP is incremented by 2.
After 03 3800 FC00 0304 5644 F800 AC1 SP 304 305 03 5644 F800 0306 5644 F800
SPRU375G
5-335
No. [5]
Size 2
Cycles 1
Pipeline X
This instruction moves the content of the 16-bit data memory location pointed by SP to data memory (Smem) location. SP is incremented by 1. Affected by Affects none none
Status Bits
Repeat Example
Syntax *AR1 = pop()
Description The content of the memory location pointed by the data stack pointer (SP) is copied to the location addressed by AR1. The SP is incremented by 1.
After 0200 0300 3400 6903 AR1 SP 200 300 0200 0301 6903 6903
5-336
SPRU375G
No. [6]
Size 2
Cycles 1
Pipeline X
This instruction moves the content of the 16-bit data memory location pointed by SP to the 16 highest bits of data memory location Lmem and moves the content of the 16-bit data memory location pointed by SP + 1 to the 16 lowest bits of data memory location Lmem. When Lmem is at an even address, the two 16-bit values popped from the stack are stored at memory location Lmem in the same order. When Lmem is at an odd address, the two 16-bit values popped from the stack are stored at memory location Lmem in the reverse order. SP is incremented by 2.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax dbl(*AR3) = pop()
Description The content of the memory location pointed by the data stack pointer (SP) is copied to the 16 highest bits of the location addressed by AR3 and the content of the memory location pointed by SP + 1 is copied to the 16 lowest bits of the location addressed by AR3. Because this instruction is a long-operand instruction, AR3 is decremented by 2 after the execution. The SP is incremented by 2.
SPRU375G
5-337
No. [1]
Syntax pshboth(xsrc)
Size 2
Cycles 1
Pipeline X
This instruction moves the lower 32 bits of ACx or the content of the 23-bit source register (XARx, XSP, XSSP, XDP, or XCDP) to the two 16-bit memory locations addressed by the data stack pointer (SP) and system stack pointer (SSP). The content of xsrc(150) is moved to the location addressed by SP and the content of xsrc(3116) is moved to the location addressed by SSP. When xsrc is a 23-bit register, the upper 9 bits of the location addressed by SSP are filled with 0.
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Pop Accumulator or Extended Auxiliary Register Content from Stack Pointers - Pop Top of Stack - Push to Top of Stack
5-338
SPRU375G
Size 2 2 3 2 2 2
Cycles 1 1 1 1 1 1
Pipeline X X X X X X
Description
These instructions move one or two operands to the data memory location addressed by the data stack pointer (SP). The operands may be:
- an accumulator, auxiliary, or temporary register - a data memory location
The decrement operation performed on SP is done by the A-unit address generator dedicated to the stack addressing management. Status Bits Affected by Affects See Also none none
SPRU375G
5-339
No. [1]
Size 2
Cycles 1
Pipeline X
Opcode
Note: FSSS = src1, FDDD = src2
0011 100E FSSS FDDD src1, src2 This instruction decrements SP by 2, then moves the content of the source register src1 to the 16-bit data memory location pointed by SP and moves the content of the source register src2 to the 16-bit data memory location pointed by SP + 1. When the source register, src1 or src2, is an accumulator, the source accumulator low part, ACx(150), is moved to the 16-bit data memory operand.
Operands Description
Status Bits
Affected by Affects
none none
Repeat Example
Syntax push(AR0, AC1)
Description The data stack pointer (SP) is decremented by 2. The content of AR0 is copied to the memory location pointed by SP and the content of AC1(150) is copied to the memory location pointed by SP + 1.
After 0300 03 5644 F800 0300 0000 0000 5890 AR0 AC1 SP 2FE 2FF 300 0300 03 5644 F800 02FE 0300 F800 5890
5-340
SPRU375G
No. [2]
Syntax push(src)
Size 2
Cycles 1
Pipeline X
This instruction decrements SP by 1, then moves the content of the source register (src) to the 16-bit data memory location pointed by SP. When the source register is an accumulator, the source accumulator low part, ACx(150), is moved to the 16-bit data memory operand. Affected by Affects none none
Status Bits
Repeat Example
Syntax push(AC0)
Description The data stack pointer (SP) is decremented by 1. The content of AC0(150) is copied to the memory location pointed by SP.
SPRU375G
5-341
No. [3]
Size 3
Cycles 1
Pipeline X
This instruction decrements SP by 2, then moves the content of the source register (src) to the 16-bit data memory location pointed by SP and moves the content of the data memory (Smem) location to the 16-bit data memory location pointed by SP + 1. When the source register is an accumulator, the source accumulator low part, ACx(150), is moved to the 16-bit data memory operand.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax push(AC0, *AR3)
Description The data stack pointer (SP) is decremented by 2. The content of AC0(150) is copied to the memory location pointed by SP and the content addressed by AR3 is copied to the memory location pointed by SP + 1.
5-342
SPRU375G
No. [4]
Syntax dbl(push(ACx))
Size 2
Cycles 1
Pipeline X
This instruction decrements SP by 2, then moves the content of the accumulator high part ACx(3116) to the 16-bit data memory location pointed by SP and moves the content of the accumulator low part ACx(150) to the 16-bit data memory location pointed by SP + 1. Affected by Affects none none
Status Bits
Repeat Example
Syntax dbl(push(AC0))
Description The data stack pointer (SP) is decremented by 2. The content of AC0(3116) is copied to the memory location pointed by SP and the content of AC0(150) is copied to the memory location pointed by SP + 1.
SPRU375G
5-343
No. [5]
Syntax push(Smem)
Size 2
Cycles 1
Pipeline X
This instruction decrements SP by 1, then moves the content of the data memory (Smem) location to the 16-bit data memory location pointed by SP. Affected by Affects none none
Status Bits
Repeat Example
Syntax push(*AR1)
Description The data stack pointer (SP) decremented by 1. The content addressed by AR1 is copied to the memory location pointed by SP.
After 6903 0305 0000 0300 *AR1 SP 304 305 6903 0304 6903 0300
5-344
SPRU375G
No. [6]
Syntax push(dbl(Lmem))
Size 2
Cycles 1
Pipeline X
This instruction decrements SP by 2, then moves the 16 highest bits of data memory location Lmem to the 16-bit data memory location pointed by SP and moves the 16 lowest bits of data memory location Lmem to the 16-bit data memory location pointed by SP + 1. When Lmem is at an even address, the two 16-bit values pushed onto the stack are stored at memory location Lmem in the same order. When Lmem is at an odd address, the two 16-bit values pushed onto the stack are stored at memory location Lmem in the reverse order.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax push(dbl(*AR3))
Description The data stack pointer (SP) is decremented by 2. The 16 highest bits of the content at the location addressed by AR3 are copied to the memory location pointed by SP and the 16 lowest bits of the content at the location addressed by AR3 are copied to the memory location pointed by SP + 1. Because this instruction is a long-operand instruction, AR3 is decremented by 2 after the execution.
SPRU375G
5-345
Description
These instructions repeat a block of instructions the number of times specified by:
- the content of BRC0 + 1, if no loop has already been detected. - the content of BRS1 + 1, if one level of the loop has already been detected.
Loop structures defined by these instructions must have the following characteristics:
- The minimum number of instructions executed within one loop iteration is 2. - The minimum number of cycles executed within one loop iteration is 2. - The maximum loop size is 64K bytes. - The block-repeat counter registers (BRCx) must be read 3 full cycles
before the end of the loops in order to extract the correct loop iteration number from these registers without any pipeline stall.
- The block-repeat operation can only be cleared by branching to a
These instructions cannot be repeated. See section 1.5 for a list of instructions that cannot be used in a repeat block mechanism. Status Bits Affected by Affects See Also none none
5-346
SPRU375G
No. [1]
Syntax localrepeat{}
Size 2
Cycles 1
Pipeline AD
This instruction repeats a block of instructions the number of times specified by:
- the content of BRC0 + 1, if no loop has already been detected. In this case: J J
In the address phase of the pipeline, RSA0 is loaded with the program address of the first instruction of the loop. The program address of the last instruction of the loop (that may be two parallel instructions) is computed in the address phase of the pipeline and stored in REA0. BRC0 is decremented at the address phase of the last instruction of the loop when its content is not equal to 0. BRC0 contains 0 after the block-repeat operation has ended.
J J
- the content of BRS1 + 1, if one level of the loop has already been detected.
In this case:
J J J
BRC1 is loaded with the content of BRS1 in the address phase of the repeat block instruction. In the address phase of the pipeline, RSA1 is loaded with the program address of the first instruction of the loop. The program address of the last instruction of the loop (that may be two parallel instructions) is computed in the address phase of the pipeline and stored in REA1. BRC1 is decremented at the address phase of the last instruction of the loop when its content is not equal to 0. BRC1 contains 0 after the block-repeat operation has ended. BRS1 content is not impacted by the block-repeat operation.
Instruction Set Descriptions 5-347
J J J SPRU375G
Loop structures defined by this instruction must have the following characteristics:
- The minimum number of instructions executed within one loop iteration is 2. - The minimum number of cycles executed within one loop iteration is 2. - The maximum loop size is 64K bytes. - The block-repeat operation can only be cleared by branching to a
before the end of the loops in order to extract the correct loop iteration number from these registers without any pipeline stall.
- C54CM bit in ST1_55 cannot be modified within a block-repeat loop. - The following instructions cannot be used as the last instruction in the loop
structure:
while (cond && (RPTC < k8)) repeat if (cond) execute(AD_Unit) if (cond) execute(D_Unit) repeat(k8) repeat(k16) repeat(CSR) repeat(CSR), CSR += k4 repeat(CSR), CSR += TAx repeat(CSR), CSR = k4
A local loop is defined as when all the code of the loop is repeatedly executed from within the instruction buffer queue (IBQ):
- All the code of the local loop must fit within the 64-byte, 4-byte-aligned IBQ;
therefore, local repeat blocks are limited to 64 bytes minus the 0 to 3 bytes of first-instruction misalignment. The 64th byte of the IBQ can only occur in a paralleled instruction. See Figure 52 for legal uses of the localrepeat instruction.
- The following instructions cannot be used as the last instruction in the local
loop:
while (cond && (RPTC < k8)) repeat if (cond) execute(AD_Unit) if (cond) execute(D_Unit) repeat(k8) repeat(k16) repeat(CSR) repeat(CSR), CSR += k4 repeat(CSR), CSR += TAx repeat(CSR), CSR = k4
- Nested local repeat block instructions are allowed. - See section 1.5 for a list of instructions that cannot be used in the local loop
code.
5-348 Instruction Set Descriptions SPRU375G
branch instructions with a target branch address pointing to an instruction included within the loop code and being at a higher address than the branching instruction. In this case, the branch conditionally instruction is executed in 3 cycles and the condition is evaluated in the address phase of the pipeline (there is a 3-cycle latency on the condition setting). Compatibility with C54x devices (C54CM = 1) When C54CM =1:
- This instruction only uses block-repeat level 0; block-repeat level 1 is
disabled.
- The block-repeat active flag (BRAF) is set to 1. BRAF is cleared to 0 at the
block-repeat operations are supported using the C54x convention with context save/restore and BRAF. The control-flow context register (CFCT) values are not used.
- BRAF is automatically cleared to 0 when a far branch (FB) or far call
none none
SPRU375G
5-349
Figure 52. Legal Uses of Repeat Block of Instructions Unconditionally (localrepeat) Instruction
(a) 60-Byte Unaligned LoopLegal Use localrepeat { 1st instruction Last instruction }
next instruction
; no alignment directive
The entire localrepeat block and the next instruction reside in the IBQ, this code is accepted by the assembler.
(b) 61-Byte Unaligned Loop with Single Instruction at End of LoopIllegal Use localrepeat { 1st instruction Last instruction (nonparalleled = single) }
next instruction
; no alignment directive
The localrepeat instruction is not aligned; the next instruction may not be fetched in the IBQ. Because the last instruction of the localrepeat block is a nonparalleled (single) instruction, the CPU must confirm that the next instruction does not have a parallel enable bit; therefore, this code is rejected by the assembler.
5-350
SPRU375G
Figure 52. Legal Uses of Repeat Block of Instructions Unconditionally (localrepeat) Instruction (Continued)
(c) 61-Byte Unaligned Loop with Paralleled Instruction at End of LoopLegal Use localrepeat { 1st instruction Last instruction (paralleled) }
next instruction
; no alignment directive
The localrepeat instruction is not aligned; the next instruction may not be fetched in the IBQ. Because the last instruction of the localrepeat block is a paralleled instruction, the CPU does not need to confirm that the next instruction does not have a parallel enable bit; therefore, this code is accepted by the assembler.
(d) 61-Byte Aligned Loop with Single Instruction at End of LoopLegal Use
align 4
The localrepeat instruction is aligned, so the entire localrepeat block and the next instruction reside in the IBQ. Because the next instruction is in the IBQ, the CPU can confirm that the next instruction does not have a parallel enable bit; therefore, this code is accepted by the assembler.
SPRU375G
5-351
Figure 52. Legal Uses of Repeat Block of Instructions Unconditionally (localrepeat) Instruction (Continued)
(e) 62-Byte Unaligned LoopIllegal Use localrepeat { 1st instruction Last instruction }
next instruction
; no alignment directive
The localrepeat instruction is not aligned; the entire localrepeat block may not reside in the IBQ. Because the last instruction of the localrepeat block may not reside in the IBQ, this code is rejected by the assembler.
(f) 62-Byte Aligned Loop with Single Instruction at End of LoopLegal Use
align 4 nop_16||nop
The nop instructions are aligned so the localrepeat instruction, the entire localrepeat block, and the next instruction reside in the IBQ. Because the next instruction is in the IBQ, the CPU can confirm that the next instruction does not have a parallel enable bit; therefore, this code is accepted by the assembler.
5-352
SPRU375G
Figure 52. Legal Uses of Repeat Block of Instructions Unconditionally (localrepeat) Instruction (Continued)
(g) 64-Byte Aligned Loop with Paralleled Instruction at End of LoopLegal Use
align 4 nop_16
The nop instruction is aligned, so the localrepeat instruction and the entire localrepeat block reside in the IBQ; the next instruction is not fetched in the IBQ. Because the last instruction of the localrepeat block is a paralleled instruction, the CPU does not need to confirm that the next instruction does not have a parallel enable bit; therefore, this code is accepted by the assembler.
SPRU375G
5-353
No. [2]
Syntax blockrepeat{}
Size 3
Cycles 1
Pipeline AD
This instruction repeats a block of instructions the number of times specified by:
- the content of BRC0 + 1, if no loop has already been detected. In this case: J J
In the address phase of the pipeline, RSA0 is loaded with the program address of the first instruction of the loop. The program address of the last instruction of the loop (that may be two parallel instructions) is computed in the address phase of the pipeline and stored in REA0. BRC0 is decremented at the address phase of the last instruction of the loop when its content is not equal to 0. BRC0 contains 0 after the block-repeat operation has ended.
J J
- the content of BRS1 + 1, if one level of the loop has already been detected.
In this case:
J J J
BRC1 is loaded with the content of BRS1 in the address phase of the repeat block instruction. In the address phase of the pipeline, RSA1 is loaded with the program address of the first instruction of the loop. The program address of the last instruction of the loop (that may be two parallel instructions) is computed in the address phase of the pipeline and stored in REA1. BRC1 is decremented at the address phase of the last instruction of the loop when its content is not equal to 0. BRC1 contains 0 after the block-repeat operation has ended. BRS1 content is not impacted by the block-repeat operation.
SPRU375G
J J J 5-354
Loop structures defined by these instructions must have the following characteristics:
- The minimum number of instructions executed within one loop iteration is 2. - The minimum number of cycles executed within one loop iteration is 2. - The maximum loop size is 64K bytes. - The block-repeat operation can only be cleared by branching to a
before the end of the loops in order to extract the correct loop iteration number from these registers without any pipeline stall.
- C54CM bit in ST1_55 cannot be modified within a block-repeat loop. - The following instructions cannot be used as the last instruction in the loop
structure:
while (cond && (RPTC < k8)) repeat if (cond) execute(AD_Unit) if (cond) execute(D_Unit) repeat(k8) repeat(k16) repeat(CSR) repeat(CSR), CSR += k4 repeat(CSR), CSR += TAx repeat(CSR), CSR = k4
- See section 1.5 for a list of instructions that cannot be used in the
block-repeat loop code. Compatibility with C54x devices (C54CM = 1) When C54CM =1:
- This instruction only uses block-repeat level 0; block-repeat level 1 is
disabled.
- The block-repeat active flag (BRAF) is set to 1. BRAF is cleared to 0 at the
block-repeat operations are supported using the C54x convention with context save/restore and BRAF. The control-flow context register (CFCT) values are not used.
- BRAF is automatically cleared to 0 when a far branch (FB) or far call
Status Bits
Affected by Affects
none none
Repeat Example
Syntax blockrepeat
Description A block of instructions is repeated as defined by the content of BRC0 + 1. A second loop of instructions is repeated as defined by the content of BRS1 + 1 (BRC1 is loaded with the content of BRS1). Address BRC0 0003 ?* 004006 004009 00400B 00400D 004015 } 004017 ? ? ? ? ? DTZ** 0000 RSA0 0000 ? 4009 ? ? ? ? ? 4009 REA0 0000 ? 4017 ? ? ? ? ? 4017 BRS1 0000 0001 ? ? ? ? ? ? 0001 BRC1 0000 0001 ? ? (BRS1) ? DTZ** ? 0000 RSA1 0000 ? ? ? 400D ? ? ? 400D REA1 0000 ? ? ? 4015 ? ? ? 4015
5-356
SPRU375G
This instruction evaluates a single condition defined by the cond field and as long as the condition is true, the next instruction or the next two paralleled instructions is repeated the number of times specified by an 8-bit immediate value, k8 + 1. The maximum number of executions of a given instruction or paralleled instructions is 28 1 (255). See Table 13 for a list of conditions. The 8 LSBs of the repeat counter register (RPTC):
- Are loaded with the immediate value at the address phase of the pipeline. - Are decremented by 1 in the decode phase of the repeated instruction.
At each step of the iteration, the condition defined by the cond field is tested in the execute phase of the pipeline. When the condition becomes false, the instruction repetition stops.
- If the condition becomes false at any execution of the repeated instruction,
the 8 LSBs of RPTC are corrected to indicate exactly how many iterations were not performed.
- Since the condition is evaluated in the execute phase of the repeated
instruction, when the condition is tested false, some of the succeeding iterations of that repeated instruction may have gone through the address, access, and read phases of the pipeline. Therefore, they may have modified the pointer registers used in the DAGEN units to generate data memory operands addresses in the address phase. When the while/repeat structure is exited, reading the computed single-repeat register (CSR) content enables you to determine how many instructions have gone through the address phase of the pipeline. You may then use the Repeat Single Instruction Unconditionally instruction [3] to rewind the pointer registers. Note that this must only be performed when a false condition has been met inside the while/repeat structure.
SPRU375G Instruction Set Descriptions 5-357
- The following table provides the 8 LSBs of RPTC and CSR once the
The repeat single mechanism triggered by this instruction is interruptible. Saving and restoring the RPTC content in ISRs enables you to preserve the while/repeat structure context. When the while/repeat structure contains any form of a store-to-memory instruction, the store-to-memory instruction is only disabled one cycle after the condition is evaluated to be false. Therefore, the store-to-memory instruction is executed once more than other processing instructions updating CPU registers. This enables you to store the last values obtained in these registers when the condition was met. Instead of programming a number of iterations (minus 1) equal to 0, it is recommended that you use the conditional execute() structure. This instruction cannot be used as the last instruction in a repeat loop structure. See section 1.5 for a list of instructions that cannot be used in a repeat single mechanism. Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the comparison of accumulators to 0 is performed as if M40 was set to 1. Status Bits Affected by Affects Repeat
5-358
See Also
Example
Syntax while (AC1 > #0 && (RPTC < #7)) repeat Description As long as the content of AC1 is greater than 0 and the repeat counter is not equal to 0, the next single instruction is repeated as defined by the unsigned 8-bit value (7) + 1. At the address phase of the pipeline, RPTC is automatically initialized to 4107h and then is immediately decreased to 4106h. address: 004004 004008 00400B
After 00 2359 0340 0340 AC1 T0 00 1FC2 7B40 0340
while (AC1 > #0 && (RPTC < #7)) repeat AC1 = AC1 (T0 * *AR1)
Before AC1 T0 *AR1
2354 *AR1 2354 RPTC 4106 RPTC 0000 At the address phase of the pipeline, RPTC is automatically initialized to 4107h and then is immediately decreased to 4106h.
SPRU375G
5-359
Size 2 3 2
Cycles 1 1 1
Pipeline AD AD AD
Description
This instruction repeats the next instruction or the next two paralleled instructions the number of times specified by the content of the computed single repeat register (CSR) + 1 or an immediate value, kx + 1. This value is loaded into the repeat counter register (RPTC). The maximum number of executions of a given instruction or paralleled instructions is 216 1 (65535). The repeat single mechanism triggered by these instructions is interruptible. These instructions cannot be repeated. These instructions cannot be used as the last instruction in a repeat loop structure. Two paralleled instructions can be repeated when following the parallelism general rules. See section 1.5 for a list of instructions that cannot be used in a repeat single mechanism.
Status Bits
Affected by Affects
none none
See Also
5-360
SPRU375G
Size 2 3
Cycles 1 1
Pipeline AD AD
Opcode
k8 k16
0100 110E kkkk kkkk 0000 110E kkkk kkkk kkkk kkkk
Operands Description
kx This instruction repeats the next instruction or the next two paralleled instructions the number of times specified by an immediate value, kx + 1. The repeat counter register (RPTC):
- Is loaded with the immediate value in the address phase of the pipeline. - Is decremented by 1 in the decode phase of the repeated instruction. - Contains 0 at the end of the repeat single mechanism. - Must not be accessed when it is being decremented in the repeat single
mechanism. The repeat single mechanism triggered by this instruction is interruptible. Two paralleled instructions can be repeated when following the parallelism general rules. This instruction cannot be used as the last instruction in a repeat loop structure. See section 1.5 for a list of instructions that cannot be used in a repeat single mechanism. Status Bits Affected by Affects Repeat
SPRU375G
none none
Example 1
Syntax repeat(#3) AC1 = AC1 + *AR3+ * *AR4+
Before AC1 AR3 AR4 200 201 202 203 400 401 402 403 00 0000 0000 0200 0400 AC03 3468 FE00 23DC D768 6987 3400 7900 After AC1 AR3 AR4 200 201 202 203 400 401 402 403 00 3376 AD10 0204 0404 AC03 3468 FE00 23DC D768 6987 3400 7900
Description The single instruction following the repeat instruction is repeated four times.
Example 2
Syntax repeat(#513) Description A single instruction is repeated as defined by the unsigned 16-bit value + 1 (513 + 1).
5-362
SPRU375G
No. [3]
Syntax repeat(CSR)
Size 2
Cycles 1
Pipeline AD
This instruction repeats the next instruction or the next two paralleled instructions the number of times specified by the content of the computed single repeat register (CSR) + 1. The repeat counter register (RPTC):
- Is loaded with CSR content in the address phase of the pipeline. - Is decremented by 1 in the decode phase of the repeated instruction. - Contains 0 at the end of the repeat single mechanism. - Must not be accessed when it is being decremented in the repeat single
mechanism. The repeat single mechanism triggered by this instruction is interruptible. Two paralleled instructions can be repeated when following the parallelism general rules. This instruction cannot be used as the last instruction in a repeat loop structure. See section 1.5 for a list of instructions that cannot be used in a repeat single mechanism. Status Bits Affected by Affects Repeat none none
SPRU375G
5-363
Example
Syntax repeat(CSR) AC1 = AC1 + *AR3+ * *AR4+
Before AC1 CSR AR3 AR4 200 201 202 203 400 401 402 403 00 0000 0000 0003 0200 0400 AC03 3468 FE00 23DC D768 6987 3400 7900
Description The single instruction following the repeat instruction is repeated as defined by the content of CSR + 1.
After AC1 CSR AR3 AR4 200 201 202 203 400 401 402 403 00 3376 AD10 0003 0204 0404 AC03 3468 FE00 23DC D768 6987 3400 7900
5-364
SPRU375G
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction repeats the next instruction or the next two paralleled instructions the number of times specified by the content of the computed single repeat register (CSR) + 1. The repeat counter register (RPTC):
- Is loaded with CSR content in the address phase of the pipeline. - Is decremented by 1 in the decode phase of the repeated instruction. - Contains 0 at the end of the repeat single mechanism. - Must not be accessed when it is being decremented in the repeat single
mechanism. With the A-unit ALU, this instruction allows the content of CSR to be decremented by k4. The CSR modification is performed in the execute phase of the pipeline; there is a 3-cycle latency between the CSR modification and its usage in the address phase. The repeat single mechanism triggered by this instruction is interruptible. Two paralleled instructions can be repeated when following the parallelism general rules. This instruction cannot be used as the last instruction in a repeat loop structure. See section 1.5 for a list of instructions that cannot be used in a repeat single mechanism. Status Bits Affected by Affects Repeat
SPRU375G
none none
See Also
Example
Syntax repeat(CSR), CSR = #2 Description A single instruction is repeated as defined by the content of CSR + 1. The content of CSR is decremented by the unsigned 4-bit value (2).
5-366
SPRU375G
Size 2 2
Cycles 1 1
Pipeline X X
Description
These instructions repeat the next instruction or the next two paralleled instructions the number of times specified by the content of the computed single repeat register (CSR) + 1. This value is loaded into the repeat counter register (RPTC). The maximum number of executions of a given instruction or paralleled instructions is 216 1 (65535). With the A-unit ALU, these instructions allow the content of CSR to be incremented. The CSR modification is performed in the execute phase of the pipeline; there is a 3-cycle latency between the CSR modification and its usage in the address phase. The repeat single mechanism triggered by these instructions is interruptible. Two paralleled instructions can be repeated when following the parallelism general rules. These instructions cannot be repeated. These instructions cannot be used as the last instruction in a repeat loop structure. See section 1.5 for a list of instructions that cannot be used in a repeat single mechanism.
Status Bits
Affected by Affects
none none
See Also
SPRU375G
5-367
This instruction repeats the next instruction or the next two paralleled instructions the number of times specified by the content of the computed single repeat register (CSR) + 1. The repeat counter register (RPTC):
- Is loaded with CSR content in the address phase of the pipeline. - Is decremented by 1 in the decode phase of the repeated instruction. - Contains 0 at the end of the repeat single mechanism. - Must not be accessed when it is being decremented in the repeat single
mechanism. With the A-unit ALU, this instruction allows the content of CSR to be incremented by the content of TAx. The CSR modification is performed in the execute phase of the pipeline; there is a 3-cycle latency between the CSR modification and its usage in the address phase. The repeat single mechanism triggered by this instruction is interruptible. Two paralleled instructions can be repeated when following the parallelism general rules. This instruction cannot be used as the last instruction in a repeat loop structure. See section 1.5 for a list of instructions that cannot be used in a repeat single mechanism. Status Bits Affected by Affects Repeat Example
Syntax repeat(CSR), CSR += T1 Description A single instruction is repeated as defined by the content of CSR + 1. The content of CSR is incremented by the content of temporary register T1.
none none
5-368
SPRU375G
This instruction repeats the next instruction or the next two paralleled instructions the number of times specified by the content of the computed single repeat register (CSR) + 1. The repeat counter register (RPTC):
- Is loaded with CSR content in the address phase of the pipeline. - Is decremented by 1 in the decode phase of the repeated instruction. - Contains 0 at the end of the repeat single mechanism. - Must not be accessed when it is being decremented in the repeat single
mechanism. With the A-unit ALU, this instruction allows the content of CSR to be incremented by k4. The CSR modification is performed in the execute phase of the pipeline; there is a 3-cycle latency between the CSR modification and its usage in the address phase. The repeat single mechanism triggered by this instruction is interruptible. Two paralleled instructions can be repeated when following the parallelism general rules. This instruction cannot be used as the last instruction in a repeat loop structure. See section 1.5 for a list of instructions that cannot be used in a repeat single mechanism. Status Bits Affected by Affects Repeat Example
Syntax repeat(CSR), CSR += #2 Description A single instruction is repeated as defined by the content of CSR + 1. The content of CSR is incremented by the unsigned 4-bit value (2).
none none
SPRU375G
5-369
Return Conditionally
Syntax Characteristics
Parallel Enable Bit Yes Cycles 5/5
No. [1]
Size 3
Pipeline R
This instructions evaluates a single condition defined by the cond field in the read phase of the pipeline. If the condition is true, a return occurs to the return address of the calling subroutine. There is a 1-cycle latency on the condition setting. A single condition can be tested as determined by the cond field of the instruction. See Table 13 for a list of conditions. After returning from a called subroutine, the CPU restores the value of two internal registers: the program counter (PC) and a loop context register. The CPU uses these values to re-establish the context of the program sequence. In the slow-return process (default), the return address (from the PC) and the loop context bits are restored from the stacks (in memory). When the CPU returns from a subroutine, the speed at which these values are restored is dependent on the speed of the memory accesses. In the fast-return process, the return address (from the PC) and the loop context bits are restored from the return address register (RETA) and the control-flow context register (CFCT). You can read from or write to RETA and CFCT as a pair with dedicated, 32-bit load and store instructions. For fastreturn mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371). When a return from a subroutine occurs:
- The loop context bits concatenated with the 8 MSBs of the return address
are popped from the top of the system stack pointer (SSP). The SSP is incremented by 1 word in the read phase of the pipeline.
- The 16 LSBs of the return address are popped from the top of the data
stack pointer (SP). The SP is incremented by 1 word in the read phase of the pipeline.
5-370 Instruction Set Descriptions SPRU375G
System Stack (SSP) Before Return SSP = x (Loop bits):PC(2316) Previously stored data Before Return SP = y
After SP = y + 1 Return R t
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, the comparison of accumulators to 0 is performed as if M40 was set to 1. Status Bits Affected by Affects Repeat See Also ACOVx, CARRY, C54CM, M40, TCx ACOVx
This instruction cannot be repeated. See the following other related instructions:
- Call Conditionally - Call Unconditionally - Return from Interrupt - Return Unconditionally
Example
Syntax if (ACOV0 = #0) return Description The AC0 overflow bit is equal to 0, the program counter (PC) is loaded with the return address of the calling subroutine.
After 0 ACOV0 PC SP 0 (return address)
Before ACOV0 PC SP
SPRU375G
5-371
Return Unconditionally
Syntax Characteristics
Parallel Enable Bit Yes
No. [1]
Syntax return
Size 2
Cycles 5
Pipeline D
This instruction passes control back to the calling subroutine. After returning from a called subroutine, the CPU restores the value of two internal registers: the program counter (PC) and a loop context register. The CPU uses these values to re-establish the context of the program sequence. In the slow-return process (default), the return address (from the PC) and the loop context bits are restored from the stacks (in memory). When the CPU returns from a subroutine, the speed at which these values are restored is dependent on the speed of the memory accesses. In the fast-return process, the return address (from the PC) and the loop context bits are restored from the return address register (RETA) and the control-flow context register (CFCT). You can read from or write to RETA and CFCT as a pair with dedicated, 32-bit load and store instructions. For fastreturn mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371).
- The loop context bits concatenated with the 8 MSBs of the return address
are popped from the top of the system stack pointer (SSP). The SSP is incremented by 1 word in the address phase of the pipeline.
- The 16 LSBs of the return address are popped from the top of the data
stack pointer (SP). The SP is incremented by 1 word in the address phase of the pipeline.
System Stack (SSP) Before Return SSP = x (Loop bits):PC(2316) Previously stored data Before Return SP = y Data Stack (SP) PC(150) Previously stored data
After SP = y + 1 Return R
5-372
SPRU375G
Status Bits
Affected by Affects
none none
This instruction cannot be repeated. See the following other related instructions:
- Call Conditionally - Call Unconditionally - Return Conditionally - Return from Interrupt
Example
Syntax return Description The program counter is loaded with the return address of the calling subroutine.
SPRU375G
5-373
This instruction passes control back to the interrupted task. After returning from an interrupt service routine (ISR), the CPU automatically restores the value of some CPU registers and two internal registers: the program counter (PC) and a loop context register. The CPU uses these values to re-establish the context of the program sequence. In the slow-return process (default), the return address (from the PC), the loop context bits, and some CPU registers are restored from the stacks (in memory). When the CPU returns from an ISR, the speed at which these values are restored is dependent on the speed of the memory accesses. In the fast-return process, the return address (from the PC) and the loop context bits are restored from the return address register (RETA) and the control-flow context register (CFCT). You can read from or write to RETA and CFCT as a pair with dedicated, 32-bit load and store instructions. Some CPU registers are restored from the stacks (in memory). For fast-return mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371).
- The loop context bits concatenated with the 8 MSBs of the return address
are popped from the top of the system stack pointer (SSP). The SSP is incremented by 1 word in the address phase of the pipeline.
- The 16 LSBs of the return address are popped from the top of the data
stack pointer (SP). The SP is incremented by 1 word in the address phase of the pipeline.
- The debug status register (DBSTAT) content is popped from the top of
SSP. The SSP is incremented by 1 word in the access phase of the pipeline.
- The status register 1 (ST1_55) content is popped from the top of SP. The
are popped from the top of SSP. The SSP is incremented by 1 word in the read phase of the pipeline.
5-374 Instruction Set Descriptions SPRU375G
- The status register 2 (ST2_55) content is popped from the top of SP. The
Status Bits
Affected by Affects
none none
This instruction cannot be repeated. See the following other related instructions:
- Return Conditionally - Return Unconditionally - Software Interrupt - Software Trap
Example
Syntax return_int Description The program counter (PC) is loaded with the return address of the interrupted task.
SPRU375G
5-375
This instruction performs a bitwise rotation to the MSBs. Both TC2 and CARRY can be used to shift in one bit (BitIn) or to store the shifted out bit (BitOut). The one bit in BitIn is shifted into the source (src) operand and the shifted out bit is stored to BitOut.
- When the destination (dst) operand is an accumulator: J J J J
if an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the register are zero extended to 40 bits the operation is performed on 40 bits in the D-unit shifter BitIn is inserted at bit position 0 BitOut is extracted at a bit position according to M40
if an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation the operation is performed on 16 bits in the A-unit ALU BitIn is inserted at bit position 0 BitOut is extracted at bit position 15
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects
5-376 Instruction Set Descriptions
This instruction can be repeated. See the following other related instructions:
- Rotate Right Accumulator, Auxiliary, or Temporary Register Content
Example
Syntax AC1 = CARRY \\ AC1 \\ TC2 Description The value of TC2 (1) before the execution of the instruction is shifted into the LSB of AC1 and bit 31 shifted out from AC1 is stored in the CARRY status bit. The rotated value is stored in AC1. Because M40 = 0, the guard bits (3932) are cleared.
After 0F E340 5678 1 1 0 AC1 TC2 CARRY M40 00 C680 ACF1 1 1 0
SPRU375G
5-377
This instruction performs a bitwise rotation to the LSBs. Both TC2 and CARRY can be used to shift in one bit (BitIn) or to store the shifted out bit (BitOut). The one bit in BitIn is shifted into the source (src) operand and the shifted out bit is stored to BitOut.
- When the destination (dst) operand is an accumulator: J J J J
if an auxiliary or temporary register is the source (src) operand of the instruction, the 16 LSBs of the register are zero extended to 40 bits the operation is performed on 40 bits in the D-unit shifter BitIn is inserted at a bit position according to M40 BitOut is extracted at bit position 0
if an accumulator is the source (src) operand of the instruction, the 16 LSBs of the accumulator are used to perform the operation the operation is performed on 16 bits in the A-unit ALU BitIn is inserted at bit position 15 BitOut is extracted at bit position 0
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects
5-378 Instruction Set Descriptions
This instruction can be repeated. See the following other related instructions:
- Rotate Left Accumulator, Auxiliary, or Temporary Register Content
Example
Syntax AC1 = TC2 // AC0 // TC2 Description The value of TC2 (1) before the execution of the instruction is shifted into bit 31 of AC0 and the LSB shifted out from AC0 is stored in TC2. The rotated value is stored in AC1. Because M40 = 0, the guard bits (3932) are cleared.
After 5F B000 1234 00 C680 ACF1 1 0 AC0 AC1 TC2 M40 5F B000 1234 00 D800 091A 0 0
SPRU375G
5-379
This instruction performs a rounding of the source accumulator ACx in the D-unit ALU.
- The rounding operation depends on RDM: J J
When RDM = 0, the biased rounding to the infinite is performed. 8000h (215) is added to the 40-bit source accumulator ACx. When RDM = 1, the unbiased rounding to the nearest is performed. According to the value of the 17 LSBs of the 40-bit source accumulator ACx, 8000h (215) is added:
if( 8000h < bit(150) < 10000h) add 8000h to the 40-bit source accumulator ACx else if( bit(150) == 8000h) if( bit(16) == 1) add 8000h to the 40-bit source accumulator ACx
If a rounding has been performed, the 16 lowest bits of the result are cleared to 0.
- Addition overflow detection depends on M40. - No addition carry report is stored in CARRY status bit. - If an overflow is detected, the destination accumulator overflow status bit
(ACOVy) is set.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, the rounding is performed without clearing the LSBs of accumulator ACx.
5-380 Instruction Set Descriptions SPRU375G
Status Bits
Affected by Affects
Repeat Example
Syntax AC1 = rnd(AC0)
Description The content of AC0 is added to 8000h, the 16 LSBs are cleared to 0, and the result is stored in AC1. M40 is cleared to 0, so overflow is detected at bit 31; SATD is cleared to 0, so AC1 is not saturated.
After EF 0FF0 8023 00 0000 0000 1 0 0 0 AC0 AC1 RDM M40 SATD ACOV1 EF 0FF0 8023 EF 0FF1 0000 1 0 0 1
SPRU375G
5-381
This instruction performs a saturation of the source accumulator ACx to the 32-bit width frame in the D-unit ALU.
- A rounding is performed if the optional rnd keyword is applied to the
When RDM = 0, the biased rounding to the infinite is performed. 8000h (215) is added to the 40-bit source accumulator ACx. When RDM = 1, the unbiased rounding to the nearest is performed. According to the value of the 17 LSBs of the 40-bit source accumulator ACx, 8000h (215) is added:
if( 8000h < bit(150) < 10000h) add 8000h to the 40-bit source accumulator ACx else if( bit(150) == 8000h) if( bit(16) == 1) add 8000h to the 40-bit source accumulator ACx
If a rounding has been performed, the 16 lowest bits of the result are cleared to 0.
- An overflow is detected at bit position 31. - No addition carry report is stored in CARRY status bit. - If an overflow is detected, the destination accumulator overflow status bit
(ACOVy) is set.
- When an overflow is detected, the destination register is saturated.
Saturation values are 00 7FFF FFFFh FF 8000 0000h (negative overflow). Compatibility with C54x devices (C54CM = 1)
(positive
overflow)
or
When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, the rounding is performed without clearing the LSBs of accumulator ACx.
5-382 Instruction Set Descriptions SPRU375G
Status Bits
Affected by Affects
Repeat Example 1
Syntax AC1 = saturate(AC0)
Description The 32-bit width content of AC0 is saturated and the saturated value, FF 8000 0000, is stored in AC1.
After EF 0FF0 8023 00 0000 0000 0 AC0 AC1 ACOV1 EF 0FF0 8023 FF 8000 0000 1
Example 2
Syntax AC1 = saturate(rnd(AC0))
Before AC0 AC1 RDM ACOV1 00 7FFF 8000 00 0000 0000 0 0
Description The 32-bit width content of AC0 is saturated. The saturated value, 00 7FFF FFFFh, is rounded, 16 LSBs are cleared, and stored in AC1.
After AC0 AC1 RDM ACOV1 00 7FFF 8000 00 7FFF 0000 0 1
SPRU375G
5-383
temporary register. The instruction sets to 1 a single bit, as defined by the bit addressing mode, Baddr, of the source register. The generated bit address must be within:
- 039 when accessing accumulator bits (only the 6 LSBs of the generated
bit address are used to determine the bit position). If the generated bit address is not within 039, the selected register bit value does not change.
- 015 when accessing auxiliary or temporary register bits (only the 4 LSBs
of the generated address are used to determine the bit position). Status Bits Affected by Affects Repeat See Also none none
This instruction can be repeated. See the following other related instructions:
- Clear Accumulator, Auxiliary, or Temporary Register Bit - Complement Accumulator, Auxiliary, or Temporary Register Bit - Set Memory Bit - Set Status Register Bit
Example
Syntax bit(AC0, AR3) = #1 Description The bit at the position defined by the content of AR3(40) in AC0 is set to 1.
5-384
SPRU375G
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction performs a bit manipulation in the A-unit ALU. The instruction sets to 1 a single bit, as defined by the content of the source (src) operand, of a memory (Smem) location. The generated bit address must be within 015 (only the 4 LSBs of the register are used to determine the bit position).
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Clear Memory Bit - Complement Memory Bit - Set Accumulator, Auxiliary, or Temporary Register Bit - Set Status Register Bit
Example
Syntax bit(*AR3, AC0) = #1 Description The bit at the position defined by AC0(30) in the content addressed by AR3 is set to 1.
SPRU375G
5-385
Size 2 2 2 2
Cycles 1 1 1 1
Pipeline X X X X
When this instruction is decoded to modify status bit CAFRZ (15), CAEN (14), or CACLR (13), the CPU pipeline is flushed and the instruction is executed in 5 cycles regardless of the instruction context.
Opcode
0100 011E kkkk 0001 0100 011E kkkk 0011 0100 011E kkkk 0101 0100 011E kkkk 0111
Operands Description
k4, STx These instructions perform a bit manipulation in the A-unit ALU. These instructions set to 1 a single bit, as defined by a 4-bit immediate value, k4, in the selected status register (ST0, ST1, ST2, or ST3). Compatibility with C54x devices (C54CM = 1) C55x DSP status registers bit mapping (Figure 53, page 5-388) does not correspond to C54x DSP status register bits.
Status Bits
Affected by Affects
This instruction cannot be repeated. See the following other related instructions:
- Clear Status Register Bit - Set Accumulator, Auxiliary, or Temporary Register Bit - Set Memory Bit
5-386
SPRU375G
Example
Syntax bit(ST0, ST0_CARRY) = #1; ST0_CARRY = bit 11 Description The ST0 bit position defined by the label (ST0_CARRY, bit 11) is set to 1.
SPRU375G
5-387
Legend: R = Read; W = Write; -n = Value after reset Highlighted bit: If you write to the protected address of the status register, a write to this bit has no effect, and the bit always appears as a 0 during read operations. The HINT bit is not used for all C55x host port interfaces (HPIs). Consult the documentation for the specific C55x DSP. The reset value of MPNMC may be dependent on the state of predefined pins at reset. To check this for a particular C55x DSP, see the boot loader section of its data sheet.
5-388
SPRU375G
Size 2 2
Cycles 1 1
Pipeline X X
Opcode
TC1 TC2
Operands Description
ACx, TCx If the source accumulator ACx(390) is equal to 0, this instruction sets the TCx status bit to 1. If the source accumulator ACx(310) has two sign bits:
- this instruction shifts left the 32-bit accumulator ACx by 1 bit - the TCx status bit is cleared to 0
If the source accumulator ACx(310) does not have two sign bits, this instruction sets the TCx status bit to 1. The sign bits are extracted at bit positions 31 and 30. Status Bits Affected by Affects Repeat See Also none TCx
This instruction can be repeated. See the following other related instructions:
- Shift Accumulator Content Logically - Shift Accumulator, Auxiliary, or Temporary Register Content Logically - Signed Shift of Accumulator Content - Signed Shift of Accumulator, Auxiliary, or Temporary Register Content
SPRU375G
5-389
Example 1
Syntax AC0 = sftc(AC0, TC1) Description Because AC0(31) XORed with AC0(30) equals 1, the content of AC0 is not shifted left and TC1 is set to 1.
After AC0 TC1
FF 8765 0055 0
FF 8765 0055 1
Example 2
Syntax AC0 = sftc(AC0, TC2) Description Because AC0(31) XORed with AC0(30) equals 0, the content of AC0 is shifted left by 1 bit and TC2 is cleared to 0.
After AC0 TC2
00 1234 0000 0
00 2468 0000 0
5-390
SPRU375G
Size 2 3
Cycles 1 1
Pipeline X X
Description
These instructions perform an unsigned shift by an immediate value, SHIFTW, or the content of a temporary register (Tx) in the D-unit shifter. Affected by Affects C54CM, M40 CARRY
Status Bits
See Also
SPRU375G
5-391
This instruction shifts by the temporary register (Tx) content the accumulator (ACx) content and stores the shifted-out bit in the CARRY status bit. If the 16-bit value contained in Tx is out of the 32 to +31 range, the shift is saturated to 32 or +31 and the shift operation is performed with this value. However, no overflow is reported when such saturation occurs.
- The operation is performed on 40 bits in the D-unit shifter. - The shift operation is performed according to M40. - The CARRY status bit contains the shifted-out bit. When the shift count is
zero, Tx = 0, the CARRY status bit is cleared to 0. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, the 6 LSBs of Tx define the shift quantity within 32 to +31. When the value is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat Example
Syntax AC1 = AC0 >>> T0 Description The content of AC0 is logically shifted right by the content of T0 and the result is stored in AC1. There is a right shift because the content of T0 is negative (6). Because M40 = 0, the guard bits (3932) are cleared.
After 5F B000 1234 00 C680 ACF0 FFFA 0 AC0 AC1 T0 M40 5F B000 1234 00 02C0 0048 FFFA 0
5-392
SPRU375G
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction shifts by a 6-bit value, SHIFTW, the accumulator (ACx) content and stores the shifted-out bit in the CARRY status bit.
- The operation is performed on 40 bits in the D-unit shifter. - The shift operation is performed according to M40. - The CARRY status bit contains the shifted-out bit. When the shift count is
zero, SHIFTW = 0, the CARRY status bit is cleared to 0. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 <<< #31 Description The content of AC1 is logically shifted left by 31 bits and the result is stored in AC0.
M40 CARRY
SPRU375G
5-393
Size 2 2
Cycles 1 1
Pipeline X X
Description
register (TAx). Status Bits Affected by Affects See Also C54CM, M40 CARRY
5-394
SPRU375G
This instruction shifts left by 1 bit the input operand (dst). The CARRY status bit contains the shifted-out bit.
- When the destination operand (dst) is an accumulator: J J J
The operation is performed on 40 bits in the D-unit shifter. 0 is inserted at bit position 0. The shifted-out bit is extracted at a bit position according to M40.
The operation is performed on 16 bits in the A-unit ALU. 0 is inserted at bit position 0. The shifted-out bit is extracted at bit position 15 and stored in the CARRY status bit.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC1 = AC1 <<< #1 Description The content of AC1 is logically shifted left by 1 bit and the result is stored in AC1. Because M40 = 0, the CARRY status bit is extracted at bit 31 and the guard bits (3932) are cleared.
After 8F E340 5678 0 0 AC1 CARRY M40 00 C680 ACF0 1 0
M40 CARRY
SPRU375G
5-395
No. [2]
Size 2
Cycles 1
Pipeline X
This instruction shifts right by 1 bit the input operand (dst). The CARRY status bit contains the shifted-out bit.
- When the destination operand (dst) is an accumulator: J J J
The operation is performed on 40 bits in the D-unit shifter. 0 is inserted at a bit position according to M40. The shifted-out bit is extracted at bit position 0 and stored in the CARRY status bit.
The operation is performed on 16 bits in the A-unit ALU. 0 is inserted at bit position 15. The shifted-out bit is extracted at bit position 0 and stored in the CARRY status bit.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 >>> #1 Description The content of AC0 is logically shifted right by 1 bit and the result is stored in AC0.
M40 CARRY
5-396
SPRU375G
Syntax ACy = ACx << Tx ACy = ACx <<C Tx ACy = ACx << #SHIFTW ACy = ACx <<C #SHIFTW
Size 2 2 3 3
Cycles 1 1 1 1
Pipeline X X X X
Description
These instructions perform a signed shift by an immediate value, SHIFTW, or by the content of a temporary register (Tx) in the D-unit shifter. Affected by Affects C54CM, M40, SATA, SATD, SXMD ACOVx, ACOVy, CARRY
Status Bits
See Also
SPRU375G
5-397
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction shifts by the temporary register (Tx) content the accumulator (ACx) content. If the 16-bit value contained in Tx is out of the 32 to +31 range, the shift is saturated to 32 or +31 and the shift operation is performed with this value; a destination accumulator overflow is reported when such saturation occurs.
- The operation is performed on 40 bits in the D-unit shifter. - When M40 = 0, the input to the shifter is modified according to SXMD and
if SXMD = 0, 0 is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter if SXMD = 1, bit 31 of the source operand is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter
- The sign position of the source operand is compared to the shift quantity.
if M40 =0, comparison is performed versus bit 31 if M40 =1, comparison is performed versus bit 39
- 0 is inserted at bit position 0. - The shifted-out bit is extracted according to M40. - After shifting, unless otherwise noted, when M40 = 0: J J
overflow is detected at bit position 31 (if an overflow is detected, the destination ACOVy bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow)
SPRU375G
5-398
overflow is detected at bit position 39 (if an overflow is detected, the destination ACOVy bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 7F FFFF FFFFh (positive overflow) or 80 0000 0000h (negative overflow)
Tx define a shift quantity within 32 to +31. When the value is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 << T0 Description The content of AC1 is shifted by the content of T0 and the result is stored in AC0.
SPRU375G
5-399
This instruction shifts by the temporary register (Tx) content the accumulator (ACx) content and stores the shifted-out bit in the CARRY status bit. If the 16-bit value contained in Tx is out of the 32 to +31 range, the shift is saturated to 32 or +31 and the shift operation is performed with this value; a destination accumulator overflow is reported when such saturation occurs.
- The operation is performed on 40 bits in the D-unit shifter. - When M40 = 0, the input to the shifter is modified according to SXMD and
if SXMD = 0, 0 is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter if SXMD = 1, bit 31 of the source operand is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter
- The sign position of the source operand is compared to the shift quantity.
if M40 =0, comparison is performed versus bit 31 if M40 =1, comparison is performed versus bit 39
- 0 is inserted at bit position 0. - The shifted-out bit is extracted according to M40 and stored in the CARRY
status bit. When the shift count is zero, Tx = 0, the CARRY status bit is cleared to 0.
- After shifting, unless otherwise noted, when M40 = 0: J J
overflow is detected at bit position 31 (if an overflow is detected, the destination ACOVy bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow)
SPRU375G
5-400
overflow is detected at bit position 39 (if an overflow is detected, the destination ACOVy bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 7F FFFF FFFFh (positive overflow) or 80 0000 0000h (negative overflow)
Tx define a shift quantity within 32 to +31. When the value is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat Example
Syntax AC2 = AC2 <<C T1 Description The content of AC2 is shifted left by the content of T1 and the saturated result is stored in AC2. The shifted out bit is stored in the CARRY status bit. Since SATD = 1 and M40 = 0, AC2 = FF 8000 0000 (saturation).
After AC2 T1 CARRY M40 ACOV2 SXMD SATD
SPRU375G
5-401
This instruction shifts by a 6-bit value, SHIFTW, the accumulator (ACx) content.
- The operation is performed on 40 bits in the D-unit shifter. - When M40 = 0, the input to the shifter is modified according to SXMD and
if SXMD = 0, 0 is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter if SXMD = 1, bit 31 of the source operand is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter
- The sign position of the source operand is compared to the shift quantity.
if M40 =0, comparison is performed versus bit 31 if M40 =1, comparison is performed versus bit 39
- 0 is inserted at bit position 0. - The shifted-out bit is extracted according to M40. - After shifting, unless otherwise noted, when M40 = 0: J J
overflow is detected at bit position 31 (if an overflow is detected, the destination ACOVy bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow)
overflow is detected at bit position 39 (if an overflow is detected, the destination ACOVy bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 7F FFFF FFFFh (positive overflow) or 80 0000 0000h (negative overflow)
SPRU375G
5-402
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, these instructions are executed as if M40 status bit was locally set to 1. There is no overflow detection, overflow report, and saturation performed by the D-unit shifter. Status Bits Affected by Affects Repeat Example 1
Syntax AC0 = AC1 << #31 Description The content of AC1 is shifted left by 31 bits and the result is stored in AC0.
Example 2
Syntax AC0 = AC1 << #32 Description The content of AC1 is shifted right by 32 bits and the result is stored in AC0.
SPRU375G
5-403
No. [4]
Size 3
Cycles 1
Pipeline X
This instruction shifts by a 6-bit value, SHIFTW, the accumulator (ACx) content and stores the shifted-out bit in the CARRY status bit.
- The operation is performed on 40 bits in the D-unit shifter. - When M40 = 0, the input to the shifter is modified according to SXMD and
if SXMD = 0, 0 is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter if SXMD = 1, bit 31 of the source operand is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter
- The sign position of the source operand is compared to the shift quantity.
if M40 =0, comparison is performed versus bit 31 if M40 =1, comparison is performed versus bit 39
- 0 is inserted at bit position 0. - The shifted-out bit is extracted according to M40 and stored in the CARRY
status bit. When the shift count is zero, SHIFTW = 0, the CARRY status bit is cleared to 0.
- After shifting, unless otherwise noted, when M40 = 0: J J
overflow is detected at bit position 31 (if an overflow is detected, the destination ACOVy bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow)
SPRU375G
5-404
overflow is detected at bit position 39 (if an overflow is detected, the destination ACOVy bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 7F FFFF FFFFh (positive overflow) or 80 0000 0000h (negative overflow)
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, these instructions are executed as if M40 status bit was locally set to 1. There is no overflow detection, overflow report, and saturation performed by the D-unit shifter. Status Bits Affected by Affects Repeat Example
Syntax AC1 = AC0 <<C #5 Description The content of AC0 is shifted right by 5 bits and the result is stored in AC1. The shifted out bit is stored in the CARRY status bit.
After AC0 AC1 CARRY SXMD
SPRU375G
5-405
Size 2 2
Cycles 1 1
Pipeline X X
Description
register (TAx). Status Bits Affected by Affects See Also C54CM, M40, SATA, SATD, SXMD ACOVx, ACOVy, CARRY
5-406
SPRU375G
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction shifts right by 1 bit the content of the destination register (dst). If the destination operand (dst) is an accumulator:
- The operation is performed on 40 bits in the D-unit shifter. - When M40 = 0, the input to the shifter is modified according to SXMD and
if SXMD = 0, 0 is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter if SXMD = 1, bit 31 of the source operand is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter
- Bit 39 is extended according to SXMD - The shifted-out bit is extracted at bit position 0. - After shifting, unless otherwise noted, when M40 = 0: J J
overflow is detected at bit position 31 if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow)
overflow is detected at bit position 39 if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 7F FFFF FFFFh (positive overflow) or 80 0000 0000h (negative overflow)
SPRU375G
5-407
overflow is detected at bit position 15 if SATA = 1, when an overflow is detected, the destination register saturation values are 7FFFh (positive overflow) or 8000h (negative overflow)
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, these instructions are executed as if M40 status bit was locally set to 1. There is no overflow detection, overflow report, and saturation performed by the D-unit shifter. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 >> #1 Description The content of AC0 is shifted right by 1 bit and the result is stored in AC0.
5-408
SPRU375G
This instruction shifts left by 1 bit the content of the destination register (dst). If the destination operand (dst) is an accumulator:
- The operation is performed on 40 bits in the D-unit shifter. - When M40 = 0, the input to the shifter is modified according to SXMD and
if SXMD = 0, 0 is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter if SXMD = 1, bit 31 of the source operand is substituted for the guard bits (3932) as the input, instead of ACx(3932), to the shifter
- The sign position of the source operand is compared to the shift quantity.
if M40 =0, comparison is performed versus bit 31 if M40 =1, comparison is performed versus bit 39
- 0 is inserted at bit position 0. - The shifted-out bit is extracted according to M40. - After shifting, unless otherwise noted, when M40 = 0: J J
overflow is detected at bit position 31 (if an overflow is detected, the destination ACOVx bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow)
overflow is detected at bit position 39 (if an overflow is detected, the destination ACOVx bit is set) if SATD = 1, when an overflow is detected, the destination accumulator saturation values are 7F FFFF FFFFh (positive overflow) or 80 0000 0000h (negative overflow)
Instruction Set Descriptions 5-409
SPRU375G
overflow is detected at bit position 15 (if an overflow is detected, the destination ACOVx bit is set) if SATA = 1, when an overflow is detected, the destination register saturation values are 7FFFh (positive overflow) or 8000h (negative overflow)
Compatibility with C54x devices (C54CM = 1) When C54CM = 1, these instructions are executed as if M40 status bit was locally set to 1. There is no overflow detection, overflow report, and saturation performed by the D-unit shifter. Status Bits Affected by Affects Repeat Example
Syntax T2 = T2 << #1
Before T2 SATA
Description The content of T2 is shifted left by 1 bit and the result is stored in T2.
After T2 SATA
EF27 1
DE4E 1
5-410
SPRU375G
Software Interrupt
Syntax Characteristics
No. [1] Syntax intr(k5) Parallel Enable Bit No Size 2 Cycles 3 Pipeline D
This instruction passes control to a specified interrupt service routine (ISR) and interrupts are globally disabled (INTM bit is set to 1 after ST1_55 content is pushed onto the data stack pointer). The ISR address is stored at the interrupt vector address defined by the content of an interrupt vector pointer (IVPD or IVPH) combined with the 5-bit constant, k5. This instruction is executed regardless of the value of INTM bit. Note: DBSTAT (the debug status register) holds debug context information used during emulation. Make sure the ISR does not modify the value that will be returned to DBSTAT. Before beginning an ISR, the CPU automatically saves the value of some CPU registers and two internal registers: the program counter (PC) and a loop context register. The CPU can use these values to re-establish the context of the interrupted program sequence when the ISR is done. In the slow-return process (default), the return address (from the PC), the loop context bits, and some CPU registers are stored to the stacks (in memory). When the CPU returns from an ISR, the speed at which these values are restored is dependent on the speed of the memory accesses. In the fast-return process, the return address (from the PC) and the loop context bits are saved to registers, so that these values can always be restored quickly. These special registers are the return address register (RETA) and the control-flow context register (CFCT). You can read from or write to RETA and CFCT as a pair with dedicated, 32-bit load and store instructions. Some CPU registers are saved to the stacks (in memory). For fast-return mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371). When control is passed to the ISR:
- The data stack pointer (SP) is decremented by 1 word in the address
phase of the pipeline. The status register 2 (ST2_55) content is pushed to the top of SP.
SPRU375G Instruction Set Descriptions 5-411
phase of the pipeline. The 7 higher bits of status register 0 (ST0_55) concatenated with 9 zeroes are pushed to the top of SSP.
- The SP is decremented by 1 word in the access phase of the pipeline. The
The debug status register (DBSTAT) content is pushed to the top of SSP.
- The SP is decremented by 1 word in the read phase of the pipeline. The
16 LSBs of the return address, from the program counter (PC), of the called subroutine are pushed to the top of SP.
- The SSP is decremented by 1 word in the read phase of the pipeline. The
loop context bits concatenated with the 8 MSBs of the return address are pushed to the top of SSP.
- The PC is loaded with the ISR program address. The active control flow
Status Bits
Affected by Affects
none INTM
This instruction cannot be repeated. See the following other related instructions:
- Return from Interrupt - Software Trap
Example
Syntax intr(#3) Description Program control is passed to the specified interrupt service routine. The interrupt vector address is defined by the content of an interrupt vector pointer (IVPD) combined with the unsigned 5-bit value (3).
5-412
SPRU375G
Software Reset
Syntax Characteristics
Parallel Enable bit No
No. [1]
Syntax reset
Size 2
Cycles ?
Pipeline D
This instruction performs a nonmaskable software reset that can be used any time to put the device in a known state. The reset instruction affects ST0_55, ST1_55, ST2_55, IFR0, IFR1, and T2 (Table 55 and Figure 54); status register ST3_55 and interrupt vectors pointer registers (IVPD and IVPH) are not affected. When the reset instruction is acknowledged, the INTM is set to 1 to disable maskable interrupts. All pending interrupts in IFR0 and IFR1 are cleared. The initialization of the system control register, the interrupt vectors pointer, and the peripheral registers is different from the initialization performed by a hardware reset.
Status Bits
Affected by Affects
Repeat
SPRU375G
5-413
1 0 0 1 0
0 1 0
5-414
SPRU375G
SPRU375G
5-415
ST1_55 15 BRAF 0 7 C16 0 14 CPL 0 6 FRCT 0 13 XF 1 5 C54CM 1 4 ASM 0 12 HM 0 11 INTM 1 10 M40 0 9 SATD 0 8 SXMD 1 0
ST2_55 15 ARMS 0 7 AR7LC 0 6 AR6LC 0 5 AR5LC 0 14 Reserved 13 12 DBGM 1 4 AR4LC 0 11 EALLOW 0 3 AR3LC 0 10 RDM 0 2 AR2LC 0 1 AR1LC 0 9 Reserved 8 CDPLC 0 0 AR0LC 0
5-416
SPRU375G
Software Trap
Syntax Characteristics
No. [1] Syntax trap(k5) Parallel Enable Bit No Size 2 Cycles ? Pipeline D
This instruction passes control to a specified interrupt service routine (ISR) and this instruction does not affect INTM bit in ST1_55. The ISR address is stored at the interrupt vector address defined by the content of an interrupt vector pointer (IVPD or IVPH) combined with the 5-bit constant, k5. This instruction is executed regardless of the value of INTM bit . This instruction is not maskable. Note: DBSTAT (the debug status register) holds debug context information used during emulation. Make sure the ISR does not modify the value that will be returned to DBSTAT. Before beginning an ISR, the CPU automatically saves the value of some CPU registers and two internal registers: the program counter (PC) and a loop context register. The CPU can use these values to re-establish the context of the interrupted program sequence when the ISR is done. In the slow-return process (default), the return address (from the PC), the loop context bits, and some CPU registers are stored to the stacks (in memory). When the CPU returns from an ISR, the speed at which these values are restored is dependent on the speed of the memory accesses. In the fast-return process, the return address (from the PC) and the loop context bits are saved to registers, so that these values can always be restored quickly. These special registers are the return address register (RETA) and the control-flow context register (CFCT). You can read from or write to RETA and CFCT as a pair with dedicated, 32-bit load and store instructions. Some CPU registers are saved to the stacks (in memory). For fast-return mode operation, see the TMS320C55x DSP CPU Reference Guide (SPRU371). When control is passed to the ISR:
- The data stack pointer (SP) is decremented by 1 word in the address
phase of the pipeline. The status register 2 (ST2_55) content is pushed to the top of SP.
SPRU375G Instruction Set Descriptions 5-417
phase of the pipeline. The 7 higher bits of status register 0 (ST0_55) concatenated with 9 zeroes are pushed to the top of SSP.
- The SP is decremented by 1 word in the access phase of the pipeline. The
The debug status register (DBSTAT) content is pushed to the top of SSP.
- The SP is decremented by 1 word in the read phase of the pipeline. The
16 LSBs of the return address, from the program counter (PC), of the called subroutine are pushed to the top of SP.
- The SSP is decremented by 1 word in the read phase of the pipeline. The
loop context bits concatenated with the 8 MSBs of the return address are pushed to the top of SSP.
- The PC is loaded with the ISR program address. The active control flow
Status Bits
Affected by Affects
none none
This instruction cannot be repeated. See the following other related instructions:
- Return from Interrupt - Software Interrupt
Example
Syntax trap(5) Description Program control is passed to the specified interrupt service routine. The interrupt vector address is defined by the content of an interrupt vector pointer (IVPD) combined with the unsigned 5-bit value (5).
5-418
SPRU375G
Square
Square
Syntax Characteristics
Parallel Enable Bit Yes No
Size 2 3
Cycles 1 1
Pipeline X X
Description
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are:
- ACx(3216) - the content of a memory (Smem) location, sign extended to 17 bits
Status Bits
Affected by Affects
See Also
SPRU375G
5-419
Square
Square
Syntax Characteristics
Parallel Enable Bit Yes
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are ACx(3216).
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 * AC1 Description The content of AC1 is squared and the result is stored in AC0.
5-420
SPRU375G
Square
Square
Syntax Characteristics
Parallel Enable Bit No
No. [2]
Size 3
Cycles 1
Pipeline X
This instruction performs a multiplication in the D-unit MAC. The input operands of the multiplier are the content of a memory (Smem) location, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits. - Rounding is performed according to RDM, if the optional rnd keyword is
SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = *AR3 * *AR3 Description The content addressed by AR3 is squared and the result is stored in AC0.
SPRU375G
5-421
Syntax ACy = rnd(ACy + (ACx * ACx)) ACy = rnd(ACx + (Smem * Smem)) [,T3 = Smem]
Size 2 3
Cycles 1 1
Pipeline X X
Description
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are:
- ACx(3216) - the content of a memory (Smem) location, sign extended to 17 bits
Status Bits
Affected by Affects
See Also
5-422
SPRU375G
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are ACx(3216).
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 + (AC1 * AC1) Description The content of AC1 squared is added to the content of AC0 and the result is stored in AC0.
SPRU375G
5-423
This instruction performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are the content of a memory (Smem) location, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 + (*AR3 * *AR3) Description The content addressed by AR3 squared is added to the content of AC1 and the result is stored in AC0.
5-424
SPRU375G
Syntax ACy = rnd(ACy (ACx * ACx)) ACy = rnd(ACx (Smem * Smem))[, T3 = Smem]
Size 2 3
Cycles 1 1
Pipeline X X
Description
This instruction performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are:
- ACx(3216) - the content of a memory (Smem) location, sign extended to 17 bits
Status Bits
Affected by Affects
See Also
SPRU375G
5-425
No. [1]
Size 2
Cycles 1
Pipeline X
This instruction performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are ACx(3216).
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC1 = AC1 (AC0 * AC0) Description The content of AC0 squared is subtracted from the content of AC1 and the result is stored in AC1.
5-426
SPRU375G
This instruction performs a multiplication and a subtraction in the D-unit MAC. The input operands of the multiplier are the content of a memory (Smem) location, sign extended to 17 bits.
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and
SATD. This instruction provides the option to store the 16-bit data memory operand Smem in temporary register T3. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 (*AR3 * *AR3) Description The content addressed by AR3 squared is subtracted from the content of AC1 and the result is stored in AC0.
SPRU375G
5-427
Square Distance
Syntax Characteristics
No. [1] Syntax sqdst(Xmem, Ymem, ACx, ACy) Parallel Enable Bit No Size 4 Cycles 1 Pipeline X
1000 0110 XXXM MMYY YMMM DDDD 1110 xxn% ACx, ACy, Xmem, Ymem This instruction performs two parallel operations: multiply and accumulate (MAC), and subtract:
ACy = ACy + (ACx * ACx), ACx = (Xmem << #16) (Ymem << #16)
The first operation performs a multiplication and an accumulation in the D-unit MAC. The input operands of the multiplier are ACx(3216).
- If FRCT = 1, the output of the multiplier is shifted left by 1 bit. - Multiplication overflow detection depends on SMUL. - The 32-bit result of the multiplication is sign extended to 40 bits and added
according to SATD. The second operation subtracts the content of data memory operand Ymem, shifted left 16 bits, from the content of data memory operand Xmem, shifted left 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD.
5-428 Instruction Set Descriptions SPRU375G
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, during the subtraction an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat See Also C54CM, FRCT, M40, SATD, SMUL, SXMD ACOVx, ACOVy, CARRY
This instruction can be repeated. See the following other related instructions:
- Absolute Distance - Square - Square and Accumulate - Square and Subtract
Example
Syntax sqdst(*AR0, *AR1, AC0, AC1) Description The content of AC0 squared is added to the content of AC1 and the result is stored in AC1. The content addressed by AR1 shifted left by 16 bits is subtracted from the content addressed by AR0 shifted left by 16 bits and the result is stored in AC0.
After FF ABCD 0000 00 0000 0000 0055 00AA 0 0 0 0 AC0 AC1 *AR0 *AR1 ACOV0 ACOV1 CARRY FRCT FF FFAB 0000 00 1BB1 8229 0055 00AA 0 0 0 0
SPRU375G
5-429
Description
This instruction stores the content of the selected accumulator (ACx) to a memory (Smem) location, to a data memory operand (Lmem), or to dual data memory operands (Xmem and Ymem). Affected by Affects C54CM, RDM, SXMD none
Status Bits
5-430
SPRU375G
See Also
to Memory
- Load Accumulator, Auxiliary, or Temporary Register from Memory - Multiply and Accumulate with Parallel Store Accumulator Content to Memory - Multiply and Subtract with Parallel Store Accumulator Content to Memory - Multiply with Parallel Store Accumulator Content to Memory - Store Accumulator Pair Content to Memory - Store Accumulator, Auxiliary, or Temporary Register Content to Memory - Store Auxiliary or Temporary Register Pair Content to Memory - Subtraction with Parallel Store Accumulator Content to Memory
SPRU375G
5-431
This instruction stores the high part of the accumulator, ACx(3116), to the memory (Smem) location. The store operation to the memory location uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs. Affected by Affects none none
Status Bits
Repeat Example
Syntax *AR3 = HI(AC0)
5-432
SPRU375G
This instruction stores the high part of the accumulator, ACx(3116), to the memory (Smem) location. Rounding is performed in the D-unit shifter according to RDM, if the optional rnd keyword is applied to the input operand. Affected by Affects RDM none
Status Bits
Repeat Example
Syntax *AR3 = HI(rnd(AC0))
Description The content of AC0(3116) is rounded and stored at the location addressed by AR3.
SPRU375G
5-433
This instruction shifts the accumulator, ACx, by the content of Tx and stores the low part of the accumulator, ACx(150), to the memory (Smem) location. If the 16-bit value in Tx is not within 32 to +31, the shift is saturated to 32 or +31 and the shift is performed with this value. The input operand is shifted in the D-unit shifter according to SXMD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with C54CM = 1, the 6 LSBs of Tx are used to determine the shift quantity. The 6 LSBs of Tx define a shift quantity within 32 to +31. When the 16-bit value in Tx is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1.
Status Bits
Affected by Affects
Repeat Example
Syntax *AR3 = LO(AC0 << T0)
Description The content of AC0 is shifted by the content of T0 and AC0(150) is stored at the location addressed by AR3.
5-434
SPRU375G
This instruction shifts the accumulator, ACx, by the content of Tx and stores high part of the accumulator, ACx(3116), to the memory (Smem) location. If the 16-bit value in Tx is not within 32 to +31, the shift is saturated to 32 or +31 and the shift is performed with this value. The input operand is shifted in the D-unit shifter according to SXMD. Rounding is performed in the D-unit shifter according to RDM, if the optional rnd keyword is applied to the input operand. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with C54CM = 1, the 6 LSBs of Tx are used to determine the shift quantity. The 6 LSBs of Tx define a shift quantity within 32 to +31. When the 16-bit value in Tx is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1.
Status Bits
Affected by Affects
Repeat Example
Syntax
Description The content of AC0 is shifted by the content of T0, is rounded, and AC0(3116) is stored at the location addressed by AR3.
SPRU375G
5-435
This instruction shifts the accumulator, ACx, by the 6-bit value, SHIFTW, and stores the low part of the accumulator, ACx(150), to the memory (Smem) location. The input operand is shifted by the 6-bit value in the D-unit shifter according to SXMD. Affected by Affects SXMD none
Status Bits
Repeat Example
Syntax *AR3 = LO(AC0 << #31)
Description The content of AC0 is shifted left by 31 bits and AC0(150) is stored at the location addressed by AR3.
5-436
SPRU375G
This instruction shifts the accumulator, ACx, by the 6-bit value, SHIFTW, and stores the high part of the accumulator, ACx(3116), to the memory (Smem) location. The input operand is shifted by the 6-bit value in the D-unit shifter according to SXMD. Affected by Affects SXMD none
Status Bits
Repeat Example
Syntax *AR3 = HI(AC0 << #31)
Description The content of AC0 is shifted left by 31 bits and AC0(3116) is stored at the location addressed by AR3.
SPRU375G
5-437
1111 1010 AAAA AAAI xxSH IFTW SSxx x0x% ACx, SHIFTW, Smem This instruction shifts the accumulator, ACx, by the 6-bit value, SHIFTW, and stores the high part of the accumulator, ACx(3116), to the memory (Smem) location. The input operand is shifted by the 6-bit value in the D-unit shifter according to SXMD. Rounding is performed in the D-unit shifter according to RDM, if the optional rnd keyword is applied to the input operand. Affected by Affects RDM, SXMD none
Status Bits
Repeat
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax *AR3 = HI(rnd(AC0 << #31)) Description The content of AC0 is shifted left by 31 bits, is rounded, and AC0(3116) is stored at the location addressed by AR3.
5-438
SPRU375G
This instruction stores the high part of the accumulator, ACx(3116), to the memory (Smem) location.
- Input operands are considered signed or unsigned according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is considered unsigned. If the optional uns keyword is not applied to the input operand, the content of the memory location is considered signed.
is applied to the input operand, the 40-bit output of the operation is saturated:
J J
If the optional uns keyword is applied to the input operand, saturation value is 00 FFFF FFFFh. If the optional uns keyword is not applied, saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow).
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with C54CM = 1, overflow detection at the output of the shifter consists of checking if the sign of the input operand is identical to the most-significant bits of the 40-bit result of the round operation:
- If the optional uns keyword is applied to the input operand, then bits 3932
3931 of the result are compared to bit 39 of the input operand and SXMD. Status Bits Affected by Affects
SPRU375G
Repeat Example
Syntax
Description The unsigned content of AC0 is rounded, is saturated, and AC0(3116) is stored at the location addressed by AR3.
*AR3 = HI(saturate(uns(rnd(AC0))))
5-440
SPRU375G
This instruction shifts the accumulator, ACx, by the content of Tx and stores the high part of the accumulator, ACx(3116), to the memory (Smem) location. If the 16-bit value in Tx is not within 32 to +31, the shift is saturated to 32 or +31 and the shift is performed with this value.
- Input operands are considered signed or unsigned according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is considered unsigned. If the optional uns keyword is not applied to the input operand, the content of the memory location is considered signed.
- The input operand is shifted in the D-unit shifter according to SXMD. - When shifting, the sign position of the input operand is compared to the
shift quantity.
J J
If the optional uns keyword is applied to the input operand, this comparison is performed against bit 32 of the shifted operand. If the optional uns keyword is not applied, this comparison is performed against bit 31 of the shifted operand that is considered signed (the sign is defined by bit 39 of the input operand and SXMD). An overflow is generated accordingly.
keyword is applied to the input operand, the 40-bit output of the operation is saturated:
J J
If the optional uns keyword is applied to the input operand, saturation value is 00 FFFF FFFFh. If the optional uns keyword is not applied, saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow).
Instruction Set Descriptions 5-441
SPRU375G
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with C54CM = 1:
- Overflow detection at the output of the shifter consists of checking if the
sign of the input operand is identical to the most-significant bits of the 40-bit result of the shift and round operation.
J J
If the optional uns keyword is applied to the input operand, then bits 3932 of the result are compared to 0. If the optional uns keyword is not applied to the input operand, then bits 3931 of the result are compared to bit 39 of the input operand and SXMD.
- The 6 LSBs of Tx are used to determine the shift quantity. The 6 LSBs of
Tx define a shift quantity within 32 to +31. When the 16-bit value in Tx is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat Example
Syntax *AR3 = HI(saturate(uns(rnd(AC0 << T0)))) Description The unsigned content of AC0 is shifted by the content of T0, is rounded, is saturated, and AC0(3116) is stored at the location addressed by AR3.
5-442
SPRU375G
1111 1010 AAAA AAAI uxSH IFTW SSxx x1x% ACx, SHIFTW, Smem This instruction shifts the accumulator, ACx, by the 6-bit value, SHIFTW, and stores the high part of the accumulator, ACx(3116), to the memory (Smem) location.
- Input operands are considered signed or unsigned according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is considered unsigned. If the optional uns keyword is not applied to the input operand, the content of the memory location is considered signed.
- The input operand is shifted by the 6-bit value in the D-unit shifter
according to SXMD.
- When shifting, the sign position of the input operand is compared to the
shift quantity.
J J
If the optional uns keyword is applied to the input operand, this comparison is performed against bit 32 of the shifted operand. If the optional uns keyword is not applied, this comparison is performed against bit 31 of the shifted operand that is considered signed (the sign is defined by bit 39 of the input operand and SXMD). An overflow is generated accordingly.
keyword is applied to the input operand, the 40-bit output of the operation is saturated:
J J
If the optional uns keyword is applied to the input operand, saturation value is 00 FFFF FFFFh. If the optional uns keyword is not applied, saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow).
Instruction Set Descriptions 5-443
SPRU375G
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with C54CM = 1, overflow detection at the output of the shifter consists of checking if the sign of the input operand is identical to the most-significant bits of the 40-bit result of the shift and round operation.
- If the optional uns keyword is applied to the input operand, then bits 3932
3931 of the result are compared to bit 39 of the input operand and SXMD. Status Bits Affected by Affects Repeat C54CM, RDM, SXMD none
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax *AR3 = HI(saturate(uns(rnd(AC0 << #31)))) Description The unsigned content of AC0 is shifted left by 31 bits, is rounded, is saturated, and AC0(3116) is stored at the location addressed by AR3.
5-444
SPRU375G
This instruction stores the content of the accumulator, ACx(310), to the data memory operand (Lmem). The store operation to the memory location uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs. Affected by Affects none none
Status Bits
Repeat Example
Syntax dbl(*AR3) = AC0
Description The content of AC0 is stored at the locations addressed by AR3 and AR3 + 1.
SPRU375G
5-445
This instruction stores the content of the accumulator, ACx(310), to the data memory operand (Lmem).
- Input operands are considered signed or unsigned according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is considered unsigned. If the optional uns keyword is not applied to the input operand, the content of the memory location is considered signed.
If the optional uns keyword is applied to the input operand, saturation value is 00 FFFF FFFFh. If the optional uns keyword is not applied, saturation values are 00 7FFF FFFFh (positive overflow) or FF 8000 0000h (negative overflow).
- The store operation to the memory location uses the D-unit shifter.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with C54CM = 1, overflow detection at the output of the shifter consists of checking if the sign of the input operand is identical to the most-significant bits of the 40-bit result of the shift and round operation.
- If the optional uns keyword is applied to the input operand, then bits 3932
3931 of the result are compared to bit 39 of the input operand and SXMD. Status Bits Affected by Affects
5-446 Instruction Set Descriptions
Repeat Example
Syntax
Description The unsigned content of AC0 is saturated and stored at the locations addressed by AR3 and AR3 + 1.
dbl(*AR3) = saturate(uns(AC0))
SPRU375G
5-447
This instruction performs two store operations in parallel and is executed in the D-unit shifter:
- The 16 highest bits of the accumulator, ACx(3116), shifted right by 1 bit
(bit 31 is sign extended according to SXMD), are stored to the 16 highest bits of the data memory operand (Lmem).
- The 16 lowest bits, ACx(150), shifted right by 1 bit (bit 15 is sign extended
according to SXMD), are stored to the 16 lowest bits of the data memory operand (Lmem). Status Bits Affected by Affects Repeat Example
Syntax HI(*AR1) = HI(AC0) >> #1, LO(*AR1) = LO(AC0) >> #1 Description The content of AC0(3116), shifted right by 1 bit, is stored at the location addressed by AR1 and the content of AC0(150), shifted right by 1 bit, is stored at the location addressed by AR1 + 1.
SXMD none
5-448
SPRU375G
Status Bits
Affected by Affects
none none
Repeat Example
Syntax *AR1 = LO(AC0), *AR2 = HI(AC0)
Before AC0 AR1 AR2 200 201
Description The content of AC0(150) is stored at the location addressed by AR1 and the content of AC0(3116) is stored at the location addressed by AR2.
After 01 4500 0030 0200 0201 3400 0FD3 AC0 AR1 AR2 200 201 01 4500 0030 0200 0201 0030 4500
SPRU375G
5-449
Description
This instruction stores the content of the selected accumulator pair, ACx and AC(x + 1), to a data memory operand (Lmem). Affected by Affects none none
Status Bits
See Also
to Memory
- Load Accumulator, Auxiliary, or Temporary Register from Memory - Multiply and Accumulate with Parallel Store Accumulator Content to Memory - Multiply and Subtract with Parallel Store Accumulator Content to Memory - Multiply with Parallel Store Accumulator Content to Memory - Store Accumulator Content to Memory - Store Accumulator, Auxiliary, or Temporary Register Content to Memory - Store Auxiliary or Temporary Register Pair Content to Memory - Subtraction with Parallel Store Accumulator Content to Memory
5-450
SPRU375G
This instruction stores the 16 highest bits of the accumulator, ACx(3116), to the 16 highest bits of the data memory operand (Lmem) and stores the 16 highest bits of AC(x + 1) to the16 lowest bits of data memory operand (Lmem):
- The store operation to the memory location uses a dedicated path
independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
- Valid accumulators are AC0 and AC2.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax *AR1+ = pair(HI(AC0))
Description The content of AC0(3116) is stored at the location addressed by AR1 and the content of AC1(3116) is stored at the location addressed by AR1 + 1. AR1 is incremented by 2.
After 01 4500 0030 03 5644 F800 0200 3400 0FD3 AC0 AC1 AR1 200 201 01 4500 0030 03 5644 F800 0202 4500 5644
SPRU375G
5-451
This instruction stores the 16 lowest bits of the accumulator, ACx(150), to the 16 highest bits of the data memory operand (Lmem) and stores the 16 lowest bits of AC(x + 1) to the16 lowest bits of data memory operand (Lmem):
- The store operation to the memory location uses a dedicated path
independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
- Valid accumulators are AC0 and AC2.
Status Bits
Affected by Affects
none none
Repeat Example
Syntax *AR3 = pair(LO(AC0))
Description The content of AC0(150) is stored at the location addressed by AR3 and the content of AC1(150) is stored at the location addressed by AR3 + 1.
5-452
SPRU375G
Description
This instruction stores the content of the selected source (src) register to a memory (Smem) location. Affected by Affects none none
Status Bits
See Also
to Memory
- Load Accumulator, Auxiliary, or Temporary Register from Memory - Multiply and Accumulate with Parallel Store Accumulator Content to Memory - Multiply and Subtract with Parallel Store Accumulator Content to Memory - Multiply with Parallel Store Accumulator Content to Memory - Store Accumulator Content to Memory - Store Accumulator Pair Content to Memory - Store Auxiliary or Temporary Register Pair Content to Memory - Subtraction with Parallel Store Accumulator Content to Memory
SPRU375G
5-453
This instruction stores the content of the source (src) register to a memory (Smem) location.
- When the source register is an accumulator: J J
The low part of the accumulator, ACx(150), is stored to the memory location. The store operation to the memory location uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
The content of the auxiliary or temporary register is stored to the memory location. The store operation to the memory location uses a dedicated path independent of the A-unit ALU. none none
Status Bits
Affected by Affects
Repeat Example
Syntax *(#0E10h) = AC0
Before AC0 0E10
5-454
SPRU375G
This instruction stores the low byte (bits 70) of the source (src) register to the high byte (bits 158) of the memory (Smem) location. The low byte (bits 70) of Smem is unchanged.
- When the source register is an accumulator: J J
The low part of the accumulator, ACx(70), is stored to the high byte of the memory location. The store operation to the memory location uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
The low part (bits 70) content of the auxiliary or temporary register is stored to the high byte of the memory location. The store operation to the memory location uses a dedicated path independent of the A-unit ALU.
(MMR). This instruction cannot access a byte within an MMR. If Smem is an MMR, the DSP sends a hardware bus-error interrupt (BERRINT) request to the CPU. Status Bits Affected by Affects Repeat Example
Syntax high_byte(*AR1) = AC1 Description The content of AC1(70) is stored in the high byte (bits 158) at the location addressed by AR1.
After 20 FC00 6788 0200 6903 AC1 AR1 200 20 FC00 6788 0200 8803
none none
SPRU375G
5-455
This instruction stores the low byte (bits 70) of the source (src) register to the low byte (bits 70) of the memory (Smem) location. The high byte (bits 158) of Smem is unchanged.
- When the source register is an accumulator: J J
The low part of the accumulator, ACx(70), is stored to the low byte of the memory location. The store operation to the memory location uses a dedicated path independent of the D-unit ALU, the D-unit shifter, and the D-unit MACs.
The low part (bits 70) content of the auxiliary or temporary register is stored to the low byte of the memory location. The store operation to the memory location uses a dedicated path independent of the A-unit ALU.
(MMR). This instruction cannot access a byte within an MMR. If Smem is an MMR, the DSP sends a hardware bus-error interrupt (BERRINT) request to the CPU. Status Bits Affected by Affects Repeat Example
Syntax low_byte(*AR3) = AC0 Description The content of AC0(70) is stored in the low byte (bits 70) at the location addressed by AR3.
none none
5-456
SPRU375G
This instruction stores the content of the temporary or auxiliary register (TAx) to the 16 highest bits of the data memory operand (Lmem) and stores the content of TA(x + 1) to the 16 lowest bits of data memory operand (Lmem):
- The store operation to the memory location uses a dedicated path
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Load Accumulator, Auxiliary, or Temporary Register from Memory - Store Accumulator, Auxiliary, or Temporary Register Content to Memory
Example
Syntax *AR2 = pair(T0) Description The content of T0 is stored at the location addressed by AR2 and the content of T1 is stored at the location addressed by AR2 + 1.
SPRU375G
5-457
Syntax Characteristics
Parallel Enable Bit No No No No No No No No No No No No No No No No No No No No
No. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]
Syntax Smem = BK03 Smem = BK47 Smem = BKC Smem = BSA01 Smem = BSA23 Smem = BSA45 Smem = BSA67 Smem = BSAC Smem = BRC0 Smem = BRC1 Smem = CDP Smem = CSR Smem = DP Smem = DPH Smem = PDP Smem = SP Smem = SSP Smem = TRN0 Smem = TRN1 dbl(Lmem) = RETA
Size 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
Cycles 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5
Pipeline X X X X X X X X X X X X X X X X X X X X
Opcode Operands
5-458
Description
These instructions store the content of the selected source CPU register to a memory (Smem) location or a data memory operand (Lmem). For instructions [9] and [10], the block repeat register (BRCx) is decremented in the address phase of the last instruction of the loop. These instructions have a 3-cycle latency requirement versus the last instruction of the loop. For instruction [20], the content of the 24-bit RETA register (the return address of the calling subroutine) and the 8-bit CFCT register (active control flow execution context flags of the calling subroutine) are stored to the data memory operand (Lmem):
- The content of the CFCT register and the 8 highest bits of the RETA
Lmem. When instruction [20] is decoded, the CPU pipeline is flushed and the instruction is executed in 5 cycles, regardless of the instruction context. Status Bits Affected by Affects Repeat See Also none none
Instruction [20] cannot be repeated; all other instructions can be repeated. See the following other related instructions:
- Load CPU Register from Memory - Load CPU Register with Immediate Value - Move CPU Register Content to Auxiliary or Temporary Register - Store Accumulator Content to Memory - Store Accumulator Pair Content to Memory - Store Accumulator, Auxiliary, or Temporary Register Content to Memory - Store Auxiliary or Temporary Register Pair Content to Memory
Example 1
Syntax *AR1+ = SP Description The content of the data stack pointer (SP) is stored in the location addressed by AR1. AR1 is incremented by 1.
After 0200 0200 0000 AR1 SP 200 0201 0200 0200
SPRU375G
5-459
Example 2
Syntax *AR1+ = SSP Description The content of the system stack pointer (SSP) is stored in the location addressed by AR1. AR1 is incremented by 1.
After 0201 0000 00FF AR1 SSP 201 0202 0000 0000
Example 3
Syntax *AR1+ = TRN0 Description The content of the transition register (TRN0) is stored in the location addressed by AR1. AR1 is incremented by 1.
After 0202 3490 0000 AR1 TRN0 202 0203 3490 3490
Example 4
Syntax *AR1+ = TRN1 Description The content of the transition register (TRN1) is stored in the location addressed by AR1. AR1 is incremented by 1.
After 0203 0020 0000 AR1 TRN1 203 0204 0020 0020
Example 5
Syntax dbl(*AR3) = RETA Description The contents of the RETA and CFCT are stored in the location addressed by AR3 and AR3 + 1.
5-460
SPRU375G
Table 56. Opcodes for Store CPU Register Content to Memory Instruction
No. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Syntax Smem = BK03 Smem = BK47 Smem = BKC Smem = BSA01 Smem = BSA23 Smem = BSA45 Smem = BSA67 Smem = BSAC Smem = BRC0 Smem = BRC1 Smem = CDP Smem = CSR Smem = DP Smem = DPH Smem = PDP Smem = SP Smem = SSP Smem = TRN0 Smem = TRN1 dbl(Lmem) = RETA Opcode
1110 0101 AAAA AAAI 1001 10xx 1110 0101 AAAA AAAI 1010 10xx 1110 0101 AAAA AAAI 1011 10xx 1110 0101 AAAA AAAI 0010 10xx 1110 0101 AAAA AAAI 0011 10xx 1110 0101 AAAA AAAI 0100 10xx 1110 0101 AAAA AAAI 0101 10xx 1110 0101 AAAA AAAI 0110 10xx 1110 0101 AAAA AAAI x001 11xx 1110 0101 AAAA AAAI x010 11xx 1110 0101 AAAA AAAI 0001 10xx 1110 0101 AAAA AAAI x000 11xx 1110 0101 AAAA AAAI 0000 10xx 1110 0101 AAAA AAAI 1100 10xx 1110 0101 AAAA AAAI 1111 10xx 1110 0101 AAAA AAAI 0111 10xx 1110 0101 AAAA AAAI 1000 10xx 1110 0101 AAAA AAAI x011 11xx 1110 0101 AAAA AAAI x100 11xx 1110 1011 AAAA AAAI xxxx 01xx
SPRU375G
5-461
No. [1]
Size 3
Cycles 1
Pipeline X
This instruction moves the content of the 23-bit source register (XARx, XSP, XSSP, XDP, or XCDP) to the 32-bit data memory location addressed by data memory operand (Lmem). The upper 9 bits of the data memory are filled with 0: Affected by Affects none none
Status Bits
This instruction can be repeated. See the following other related instructions:
- Load Extended Auxiliary Register from Memory - Load Extended Auxiliary Register with Immediate Value - Modify Extended Auxiliary Register Content - Move Extended Auxiliary Register Content
Example
Syntax dbl(*AR3) = XAR1 Description The 7 highest bits of XAR1 are moved to the 7 lowest bits of the location addressed by AR3, the 9 highest bits are filled with 0, and the 16 lowest bits of XAR1 are moved to the location addressed by AR3 + 1.
After 7F 3492 0200 3765 0FD3 XAR1 AR3 200 201 7F 3492 0200 007F 3492
5-462
SPRU375G
Subtract Conditionally
Syntax Characteristics
No. [1] Syntax subc(Smem, ACx, ACy) Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction performs a conditional subtraction in the D-unit ALU. The D-unit shifter is not used to perform the memory operand shift.
- The 16-bit data memory operand Smem is sign extended to 40 bits
according to SXMD, shifted left by 15 bits, and subtracted from the content of the source accumulator ACx.
J J
The shift operation is equivalent to the signed shift instruction. Overflow and carry bit is always detected at bit position 31. The subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit. If an overflow is detected and reported in accumulator overflow bit ACOVy, no saturation is performed on the result of the operation.
- If the result of the subtraction is greater than 0 (bit 39 = 0), the result is
shifted left by 1 bit, added to 1, and stored in the destination accumulator ACy.
- If the result of the subtraction is less than 0 (bit 39 = 1), the source
accumulator ACx is shifted left by 1 bit and stored in the destination accumulator ACy.
if ((ACx (Smem << #15)) >= 0) ACy = (ACx (Smem << #15)) << #1 + 1 else ACy = ACx << #1
This instruction is used to make a 16 step 16-bit by 16-bit division. The divisor and the dividend are both assumed to be positive in this instruction. SXMD affects this operation:
- If SXMD = 1, the divisor must have a 0 value in the most significant bit - If SXMD = 0, any 16-bit divisor value produces the expected result
The dividend, which is in the source accumulator ACx, must be positive (bit 31 = 0) during the computation.
SPRU375G Instruction Set Descriptions 5-463
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Addition or Subtraction Conditionally - Addition or Subtraction Conditionally with Shift - Addition, Subtraction, or Move Accumulator Content Conditionally - Dual 16-Bit Subtraction and Addition - Subtraction - Subtraction with Parallel Store Accumulator Content to Memory
Example 1
Syntax subc(*AR1, AC0, AC1) Description The content addressed by AR1 shifted left by 15 bits is subtracted from the content of AC0. The result is greater than 0; therefore, the result is shifted left by 1 bit, added to 1, and the new result stored in AC1. The result generated an overflow and a carry.
After AC0 AC1 AR1 300 SXMD ACOV1 CARRY 23 4300 0000 46 8400 0001 300 200 0 1 1
Example 2
Syntax repeat (CSR) subc(*AR1, AC1, AC1) Description The content addressed by AR1 shifted left by 15 bits is subtracted from the content of AC1. The result is greater than 0; therefore, the result is shifted left by 1 bit, added to 1, and the new result stored in AC1. The content addressed by AR1 shifted left by 15 bits is subtracted from the content of AC1. The result is greater than 0; therefore, the result is shifted left by 1 bit, added to 1, and the new result stored in AC1. The result generated a carry.
After AC1 AR1 200 CSR ACOV1 CARRY 00 1A18 0007 200 0100 0 0 1
5-464
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit Yes Yes No No No Yes Yes No No No No No No No No No No No
No. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]
Syntax dst = dst src dst = dst k4 dst = src K16 dst = src Smem dst = Smem src ACy = ACy (ACx << Tx) ACy = ACy (ACx << #SHIFTW) ACy = ACx (K16 << #16) ACy = ACx (K16 << #SHFT) ACy = ACx (Smem << Tx) ACy = ACx (Smem << #16) ACy = (Smem << #16) ACx ACy = ACx uns(Smem) BORROW ACy = ACx uns(Smem) ACy = ACx (uns(Smem) << #SHIFTW) ACy = ACx dbl(Lmem) ACy = dbl(Lmem) ACx ACx = (Xmem << #16) (Ymem << #16)
Size 2 2 4 3 3 2 3 4 4 3 3 3 3 3 4 3 3 3
Cycles 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Pipeline X X X X X X X X X X X X X X X X X X
These instructions perform a subtraction operation. Affected by Affects CARRY, C54CM, M40, SATA, SATD, SXMD ACOVx, ACOVy, CARRY
SPRU375G
5-465
Subtraction
See Also
5-466
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
No. [1] Syntax dst = dst src Parallel Enable Bit Yes Size 2 Cycles 1 Pipeline X
The operation is performed on 40 bits in the D-unit ALU. Input operands are sign extended to 40 bits according to SXMD. If an auxiliary or temporary register is the source operand (src) of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended according to SXMD. Overflow detection and CARRY status bit depends on M40. The subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit. When an overflow is detected, the accumulator is saturated according to SATD.
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source operand (src) of the instruction, the 16 LSBs of the accumulator are used to perform the operation. Overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 AC1 Description The content of AC1 is subtracted from the content of AC0 and the result is stored in AC0.
SPRU375G
5-467
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit Yes
No. [2]
Size 2
Cycles 1
Pipeline X
The operation is performed on 40 bits in the D-unit ALU. Overflow detection and CARRY status bit depends on M40. The subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit. When an overflow is detected, the accumulator is saturated according to SATD.
The operation is performed on 16 bits in the A-unit ALU. Overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 #15 Description An unsigned 4-bit value (15) is subtracted from the content of AC0 and the result is stored in AC0.
5-468
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [3]
Size 4
Cycles 1
Pipeline X
The operation is performed on 40 bits in the D-unit ALU. If an auxiliary or temporary register is the source operand (src) of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended according to SXMD. The 16-bit constant, K16, is sign extended to 40 bits according to SXMD. Overflow detection and CARRY status bit depends on M40. The subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit. When an overflow is detected, the accumulator is saturated according to SATD.
J J
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source operand (src) of the instruction, the 16 LSBs of the accumulator are used to perform the operation. Overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
SPRU375G Instruction Set Descriptions 5-469
Subtraction
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 FFFFh
Description A signed 16-bit value (FFFFh) is subtracted from the content of AC1 and the result is stored in AC0.
5-470
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [4]
Size 3
Cycles 1
Pipeline X
This instruction subtracts the content of a memory (Smem) location from a register content.
- When the destination operand (dst) is an accumulator: J J
The operation is performed on 40 bits in the D-unit ALU. If an auxiliary or temporary register is the source operand (src) of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended according to SXMD. The content of the memory location is sign extended to 40 bits according to SXMD. Overflow detection and CARRY status bit depends on M40. The subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit. When an overflow is detected, the accumulator is saturated according to SATD.
J J
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source operand (src) of the instruction, the 16 LSBs of the accumulator are used to perform the operation. Overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
SPRU375G Instruction Set Descriptions 5-471
Subtraction
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = AC1 *AR3
Description The content addressed by AR3 is subtracted from the content of AC1 and the result is stored in AC0.
5-472
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [5]
Size 3
Cycles 1
Pipeline X
This instruction subtracts a register content from the content of a memory (Smem) location.
- When the destination operand (dst) is an accumulator: J J
The operation is performed on 40 bits in the D-unit ALU. If an auxiliary or temporary register is the source operand (src) of the instruction, the 16 LSBs of the auxiliary or temporary register are sign extended according to SXMD. The content of the memory location is sign extended to 40 bits according to SXMD. Overflow detection and CARRY status bit depends on M40. The subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit. When an overflow is detected, the accumulator is saturated according to SATD.
J J
The operation is performed on 16 bits in the A-unit ALU. If an accumulator is the source operand (src) of the instruction, the 16 LSBs of the accumulator are used to perform the operation. Overflow detection is done at bit position 15. When an overflow is detected, the destination register is saturated according to SATA.
Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured.
SPRU375G Instruction Set Descriptions 5-473
Subtraction
Status Bits
Affected by Affects
Repeat Example
Syntax AC0 = *AR3 AC1
Description The content of AC1 is subtracted from the content addressed by AR3 and the result is stored in AC0.
5-474
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
No. [6] Syntax ACy = ACy (ACx << Tx) Parallel Enable Bit Yes Size 2 Cycles 1 Pipeline X
This instruction subtracts an accumulator content ACx shifted by the content of Tx from an accumulator content ACy.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1:
- An intermediary shift operation is performed as if M40 is locally set to 1 and
no overflow detection, report, and saturation is done after the shifting operation.
- The 6 LSBs of Tx are used to determine the shift quantity. The 6 LSBs of
Tx define a shift quantity within 32 to +31. When the value is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 (AC1 << T0) Description The content of AC1 shifted by the content of T0 is subtracted from the content of AC0 and the result is stored in AC0.
SPRU375G
5-475
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit Yes
No. [7]
Size 3
Cycles 1
Pipeline X
This instruction subtracts an accumulator content ACx shifted by the 6-bit value, SHIFTW, from an accumulator content ACy.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC0 (AC1 << #31) Description The content of AC1 shifted left by 31 bits is subtracted from the content of AC0 and the result is stored in AC0.
5-476
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [8]
Size 4
Cycles 1
Pipeline X
This instruction subtracts the 16-bit signed constant, K16, shifted left by 16 bits from an accumulator content ACx.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 (FFFFh << #16) Description A signed 16-bit value (FFFFh) shifted left by 16 bits is subtracted from the content of AC1 and the result is stored in AC0.
SPRU375G
5-477
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [9]
Size 4
Cycles 1
Pipeline X
0111 0001 KKKK KKKK KKKK KKKK SSDD SHFT ACx, ACy, K16, SHFT This instruction subtracts the 16-bit signed constant, K16, shifted left by the 4-bit value, SHFT, from an accumulator content ACx.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC1 = AC0 (#9800h << #5) Description A signed 16-bit value (9800h) shifted left by 5 bits is subtracted from the content of AC0 and the result is stored in AC1.
5-478
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
No. [10] Syntax ACy = ACx (Smem << Tx) Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction subtracts the content of a memory (Smem) location shifted by the content of Tx from an accumulator content ACx.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1:
- An intermediary shift operation is performed as if M40 is locally set to 1 and
no overflow detection, report, and saturation is done after the shifting operation.
- The 6 LSBs of Tx are used to determine the shift quantity. The 6 LSBs of
Tx define a shift quantity within 32 to +31. When the value is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 (*AR3 << T0) Description The content addressed by AR3 shifted by the content of T0 is subtracted from the content of AC1 and the result is stored in AC0.
SPRU375G
5-479
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [11]
Size 3
Cycles 1
Pipeline X
This instruction subtracts the content of a memory (Smem) location shifted left by 16 bits from an accumulator content ACx.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. If the result
of the subtraction generates a borrow, the CARRY status bit is cleared; otherwise, the CARRY status bit is not affected.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 (*AR3 << #16) Description The content addressed by AR3 shifted left by 16 bits is subtracted from the content of AC1 and the result is stored in AC0.
5-480
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [12]
Size 3
Cycles 1
Pipeline X
This instruction subtracts an accumulator content ACx from the content of a memory (Smem) location shifted left by 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = (*AR3 << #16) AC1 Description The content of AC1 is subtracted from the content addressed by AR3 shifted left by 16 bits and the result is stored in AC0.
SPRU375G
5-481
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [13]
Size 3
Cycles 1
Pipeline X
This instruction subtracts the logical complement of the CARRY status bit (borrow) and the content of a memory (Smem) location from an accumulator content ACx.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are extended to 40 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat
5-482
Subtraction
Example
Syntax AC1 = AC0 uns(*AR1) BORROW Description The complement of the CARRY bit (1) and the unsigned content addressed by AR1 (F000h) are subtracted from the content of AC0 and the result is stored in AC1.
After 00 EC00 0000 00 0000 0000 0302 F000 0 AC0 AC1 AR1 302 CARRY 00 EC00 0000 00 EBFF 0FFF 0302 F000 1
SPRU375G
5-483
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [14]
Size 3
Cycles 1
Pipeline X
This instruction subtracts the content of a memory (Smem) location from an accumulator content ACx.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are extended to 40 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = AC1 uns(*AR3) Description The unsigned content addressed by AR3 is subtracted from the content of AC1 and the result is stored in AC0.
5-484
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [15]
Size 4
Cycles 1
Pipeline X
1111 1001 AAAA AAAI uxSH IFTW SSDD 01xx ACx, ACy, SHIFTW, Smem This instruction subtracts the content of a memory (Smem) location shifted by the 6-bit value, SHIFTW, from an accumulator content ACx.
- The operation is performed on 40 bits in the D-unit shifter. - Input operands are extended to 40 bits according to uns. J J
If the optional uns keyword is applied to the input operand, the content of the memory location is zero extended to 40 bits. If the optional uns keyword is not applied to the input operand, the content of the memory location is sign extended to 40 bits according to SXMD.
- The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects
SPRU375G
Subtraction
Repeat
This instruction cannot be repeated when using the *(#k23) absolute addressing mode to access the memory operand (Smem); when using other addressing modes, this instruction can be repeated.
Example
Syntax AC0 = AC1 (uns(*AR3) << #31) Description The unsigned content addressed by AR3 shifted left by 31 bits is subtracted from the content of AC1 and the result is stored in AC0.
5-486
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
No. [16] Syntax ACy = ACx dbl(Lmem) Parallel Enable Bit No Size 3 Cycles 1 Pipeline X
This instruction subtracts the content of data memory operand dbl(Lmem) from an accumulator content ACx.
- The data memory operand dbl(Lmem) addresses are aligned: J J
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax Description AC0 = AC1 dbl(*AR3+) The content (long word) addressed by AR3 and AR3 + 1 is subtracted from the content of AC1 and the result is stored in AC0. Because this instruction is a long-operand instruction, AR3 is incremented by 2 after the execution.
SPRU375G
5-487
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [17]
Size 3
Cycles 1
Pipeline X
This instruction subtracts an accumulator content ACx from the content of data memory operand dbl(Lmem).
- The data memory operand dbl(Lmem) addresses are aligned: J J
if Lmem address is even: most significant word = Lmem, least significant word = Lmem + 1 if Lmem address is odd: most significant word = Lmem, least significant word = Lmem 1
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. Status Bits Affected by Affects Repeat Example
Syntax AC0 = dbl(*AR3) AC1 Description The content of AC1 is subtracted from the content (long word) addressed by AR3 and AR3 + 1 and the result is stored in AC0.
5-488
SPRU375G
Subtraction
Subtraction
Syntax Characteristics
Parallel Enable Bit No
No. [18]
Size 3
Cycles 1
Pipeline X
This instruction subtracts the content of data memory operand Ymem, shifted left 16 bits, from the content of data memory operand Xmem, shifted left 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit.
- When an overflow is detected, the accumulator is saturated according to
SATD. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation. Status Bits Affected by Affects Repeat Example
Syntax AC0 = (*AR3 << #16) (*AR4 << #16) Description The content addressed by AR4 shifted left by 16 bits is subtracted from the content addressed by AR3 shifted left by 16 bits and the result is stored in AC0.
SPRU375G
5-489
1000 0111 XXXM MMYY YMMM SSDD 101x xxxx ACx, ACy, T2, Xmem, Ymem This instruction performs two operations in parallel: subtraction and store. The first operation subtracts an accumulator content from the content of data memory operand Xmem shifted left by 16 bits.
- The operation is performed on 40 bits in the D-unit ALU. - Input operands are sign extended to 40 bits according to SXMD. - The shift operation is equivalent to the signed shift instruction. - Overflow detection and CARRY status bit depends on M40. The
subtraction borrow bit is reported in the CARRY status bit; the borrow bit is the logical complement of the CARRY status bit. When C54CM = 1, an intermediary shift operation is performed as if M40 is locally set to 1 and no overflow detection, report, and saturation is done after the shifting operation.
- When an overflow is detected, the accumulator is saturated according to
SATD. The second operation shifts the accumulator ACy by the content of T2 and stores ACy(3116) to data memory operand Ymem. If the 16-bit value in T2 is not within 32 to +31, the shift is saturated to 32 or +31 and the shift is performed with this value.
- The input operand is shifted in the D-unit shifter according to SXMD. - After the shift, the high part of the accumulator, ACy(3116), is stored to
the memory location. Compatibility with C54x devices (C54CM = 1) When this instruction is executed with M40 = 0, compatibility is ensured. When this instruction is executed with C54CM = 1, the 6 LSBs of T2 are used to determine the shift quantity. The 6 LSBs of T2 define a shift quantity within 32 to +31. When the 16-bit value in T2 is between 32 to 17, a modulo 16 operation transforms the shift quantity to within 16 to 1.
5-490 Instruction Set Descriptions SPRU375G
Status Bits
Affected by Affects
This instruction can be repeated. See the following other related instructions:
- Addition or Subtraction Conditionally - Addition or Subtraction Conditionally with Shift - Addition, Subtraction, or Move Accumulator Content Conditionally - Dual 16-Bit Addition and Subtraction - Dual 16-Bit Subtractions - Dual 16-Bit Subtraction and Addition - Subtraction - Subtract Conditionally
Example
Syntax AC0 = (*AR3 << #16) AC1, *AR4 = HI(AC0 << T2) Description Both instructions are performed in parallel. The content of AC1 is subtracted from the content addressed by AR3 shifted left by 16 bits and the result is stored in AC0. The content of AC0 is shifted by the content of T2, and AC0(3116) is stored at the address of AR4.
SPRU375G
5-491
Opcode
Operands Description
ACx, ACy This instruction performs parallel moves between two accumulators. These operations are performed in a dedicated datapath independent of the D-unit operators. This instruction moves the content of the first accumulator (ACx) to the second accumulator (ACy), and reciprocally moves the content of the second accumulator to the first accumulator. Accumulator swapping is performed in the execute phase of the pipeline.
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Swap Accumulator Pair Content - Swap Auxiliary Register Content - Swap Auxiliary and Temporary Register Content - Swap Temporary Register Content
Example
Syntax swap(AC0, AC2)
Before AC0 AC2 01 E500 0030 00 2800 0200
Description The content of AC0 is moved to AC2 and the content of AC2 is moved to AC0.
After AC0 AC2 00 2800 0200 01 E500 0030
5-492
SPRU375G
This instruction performs two parallel moves between four accumulators (AC0 and AC2, AC1 and AC3) in one cycle. These operations are performed in a dedicated datapath independent of the D-unit operators. Accumulator swapping is performed in the execute phase of the pipeline. This instruction performs two parallel moves:
- the content of AC0 to AC2, and reciprocally the content of AC2 to AC0 - the content of AC1 to AC3, and reciprocally the content of AC3 to AC1
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Swap Accumulator Content - Swap Auxiliary Register Pair Content - Swap Auxiliary and Temporary Register Pair Content - Swap Temporary Register Pair Content
Example
Syntax swap(pair(AC0), pair(AC2)) Description The following two swap instructions are performed in parallel: the content of AC0 is moved to AC2 and the content of AC2 is moved to AC0, and the content of AC1 is moved to AC3 and the content of AC3 is moved to AC1.
After 01 E500 0030 00 FFFF 0000 00 2800 0200 00 8800 0800 AC0 AC1 AC2 AC3 00 2800 0200 00 8800 0800 01 E500 0030 00 FFFF 0000
SPRU375G
5-493
Opcode
0101 111E 0011 1000 0101 111E 0000 1000 0101 111E 0000 1001
Operands Description
ARx, ARy This instruction performs parallel moves between two auxiliary registers. These operations are performed in a dedicated datapath independent of the A-unit operators. This instruction moves the content of the first auxiliary register (ARx) to the second auxiliary register (ARy), and reciprocally moves the content of the second auxiliary register to the first auxiliary register. Auxiliary register swapping is performed in the address phase of the pipeline.
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Swap Accumulator Content - Swap Auxiliary and Temporary Register Content - Swap Auxiliary Register Pair Content - Swap Temporary Register Content
Example
Syntax swap(AR0, AR2)
Before AR0 AR2 6500 0300
Description The content of AR0 is moved to AR2 and the content of AR2 is moved to AR0.
After AR0 AR2 0300 6500
5-494
SPRU375G
This instruction performs two parallel moves between four auxiliary registers (AR0 and AR2, AR1 and AR3) in one cycle. These operations are performed in a dedicated datapath independent of the A-unit operators. Auxiliary register swapping is performed in the address phase of the pipeline. This instruction performs two parallel moves:
- the content of AR0 to AR2, and reciprocally the content of AR2 to AR0 - the content of AR1 to AR3, and reciprocally the content of AR3 to AR1
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Swap Accumulator Pair Content - Swap Auxiliary Register Content - Swap Auxiliary and Temporary Register Pair Content - Swap Temporary Register Pair Content
Example
Syntax swap(pair(AR0), pair(AR2)) Description The following two swap instructions are performed in parallel: the content of AR0 is moved to AR2 and the content of AR2 is moved to AR0, and the content of AR1 is moved to AR3 and the content of AR3 is moved to AR1.
After 0200 0300 6788 0200 AR0 AR1 AR2 AR3 6788 0200 0200 0300
SPRU375G
5-495
Opcode
0101 111E 0000 1100 0101 111E 0000 1101 0101 111E 0000 1110 0101 111E 0000 1111
Operands Description
ARx, Tx This instruction performs parallel moves between auxiliary registers and temporary registers. These operations are performed in a dedicated datapath independent of the A-unit operators. This instruction moves the content of the auxiliary register (ARx) to the temporary register (Tx), and reciprocally moves the content of the temporary register to the auxiliary register. Auxiliary and temporary register swapping is performed in the address phase of the pipeline.
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Swap Accumulator Content - Swap Auxiliary Register Content - Swap Auxiliary and Temporary Register Pair Content - Swap Auxiliary and Temporary Register Pairs Content - Swap Temporary Register Content
5-496
SPRU375G
Example
Syntax swap(AR4, T0)
Before T0 AR4 6500 0300
Description The content of AR4 is moved to T0 and the content of T0 is moved to AR4.
After T0 AR4 0300 6500
SPRU375G
5-497
Opcode
Operands Description
ARx, Tx This instruction performs two parallel moves between two auxiliary registers and two temporary registers in one cycle. These operations are performed in a dedicated datapath independent of the A-unit operators. Auxiliary and temporary register swapping is performed in the address phase of the pipeline. Instruction [1] performs two parallel moves:
- the content of AR4 to T0, and reciprocally the content of T0 to AR4 - the content of AR5 to T1, and reciprocally the content of T1 to AR5
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Swap Accumulator Pair Content - Swap Auxiliary Register Pair Content - Swap Auxiliary and Temporary Register Content - Swap Auxiliary and Temporary Register Pairs Content - Swap Temporary Register Pair Content
5-498
SPRU375G
Example
Syntax swap(pair(AR4), pair(T0)) Description The following two swap instructions are performed in parallel: the content of AR4 is moved to T0 and the content of T0 is moved to AR4, and the content of AR5 is moved to T1 and the content of T1 is moved to AR5.
After 0200 0300 6788 0200 AR4 AR5 T0 T1 6788 0200 0200 0300
SPRU375G
5-499
No. [1]
Size 2
Cycles 1
Pipeline AD
This instruction performs four parallel moves between four auxiliary registers (AR4, AR5, AR6, and AR7) and four temporary registers (T0, T1, T2, and T3) in one cycle. These operations are performed in a dedicated datapath independent of the A-unit operators. Auxiliary and temporary register swapping is performed in the address phase of the pipeline. This instruction performs four parallel moves:
- the content of AR4 to T0, and reciprocally the content of T0 to AR4 - the content of AR5 to T1, and reciprocally the content of T1 to AR5 - the content of AR6 to T2, and reciprocally the content of T2 to AR6 - the content of AR7 to T3, and reciprocally the content of T3 to AR7
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Swap Auxiliary and Temporary Register Content - Swap Auxiliary and Temporary Register Pair Content
5-500
SPRU375G
Example
Syntax swap (block(AR4), block(T0)) Description The following four swap instructions are performed in parallel: the content of AR4 is moved to T0 and the content of T0 is moved to AR4, the content of AR5 is moved to T1 and the content of T1 is moved to AR5, the content of AR6 is moved to T2 and the content of T2 is moved to AR6, and the content of AR7 is moved to T3 and the content of T3 is moved to AR7.
After 0200 0300 0240 0400 0030 0200 3400 0FD3 AR4 AR5 AR6 AR7 T0 T1 T2 T3 0030 0200 3400 0FD3 0200 0300 0240 0400
SPRU375G
5-501
Opcode
Operands Description
Tx, Ty This instruction performs parallel moves between two temporary registers. These operations are performed in a dedicated datapath independent of the A-unit operators. This instruction moves the content of the first temporary register (Tx) to the second temporary register (Ty), and reciprocally moves the content of the second temporary register to the first temporary register. Temporary register swapping is performed in the address phase of the pipeline.
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Swap Accumulator Content - Swap Auxiliary Register Content - Swap Auxiliary and Temporary Register Content - Swap Temporary Register Pair Content
Example
Syntax swap(T0, T2)
Before T0 T2 6500 0300
5-502
SPRU375G
This instruction performs two parallel moves between four temporary registers (T0 and T2, T1 and T3) in one cycle. These operations are performed in a dedicated datapath independent of the A-unit operators. Temporary register swapping is performed in the address phase of the pipeline. This instruction performs two parallel moves:
- the content of T0 to T2, and reciprocally the content of T2 to T0 - the content of T1 to T3, and reciprocally the content of T3 to T1
Status Bits
Affected by Affects
none none
This instruction can be repeated. See the following other related instructions:
- Swap Accumulator Pair Content - Swap Auxiliary Register Pair Content - Swap Auxiliary and Temporary Register Pair Content - Swap Temporary Register Content
Example
Syntax swap(pair(T0), pair(T2)) Description The following two swap instructions are performed in parallel: the content of T0 is moved to T2 and the content of T2 is moved to T0, and the content of T1 is moved to T3 and the content of T3 is moved to T1.
After 0200 0300 6788 0200 T0 T1 T2 T3 6788 0200 0200 0300
Before T0 T1 T2 T3
SPRU375G
5-503
Opcode
TC1 TC2
1110 1100 AAAA AAAI FSSS 1000 1110 1100 AAAA AAAI FSSS 1001
Operands Description
temporary register. The instruction tests a single bit of the source register location as defined by the bit addressing mode, Baddr. The tested bit is copied into the selected TCx status bit. The generated bit address must be within:
- 039 when accessing accumulator bits (only the 6 LSBs of the generated
bit address are used to determine the bit position). If the generated bit address is not within 039, 0 is stored into the selected TCx status bit.
- 015 when accessing auxiliary or temporary register bits (only the 4 LSBs
of the generated address are used to determine the bit position). Status Bits Affected by Affects Repeat See Also none TCx
This instruction can be repeated. See the following other related instructions:
- Clear Accumulator, Auxiliary, or Temporary Register Bit - Complement Accumulator, Auxiliary, or Temporary Register Bit - Set Accumulator, Auxiliary, or Temporary Register Bit - Test Accumulator, Auxiliary, or Temporary Register Bit Pair - Test Memory Bit
5-504
SPRU375G
Example
Syntax TC1 = bit(T0, @#12) Description The bit at the position defined by the register bit address (12) in T0 is tested and the tested bit is copied into TC1.
After FE00 0 T0 TC1 FE00 1
Before T0 TC1
SPRU375G
5-505
temporary register. The instruction tests two consecutive bits of the source register location as defined by the bit addressing mode, Baddr and Baddr + 1. The tested bits are copied into status bits TC1 and TC2:
J J
TC1 tests the bit that is defined by Baddr TC2 tests the bit defined by Baddr + 1
bit address are used to determine the bit position). If the generated bit address is not within 038:
J J
If the generated bit address is 39, bit 39 of the register is stored into TC1 and 0 is stored into TC2. In all other cases, 0 is stored into TC1 and TC2.
- 014 when accessing auxiliary or temporary register bits (only the 4 LSBs
of the generated address are used to determine the bit position). If the generated bit address is not within 014:
J J
If the generated bit address is 15, bit 15 of the register is stored into TC1 and 0 is stored into TC2. In all other cases, 0 is stored into TC1 and TC2. none TC1, TC2
SPRU375G
Status Bits
Affected by Affects
5-506
This instruction can be repeated. See the following other related instructions:
- Clear Accumulator, Auxiliary, or Temporary Register Bit - Complement Accumulator, Auxiliary, or Temporary Register Bit - Set Accumulator, Auxiliary, or Temporary Register Bit - Test Accumulator, Auxiliary, or Temporary Register Bit - Test Memory Bit
Example
Syntax bit(AC0, pair(AR1(T0))) Description The bit at the position defined by the content of AR1(T0) in AC0 is tested and the tested bit is copied into TC1. The bit at the position defined by the content of AR1(T0) + 1 in AC0 is tested and the tested bit is copied into TC2.
After E0 1234 0000 0026 0001 0 0 AC0 AR1 T0 TC1 TC2 E0 1234 0000 0026 0001 1 0
SPRU375G
5-507
Size 3 3
Cycles 1 1
Pipeline X X
Description
These instructions perform a bit manipulation in the A-unit ALU. These instructions test a single bit of a memory (Smem) location. The bit tested is defined by either the content of the source (src) operand or a 4-bit immediate value, k4. The tested bit is copied into the selected TCx status bit. For instruction [1], the generated bit address must be within 015 (only the 4 LSBs of the register are used to determine the bit position).
Status Bits
Affected by Affects
none TCx
See Also
5-508
SPRU375G
Size 3 3
Cycles 1 1
Pipeline X X
Opcode
TC1 TC2
1110 0000 AAAA AAAI FSSS xxx0 1110 0000 AAAA AAAI FSSS xxx1
Operands Description
Smem, src, TCx This instruction performs a bit manipulation in the A-unit ALU. This instruction tests a single bit of a memory (Smem) location. The bit tested is defined by the content of the source (src) operand. The tested bit is copied into the selected TCx status bit. The generated bit address must be within 015 (only the 4 LSBs of the register are used to determine the bit position).
Status Bits
Affected by Affects
none TCx
Repeat Example
Syntax TC1 = bit(*AR0, AC0)
Description The bit at the position defined by AC0(30) in the content addressed by AR0 is tested and the tested bit is copied into TC1.
After 00 0000 0008 00C0 0 AC0 *AR0 TC1 00 0000 0008 00C0 0
SPRU375G
5-509
Size 3 3
Cycles 1 1
Pipeline X X
Opcode
TC1 TC2
1101 1100 AAAA AAAI kkkk xx00 1101 1100 AAAA AAAI kkkk xx01
Operands Description
k4, Smem, TCx This instruction performs a bit manipulation in the A-unit ALU. This instruction tests a single bit of a memory (Smem) location. The bit tested is defined by a 4-bit immediate value, k4. The tested bit is copied into the selected TCx status bit. Affected by Affects none TCx
Status Bits
Repeat Example
Syntax TC1 = bit(*AR3, #12)
Description The bit at the position defined by an unsigned 4-bit value (12) in the content addressed by AR3 is tested and the tested bit is copied into TC1.
5-510
SPRU375G
Syntax TC1 = bit(Smem, k4), bit(Smem, k4) = #0 TC2 = bit(Smem, k4), bit(Smem, k4) = #0
Size 3 3
Cycles 1 1
Pipeline X X
Opcode
TC1 TC2
1110 0011 AAAA AAAI kkkk 010x 1110 0011 AAAA AAAI kkkk 011x
Operands Description
k4, Smem, TCx This instruction performs a bit manipulation in the A-unit ALU. The instruction tests a single bit, as defined by a 4-bit immediate value, k4, of a memory (Smem) location. The tested bit is copied into status bit TCx and is cleared to 0 in Smem. Affected by Affects none TCx
Status Bits
This instruction can be repeated. See the following other related instructions:
- Clear Memory Bit - Complement Memory Bit - Set Memory Bit - Test and Complement Memory Bit - Test and Set Memory Bit - Test Memory Bit
Example
Syntax TC1 = bit(*AR3, #12), bit(*AR3, #12) = #0 Description The bit at the position defined by the unsigned 4-bit value (12) in the content addressed by AR3 is tested and the tested bit is copied into TC1. The selected bit (12) in the content addressed by AR3 is cleared to 0.
SPRU375G
5-511
Opcode
TC1 TC2
1110 0011 AAAA AAAI kkkk 100x 1110 0011 AAAA AAAI kkkk 101x
Operands Description
k4, Smem, TCx This instruction performs a bit manipulation in the A-unit ALU. The instruction tests a single bit, as defined by a 4-bit immediate value, k4, of a memory (Smem) location and the tested bit is copied into status bit TCx and is complemented in Smem. Affected by Affects none TCx
Status Bits
This instruction can be repeated. See the following other related instructions:
- Clear Memory Bit - Complement Memory Bit - Set Memory Bit - Test and Clear Memory Bit - Test and Set Memory Bit - Test Memory Bit
Example
Syntax TC1 = bit(*AR0, #12), cbit(*AR0, #12) Description The bit at the position defined by the unsigned 4-bit value (12) in the content addressed by AR0 is tested and the tested bit is copied into TC1. The selected bit (12) in the content addressed by AR0 is complemented.
5-512
SPRU375G
Syntax TC1 = bit(Smem, k4), bit(Smem, k4) = #1 TC2 = bit(Smem, k4), bit(Smem, k4) = #1
Size 3 3
Cycles 1 1
Pipeline X X
Opcode
TC1 TC2
1110 0011 AAAA AAAI kkkk 000x 1110 0011 AAAA AAAI kkkk 001x
Operands Description
k4, Smem, TCx This instruction performs a bit manipulation in the A-unit ALU. The instruction tests a single bit, as defined by a 4-bit immediate value, k4, of a memory (Smem) location. The tested bit is copied into status bit TCx and is set to 1 in Smem. Affected by Affects none TCx
Status Bits
This instruction can be repeated. See the following other related instructions:
- Clear Memory Bit - Complement Memory Bit - Set Memory Bit - Test and Clear Memory Bit - Test and Complement Memory Bit - Test Memory Bit
Example
Syntax TC1 = bit(*AR3, #12), bit(*AR3, #12) = #1 Description The bit at the position defined by the unsigned 4-bit value (12) in the content addressed by AR3 is tested and the tested bit is copied into TC1. The selected bit (12) in the content addressed by AR3 is set to 1.
SPRU375G
5-513
Chapter 6
Topic
6.1 6.2
Page
Instruction Set Opcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Instruction Set Opcode Symbols and Abbreviations . . . . . . . . . . . . 6-16
6-1
6-2
SPRU375G
SPRU375G
6-3
6-4
SPRU375G
SPRU375G
6-5
6-6
SPRU375G
SPRU375G
6-7
mar(Xmem), ACx = M40(rnd(ACx (uns(Ymem) * uns(coef(Cmem))))) ACx = M40(rnd(ACx (uns(Xmem) * uns(coef(Cmem))))), ACy = M40(rnd(ACy (uns(Ymem) * uns(coef(Cmem))))) mar(Xmem) ,mar(Ymem) ,mar(coef(Cmem)) firs(Xmem, Ymem, coef(Cmem), ACx, ACy) firsn(Xmem, Ymem, coef(Cmem), ACx, ACy) ACx = M40(rnd(uns(Xmem) * uns(Ymem))) [,T3 = Xmem] ACy = M40(rnd(ACx + (uns(Xmem) * uns(Ymem)))) [,T3 = Xmem]
ACy = M40(rnd((ACx >> #16) + (uns(Xmem) * uns(Ymem)))) [,T3 = Xmem]
10000101 XXXMMMYY YMMM10mm xxxxxxxx 10000101 XXXMMMYY YMMM11mm DDx0DDU% 10000101 XXXMMMYY YMMM11mm DDx1DDU% 10000110 XXXMMMYY YMMMxxDD 000guuU% 10000110 XXXMMMYY YMMMSSDD 001guuU% 10000110 XXXMMMYY YMMMSSDD 010guuU% 10000110 XXXMMMYY YMMMSSDD 011guuU%
6-8
SPRU375G
SPRU375G
6-9
6-10
SPRU375G
SPRU375G
6-11
6-12
SPRU375G
SPRU375G
6-13
6-14
SPRU375G
SPRU375G
6-15
AAAA AAAI AAAA AAA0 AAAA AAA1 0001 0001 0011 0001 0101 0001 0111 0001 1001 0001 1011 0001 1101 0001 1111 0001 PPP0 0001 PPP0 0011 PPP0 0101 PPP0 0111 PPP0 1001 PPP0 1011 PPP0 1101 PPP0 1111 PPP1 0011 PPP1 0101
Smem addressing mode: @dma, direct memory address (dma) direct access Smem indirect memory access: ABS16(#k16) *(#k23) *port(#k16) *CDP *CDP+ *CDP *CDP(#K16) *+CDP(#K16) *ARn *ARn+ *ARn *(ARn + T0), when C54CM = 0 *(ARn + T0), when C54CM = 1 *(ARn T0), when C54CM = 0 *(ARn T0), when C54CM = 1 *ARn(T0), when C54CM = 0 *ARn(T0), when C54CM = 1 *ARn(#K16) *+ARn(#K16) *(ARn + T1), when ARMS = 0 *ARn(short(#1)), when ARMS = 1 *(ARn T1), when ARMS = 0 *ARn(short(#2)), when ARMS = 1
6-16
SPRU375G
cc 00 01 10 11
Relational operators (RELOP): == < >= != (equal to) (less than) (greater than or equal to) (not equal to)
CCC CCCC 000 FSSS 001 FSSS 010 FSSS 011 FSSS 100 FSSS 101 FSSS 110 00SS 110 0100 110 0101 110 0110 110 0111
Conditional field (cond) on source accumulator, auxiliary, or temporary register; TCx; and CARRY: src == 0 src != 0 src < 0 src <= 0 src > 0 src >= 0 (source is equal to 0) (source is not equal to 0) (source is less than 0) (source is less than or equal to 0) (source is greater than 0) (source is greater than or equal to 0)
overflow(ACx) (source accumulator overflow status bit (ACOVx) is tested against 1) TC1 TC2 CARRY Reserved (status bit is tested against 1) (status bit is tested against 1) (status bit is tested against 1)
SPRU375G
6-17
dd 00 01 10 11
Destination temporary register (Tx, Ty): Temporary register 0 (T0) Temporary register 1 (T1) Temporary register 2 (T2) Temporary register 3 (T3)
6-18
SPRU375G
DDD . . . D
0 1
FDDD FSSS 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Destination or Source accumulator, auxiliary, or temporary register (dst, src, TAx, TAy): Accumulator 0 (AC0) Accumulator 1 (AC1) Accumulator 2 (AC2) Accumulator 3 (AC3) Temporary register 0 (T0) Temporary register 1 (T1) Temporary register 2 (T2) Temporary register 3 (T3) Auxiliary register 0 (AR0) Auxiliary register 1 (AR1) Auxiliary register 2 (AR2) Auxiliary register 3 (AR3) Auxiliary register 4 (AR4) Auxiliary register 5 (AR5) Auxiliary register 6 (AR6) Auxiliary register 7 (AR7)
SPRU375G
6-19
kk kkkk 00 0000 00 0001 00 0100 00 0101 00 1000 00 1001 00 1100 00 1101 00 1110 00 1111 01 0000 01 0001 01 0100 01 0101 01 1000 01 1001 01 1100 01 1101 01 1110 01 1111 10 1000 10 1100 11 1000 11 1100 1x 0000 1x 0001
Swap code for Swap Register Content instruction: swap(AC0, AC2) swap(AC1, AC3) swap(T0, T2) swap(T1, T3) swap(AR0, AR2) swap(AR1, AR3) swap(AR4, T0) swap(AR5, T1) swap(AR6, T2) swap(AR7, T3) swap(pair(AC0), pair(AC2)) Reserved swap(pair(T0), pair(T2)) Reserved swap(pair(AR0), pair(AR2)) Reserved swap(pair(AR4), pair(T0)) Reserved swap(pair(AR6), pair(T2)) Reserved Reserved swap(block(AR4), block(T0)) swap(AR0, AR1) Reserved Reserved Reserved
6-20
SPRU375G
kkk . . . k
KKK . . . K
lll . . . l
Program address label coded on n bits (unsigned offset relative to program counter register)
LLL . . . L
Program address label coded on n bits (signed offset relative to program counter register)
mm 00 01 10 11
Modifier option for Xmem or Ymem addressing mode: *ARn *ARn+ *ARn *(ARn + T0), when C54CM = 0 *(ARn + AR0), when C54CM = 1 *(ARn + T1) *(ARn T0), when C54CM = 0 *(ARn AR0), when C54CM = 1
SPRU375G
6-21
Reserved bit
PPP . . . P
0 1
SHFT
SHIFTW
ss 00 01 10 11
Source temporary register (Tx, Ty): Temporary register 0 (T0) Temporary register 1 (T1) Temporary register 2 (T2) Temporary register 3 (T3)
SS 00 01 10 11
Source accumulator register (ACw, ACx, ACy, ACz): Accumulator 0 (AC0) Accumulator 1 (AC1) Accumulator 2 (AC2) Accumulator 3 (AC3)
6-22
SPRU375G
0 1
uns keyword is not applied; operand is considered signed uns keyword is applied; operand is considered unsigned
0 1
No update of T3 with Smem or Xmem content T3 is updated with Smem or Xmem content
vv
00 01 10 11
Bit 0: shifted-out bit of Rotate instruction Bit 1: shifted-in bit of Rotate instruction When value = 0: CARRY is selected When value = 1: TC2 is selected
Reserved bit
XDDD XSSS 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Destination or Source accumulator or extended register. All 23 bits of stack pointer (XSP), system stack pointer (XSSP), data page pointer (XDP), coefficient data pointer (XCDP), and extended auxiliary register (XARx). Accumulator 0 (AC0) Accumulator 1 (AC1) Accumulator 2 (AC2) Accumulator 3 (AC3) Stack pointer (XSP) System stack pointer (XSSP) Data page pointer (XDP) Coefficient data pointer (XCDP) Auxiliary register 0 (XAR0) Auxiliary register 1 (XAR1)
SPRU375G
6-23
XXX YYY 000 001 010 011 100 101 110 111
Auxiliary register designation for Xmem or Ymem addressing mode: Auxiliary register 0 (AR0) Auxiliary register 1 (AR1) Auxiliary register 2 (AR2) Auxiliary register 3 (AR3) Auxiliary register 4 (AR4) Auxiliary register 5 (AR5) Auxiliary register 6 (AR6) Auxiliary register 7 (AR7)
6-24
SPRU375G
Chapter 7
7-1
Dual 16-Bit Addition and Subtraction HI(ACx) = Smem + Tx, LO(ACx) = Smem Tx HI(ACx) = HI(Lmem) + Tx, LO(ACx) = LO(Lmem) Tx
ADDSUB: Dual 16-Bit Addition and Subtraction ADDSUB Tx, Smem, ACx ADDSUB Tx, dual(Lmem), ACx Cross-Reference of Algebraic and Mnemonic Instruction Sets
Dual 16-Bit Subtractions HI(ACy) = HI(ACx) HI(Lmem), LO(ACy) = LO(ACx) LO(Lmem) HI(ACy) = HI(Lmem) HI(ACx), LO(ACy) = LO(Lmem) LO(ACx) HI(ACx) = Tx HI(Lmem), LO(ACx) = Tx LO(Lmem) HI(ACx) = HI(Lmem) Tx, LO(ACx) = LO(Lmem) Tx
SUB: Dual 16-Bit Subtractions SUB dual(Lmem), [ACx,] ACy SUB ACx, dual(Lmem), ACy SUB dual(Lmem), Tx, ACx SUB Tx, dual(Lmem), ACx
Dual 16-Bit Subtraction and Addition HI(ACx) = Smem Tx, LO(ACx) = Smem + Tx HI(ACx) = HI(Lmem) Tx, LO(ACx) = LO(Lmem) + Tx
SUBADD: Dual 16-Bit Subtraction and Addition SUBADD Tx, Smem, ACx SUBADD Tx, dual(Lmem), ACx
MOV::MOV: Load Accumulator from Memory with Parallel Store Accumulator Content to Memory MOV Xmem << #16, ACy :: MOV HI(ACx << T2), Ymem MOV: Load Accumulator Pair from Memory MOV dbl(Lmem), pair(HI(ACx)) MOV dbl(Lmem), pair(LO(ACx)) MOV: Load Accumulator with Immediate Value MOV K16 << #16, ACx MOV K16 << #SHFT, ACx
Modify Auxiliary or Temporary Register Content by Subtraction ASUB: Modify Auxiliary or Temporary Register Content by Subtraction mar(TAy TAx) mar(TAx P8) Modify Data Stack Pointer SP = SP + K8 Modify Extended Auxiliary Register Content XAdst = mar(Smem) Move Accumulator Content to Auxiliary or Temporary Register TAx = HI(ACx) Move Accumulator, Auxiliary, or Temporary Register Content dst = src Move Auxiliary or Temporary Register Content to Accumulator HI(ACx) = TAx ASUB TAx, TAy ASUB P8, TAx AADD: Modify Data Stack Pointer (SP) AADD K8, SP AMAR: Modify Extended Auxiliary Register Content AMAR Smem, XAdst MOV: Move Accumulator Content to Auxiliary or Temporary Register MOV HI(ACx), TAx MOV: Move Accumulator, Auxiliary, or Temporary Register Content MOV src, dst MOV: Move Auxiliary or Temporary Register Content to Accumulator MOV TAx, HI(ACx)
Move Auxiliary or Temporary Register Content to CPU Register MOV: Move Auxiliary or Temporary Register Content to CPU Register BRC0 = TAx BRC1 = TAx CDP = TAx CSR = TAx SP = TAx SSP = TAx MOV TAx, BRC0 MOV TAx, BRC1 MOV TAx, CDP MOV TAx, CSR MOV TAx, SP MOV TAx, SSP
Move CPU Register Content to Auxiliary or Temporary Register MOV: Move CPU Register Content to Auxiliary or Temporary Register TAx = BRC0 TAx = BRC1 TAx = CDP TAx = RPTC TAx = SP TAx = SSP Move Extended Auxiliary Register Content xdst = xsrc MOV BRC0, TAx MOV BRC1, TAx MOV CDP, TAx MOV RPTC, TAx MOV SP, TAx MOV SSP, TAx MOV: Move Extended Auxiliary Register Content MOV xsrc, xdst
MACM::MOV: Multiply and Accumulate with Parallel Load Accumulator from Memory MACM[R] [T3 = ]Xmem, Tx, ACx :: MOV Ymem << #16, ACy
MOV: Store Accumulator Pair Content to Memory MOV pair(HI(ACx)), dbl(Lmem) MOV pair(LO(ACx)), dbl(Lmem) MOV: Store Accumulator, Auxiliary, or Temporary Register Content to Memory MOV src, Smem MOV src, high_byte(Smem) MOV src, low_byte(Smem) MOV: Store Auxiliary or Temporary Register Pair Content to Memory MOV pair(TAx), dbl(Lmem) MOV: Store CPU Register Content to Memory MOV BK03, Smem MOV BK47, Smem
BTSTNOT: Test and Complement Memory Bit BTSTNOT k4, Smem, TCx
BTSTSET: Test and Set Memory Bit BTSTSET k4, Smem, TCx
Index
Index
A
abdst 5-2 absolute addressing modes 3-3 I/O absolute 3-3 k16 absolute 3-3 k23 absolute 3-3 Absolute Distance (abdst) 5-2 Absolute Value 5-4 Addition 5-7 Addition or Subtraction Conditionally (adsc) 5-31 Addition or Subtraction Conditionally with Shift (ads2c) 5-33 Addition with Absolute Value 5-27 Addition with Parallel Store Accumulator Content to Memory 5-29 Addition, Subtraction, or Move Accumulator Content Conditionally (adsc) 5-36 addressing modes absolute 3-3 direct 3-4 indirect 3-6 introduction 3-2 ads2c 5-33 adsc 5-31, 5-36 affect of status bits 1-9 algebraic instruction set cross-reference to mnemonic instruction set 7-1 AND 5-38 Antisymmetrical Finite Impulse Response Filter (firsn) 5-168 arithmetic absolute distance 5-2 absolute value 5-4 addition 5-7 addition or subtraction conditionally 5-31, 5-36 addition or subtraction conditionally with shift 5-33 addition with absolute value 5-27 compare memory with immediate value 5-126 compute exponent of accumulator content 5-131 compute mantissa and exponent of accumulator content 5-132 dual 16-bit addition and subtraction 5-140 dual 16-bit additions 5-135 dual 16-bit subtraction and addition 5-154 dual 16-bit subtractions 5-145 finite impulse response filter, antisymmetrical 5-168 finite impulse response filter, symmetrical 5-170 least mean square 5-173 multiply 5-255 multiply and accumulate 5-271 multiply and subtract 5-294 negation 5-313 round accumulator content 5-380 saturate accumulator content 5-382 square 5-419 square and accumulate 5-422 square and subtract 5-425 square distance 5-428 subtract conditionally 5-463 subtraction 5-465
B
bit field comparison bit field counting bit field expand bit field extract 5-47 5-134 5-166 5-167
Index-1
Index
bit manipulation bitwise AND memory with immediate value and compare to zero 5-47 clear accumulator, auxiliary, or temporary register bit 5-88 clear memory bit 5-89 clear status register bit 5-90 complement accumulator, auxiliary, or temporary register bit 5-128 complement accumulator, auxiliary, or temporary register content 5-129 complement memory bit 5-130 expand accumulator bit field 5-166 extract accumulator bit field 5-167 set accumulator, auxiliary, or temporary register bit 5-384 set memory bit 5-385 set status register bit 5-386 test accumulator, auxiliary, or temporary register bit 5-504 test accumulator, auxiliary, or temporary register bit pair 5-506 test and clear memory bit 5-511 test and complement memory bit 5-512 test and set memory bit 5-513 test memory bit 5-508 Bitwise AND 5-38 Bitwise AND Memory with Immediate Value and Compare to Zero 5-47 bitwise complement 5-129 Bitwise Exclusive OR (XOR) 5-57 Bitwise OR 5-48 blockrepeat 5-346 branch conditionally 5-66 on auxiliary register not zero 5-74 unconditionally 5-70 Branch Conditionally (if goto) 5-66 Branch on Auxiliary Register Not Zero (if goto) 5-74 Branch Unconditionally (goto) 5-70
C
call 5-83 conditionally 5-77 unconditionally 5-83 Call Conditionally (if call) 5-77 Index-2
Call Unconditionally (call) 5-83 cbit 5-128, 5-130 circular 5-87 circular addressing 3-20 Circular Addressing Qualifier (circular) 5-87 clear accumulator bit 5-88 auxiliary register bit 5-88 memory bit 5-89 status register bit 5-90 temporary register bit 5-88 Clear Accumulator Bit 5-88 Clear Auxiliary Register Bit 5-88 Clear Memory Bit 5-89 Clear Status Register Bit 5-90 Clear Temporary Register Bit 5-88 compare accumulator, auxiliary, or temporary register content 5-93 accumulator, auxiliary, or temporary register content maximum 5-105 accumulator, auxiliary, or temporary register content minimum 5-108 accumulator, auxiliary, or temporary register content with AND 5-95 accumulator, auxiliary, or temporary register content with OR 5-100 and branch 5-111 and select accumulator content maximum 5-114 and select accumulator content minimum 5-120 memory with immediate value 5-126 Compare Accumulator Content 5-93 Compare Accumulator Content Maximum (max) 5-105 Compare Accumulator Content Minimum (min) 5-108 Compare Accumulator Content with AND 5-95 Compare Accumulator Content with OR 5-100 Compare and Branch 5-111 compare and goto 5-111 Compare and Select Accumulator Content Maximum (max_diff) 5-114 Compare and Select Accumulator Content Minimum (min_diff) 5-120 Compare Auxiliary Register Content 5-93 Compare Auxiliary Register Content Maximum (max) 5-105
Index
Compare Auxiliary Register Content Minimum (min) 5-108 Compare Auxiliary Register Content with AND 5-95 Compare Auxiliary Register Content with OR 5-100 compare maximum 5-105 Compare Memory with Immediate Value 5-126 compare minimum 5-108 Compare Temporary Register Content 5-93 Compare Temporary Register Content Maximum (max) 5-105 Compare Temporary Register Content Minimum (min) 5-108 Compare Temporary Register Content with AND 5-95 Compare Temporary Register Content with OR 5-100 complement accumulator bit 5-128 accumulator content 5-129 auxiliary register bit 5-128 auxiliary register content 5-129 memory bit 5-130 temporary register bit 5-128 temporary register content 5-129 Complement Accumulator Bit (cbit) 5-128 Complement Accumulator Content 5-129 Complement Auxiliary Register Bit (cbit) 5-128 Complement Auxiliary Register Content 5-129 Complement Memory Bit (cbit) 5-130 Complement Temporary Register Bit (cbit) 5-128 Complement Temporary Register Content 5-129 Compute Exponent of Accumulator Content (exp) 5-131 Compute Mantissa and Exponent of Accumulator Content 5-132 cond field 1-7 conditional addition or subtraction 5-31 addition or subtraction with shift 5-33 addition, subtraction, or move accumulator content 5-36 branch 5-66
call 5-77 execute 5-159 repeat single instruction 5-357 return 5-370 shift 5-389 subtract 5-463 count 5-134 Count Accumulator Bits (count) 5-134 Cross-Reference to Algebraic and Mnemonic Instruction Sets 7-1
D
delay 5-212 direct addressing modes 3-4 DP direct 3-4 PDP direct 3-5 register-bit direct 3-5 SP direct 3-5 Dual 16-Bit Addition and Subtraction Dual 16-Bit Additions 5-135 dual 16-bit arithmetic addition and subtraction 5-140 additions 5-135 subtraction and addition 5-154 subtractions 5-145 Dual 16-Bit Subtraction and Addition Dual 16-Bit Subtractions 5-145
5-140
5-154
E
Execute Conditionally (if execute) 5-159 exp 5-131, 5-132 Expand Accumulator Bit Field (field_expand) 5-166 extended auxiliary register (XAR) load from memory 5-209 load with immediate value 5-210 modify content 5-238 move content 5-247 pop content from stack pointers 5-330 push content to stack pointers 5-338 store to memory 5-462 Extract Accumulator Bit Field (field_extract)
5-167
Index-3
Index
F
field_expand 5-166 field_extract 5-167 finite impulse response (FIR) filter antisymmetrical 5-168 symmetrical 5-170 firs 5-170 firsn 5-168
instruction set opcode abbreviations 6-16 symbols 6-16 instruction set opcodes 6-2 instruction set summary 4-1 instruction set terms, symbols, and abbreviations 1-2 interrupt 5-411 intr 5-411
G
goto 5-70
L
Least Mean Square (lms) 5-173 linear 5-175 Linear Addressing Qualifier (linear) 5-175 List of Algebraic Instruction Opcodes 6-1 lms 5-173 load accumulator from memory 5-176 accumulator from memory with parallel store accumulator content to memory 5-185 accumulator pair from memory 5-187 accumulator with immediate value 5-190 accumulator, auxiliary, or temporary register from memory 5-193 accumulator, auxiliary, or temporary register with immediate value 5-199 auxiliary or temporary register pair from memory 5-203 CPU register from memory 5-204 CPU register with immediate value 5-207 extended auxiliary register (XAR) from memory 5-209 extended auxiliary register (XAR) with immediate value 5-210 memory with immediate value 5-211 Load Accumulator from Memory 5-176, 5-193 Load Accumulator from Memory with Parallel Store Accumulator Content to Memory 5-185 Load Accumulator Pair from Memory 5-187 Load Accumulator with Immediate Value 5-190, 5-199 Load Auxiliary Register from Memory 5-193 Load Auxiliary Register Pair from Memory 5-203 Load Auxiliary Register with Immediate Value 5-199 Load CPU Register from Memory 5-204
I
idle 5-172 if call 5-77 if execute 5-159 if goto 5-66, 5-74 if return 5-370 indirect addressing modes 3-6 AR indirect 3-6 CDP indirect 3-16 coefficient indirect 3-18 dual AR indirect 3-14 initialize memory 5-211 instruction qualifier circular addressing 5-87 linear addressing 5-175 memory-mapped register access 5-213 instruction set abbreviations 1-2 affect of status bits 1-9 conditional fields 1-7 nonrepeatable instructions 1-20 notes 1-14 opcode symbols and abbreviations 6-16 opcodes 6-2 operators 1-6 rules 1-14 symbols 1-2 terms 1-2 instruction set conditional fields 1-7 instruction set notes and rules 1-14 Index-4
Index
Load CPU Register with Immediate Value 5-207 Load Extended Auxiliary Register (XAR) from Memory 5-209 Load Extended Auxiliary Register (XAR) with Immediate Value 5-210 Load Memory with Immediate Value 5-211 Load Temporary Register from Memory Load Temporary Register with Immediate Value 5-199 localrepeat 5-346 logical bitwise AND 5-38 bitwise OR 5-48 bitwise XOR 5-57 count accumulator bits 5-134 shift accumulator content logically 5-391 shift accumulator, auxiliary, or temporary register content logically 5-394 5-193 5-203 Load Temporary Register Pair from Memory
M
mant 5-132 mar 5-214, 5-225, 5-229, 5-233, 5-238, 5-316 max 5-105 5-114 max_diff
max_diff_dbl 5-114 memory bit clear 5-89 complement (not) 5-130 set 5-385 test 5-508 test and clear 5-511 test and complement 5-512 test and set 5-513 Memory Delay (delay) 5-212 Memory-Mapped Register Access Qualifier (mmap) 5-213 min 5-108 min_diff 5-120 min_diff_dbl 5-120 mmap 5-213 mnemonic instruction set cross-reference to algebraic instruction set 7-1
modify auxiliary or temporary register content 5-225 auxiliary or temporary register content by addition 5-229 auxiliary or temporary register content by subtraction 5-233 auxiliary register content 5-214 auxiliary register content with parallel multiply 5-216 auxiliary register content with parallel multiply and accumulate 5-218 auxiliary register content with parallel multiply and subtract 5-223 data stack pointer 5-237 extended auxiliary register (XAR) content 5-238 Modify Auxiliary Register Content (mar) 5-214, 5-225 Modify Auxiliary Register Content by Addition (mar) 5-229 Modify Auxiliary Register Content by Subtraction (mar) 5-233 Modify Auxiliary Register Content with Parallel Multiply (mar) 5-216 Modify Auxiliary Register Content with Parallel Multiply and Accumulate (mar) 5-218 Modify Auxiliary Register Content with Parallel Multiply and Subtract (mar) 5-223 Modify Data Stack Pointer 5-237 Modify Extended Auxiliary Register Content (mar) 5-238 Modify Temporary Register Content (mar) 5-225 Modify Temporary Register Content by Addition (mar) 5-229 Modify Temporary Register Content by Subtraction (mar) 5-233 move accumulator content to auxiliary or temporary register 5-239 accumulator, auxiliary, or temporary register content 5-240 auxiliary or temporary register content to accumulator 5-242 auxiliary or temporary register content to CPU register 5-243 CPU register content to auxiliary or temporary register 5-245 extended auxiliary register content 5-247 memory delay 5-212 memory to memory 5-248
Index-5
Index
move (continued) pop accumulator or extended auxiliary register content from stack pointers 5-330 pop top of stack 5-331 push accumulator or extended auxiliary register content to stack pointers 5-338 push to top of stack 5-339 swap accumulator content 5-492 swap accumulator pair content 5-493 swap auxiliary and temporary register content 5-496 swap auxiliary and temporary register pair content 5-498 swap auxiliary and temporary register pairs content 5-500 swap auxiliary register content 5-494 swap auxiliary register pair content 5-495 swap temporary register content 5-502 swap temporary register pair content 5-503 Move Accumulator Content 5-240 Move Accumulator Content to Auxiliary Register 5-239 Move Accumulator Content to Temporary Register 5-239 Move Auxiliary Register Content 5-240 Move Auxiliary Register Content to Accumulator 5-242 Move Auxiliary Register Content to CPU Register 5-243 Move CPU Register Content to Auxiliary Register 5-245 Move CPU Register Content to Temporary Register 5-245 Move Extended Auxiliary Register (XAR) Content 5-247 Move Memory to Memory 5-248 5-240 Move Temporary Register Content
Multiply and Accumulate with Parallel Multiply 5-290 Multiply and Accumulate with Parallel Store Accumulator Content to Memory 5-292 Multiply and Subtract 5-294 Multiply and Subtract with Parallel Load Accumulator from Memory 5-302 Multiply and Subtract with Parallel Multiply 5-304 Multiply and Subtract with Parallel Multiply and Accumulate 5-306 Multiply and Subtract with Parallel Store Accumulator Content to Memory 5-311 Multiply with Parallel Multiply and Accumulate 5-267 Multiply with Parallel Store Accumulator Content to Memory 5-269
N
Negate Accumulator Content 5-313 5-313 5-313 Negate Auxiliary Register Content Negate Temporary Register Content negation accumulator content 5-313 auxiliary register content 5-313 temporary register content 5-313 No Operation (nop) nop 5-315 5-315 1-20 nonrepeatable instructions
O
operand qualifier OR 5-48 5-328
Move Temporary Register Content to Accumulator 5-242 Move Temporary Register Content to CPU Register 5-243 Multiply 5-255 Multiply and Accumulate (MAC) 5-271 5-286 Multiply and Accumulate with Parallel Delay Multiply and Accumulate with Parallel Load Accumulator from Memory 5-288 Index-6
P
Parallel Modify Auxiliary Register Contents (mar) 5-316 Parallel Multiplies 5-317 5-319 5-326 Parallel Multiply and Accumulates Parallel Multiply and Subtracts
Index
parallel operations addition with parallel store accumulator content to memory 5-29 load accumulator from memory with parallel store accumulator content to memory 5-185 modify auxiliary register content with parallel multiply 5-216 modify auxiliary register content with parallel multiply and accumulate 5-218 modify auxiliary register content with parallel multiply and subtract 5-223 modify auxiliary register contents 5-316 multiplies 5-317 multiply and accumulate with parallel delay 5-286 multiply and accumulate with parallel load accumulator from memory 5-288 multiply and accumulate with parallel multiply 5-290 multiply and accumulate with parallel store accumulator content to memory 5-292 multiply and accumulates 5-319 multiply and subtract with parallel load accumulator from memory 5-302 multiply and subtract with parallel multiply 5-304 multiply and subtract with parallel multiply and accumulate 5-306 multiply and subtract with parallel store accumulator content to memory 5-311 multiply and subtracts 5-326 multiply with parallel multiply and accumulate 5-267 multiply with parallel store accumulator content to memory 5-269 subtraction with parallel store accumulator content to memory 5-490 parallelism basics parallelism features 2-3 2-2 5-328
program control branch conditionally 5-66 branch on auxiliary register not zero 5-74 branch unconditionally 5-70 call conditionally 5-77 call unconditionally 5-83 compare and branch 5-111 execute conditionally 5-159 idle 5-172 no operation 5-315 repeat block of instructions unconditionally 5-346 repeat single instruction conditionally 5-357 repeat single instruction unconditionally 5-360 repeat single instruction unconditionally and decrement CSR 5-365 repeat single instruction unconditionally and increment CSR 5-367 return conditionally 5-370 return from interrupt 5-374 return unconditionally 5-372 software interrupt 5-411 software reset 5-413 software trap 5-417 pshboth 5-338 push 5-339 Push Accumulator Content to Stack Pointers (pshboth) 5-338 Push Extended Auxiliary Register (XAR) Content to Stack Pointers (pshboth) 5-338 Push to Top of Stack (push) 5-339
R
readport 5-328 register bit clear 5-88 complement (not) 5-128 set 5-384 test 5-504 test bit pair 5-506 repeat 5-360, 5-365, 5-367 Repeat Block of Instructions Unconditionally 5-346 Repeat Single Instruction Conditionally (while repeat) 5-357 Repeat Single Instruction Unconditionally (repeat) 5-360 Repeat Single Instruction Unconditionally and Decrement CSR (repeat) 5-365
Pop Accumulator Content from Stack Pointers (popboth) 5-330 Pop Extended Auxiliary Register (XAR) Content from Stack Pointers (popboth) 5-330 Pop Top of Stack (pop) popboth 5-330 5-331
Index-7
Index
Repeat Single Instruction Unconditionally and Increment CSR (repeat) 5-367 reset 5-413 resource conflicts in a parallel pair 2-4 return 5-372 Return Conditionally (if return) 5-370 Return from Interrupt (return_int) 5-374 Return Unconditionally (return) 5-372 return_int 5-374 rnd 5-380 Rotate Left Accumulator Content 5-376 Rotate Left Auxiliary Register Content 5-376 Rotate Left Temporary Register Content 5-376 Rotate Right Accumulator Content 5-378 Rotate Right Auxiliary Register Content 5-378 Rotate Right Temporary Register Content 5-378 Round Accumulator Content (rnd) 5-380 rounding 5-380
S
saturate 5-382 Saturate Accumulator Content (saturate) 5-382 set accumulator bit 5-384 auxiliary register bit 5-384 memory bit 5-385 status register bit 5-386 temporary register bit 5-384 Set Accumulator Bit 5-384 Set Auxiliary Register Bit 5-384 Set Memory Bit 5-385 Set Status Register Bit 5-386 Set Temporary Register Bit 5-384 sftc 5-389 Shift Accumulator Content Conditionally (sftc) 5-389 Shift Accumulator Content Logically 5-391, 5-394 Shift Auxiliary Register Content Logically 5-394 shift conditionally 5-389 shift logically 5-391, 5-394 Shift Temporary Register Content Logically 5-394 Signed Shift of Accumulator Content 5-397, 5-406 Signed Shift of Auxiliary Register Content 5-406 Signed Shift of Temporary Register Content 5-406 Index-8
soft-dual parallelism 2-5 Software Interrupt (intr) 5-411 Software Reset (reset) 5-413 Software Trap (trap) 5-417 sqdst 5-428 Square 5-419 Square and Accumulate 5-422 Square and Subtract 5-425 Square Distance (sqdst) 5-428 status register bit clear 5-90 set 5-386 store accumulator content to memory 5-430 accumulator pair content to memory 5-450 accumulator, auxiliary, or temporary register content to memory 5-453 auxiliary or temporary register pair content to memory 5-457 CPU register content to memory 5-458 extended auxiliary register (XAR) to memory 5-462 Store Accumulator Content to Memory 5-430, 5-453 Store Accumulator Pair Content to Memory 5-450 Store Auxiliary Register Content to Memory 5-453 Store Auxiliary Register Pair Content to Memory 5-457 Store CPU Register Content to Memory 5-458 Store Extended Auxiliary Register (XAR) to Memory 5-462 Store Temporary Register Content to Memory 5-453 Store Temporary Register Pair Content to Memory 5-457 subc 5-463 Subtract Conditionally 5-463 Subtraction 5-465 Subtraction with Parallel Store Accumulator Content to Memory 5-490 swap 5-492, 5-493, 5-494, 5-495, 5-496, 5-498, 5-500, 5-502, 5-503 Swap Accumulator Content (swap) 5-492 Swap Accumulator Pair Content (swap) 5-493 Swap Auxiliary and Temporary Register Content (swap) 5-496 Swap Auxiliary and Temporary Register Pair Content (swap) 5-498
Index
Swap Auxiliary and Temporary Register Pairs Content (swap) 5-500 Swap Auxiliary Register Content (swap) 5-494 Swap Auxiliary Register Pair Content (swap) 5-495 Swap Temporary Register Content (swap) 5-502 Swap Temporary Register Pair Content (swap) 5-503 Symmetrical Finite Impulse Response Filter (firs) 5-170
Test Memory Bit 5-508 Test Temporary Register Bit 5-504 Test Temporary Register Bit Pair 5-506 trap 5-417
U
unconditional branch 5-70 call 5-83 repeat block of instructions 5-346 repeat single instruction 5-360 repeat single instruction and decrement CSR 5-365 repeat single instruction and increment CSR 5-367 return 5-372 return from interrupt 5-374
T
test accumulator bit 5-504 accumulator bit pair 5-506 auxiliary register bit 5-504 auxiliary register bit pair 5-506 memory bit 5-508 temporary register bit 5-504 temporary register bit pair 5-506 Test Accumulator Bit 5-504 Test Accumulator Bit Pair 5-506 Test and Clear Memory Bit 5-511 Test and Complement Memory Bit 5-512 Test and Set Memory Bit 5-513 Test Auxiliary Register Bit 5-504 Test Auxiliary Register Bit Pair 5-506
W
while repeat 5-357 writeport 5-328
X
XOR 5-57
Index-9