Browse Prior Art Database

Auto-Looping Mechanism with Automatic Return for Subroutine

IP.com Disclosure Number: IPCOM000110830D
Original Publication Date: 1994-Jan-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 6 page(s) / 218K

Publishing Venue

IBM

Related People

Jones Jr, GD: AUTHOR [+4]

Abstract

Digital signal processing for multi-media applications often involves the repetitive execution of a code segment. In order to minimize the overhead required to control this repetitive execution, various "Zero Overhead" or "Auto-Looping" mechanisms have been designed and implemented. However, such Auto-Looping mechanisms are best utilized for "in-line" code. When Auto-Looping is used within a subroutine, an explicit Return-from-Subroutine type of Branch instruction is required to return program flow to the code which invoked the subroutine. This extra Branch instruction does not contribute to the completion of the task at hand, and can be considered overhead. In applications where both performance must be maximized and instruction storage space must be minimized (such as JPEG and MPEG), this overhead can be costly.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 29% of the total text.

Auto-Looping Mechanism with Automatic Return for Subroutine

      Digital signal processing for multi-media applications often
involves the repetitive execution of a code segment.  In order to
minimize the overhead required to control this repetitive execution,
various "Zero Overhead" or "Auto-Looping" mechanisms have been
designed and implemented.  However, such Auto-Looping mechanisms are
best utilized for "in-line" code.  When Auto-Looping is used within a
subroutine, an explicit Return-from-Subroutine type of Branch
instruction is required to return program flow to the code which
invoked the subroutine.  This extra Branch instruction does not
contribute to the completion of the task at hand, and can be
considered overhead.  In applications where both performance must be
maximized and instruction storage space must be minimized (such as
JPEG and MPEG), this overhead can be costly.

      The Auto-Looping mechanism described here eliminates the
requirement for this explicit Return-from-Subroutine Branch
instruction.  When completion of all iterations in a loop is
detected, the return address is automatically placed in the
instruction address register so that the next instruction fetched is
located in the code segment which called the repetitive subroutine.

There are two key elements in this invention.  They are:

1.  Subroutine Call instructions which:

    o   save the return address in a register, and

    o   set the Loop Start Address register of the Auto-Looping
        mechanism to the target of the Subroutine Call.

2.  An Auto-Looping mechanism which detects completion of the last
    iteration in a loop and places the return address in the
    Instruction Address Register.

Although these are the unique parts of this invention, it is
necessary to describe the entire looping mechanism in order to
provide a complete understanding.

      In one Digital Signal Processor, automatic looping takes the
form of the following programming construct:

        DO LE UNTIL LC = 0

            First Instruction in Loop   (Loop Start Address)

            Second Instruction in Loop

             ...

             ...

        LE  Last Instruction in Loop    (Loop End Address)
where "LE" is the ending address of the Loop, and "LC" (Loop Count)
is the number of iterations the loop is to be executed.  Note that in
this construct, the instructions within the loop are always executed
at least once.  This is because the test to leave the loop is
performed at the end of the loop.  Loop control is part of the
instruction flow control function, and the looping logic provides the
controls necessary to test for end-of-loop, branch to the starting
instruction, and count the number of times the loop has been
executed.  Using these capabilities, DO UNTIL loops can be
implemented with zero in-loop overhead.

      The general philosophy of the loop contro...