EasyManuals Logo

Infineon TriCore TC1.6P User Manual

Infineon TriCore TC1.6P
484 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #40 background imageLoading...
Page #40 background image
TriCore
®
TC1.6P & TC1.6E
32-bit Unified Processor Core
Instruction Set Overview
V1.0 2013-07
User Manual (Volume 2) 2-18
Conditional Jumps on Bits
Conditional jumps can be performed based on the value of any bit in any data register. The JZ.T instruction jumps
when the bit is clear, and the JNZ.T instruction jumps when the bit is set. For these instructions the jump
displacement field is 15-bits.
There are two 16-bit instructions that test any of the lower 16-bits in the implicit register D[15] and have a
displacement field of 4-bit zero extended constant.
2.9.3 Loop Instructions
Four special versions of conditional jump instructions are intended for efficient implementation of loops:
•JNEI
•JNED
•LOOP
•LOOPU
Loop Instructions with Auto Incrementing/Decrementing Counter
The JNEI (Jump if Not Equal and Increment) and JNED (Jump if Not Equal and Decrement) instructions are similar
to a normal JNE instruction, but with an additional increment or decrement operation of the first register operand.
The increment or decrement operation is performed unconditionally after the comparison. The jump displacement
field is 15 bits.
For example, a loop that should be executed for D[3] = 3, 4, 5 ... 10, can be implemented as follows:
lea d3, 3
loop1:
...
jnei d3, 10, loop1
Loop Instructions with Reduced Execution Overhead
The LOOP instruction is a special kind of jump which utilizes the TriCore hardware that implements ‘zero
overhead’ loops.
The LOOP instruction only requires execution time in the pipeline the first and last time it is executed (for a given
loop). For all other iterations of the loop, the LOOP instruction has zero execution time.
A loop that should be executed 100 times for example, may be implemented as:
mova a2, 99
loop2:
...
loop a2, loop2
This LOOP instruction (in the example above) requires execution cycles the first time it is executed, but the other
99 executions require no cycles.
Note that the LOOP instruction differs from the other conditional jump instructions in that it uses an address
register, rather than a data register, for the iteration count. This allows it to be used in filter calculations in which a
large number of data register reads and writes occur each cycle. Using an address register for the LOOP
instruction reduces the need for an extra data register read port.
The LOOP instruction has a 32-bit version using a 15-bit displacement field (left-shifted by one bit and sign-
extended), and a 16-bit version that uses a 4-bit displacement field. Unlike other 16-bit relative jumps, the 4-bit
value is one-extended rather than zero-extended, because this instruction is specifically intended for loops.
An unconditional variant of the LOOP instruction, LOOPU, is also provided. This instruction utilizes the zero
overhead LOOP hardware. Such an instruction is used at the end of a while LOOP body to optimize the jump back
to the start of the while construct.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Infineon TriCore TC1.6P and is the answer not in the manual?

Infineon TriCore TC1.6P Specifications

General IconGeneral
BrandInfineon
ModelTriCore TC1.6P
CategoryMicrocontrollers
LanguageEnglish

Related product manuals