JPH07120282B2 - Branch instruction processor - Google Patents

Branch instruction processor

Info

Publication number
JPH07120282B2
JPH07120282B2 JP20038286A JP20038286A JPH07120282B2 JP H07120282 B2 JPH07120282 B2 JP H07120282B2 JP 20038286 A JP20038286 A JP 20038286A JP 20038286 A JP20038286 A JP 20038286A JP H07120282 B2 JPH07120282 B2 JP H07120282B2
Authority
JP
Japan
Prior art keywords
instruction
address
branch
stack
operand
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.)
Expired - Lifetime
Application number
JP20038286A
Other languages
Japanese (ja)
Other versions
JPS6355640A (en
Inventor
雅彦 山毛利
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 JP20038286A priority Critical patent/JPH07120282B2/en
Publication of JPS6355640A publication Critical patent/JPS6355640A/en
Publication of JPH07120282B2 publication Critical patent/JPH07120282B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

【発明の詳細な説明】 技術分野 本発明は分岐命令処理装置に関し、特に命令の先行制御
を行う情報処理装置における分岐命令処理装置に関する
ものである。
Description: TECHNICAL FIELD The present invention relates to a branch instruction processing device, and more particularly to a branch instruction processing device in an information processing device for performing advance control of instructions.

従来技術 従来、命令の先行処理を採用した情報処理装置にあって
は、分岐命令、特に条件分岐命令処理では、命令の実行
時にならなければ分岐条件が判定できないので、分岐先
アドレスが予測できない。また、予測できたとしても、
予測に失敗した場合には分岐命令処理に余分なオーバヘ
ッドを生じる。
2. Description of the Related Art Conventionally, in an information processing apparatus that employs instruction prior processing, in branch instructions, particularly conditional branch instruction processing, the branch condition cannot be determined until the instruction is executed, so the branch destination address cannot be predicted. Also, even if you can predict,
If the prediction is unsuccessful, an extra overhead is generated in branch instruction processing.

しかしながら、実際のプログラムにおいては、第2図に
示す様にある条件を判定して1命令をスキップするよう
なコーディングが多く用いられている。従来、この様な
ケースの分岐命令を高速化するための技術として、スキ
ップされる命令(第2図のADD命令)を先行処理して演
算処理装置に供給し、もしこの命令がスキップされる場
合は演算実行時に結果の書込みを抑止するような方式が
ある(例えば、特公昭50-5540号公報参照)。
However, in an actual program, coding is often used to judge a certain condition and skip one instruction as shown in FIG. Conventionally, as a technique for speeding up a branch instruction in such a case, if a skipped instruction (ADD instruction in FIG. 2) is processed in advance and supplied to an arithmetic processing unit, and if this instruction is skipped, There is a method for suppressing the writing of the result when the calculation is executed (for example, see Japanese Patent Publication No. 5-5540).

かかる従来技術では、スキップされる命令をあたかもNO
P(No Operation)命令の如く実行するので、本来不要
であるべき命令を実行することとなり、それだけ性能低
下の要因となるという欠点がある。
In such a conventional technique, the instruction to be skipped is as if NO.
Since the instruction is executed like a P (No Operation) instruction, an instruction that should not be needed is executed, which has the drawback of degrading the performance.

発明の目的 そこで本発明はこのような従来技術の欠点を解決すべく
なされたものであって、その目的とするところは、不必
要な命令の演算実行を抑止するようにして性能低下を防
止しつつ分岐命令の高速処理を可能とした分岐命令処理
装置を提供することにある。
SUMMARY OF THE INVENTION Therefore, the present invention has been made to solve the above-mentioned drawbacks of the prior art, and an object of the present invention is to prevent the execution of unnecessary instructions by arithmetic operations so as to prevent performance degradation. It is another object of the present invention to provide a branch instruction processing device that enables high-speed processing of branch instructions.

発明の構成 本発明によれば、命令とオプランドとを対にして保持す
べく複数のエントリより構成されたオペランドスタック
を有し、命令の先行制御を行うようにした情報処理装置
における分岐命令処理方式であって、前記オペランドス
タックの読出しアドレスを供給する手段と、命令語のア
ドレスと分岐先アドレスとの差分を求める手段と、前記
オペランドスタックの読出しアドレスを前記差分に応じ
て補正する手段とを含むことを特徴とする分岐命令処理
装置が得られる。
According to the present invention, a branch instruction processing method in an information processing apparatus having an operand stack composed of a plurality of entries for holding an instruction and an opland in a pair and performing advance control of the instruction And means for supplying a read address of the operand stack, means for obtaining a difference between an instruction word address and a branch destination address, and means for correcting the read address of the operand stack according to the difference. A branch instruction processing device characterized by the above is obtained.

実施例 以下、図面を用いて本発明の実施例を説明する。Embodiments Embodiments of the present invention will be described below with reference to the drawings.

第1図は本発明の実施例のブロック図である。図におい
て、1は先取りスタックであり、命令語、オペランド、
オペランドアドレス等を対にして複数対格納可能なエン
トリ容量を有する。この先取りスタック1の書込みアド
レスはアドレスレジスタ2及びインクリメンタ11により
生成される。またこのスタック1の読出しアドレスはア
ドレスレジスタ3及びインクリメンタ12、更には加算器
4により生成される。
FIG. 1 is a block diagram of an embodiment of the present invention. In the figure, 1 is a prefetch stack, which is an instruction word, an operand,
It has an entry capacity capable of storing a plurality of pairs of operand addresses and the like. The write address of the prefetch stack 1 is generated by the address register 2 and the incrementer 11. The read address of the stack 1 is generated by the address register 3, the incrementer 12, and the adder 4.

オペランドアドレスレジスタ5は現在実行中の命令のオ
ペランドアドレスを保持するものであり、また命令カウ
ンタ6は現在実行中の命令の命令語アドレスを保持する
ものである。減算器7はオペランドアドレスレジスタ5
の出力と命令カウンタ6の出力との減算を行うものであ
り、この減算結果が制御部8へ供給されている。また、
この減算結果302は、加算器4の一方の加算入力(読出
しアドレスレジスタ3の出力に加算するためのデータ)
を選択する2入力/1出力セレクタ9の入力となってい
る。このセレクタ9の他入力には「0」が印加されてい
る。尚、13は命令カウンタ6の内容を+1するためのイ
ンクリメンタである。
The operand address register 5 holds the operand address of the instruction currently being executed, and the instruction counter 6 holds the instruction word address of the instruction currently being executed. Subtractor 7 is operand address register 5
Is subtracted from the output of the instruction counter 6, and the result of this subtraction is supplied to the control unit 8. Also,
This subtraction result 302 is one addition input of the adder 4 (data to be added to the output of the read address register 3)
It is an input of the 2-input / 1-output selector 9 for selecting. “0” is applied to the other input of the selector 9. Incidentally, 13 is an incrementer for incrementing the content of the instruction counter 6.

命令の先取りが完了すると、命令語,オペランド,オペ
ランドアドレス等のエントリ対が先取りスタック1に線
101を介して設定されると同時に、書込みアドレスレジ
スタ2の内容もインクリメンタ11により更新される。次
に、演算ユニット(図示せず)が起動されると先取りス
タック1の内容がこの演算ユニットへ転送される。この
とき、先取りスタック1の読出しアドレスはレジスタ3
の内容である。すなわち、選択器9では「0」データが
選択されており、加算器4でこのレジスタ3の内容と
「0」データとの加算が行われ、先取りスタック1の読
出しアドレスが生成される。
When the instruction prefetching is completed, the entry pairs of the instruction word, operand, operand address, etc. are lined up on the prefetch stack 1.
At the same time as being set via 101, the contents of the write address register 2 are also updated by the incrementer 11. Next, when an arithmetic unit (not shown) is activated, the contents of the prefetch stack 1 are transferred to this arithmetic unit. At this time, the read address of the prefetch stack 1 is the register 3
Is the content of. That is, the selector 9 selects "0" data, and the adder 4 adds the contents of the register 3 and "0" data to generate the read address of the prefetch stack 1.

ここで、オペランドアドレスレジスタ5は現在実行中の
オペランドアドレスを保持しており、また命令カウンタ
6は現在実行中の命令の命令語アドレスを保持してお
り、この命令カウンタ6は命令の実行が終了する毎にイ
ンクリメンタ13により+1更新されるものである。
Here, the operand address register 5 holds the operand address currently being executed, the instruction counter 6 holds the instruction word address of the instruction currently being executed, and the instruction counter 6 finishes executing the instruction. Each time it is done, the incrementer 13 updates it by +1.

第3図は第2図に示した如き命令シーケンスを処理する
際の先取りスタック1への命令の格納態様を示した図で
ある。いま、JNE命令を実行するとする。アドレス
「2」に対応したエントリより先行処理した情報が読出
され、オペランドアドレス、すなわち分岐先アドレスが
オペランドアドレスレジスタ5にセットされる。このと
き、命令カウンタ6の内容を「100」とすると、オペラ
ンドアドレスレジスタ5には「102」がセットされるこ
とになる。この時点で、読出しアドレスレジスタ3は+
1更新されて「3」となる。
FIG. 3 is a diagram showing the manner of storing instructions in the prefetch stack 1 when processing the instruction sequence as shown in FIG. Now, suppose that the JNE instruction is executed. The preprocessed information is read from the entry corresponding to the address "2", and the operand address, that is, the branch destination address is set in the operand address register 5. At this time, if the content of the instruction counter 6 is "100", "102" is set in the operand address register 5. At this point, the read address register 3 becomes +
It is updated by 1 to become "3".

このJNE命令の実行によって分岐GOが判定されると、線2
01を通じて制御部8へこれが報告される。一方、減算器
7においては、オペランドアドレスレジスタ5の内容か
ら、命令カウンタ6の内容に+1した値が差引かれる如
き演算が行われる。いま、オペランドアドレスは「10
2」であり、命令カウンタ6の内容は「100」であること
から、減算結果は「1」となる。この結果は制御部8へ
入力されてスキップ可能か否かが判断され、スキップ可
能と判断された場合、線301によりセレクタ9が制御さ
れて減算器7の出力302が選択される様動作する。よっ
て、加算器4へ読出しアドレスの補正値「1」が送られ
ることになる。
If branch GO is determined by executing this JNE instruction, line 2
This is reported to the control unit 8 through 01. On the other hand, the subtracter 7 performs an operation such that a value obtained by adding 1 to the content of the instruction counter 6 is subtracted from the content of the operand address register 5. Now, the operand address is "10
2 ”and the content of the instruction counter 6 is“ 100 ”, the subtraction result is“ 1 ”. This result is input to the control unit 8 to determine whether skipping is possible. If it is determined that skipping is possible, the selector 9 is controlled by the line 301 and the output 302 of the subtracter 7 is selected. Therefore, the correction value "1" of the read address is sent to the adder 4.

いま、先取りスタック1の読出しアドレスレジスタ3の
内容は「3」となっているので、読出しアドレスは「3
+1」と補正され「4」となり、ADD命令をスキップし
て分岐先であるST命令を読出して後続命令として実行さ
れるようになるのである。
Since the content of the read address register 3 of the prefetch stack 1 is "3", the read address is "3".
It is corrected to "+1" and becomes "4", the ADD instruction is skipped, the ST instruction which is the branch destination is read, and the instruction is executed as the subsequent instruction.

減算器7による減算結果が、先取りスタック1の容量に
より定まる所定値より大となった場合には、先取りスタ
ック1の読出しアドレスをその減算結果によって補正し
ても、先取りスタック1の最大アドレス値を越えてしま
うことになる。そこで、制御部8はこの減算結果を予め
定められた所定値と比較し、減算結果がこの所定値以下
であれば先取りスタック1内のエントリにスキップ可能
と判断して、先述した如く読出しアドレスの補正をなす
のである。
When the subtraction result of the subtractor 7 becomes larger than the predetermined value determined by the capacity of the prefetch stack 1, even if the read address of the prefetch stack 1 is corrected by the subtraction result, the maximum address value of the prefetch stack 1 remains unchanged. Will be exceeded. Therefore, the control unit 8 compares the subtraction result with a predetermined value, and if the subtraction result is less than or equal to the predetermined value, determines that the entry in the prefetch stack 1 can be skipped. Make a correction.

こうすることにより、不必要な命令を演算実行すること
なく分岐命令の高速処理が可能となる。
By doing so, high-speed processing of branch instructions becomes possible without executing unnecessary instructions.

発明の効果 叙上の如く、本発明によれば先取りスタックの読出しア
ドレスを分岐命令の実行による分岐GO判定に応答して補
正する様にしたので、分岐GOによるスキップ先のアドレ
スが自動的に生成されることになり、不必要な命令の演
算実行が抑止され、性能低下が防止されるという効果が
ある。
As described above, according to the present invention, the read address of the prefetch stack is corrected in response to the branch GO judgment by the execution of the branch instruction, so that the skip destination address is automatically generated by the branch GO. As a result, the execution of unnecessary instructions is suppressed and the performance is prevented from being degraded.

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

第1図は本発明の実施例のブロック図、第2図は命令シ
ーケンスの1例を示す図、第3図は先取りスタックの格
納態様を示す図である。 主要部分の符号の説明 1……先取りスタック 3……読出しアドレスレジスタ 4……加算器 5……オペランドアドレスレジスタ 6……命令カウンタ 7……減算器 8……制御部 9……セレクタ
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a diagram showing an example of an instruction sequence, and FIG. 3 is a diagram showing a storage mode of a prefetch stack. Description of symbols of main part 1 ... Prefetch stack 3 ... Read address register 4 ... Adder 5 ... Operand address register 6 ... Instruction counter 7 ... Subtractor 8 ... Control unit 9 ... Selector

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】命令とオペランドとを対にして保持すべく
複数のエントリより構成されたオペランドスタックを有
し、命令の先行制御を行うようにした情報処理装置にお
ける分岐命令処理方式であって、前記オペランドスタッ
クの読出しアドレスを供給する手段と、命令語のアドレ
スと分岐先アドレスとの差分を求める手段と、前記オペ
ランドスタックの読出しアドレスを前記差分に応じて補
正する手段とを含むことを特徴とする分岐命令処理装
置。
1. A branch instruction processing method in an information processing apparatus, comprising: an operand stack composed of a plurality of entries for holding instructions and operands in pairs, and performing advance control of instructions. A read address of the operand stack, a means for obtaining a difference between an instruction word address and a branch destination address, and a means for correcting the read address of the operand stack according to the difference. Branch instruction processing device.
JP20038286A 1986-08-27 1986-08-27 Branch instruction processor Expired - Lifetime JPH07120282B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20038286A JPH07120282B2 (en) 1986-08-27 1986-08-27 Branch instruction processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20038286A JPH07120282B2 (en) 1986-08-27 1986-08-27 Branch instruction processor

Publications (2)

Publication Number Publication Date
JPS6355640A JPS6355640A (en) 1988-03-10
JPH07120282B2 true JPH07120282B2 (en) 1995-12-20

Family

ID=16423388

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20038286A Expired - Lifetime JPH07120282B2 (en) 1986-08-27 1986-08-27 Branch instruction processor

Country Status (1)

Country Link
JP (1) JPH07120282B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2736580B2 (en) * 1992-03-10 1998-04-02 中国電力株式会社 Thermal storage tank using solid-liquid mixed thermal storage material

Also Published As

Publication number Publication date
JPS6355640A (en) 1988-03-10

Similar Documents

Publication Publication Date Title
JP2678183B2 (en) Digital processor controller and method for runtime memory allocation
US4782441A (en) Vector processor capable of parallely executing instructions and reserving execution status order for restarting interrupted executions
JP2883784B2 (en) Microcomputer
JPS63175934A (en) Data processor
EP0655679B1 (en) Method and apparatus for controlling instruction in pipeline processor
EP0297943B1 (en) Microcode reading control system
JP3630804B2 (en) Data processing device
US5964870A (en) Method and apparatus for using function context to improve branch
US6308242B1 (en) Apparatus for adaptively controlling a prefetch queue based on various flush conditions
JPH07120282B2 (en) Branch instruction processor
US7080236B2 (en) Updating stack pointer based on instruction bit indicator without executing an update microinstruction
US4775933A (en) Address generation system
JPH01291327A (en) Processing mode prefetch control system
JP2894438B2 (en) Pipeline processing equipment
JP3313969B2 (en) Information processing device
JPS6235694B2 (en)
JPS6149695B2 (en)
JPH09223009A (en) Device and method for processing data
JP2000112754A (en) Data processor
JPS6116334A (en) Data processor
JPH04338825A (en) Arithmetic processor
JP2002323983A (en) Instruction generating method, instruction generating method and information processor
JPS6212532B2 (en)
JPH06301534A (en) Information processor
JP2002287984A (en) Information processing device