JPH0324623A - Loop processing controller - Google Patents

Loop processing controller

Info

Publication number
JPH0324623A
JPH0324623A JP15904689A JP15904689A JPH0324623A JP H0324623 A JPH0324623 A JP H0324623A JP 15904689 A JP15904689 A JP 15904689A JP 15904689 A JP15904689 A JP 15904689A JP H0324623 A JPH0324623 A JP H0324623A
Authority
JP
Japan
Prior art keywords
loop
register
instruction
instructions
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP15904689A
Other languages
Japanese (ja)
Inventor
Seiji Baba
馬場 清治
Masayuki Fujii
雅之 藤井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP15904689A priority Critical patent/JPH0324623A/en
Publication of JPH0324623A publication Critical patent/JPH0324623A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To rapidly process a loop by adding a counter value indicating the number of addresses of executed instructions to the value of a 3rd register for holding the addresses of loop control instructions when a previously set loop condition is formed, and using the added value as the address of an instruction to be successively read out from a control storage circuit. CONSTITUTION:A firmware instruction from the control storage circuit 1 is temporarily stored in a 1st register 2, recoded by a decoder 3 and stored in a 2nd register 4. The formation of a loop condition in an instruction is detected by a detector 5. The counter 8 counts up the number of instructions to be repeatedly executed and inputs an address updating value to an adder 7 and the added value is held in the 3rd register 6. Then, the loop condition, the number of repeats to be executed and operation to be executed are stored in a 4th register 9, and when one of these contents is switched by a selector 11 and applied to the adder 7, the instruction to be read out next in the circuit 1 can be read out even when it is stored in an address other than continuous addresses, so that rapid loop processing can be attained.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はファームウェア命令により制御されるプロセッ
サにおけるファームウエア命令の実行に利用する。本発
明はループ処理におけるファームウェア命令の制御に関
する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention is utilized for the execution of firmware instructions in a processor controlled by the firmware instructions. The present invention relates to control of firmware instructions in loop processing.

〔概要〕〔overview〕

本発明はファームウエア命令の制御によりループ処理を
実行するプロセッサのループ処理制御装置において、 あらかじめ設定したループ条件が戊立しているときは、
Cループ制御命令のアドレスを保持する(第三の〉レジ
スタの値に、実行させた命令のアドレス数を示すカウン
タの値を加算しこれを制御記憶回路の次に読出す命令の
アドレスとすることにより、 ループ処理を高速に行い、複数の連続したファームウェ
ア命令を繰り返し実行できるようにし、条件分岐と複数
の演算命令からなるループ処理の実行性能を向上させる
ようにしたものである。
The present invention provides a loop processing control device for a processor that executes loop processing under the control of firmware instructions, when a preset loop condition is established.
Hold the address of the C loop control instruction (add the value of the counter indicating the number of addresses of executed instructions to the value of the third register and use this as the address of the next instruction to be read from the control storage circuit) This enables high-speed loop processing, allows multiple consecutive firmware instructions to be executed repeatedly, and improves the execution performance of loop processing consisting of conditional branches and multiple arithmetic instructions.

〔従来の技術〕[Conventional technology]

従来、この種のループ処理は少なくとも二つのファーム
ウエア命令を組み合わせて行われていた。
Conventionally, this type of loop processing has been performed by combining at least two firmware instructions.

すなわち、条件分岐命令と通常の演算あるいはメモリア
クセス命令によりループ処理が構或されていた。
That is, loop processing is constructed using conditional branch instructions and normal arithmetic or memory access instructions.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述した従来のループ処理は、最低二つのファームウェ
ア命令によって構或されており、条件分岐命令と演算あ
るいはメモリアクセス命令が分離しているため、ループ
回数をn回とすると少なくとも2×nステップの実行時
間を必要としていた。
The conventional loop processing described above consists of at least two firmware instructions, and the conditional branch instruction and operation or memory access instruction are separated, so if the number of loops is n, at least 2 x n steps are executed. I needed time.

プロセッサの処理速度向上が強く望まれる中で、ループ
処理に関する性能向上は最も大きなテーマの一つであり
、従来技術においてもループの回数の分だけ演算命令を
複数個記述し、少しでも条件判定のオーバヘッドをなく
そうというプログラミング上のテクニックが存在してい
た。
Amidst the strong desire to improve the processing speed of processors, improving the performance of loop processing is one of the most important themes, and in conventional technology, multiple arithmetic instructions are written for the number of loops, and condition judgment is improved even slightly. Programming techniques existed to eliminate overhead.

しかし、ループ回数が固定でない場合にはこの方法が使
用できないこと、およびメモリ使用効率が悪いことなど
の欠点があり、ほとんどの場合には条件分岐命令と演算
命令の組み合わせによりループ処理を実現していた。こ
のような場合は本来の演算に関する実行時間の2倍以上
の時間を必要とするために性能向上の妨げになる欠点が
あった。
However, this method cannot be used when the number of loops is not fixed, and has disadvantages such as poor memory usage efficiency. In most cases, loop processing is achieved by a combination of conditional branch instructions and arithmetic instructions. Ta. In such a case, the execution time required for the original calculation is more than twice as long, which has the disadvantage of hindering performance improvement.

本発明はこのような欠点を除去するもので、高速にルー
プ処理を行うことができる装置を提供することを目的と
する。
The present invention aims to eliminate such drawbacks and provides an apparatus that can perform loop processing at high speed.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は、ファームウェア命令を格納する制御記憶回路
と、この制御記憶回路より出力されたファームウェア命
令を一時保持する第一のレジスタと、この第一のレジス
タに保持されたファームウェア命令をデコードするデコ
ーダと、このデコード結果を保持する第二のレジスタと
、ループ制御命令中のループの条件が成立しているか否
かを検出する条件検出器と、前記制御記憶回路のアドレ
スを保持する第三のレジスタとを備えたループ処理制御
装置において、前記制御記憶回路のアドレスを計算して
前記第三のレジスタに与える加算器と、繰り返し実行さ
れる命令の数を記憶し1からこの命令の数までの数値を
順次出力し前記加算器に対しアドレスの更新値を人力す
るカウンタとを備えたことを特徴とする。
The present invention includes a control storage circuit that stores firmware instructions, a first register that temporarily holds the firmware instructions output from the control storage circuit, and a decoder that decodes the firmware instructions held in the first register. , a second register that holds the decoding result, a condition detector that detects whether a loop condition in the loop control instruction is satisfied, and a third register that holds the address of the control storage circuit. A loop processing control device comprising: an adder that calculates the address of the control storage circuit and supplies it to the third register; The present invention is characterized by comprising a counter that sequentially outputs an update value of the address to the adder.

加算器の人力にセレクタを介して第四のレジスタを設け
、この第四のレジスタは、ループ処理を制御するために
用いられるループ条件、繰り返し実行する命令数、条件
成立時に実行すべき演算が記述されたループ命令数にし
たがってループ制御命令のアドレスを保持させる構戊と
することができる。
A fourth register is provided in the adder via a selector, and this fourth register describes the loop conditions used to control loop processing, the number of instructions to be repeatedly executed, and the operations to be executed when the conditions are met. The address of the loop control instruction can be held according to the number of executed loop instructions.

〔作用〕[Effect]

ループ条件が成立している間はループ制御命令が記述さ
れた制御記憶回路のアドレスを保持するレジスタの値に
実行させた命令数を表すカウンタの値を加算して制御記
憶回路のアドレスを生或することによって複数の連続し
たファームウェア命令を繰り返し実行する。
While the loop condition is satisfied, the address of the control memory circuit is generated by adding the value of the counter representing the number of executed instructions to the value of the register that holds the address of the control memory circuit where the loop control instruction is written. Repeatedly executes multiple consecutive firmware instructions.

第四のレジスタを設け、セレクタによりこれを切換えて
加算器の入力に与えるようにすると、制御記憶回路の中
で次に読出すべき命令が連続するアドレス以外のアドレ
スに記憶されている場合にも対応できる。
By providing a fourth register and switching it with a selector to feed it to the input of the adder, even if the next instruction to be read is stored at an address other than consecutive addresses in the control storage circuit, I can handle it.

これにより、高速なループ処理を行うことができ、また
複数の連続したファームウェア命令を繰り返し実行する
ことができる。特に1ステップのループ命令の場合には
条件分岐命令と演算命令とを対にして処理するときの2
倍の性能で処理を行うことができ、少ないステップ数で
同様の処理を実行することができる。
This allows high-speed loop processing and allows multiple consecutive firmware instructions to be repeatedly executed. In particular, in the case of a one-step loop instruction, two
Processing can be performed with twice the performance, and similar processing can be performed with fewer steps.

〔実施例〕 次に本発明実施例を図面に基づいて説明する。〔Example〕 Next, embodiments of the present invention will be described based on the drawings.

図は本発明実施例の構或を示すブロック図である。The figure is a block diagram showing the structure of an embodiment of the present invention.

本発明実施例は、ファームウエア命令を格納する制御記
憶回路lと、この制御記憶回路lより読み出されたファ
ームウェア命令を保持する第一のレジスタ2と、ファー
ムウエア命令をデコードするデコーダ3と、デコーダ結
果を保持する第二のレジスタ4と、ループの条件が戒立
しているか否かを検出する条件検出器5と、次に読み出
すべきファームウェア命令のアドレスを保持する第三の
レジスタ6と、制御記憶回路lのアドレスを計算する加
算器7と、加算器7に入力するオフセット値を生威する
カウンタ8と、ループ制御命令のアドレスを格納する第
四のレジスタ9と、第一および第二のセレクタ10, 
11とを備える。
The embodiment of the present invention includes a control memory circuit l for storing firmware instructions, a first register 2 for holding firmware instructions read from the control memory circuit l, and a decoder 3 for decoding the firmware instructions. A second register 4 that holds the decoder result, a condition detector 5 that detects whether the loop condition is satisfied, and a third register 6 that holds the address of the firmware instruction to be read next. an adder 7 for calculating the address of the control storage circuit l; a counter 8 for generating an offset value input to the adder 7; a fourth register 9 for storing the address of the loop control instruction; selector 10,
11.

次に、このように構或された本発明実施例の動作につい
て説明する。
Next, the operation of the embodiment of the present invention constructed in this manner will be explained.

ループ制御命令でない通常の命令は制御記憶回路1から
読み出され、第一のレジスタ2に格納される。次に第一
のレジスタ2のファームウェア命令はデコーダ3に入力
され、命令のデコードが行われ第二のレジスタ4に人力
され実行される。
Normal instructions that are not loop control instructions are read from the control storage circuit 1 and stored in the first register 2. Next, the firmware instruction in the first register 2 is input to the decoder 3, the instruction is decoded, and then input to the second register 4 for execution.

ファームウェア命令のアドレスは加算器7により生戒さ
れる。第三のレジスタ6には次に読み出すべきファーム
ウエア命令のアドレスが格納される。ループ中でない場
合は第三のレジスタ6の出力をセレクタ1lにより選択
し加算器7に人力する。
The address of the firmware instruction is read by an adder 7. The third register 6 stores the address of the firmware instruction to be read next. If the loop is not in progress, the output of the third register 6 is selected by the selector 1l and inputted to the adder 7.

カウンタ8からは常に“1″を出力し、加算器7にて加
算することにより次に制御記憶回路1から読み出すファ
ームウェア命令のアドレスを生戊する。
The counter 8 always outputs "1", and the adder 7 adds it to generate the address of the firmware instruction to be read out from the control storage circuit 1 next.

ループ制御命令のみで1ステップのループを実行する場
合には、ループ制御命令中にはルーブすべき命令数とし
てゼロが格納されている。ループ制御命令がデコーダ3
に入力されると、条件検出器5によりループ条件が戒立
しているかどうかがチェックされる。
When executing a one-step loop using only a loop control instruction, zero is stored in the loop control instruction as the number of instructions to be looped. Loop control instruction is decoder 3
When the loop condition is input, the condition detector 5 checks whether the loop condition is satisfied.

条件が威立した場合には第一のセレクタlOはデコーダ
3の出力を選択する。ループ条件が成立している間はデ
コーダ3に入力されたファームウェア命令は再度デコー
ダ3に入力されると同時に制御記憶回路1からのファー
ムウエア命令の読み出しは行わない。この操作によりl
ステップのループを実現することができる。
If the conditions are met, the first selector lO selects the output of the decoder 3. While the loop condition is satisfied, the firmware command input to the decoder 3 is input to the decoder 3 again, and at the same time, the firmware command is not read from the control storage circuit 1. With this operation, l
A loop of steps can be realized.

次に、ループ制御命令の後にステップのループを実行す
る場合について説明する。この場合ループ制御命令中に
はループすべき命令数nが格納される。ループ制御命令
がデコーダ3に人力されると、カウンタ8に繰り返し実
行される命令数nがカウントの最大値としてセットされ
る。ループ制御命令のアドレスは第四のレジスタ9に保
持される。条件検出器5によりループ条件が成立してい
ることが確認されると、カウンタ8はlを初期値として
1ずつカウントアップする。
Next, a case will be described in which a step loop is executed after a loop control instruction. In this case, the number n of instructions to be looped is stored in the loop control instruction. When a loop control command is manually input to the decoder 3, the number n of commands to be repeatedly executed is set in the counter 8 as the maximum value of the count. The address of the loop control instruction is held in the fourth register 9. When the condition detector 5 confirms that the loop condition is satisfied, the counter 8 counts up by 1 with l as the initial value.

加算器7ではカウンタ8のカウント値とループ制御命令
のアドレスを加算することによって制御記憶回路1から
読み出すべきファームウエア命令のアドレスを生或する
。カウント値が最大値nを越えると、カウント値がゼロ
にリセットされ加算器7では再びループ制御命令のアド
レスが生戊される。
The adder 7 generates the address of the firmware instruction to be read from the control storage circuit 1 by adding the count value of the counter 8 and the address of the loop control instruction. When the count value exceeds the maximum value n, the count value is reset to zero and the adder 7 generates the address of the loop control command again.

このアドレス生戊機能により制御記憶回路1からはルー
プ制御命令以降のファームウェア命令がn命令分順次読
み出され、第一のレジスタ2およびデコーダ3を経由し
第二のレジスタ4に格納され実行される。カウント値が
ゼロにリセットされると、再び制御記憶回路lからルー
プ制御命令が読み出されループ条件が戊立している間は
同様の繰り返し動作が行われる。
This address generation function sequentially reads n firmware instructions after the loop control instruction from the control storage circuit 1, stores them in the second register 4 via the first register 2 and decoder 3, and executes them. . When the count value is reset to zero, the loop control command is read again from the control storage circuit 1, and the same repeated operation is performed while the loop condition is satisfied.

ループ条件が不戊立であった場合は、カウンタ8にセッ
トされた繰り返し実行される命令数nに1を加えて値が
カウンタ8より出力される。加算器7ではカウンタ8の
出力とループ制御命令のアドレスを加えることによって
ループ処理から抜け出すためのアドレス生成が行われる
If the loop condition is not satisfied, the counter 8 outputs a value obtained by adding 1 to the number n of instructions to be repeatedly executed set in the counter 8. Adder 7 generates an address for exiting from loop processing by adding the output of counter 8 and the address of the loop control command.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明によれば、ループ制御命令中
に繰り返し実行すべき命令の個数を記述し、繰り返し個
数がゼロの場合には制御記憶域からの命令読み出しを止
めてデコーダへ入力されたファームウエア命令を再びデ
コーダへ入力することにより、高速なループ処理を行う
ことができる。
As explained above, according to the present invention, the number of instructions to be repeatedly executed is written in the loop control instruction, and when the number of repeats is zero, instruction reading from the control storage area is stopped and the instructions are input to the decoder. By inputting the firmware instructions to the decoder again, high-speed loop processing can be performed.

また、繰り返し個数がゼロでない場合には繰り返し個数
を最大値とするカウンタのカウント値とループ制御命令
のアドレスを加え、ループ制御命令以降に繰り返し実行
すべき命令を順次実行することにより、複数の連続した
ファームウエア命令を繰り返し実行することができる。
In addition, if the number of repetitions is not zero, add the count value of the counter whose maximum value is the number of repetitions and the address of the loop control instruction, and sequentially execute the instructions that should be repeatedly executed after the loop control instruction. The firmware instructions can be executed repeatedly.

特に1ステップのループ命令では従来の条件分岐命令と
演算命令の対のループ処理の2倍の性能で処理を行うこ
とができ、また、従来のループ処理より少ないステップ
数で同様の処理を行うことができるなどの効果がある。
In particular, a one-step loop instruction can perform processing with twice the performance of conventional loop processing of a pair of conditional branch instruction and arithmetic instruction, and it is also possible to perform the same processing with fewer steps than conventional loop processing. There are effects such as being able to.

【図面の簡単な説明】[Brief explanation of drawings]

図は本発明実施例の構戒を示すブロック図。 ■・・・制御記憶回路、2、4、6、9・・・レジスタ
、3・・・デコーダ、5・・・条件検出器、7・・・加
算器、8・・・カウンタ、10、1l・・・セレクタ。
The figure is a block diagram showing the structure of an embodiment of the present invention. ■... Control storage circuit, 2, 4, 6, 9... Register, 3... Decoder, 5... Condition detector, 7... Adder, 8... Counter, 10, 1l ···selector.

Claims (1)

【特許請求の範囲】 1、ファームウェア命令を格納する制御記憶回路と、 この制御記憶回路より出力されたファームウェア命令を
一時保持する第一のレジスタと、 この第一のレジスタに保持されたファームウェア命令を
デコードするデコーダと、 このデコード結果を保持する第二のレジスタと、ループ
制御命令中のループの条件が成立しているか否かを検出
する条件検出器と、 前記制御記憶回路のアドレスを保持する第三のレジスタ
と を備えたループ処理制御装置において、 前記制御記憶回路のアドレスを計算して前記第三のレジ
スタに与える加算器と、 繰り返し実行される命令の数を記憶し1からこの命令の
数までの数値を順次出力し前記加算器に対しアドレスの
更新値を入力するカウンタとを備えたことを特徴とする
ループ処理制御装置。
[Claims] 1. A control storage circuit that stores firmware instructions; a first register that temporarily holds firmware instructions output from the control storage circuit; a decoder for decoding, a second register for holding the decoding result, a condition detector for detecting whether a loop condition in a loop control instruction is satisfied, and a second register for holding an address of the control storage circuit. a loop processing control device comprising three registers, an adder that calculates the address of the control storage circuit and supplies it to the third register; and an adder that stores the number of instructions to be repeatedly executed and calculates the number of instructions from 1 to the number of this instruction. A loop processing control device comprising: a counter that sequentially outputs numerical values up to and inputs an updated value of an address to the adder.
JP15904689A 1989-06-21 1989-06-21 Loop processing controller Pending JPH0324623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15904689A JPH0324623A (en) 1989-06-21 1989-06-21 Loop processing controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15904689A JPH0324623A (en) 1989-06-21 1989-06-21 Loop processing controller

Publications (1)

Publication Number Publication Date
JPH0324623A true JPH0324623A (en) 1991-02-01

Family

ID=15685047

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15904689A Pending JPH0324623A (en) 1989-06-21 1989-06-21 Loop processing controller

Country Status (1)

Country Link
JP (1) JPH0324623A (en)

Similar Documents

Publication Publication Date Title
JPS59174948A (en) Information processing device
JPH02161524A (en) Branch system used for pipeline computer
US4954947A (en) Instruction processor for processing branch instruction at high speed
US5390306A (en) Pipeline processing system and microprocessor using the system
JPH0324623A (en) Loop processing controller
JPS583040A (en) Information processor
JP2000181707A (en) Instruction controller and its method
JPS6125166B2 (en)
JP2825315B2 (en) Information processing device
JPS6116334A (en) Data processor
JPH0353322A (en) Information processor
JPH0218732B2 (en)
JPH0338726A (en) Branch instruction processor
JPH04317130A (en) Data processor
JPH04137169A (en) Information processor
JPS63197233A (en) Information processor
JPH03201131A (en) Loop instruction processing system
JPH02100136A (en) Information processor
JPH0256027A (en) Parallel processing system for digital signal processor
JPH04287227A (en) Operation processor
JPH0431134B2 (en)
JPH01195532A (en) Microprocessor
JPH04167150A (en) Computer containing list instruction processor
JPH01241627A (en) Microprogram controller
JPH02217922A (en) Data processor