JPH05108345A - Branch instruction processor - Google Patents

Branch instruction processor

Info

Publication number
JPH05108345A
JPH05108345A JP3267954A JP26795491A JPH05108345A JP H05108345 A JPH05108345 A JP H05108345A JP 3267954 A JP3267954 A JP 3267954A JP 26795491 A JP26795491 A JP 26795491A JP H05108345 A JPH05108345 A JP H05108345A
Authority
JP
Japan
Prior art keywords
branch
instruction
output
selection circuit
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
JP3267954A
Other languages
Japanese (ja)
Inventor
Masahiro Fukuda
政広 福田
Terumi Nakajima
輝美 中島
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 JP3267954A priority Critical patent/JPH05108345A/en
Publication of JPH05108345A publication Critical patent/JPH05108345A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/30Hydrogen technology
    • Y02E60/50Fuel cells

Abstract

PURPOSE:To increase the data processing speed and to improve the data processing efficiency by using the hardware to carry out a branch instruction. CONSTITUTION:When a branch instruction is received, the branch destination address corresponding to the output of a program counter 100 is retrieved and outputted by the output through the branch address storing associative memories 611-613. At the same time, the increase of the count value of the counter 100 is stopped by the output of an instruction decoder 310. Then the branch addresses outputted from the memories 611-613 are selected based on the branch conditions and applied to the counter 100. The output of the counter 100 is applied to an instruction storing memory 200.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、ストアードプログラム
方式の演算処理装置に利用する。本発明は特にマルチウ
エイ分岐を効率的に実行する分岐命令処理装置に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is used in a stored program type arithmetic processing unit. The present invention particularly relates to a branch instruction processing device that efficiently executes multiway branching.

【0002】[0002]

【従来の技術】LSI製造技術の発達により、処理能力
の高いマイクロプロセッサが安価に利用できるようにな
ってきた。処理能力の高いマイクロプロセッサを実現す
るために、動作周波数を高速化したり、ハードウエアの
高集積化がはかられている。
2. Description of the Related Art Advances in LSI manufacturing technology have made it possible to inexpensively use microprocessors with high processing capabilities. In order to realize a microprocessor with high processing capability, the operating frequency has been increased and the hardware has been highly integrated.

【0003】特に、近年のマイクロプロセッサは、デコ
ーダの負担軽減を狙って命令体系をワード固定長とし、
性能向上を図っている。この一つのワード固定長命令
は、複数のサブ命令からなり、同時に複数のハードウエ
ア動作を指定することができるものである。例えば、一
つのワード固定長命令においてALU演算、データ転送
命令、その他のマイクロプロセッサ内制御のすべてを同
時に行うことが可能である。サブ命令としては、他にも
分岐命令や即値ロード命令などを用いることができる。
しかし、これら2つの命令はオペランドとして、それぞ
れ分岐アドレス部分、即値データ部分を保持する。その
ため、分岐命令と即値ロード命令は、ビット長の短い限
られたサブ命令としか同時に実行できない。これは、1
命令のビット長が限られている場合の欠点である。
Particularly, in recent microprocessors, the instruction system has a fixed word length in order to reduce the load on the decoder.
We are trying to improve performance. This one word fixed-length instruction is composed of a plurality of sub-instructions and can designate a plurality of hardware operations at the same time. For example, it is possible to perform all ALU operations, data transfer instructions, and other in-microprocessor control simultaneously in one word fixed length instruction. As the sub-instruction, a branch instruction or an immediate value load instruction may be used.
However, these two instructions hold a branch address part and an immediate data part, respectively, as operands. Therefore, the branch instruction and the immediate load instruction can be simultaneously executed only with the limited sub instruction having the short bit length. This is 1
This is a drawback when the bit length of the instruction is limited.

【0004】一方、ソフトウエアの生産性を向上させる
ため、マイクロプロセッサの命令体系に対しては、高級
言語とのセマンティックギャップを小さくすることが望
まれている。科学技術計算に幅広く使用されているFO
RTRANの分岐文に、 IF(K) 分岐先1,分岐先2,分岐先3 というものがある。これは条件式Kを評価し、その値が
「負」、「0」、「正」のいずれであるかにより、実行
をそれぞれ分岐先1、2、3のうちの一つに移すという
3方向分岐を行う文である。この文をマイクロプロセッ
サのアセンブラレベルで実現するにあたって、まず始め
に分岐先が2方向である場合について図12を用いて説
明する。
On the other hand, in order to improve the productivity of software, it is desired for the instruction system of the microprocessor to reduce the semantic gap with a high-level language. FO widely used for scientific computing
RTRAN branch statements include IF (K) branch target 1, branch target 2, and branch target 3. This is a three-way method in which conditional expression K is evaluated and execution is moved to one of branch destinations 1, 2, and 3 depending on whether the value is “negative”, “0”, or “positive”. This is a statement for branching. In realizing this sentence at the assembler level of the microprocessor, first, the case where the branch destination is two directions will be described with reference to FIG.

【0005】図12に示す数値演算処理装置における分
岐処理を行う装置では、プログラムカウンタ100、こ
のプログラムカウンタ100のインクリメンタ150、
プログラムカウンタ100の出力する現在の値101に
よって命令201を出力する命令格納用メモリ200、
この命令201をデコードする命令デコーダ300、数
値演算処理装置のALUの演算結果に応じて変化するフ
ラグ400、フラグ400の出力するフラグの値401
によってインクリメンタ150の出力151と命令デコ
ーダ300の出力301のいずれかを選択する選択回路
500を備えている。
In the apparatus for performing branch processing in the numerical processing apparatus shown in FIG. 12, a program counter 100, an incrementer 150 of the program counter 100,
An instruction storage memory 200 for outputting an instruction 201 according to the current value 101 output by the program counter 100,
An instruction decoder 300 that decodes this instruction 201, a flag 400 that changes according to the calculation result of the ALU of the numerical processing unit, and a value 401 of the flag that the flag 400 outputs.
Is provided with a selection circuit 500 for selecting either the output 151 of the incrementer 150 or the output 301 of the instruction decoder 300.

【0006】次にこの装置における分岐処理動作を説明
する。命令格納用メモリ200中の条件分岐命令が命令
デコーダ300に出力されると、命令文中の分岐先アド
レス301と、インクリメンタ150の出力151が選
択回路500に与えられる。選択回路500は、その2
つの入力のうち、フラグ400の値が条件分岐命令中の
条件を満たす場合には、分岐先アドレス301を、満た
さない場合には、インクリメンタ150の出力151を
値を選択する。選択回路500の出力501は、次に実
行されるべきアドレスとしてプログラムカウンタ100
に入力される。
Next, the branch processing operation in this apparatus will be described. When the conditional branch instruction in the instruction storage memory 200 is output to the instruction decoder 300, the branch destination address 301 in the instruction statement and the output 151 of the incrementer 150 are given to the selection circuit 500. The selection circuit 500 is
Of the two inputs, if the value of the flag 400 satisfies the condition in the conditional branch instruction, the branch destination address 301 is selected, and if not, the output 151 of the incrementer 150 is selected. The output 501 of the selection circuit 500 is used as the address to be executed next, and the program counter 100
Entered in.

【0007】これを3方向に拡張するには、この条件分
岐命令を3個組み合わせて実行することになる。実際に
プログラムを作成すると次のようになる。
To expand this in three directions, three conditional branch instructions are combined and executed. The actual program is as follows.

【0008】 cmp rl,0 … 条件式r1と0を比較 jz 1000h … r1が0の時1000hへ js 2000h … r1が負の時2000hへ jl 3000h … r1が正の時3000hへ cmp d,s … 比較命令、比較結果が等しいとき
ゼロフラグをセット、d<sの時キャリフラグをセッ
ト、 jz D … 条件分岐命令、ゼロフラグがセットされ
ているとき、分岐、 js D … 条件分岐命令、キャリフラグがセットさ
れているとき、分岐、 jl D … 条件分岐命令、ゼロフラグとキャリフラ
グがセットされていないとき、分岐、
Cmp rl, 0 ... Comparing conditional expressions r1 and 0 jz 1000h ... When r1 is 0 to 1000h js 2000h ... When r1 is negative to 2000h jl 3000h ... When r1 is positive to 3000h cmp d, s ... Comparison instruction, set zero flag when comparison result is equal, set carry flag when d <s, jz D ... Conditional branch instruction, branch when zero flag is set, js D ... Conditional branch instruction, carry flag set , Jl D ... Conditional branch instruction, branch when zero flag and carry flag are not set,

【0009】[0009]

【発明が解決しようとする課題】3方向への分岐を実現
するためには、このプログラムに示すように、比較命令
と3個の条件分岐命令を組み合わせて実行する必要があ
った。しかし、この方法では実行ステップ数、命令格納
用メモリへのアクセス回数が多くなり、データ処理速度
と処理効率を低下させていた。
In order to realize a branch in three directions, it is necessary to execute a combination of a comparison instruction and three conditional branch instructions as shown in this program. However, with this method, the number of execution steps and the number of accesses to the memory for storing instructions increase, which reduces the data processing speed and processing efficiency.

【0010】本発明は上述の欠点を解決するもので、分
岐アドレス格納用連想メモリを複数設けることにより、
3方向への分岐命令を1命令で実現できるようにし、デ
ータ処理速度および処理効率を増加させることができる
分岐命令処理装置を提供することを目的とする。
The present invention solves the above-mentioned drawbacks by providing a plurality of associative memories for storing branch addresses,
An object of the present invention is to provide a branch instruction processing device that can realize branch instructions in three directions with one instruction and can increase data processing speed and processing efficiency.

【0011】[0011]

【課題を解決するための手段】本発明は、実行される命
令を格納する命令格納用メモリと、この命令をデコード
して条件分岐命令を出力する命令デコーダと、分岐条件
が設定されるレジスタと、このレジスタに設定された分
岐条件にしたがって分岐先アドレスを選択して出力する
第一の選択回路と、この選択された分岐先アドレスが入
力され次に実行すべき命令格納アドレスを上記命令格納
用メモリに出力するプログラムカウンタと、このプログ
ラムカウンタの出力をインクリメントするインクリメン
タとを備えた分岐命令処理装置において、分岐先数に対
応して複数個設けられ上記命令格納用メモリに与えられ
る上記プログラムカウンタの出力をキーとして対応する
分岐先アドレスを記憶し分岐先アドレスを上記第一の選
択回路に出力する分岐アドレス格納用連想メモリと、上
記第一の選択回路の出力と上記インクリメンタの出力と
を上記命令デコーダの出力にしたがって選択する第二の
選択回路とを備えたことを特徴とする。
According to the present invention, there is provided an instruction storage memory for storing an instruction to be executed, an instruction decoder for decoding the instruction and outputting a conditional branch instruction, and a register for setting a branch condition. , A first selection circuit that selects and outputs a branch destination address according to the branch condition set in this register, and an instruction storage address to which the selected branch destination address is input and the next execution is for storing the instruction In a branch instruction processing device provided with a program counter for outputting to a memory and an incrementer for incrementing the output of the program counter, a plurality of program counters provided corresponding to the number of branch destinations and given to the instruction storing memory. The corresponding branch destination address is stored using the output of as a key and the branch destination address is output to the first selection circuit. And associative memory for Toki address storage, characterized in that the outputs of the above incrementer of said first selection circuit and a second selection circuit for selecting in accordance with the output of the instruction decoder.

【0012】なお、プログラムカウンタの出力と各分岐
アドレス格納用連想メモリの出力とをそれぞれ加算する
加算器を備えることができる。
An adder for adding the output of the program counter and the output of the associative memory for storing each branch address can be provided.

【0013】[0013]

【作用】命令格納用メモリから出力された命令は命令デ
コーダでデコードされる。同時に分岐アドレス格納用連
想メモリはプログラムカウンタの値をキーとして分岐ア
ドレスを検索してそれぞれ出力する。この複数の分岐ア
ドレス格納用連想メモリの出力する分岐アドレスの何れ
かをレジスタの出力に基づいて第一の選択回路で選択す
る。この選択された分岐アドレスは、命令デコーダの出
力にしたがって、この分岐アドレスかインクリメンタ出
力のいずれかを選択してプログラムカウンタに与えられ
る。このため分岐命令を実行しているときはレジスタの
出力する値によってそれぞれの分岐アドレス格納用連想
メモリから出力される分岐アドレスがプログラムカウン
タに入力されて分岐命令を実行する。分岐命令でない場
合はプログラムカウンタはインクリメントされる。
The instruction output from the instruction storage memory is decoded by the instruction decoder. At the same time, the associative memory for storing the branch address retrieves the branch address using the value of the program counter as a key and outputs it. One of the branch addresses output from the plurality of associative memories for storing branch addresses is selected by the first selection circuit based on the output of the register. The selected branch address is given to the program counter by selecting either the branch address or the incrementer output according to the output of the instruction decoder. Therefore, when a branch instruction is being executed, the branch address output from each branch address storage associative memory is input to the program counter according to the value output from the register, and the branch instruction is executed. If it is not a branch instruction, the program counter is incremented.

【0014】[0014]

【実施例】以下図面を参照して本発明実施例を説明す
る。
Embodiments of the present invention will be described below with reference to the drawings.

【0015】図1は本発明の第一実施例の分岐処理装置
の構成を示すものである。この第一実施例装置は、実行
される命令を格納する命令格納用メモリ200と、この
命令をデコードして条件分岐命令を出力する命令デコー
ダ310と、分岐条件が設定されるレジスタ800と、
このレジスタ800に設定された分岐条件にしたがって
分岐先アドレスを選択して出力する第一の選択回路51
0と、この選択された分岐先アドレスが入力され次に実
行すべき命令格納アドレスを上記命令格納用メモリに出
力するプログラムカウンタ100と、プログラムカウン
タ100の出力をインクリメントするインクリメンタ1
50とを備えた分岐命令処理装置において、本発明の特
徴とする分岐先数に対応して複数個設けられ命令格納用
メモリ200に与えられるプログラムカウンタ100の
出力をキーとして対応する分岐先アドレスを記憶し分岐
先アドレスを上記第一の選択回路に出力する分岐アドレ
ス格納用連想メモリ611、612、613と、上記第
一の選択回路510の出力と上記インクリメンタ150
の出力とを上記命令デコーダ310の出力にしたがって
選択する第二の選択回路550とを備えている。
FIG. 1 shows the configuration of a branch processing apparatus according to the first embodiment of the present invention. The first embodiment apparatus includes an instruction storage memory 200 for storing an instruction to be executed, an instruction decoder 310 for decoding the instruction and outputting a conditional branch instruction, a register 800 for setting a branch condition,
A first selection circuit 51 for selecting and outputting a branch destination address according to the branch condition set in the register 800.
0, a program counter 100 that inputs the selected branch destination address and outputs the instruction storage address to be executed next to the instruction storage memory, and an incrementer 1 that increments the output of the program counter 100.
In the branch instruction processing device including 50, a plurality of branch destination addresses provided corresponding to the number of branch destinations, which is a feature of the present invention, and provided to the instruction storing memory 200 is used as a key to set a corresponding branch destination address. Branch address storing associative memories 611, 612 and 613 for storing and outputting the branch destination address to the first selecting circuit, the output of the first selecting circuit 510 and the incrementer 150.
And a second selection circuit 550 for selecting the output of the instruction decoder 310 according to the output of the instruction decoder 310.

【0016】なお、151はインクリメンタ150の出
力、201は命令格納用メモリ200から選び出された
命令、301は命令デコーダ310の出力、601、6
02、603は分岐アドレス格納用連想メモリ611、
612、613の出力、511は選択回路510の出
力、551は選択回路550の出力である。
Numeral 151 is the output of the incrementer 150, 201 is the instruction selected from the instruction storing memory 200, 301 is the output of the instruction decoder 310, and 601 and 6
02 and 603 are associative memories 611 for storing branch addresses,
Outputs 612 and 613, 511 is an output of the selection circuit 510, and 551 is an output of the selection circuit 550.

【0017】次に本第一実施例の動作を説明する。Next, the operation of the first embodiment will be described.

【0018】命令デコーダ310は、3方向分岐命令が
与えられると、選択回路550に、3方向分岐命令が与
えられたことを知らせる信号312を出力する。
When a 3-way branch instruction is given, the instruction decoder 310 outputs to the selection circuit 550 a signal 312 notifying that the 3-way branch instruction has been given.

【0019】選択回路510は、レジスタ800の値が
「負」、「0」、「正」のいずれかによって出力データ
を選択するため、図2に示すように構成されている。図
2において、符号521は、レジスタ800の値が
「正」の場合のみ開き、そのゲートに入力されたアドレ
スを通すゲート、符号522は、レジスタ800の値が
「0」の場合のみ同様の働きをするゲート、符号523
は、レジスタ800の値が「負」の場合のみ同様の働き
をするゲートである。この図2においては、「2」の補
数表現を用い、利用するレジスタのビット幅が5ビット
であるものとしている。
The selection circuit 510 is configured as shown in FIG. 2 in order to select the output data depending on whether the value of the register 800 is "negative", "0" or "positive". In FIG. 2, reference numeral 521 indicates a gate which opens only when the value of the register 800 is “positive”, and which passes the address input to the gate. Reference numeral 522 indicates the same operation only when the value of the register 800 is “0”. Gate 523
Is a gate that operates similarly only when the value of the register 800 is "negative". In FIG. 2, the complement of “2” is used and the bit width of the register to be used is 5 bits.

【0020】命令格納用メモリ200には、図3に示す
ような命令が格納されているとする。分岐アドレス格納
用連想メモリ611、612、613には、それぞれ図
4、図5、図6に示すようなデータが格納されているも
のとする。図3において、‘IF K’とはFORTR
ANの ‘IF (K) 分岐先1,分岐先2,分岐先3’ の文と同等の命令であるとする。
It is assumed that the instruction storage memory 200 stores instructions as shown in FIG. Assume that branch address storage associative memories 611, 612, and 613 store data as shown in FIGS. 4, 5, and 6, respectively. In FIG. 3, “IF K” is FORTR
It is assumed that the instruction is equivalent to the statement of IF '(K) branch destination 1, branch destination 2, branch destination 3'of AN.

【0021】プログラムカウンタ100の値101が
「10」のとき、命令格納用メモリ200から出力され
た命令201は、命令デコーダ310でデコードされ
る。これと同時に分岐アドレス格納用連想メモリ61
1、612、613では、プログラムカウンタ100の
値「10」をキーとしてそれぞれ検索され、分岐アドレ
ス「1000000h」、分岐アドレス「200000
0h」、分岐アドレス「3000000h」をそれぞれ
選択回路510へ出力する。選択回路510では、レジ
スタ800の値にしたがって、各分岐アドレスのいずれ
かを選択し、さらに選択回路550へ出力する。選択回
路550は、命令デコーダ310の出力312にしたが
って、選択回路510からの出力511とインクリメン
タ150の出力151のいずれかをプログラムカウンタ
100に与える。
When the value 101 of the program counter 100 is "10", the instruction 201 output from the instruction storing memory 200 is decoded by the instruction decoder 310. At the same time, the associative memory 61 for storing the branch address
In 1, 612, and 613, the value “10” of the program counter 100 is used as a key to search for the branch address “1000000h” and the branch address “200000”.
0h ”and branch address“ 3000000h ”are output to the selection circuit 510, respectively. The selection circuit 510 selects one of the branch addresses according to the value of the register 800, and outputs it to the selection circuit 550. The selection circuit 550 provides either the output 511 from the selection circuit 510 or the output 151 of the incrementer 150 to the program counter 100 according to the output 312 of the instruction decoder 310.

【0022】例えば、レジスタ800の値が「正」の場
合、分岐アドレス格納用連想メモリ611から出力され
た値「1000000h」とインクリメンタ150の出
力151の値「11」が選択回路550に与えられる。
しかし、選択回路550は、命令デコーダ310の出力
312が3方向分岐命令実行中であることを示している
ため、分岐格納用連想メモリ611の出力した値「10
00000h」をプログラムカウンタ100に出力す
る。またレジスタ800の値が「0」である場合も同様
にして、分岐アドレス格納用メモリ612から出力され
た値「2000000h」が選択回路510、550を
介してプログラムカウンタ100に出力される。レジス
タ800の値が「負」の場合も同様で、分岐アドレス格
納用メモリ613から出力された値「3000000
h」が選択回路510、550を介してプログラムカウ
ンタ100に出力される。
For example, when the value of the register 800 is "positive", the value "1000000h" output from the associative memory 611 for storing the branch address and the value "11" of the output 151 of the incrementer 150 are supplied to the selection circuit 550. ..
However, since the selection circuit 550 indicates that the output 312 of the instruction decoder 310 is executing a three-way branch instruction, the value “10” output from the branch storage associative memory 611 is output.
"00000h" is output to the program counter 100. Similarly, when the value of the register 800 is "0", the value "2000000h" output from the branch address storage memory 612 is output to the program counter 100 via the selection circuits 510 and 550. The same applies when the value of the register 800 is "negative", and the value "3000000" output from the memory 613 for storing the branch address is the same.
“H” is output to the program counter 100 via the selection circuits 510 and 550.

【0023】次に本発明第二実施例を図7ないし図11
に基づいて説明する。
Next, a second embodiment of the present invention will be described with reference to FIGS.
It will be explained based on.

【0024】この第二実施例は第一実施例と比べると、
プログラムカウンタ100の出力と分岐アドレス格納用
連想メモリ611の出力601の値とを加算し選択回路
510に与える加算器711、プログラムカウンタ10
0の出力と分岐アドレス格納用連想メモリ612の出力
602の値とを加算し選択回路510に与える加算器7
12、プログラムカウンタ100の出力と分岐アドレス
格納用連想メモリ613の出力603の値とを加算し選
択回路510に与える加算器712とを備えている点が
異なる。
This second embodiment is compared with the first embodiment,
The adder 711 and the program counter 10 which add the output of the program counter 100 and the value of the output 601 of the associative memory 611 for storing the branch address and give it to the selection circuit 510
An adder 7 that adds the output of 0 and the value of the output 602 of the associative memory 612 for storing the branch address to the selection circuit 510
12. The difference is that an adder 712 for adding the output of the program counter 100 and the value of the output 603 of the associative memory 613 for storing branch address and giving it to the selection circuit 510 is provided.

【0025】この第二実施例の動作を説明する。The operation of the second embodiment will be described.

【0026】選択回路510は、レジスタ800の値が
「負」、「0」、「正」のいずれであるかによって、デ
ータを選択するため、図2に示したように構成する。
The selection circuit 510 selects the data depending on whether the value of the register 800 is "negative", "0", or "positive", and thus is configured as shown in FIG.

【0027】命令格納用メモリ200には図8に示すよ
うな命令が格納されているとする。分岐アドレス格納用
連想メモリ611、612、613にはそれぞれ図9、
図10、図11に示すようなデータが格納されていると
する。図8において、‘IFK’とはFORTRANの ‘IF (K) 分岐先1,分岐先2,分岐先3’ の文と同等の命令であるとする。
It is assumed that the instruction storage memory 200 stores instructions as shown in FIG. The associative memories 611, 612, and 613 for storing branch addresses are shown in FIG.
It is assumed that the data as shown in FIGS. 10 and 11 is stored. In FIG. 8, it is assumed that “IFK” is an instruction equivalent to the statement of “IF (K) branch target 1, branch target 2, branch target 3” of FORTRAN.

【0028】プログラムカウンタ100の値が「10」
のとき、命令201は、命令デコーダ310でデコード
される。これと同時に分岐アドレス格納用連想メモリ6
11、612、613では、プログラムカウンタの値
「10」をキーとしてそれぞれ検索され、分岐アドレス
「100h」、分岐アドレス「200h」、分岐アドレ
ス「300h」をそれぞれ加算器711、712、71
3に出力する。加算器711では、分岐アドレス格納用
連想メモリ611の出力601の値とプログラムカウン
タ100の出力101とを加算して選択回路510に出
力する。加算器712、加算器713も同様である。選
択回路510では、レジスタ800の保持する値にした
がって、加算器711、712、713それぞれからの
出力701、702、703のいずれかを選択し、選択
回路550に出力する。選択回路550は命令デコーダ
310の出力312にしたがって、選択回路510の出
力511とインクリメンタ150の出力151とのいず
れかをプログラムカウンタ100に出力する。
The value of the program counter 100 is "10".
At this time, the instruction 201 is decoded by the instruction decoder 310. At the same time, the associative memory 6 for storing the branch address
In 11, 612 and 613, the program counter value “10” is searched as a key, and the branch address “100h”, the branch address “200h” and the branch address “300h” are added to the adders 711, 712 and 71, respectively.
Output to 3. The adder 711 adds the value of the output 601 of the associative memory for branch address storage 611 and the output 101 of the program counter 100 and outputs the result to the selection circuit 510. The same applies to the adders 712 and 713. The selection circuit 510 selects one of the outputs 701, 702, and 703 from each of the adders 711, 712, and 713 according to the value held in the register 800, and outputs it to the selection circuit 550. The selection circuit 550 outputs either the output 511 of the selection circuit 510 or the output 151 of the incrementer 150 to the program counter 100 according to the output 312 of the instruction decoder 310.

【0029】例えば、レジスタ800の値が「正」の場
合、加算器711から出力された「110h」とインク
リメンタ150の出力151の値が選択回路550に与
えられる。しかし選択回路550は、命令デコーダ31
0からの出力312が、3方向分岐命令を実行中である
ことを示しているため、加算器711の出力701の値
「110h」をプログラムカウンタ100に出力する。
レジスタ800の値が「0」の場合も同様に、加算器7
12の出力702の値「210h」が選択回路550を
通してプログラムカウンタ100に出力される。レジス
タ800の値が「負」の場合も同様で、加算器713の
出力703の値「310h」がプログラムカウンタ10
0に出力される。
For example, when the value of the register 800 is "positive", "110h" output from the adder 711 and the value of the output 151 of the incrementer 150 are supplied to the selection circuit 550. However, the selection circuit 550 is
Since the output 312 from 0 indicates that the three-way branch instruction is being executed, the value “110h” of the output 701 of the adder 711 is output to the program counter 100.
Similarly, when the value of the register 800 is “0”, the adder 7
The value “210h” of the 12 output 702 is output to the program counter 100 through the selection circuit 550. The same applies when the value of the register 800 is “negative”, and the value “310h” of the output 703 of the adder 713 is the program counter 10
It is output to 0.

【0030】この第二実施例が第一実施例と異なるとこ
ろは、分岐先が相対アドレスでも指定することができる
ことにある。
The difference between the second embodiment and the first embodiment is that the branch destination can be designated by a relative address.

【0031】なお、上記実施例では、選択回路の制御を
「2」の補数であり、かつ扱うデータが5ビットである
として説明した。しかし、「1」の補数を用いたり、デ
ータのビット数が16ビット幅や32ビット幅を用いた
場合でも同様の効果が得られることは明らかである。
In the above embodiment, the control of the selection circuit is described as being "2" complement and the data to be handled is 5 bits. However, it is clear that the same effect can be obtained even when the complement of "1" is used or the number of bits of data is 16-bit width or 32-bit width.

【0032】[0032]

【発明の効果】このように、本発明は、分岐アドレス格
納用連想メモリを複数設けることにより、従来4命令で
あった3方向への分岐命令を1命令で実現できる。この
ことにより、マイクロプロセッサのデータ処理速度およ
び処理効率を増加させることができる。また、高級言語
とのセマンティックギャップを減少させることができ
る。
As described above, by providing a plurality of associative memories for storing branch addresses, the present invention can realize a branch instruction in three directions, which was conventionally four instructions, with one instruction. As a result, the data processing speed and processing efficiency of the microprocessor can be increased. Also, the semantic gap with high-level languages can be reduced.

【0033】さらに、従来1命令中の分岐アドレス値を
保持させていたビット部分には他のサブ命令を指定する
ことができるため、その分、処理効率を上げることがで
きる。なお、分岐アドレス格納用メモリの容量は分岐命
令の分岐先数の総和だけあれば十分であり、その容量が
増大することはない。
Further, since another sub-instruction can be designated in the bit portion which conventionally holds the branch address value in one instruction, the processing efficiency can be improved accordingly. The capacity of the memory for storing the branch address is sufficient if it is the total number of branch destinations of the branch instruction, and the capacity does not increase.

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

【図1】本発明第一実施例を示すブロック図。FIG. 1 is a block diagram showing a first embodiment of the present invention.

【図2】選択回路510の構成図。FIG. 2 is a configuration diagram of a selection circuit 510.

【図3】第一実施例命令格納用メモリの内容を示す図。FIG. 3 is a diagram showing the contents of a memory for storing instructions according to the first embodiment.

【図4】第一実施例分岐アドレス格納用連想メモリの内
容を示す図。
FIG. 4 is a diagram showing the contents of an associative memory for storing a branch address according to the first embodiment.

【図5】第一実施例分岐アドレス格納用連想メモリの内
容を示す図。
FIG. 5 is a diagram showing the contents of an associative memory for storing a branch address according to the first embodiment.

【図6】第一実施例分岐アドレス格納用連想メモリの内
容を示す図。
FIG. 6 is a diagram showing the contents of an associative memory for storing a branch address according to the first embodiment.

【図7】本発明第二実施例を示すブロック図。FIG. 7 is a block diagram showing a second embodiment of the present invention.

【図8】第二実施例命令格納用メモリの内容を示す図。FIG. 8 is a diagram showing the contents of a memory for storing instructions according to the second embodiment.

【図9】第二実施例分岐アドレス格納用連想メモリの内
容を示す図。
FIG. 9 is a diagram showing the contents of an associative memory for storing a branch address according to the second embodiment.

【図10】第二実施例分岐アドレス格納用連想メモリの
内容を示す図。
FIG. 10 is a diagram showing the contents of an associative memory for storing a branch address according to the second embodiment.

【図11】第二実施例分岐アドレス格納用連想メモリの
内容を示す図。
FIG. 11 is a diagram showing the contents of an associative memory for storing a branch address according to the second embodiment.

【図12】従来例を示すブロック図。FIG. 12 is a block diagram showing a conventional example.

【符号の説明】[Explanation of symbols]

100 プログラムカウンタ 101 プログラムカウンタの出力 150 インクリメンタ 151 インクリメンタの出力 200 命令格納用メモリ 201 実行される命令 300、310 命令デコーダ 301 命令デコーダ300の出力 400 フラグ 401 フラグの値 500、510、550 選択回路 501 選択回路500の出力 511 選択回路510の出力 521、522、523 選択用ゲート 551 選択回路550の出力 601、602、603 分岐アドレス格納用連想メモ
リの出力 611、612、613 分岐アドレス格納用連想メモ
リ 701、702、703 加算器の出力 711、712、713 加算器 800 レジスタ
100 Program Counter 101 Program Counter Output 150 Incrementer 151 Incrementer Output 200 Instruction Storage Memory 201 Instructions to be executed 300, 310 Instruction Decoder 301 Output of Instruction Decoder 300 400 Flag 401 Flag Value 500, 510, 550 Selection Circuit 501 Output of selection circuit 500 511 Output of selection circuit 510 521, 522, 523 Selection gate 551 Output of selection circuit 550 601, 602, 603 Output of associative memory for storing branch address 611, 612, 613 Associative memory for storing branch address 701, 702, 703 Adder output 711, 712, 713 Adder 800 register

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 実行される命令を格納する命令格納用メ
モリと、 この命令をデコードして条件分岐命令を出力する命令デ
コーダと、 分岐条件が設定されるレジスタと、 このレジスタに設定された分岐条件にしたがって分岐先
アドレスを選択して出力する第一の選択回路と、 この選択された分岐先アドレスが入力され次に実行すべ
き命令格納アドレスを上記命令格納用メモリに出力する
プログラムカウンタと、 このプログラムカウンタの出力をインクリメントするイ
ンクリメンタとを備えた分岐命令処理装置において、 分岐先数に対応して複数個設けられ上記命令格納用メモ
リに与えられる上記プログラムカウンタの出力をキーと
して対応する分岐先アドレスを記憶し分岐先アドレスを
上記第一の選択回路に出力する分岐アドレス格納用連想
メモリと、 上記第一の選択回路の出力と上記インクリメンタの出力
とを上記命令デコーダの出力にしたがって選択する第二
の選択回路とを備えたことを特徴とする分岐命令処理装
置。
1. An instruction storage memory for storing an instruction to be executed, an instruction decoder for decoding the instruction and outputting a conditional branch instruction, a register in which a branch condition is set, and a branch set in this register. A first selection circuit for selecting and outputting a branch destination address according to a condition; a program counter for inputting the selected branch destination address and outputting an instruction storage address to be executed next to the instruction storage memory; In a branch instruction processing device equipped with an incrementer that increments the output of this program counter, a plurality of branch instructions are provided corresponding to the number of branch destinations, and the corresponding branch is given using the output of the program counter given to the instruction storing memory as a key. Associating branch address storage for storing the destination address and outputting the branch destination address to the first selection circuit A branch instruction processing device comprising: a memory; and a second selection circuit that selects the output of the first selection circuit and the output of the incrementer according to the output of the instruction decoder.
【請求項2】 上記分岐アドレス格納用連想メモリの出
力する分岐アドレスと上記プログラムカウンタの出力と
をそれぞれ加算し上記第一の選択回路に与える複数の加
算器を備える請求項1記載の分岐命令処理装置。
2. The branch instruction processing according to claim 1, further comprising a plurality of adders for adding the branch address output from the associative memory for storing the branch address and the output of the program counter to the first selection circuit. apparatus.
JP3267954A 1991-10-16 1991-10-16 Branch instruction processor Pending JPH05108345A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3267954A JPH05108345A (en) 1991-10-16 1991-10-16 Branch instruction processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3267954A JPH05108345A (en) 1991-10-16 1991-10-16 Branch instruction processor

Publications (1)

Publication Number Publication Date
JPH05108345A true JPH05108345A (en) 1993-04-30

Family

ID=17451906

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3267954A Pending JPH05108345A (en) 1991-10-16 1991-10-16 Branch instruction processor

Country Status (1)

Country Link
JP (1) JPH05108345A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5724563A (en) * 1995-04-12 1998-03-03 Matsushita Electric Industrial Co., Ltd. Pipeline processsor
US6334184B1 (en) 1998-03-24 2001-12-25 International Business Machines Corporation Processor and method of fetching an instruction that select one of a plurality of decoded fetch addresses generated in parallel to form a memory request
KR100381876B1 (en) * 1995-07-03 2003-07-18 텍사스 인스트루먼츠 인코포레이티드 Incrementing and Decrementing a Microprocessor Program Counter
JP2005018191A (en) * 2003-06-24 2005-01-20 Yokogawa Electric Corp Nonvolatile memory device and access method therefor
JP2020505674A (en) * 2017-01-19 2020-02-20 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Conditional branch to indirectly specified position

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5724563A (en) * 1995-04-12 1998-03-03 Matsushita Electric Industrial Co., Ltd. Pipeline processsor
KR100381876B1 (en) * 1995-07-03 2003-07-18 텍사스 인스트루먼츠 인코포레이티드 Incrementing and Decrementing a Microprocessor Program Counter
US6334184B1 (en) 1998-03-24 2001-12-25 International Business Machines Corporation Processor and method of fetching an instruction that select one of a plurality of decoded fetch addresses generated in parallel to form a memory request
JP2005018191A (en) * 2003-06-24 2005-01-20 Yokogawa Electric Corp Nonvolatile memory device and access method therefor
JP2020505674A (en) * 2017-01-19 2020-02-20 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Conditional branch to indirectly specified position

Similar Documents

Publication Publication Date Title
US4578750A (en) Code determination using half-adder based operand comparator
KR100254008B1 (en) Data processor simultaneously executable two instruction
KR940009095B1 (en) Data processing system
JPS61122747A (en) Data processor
US5704052A (en) Bit processing unit for performing complex logical operations within a single clock cycle
JPH0659861A (en) 3-1 logic operating device
US4954947A (en) Instruction processor for processing branch instruction at high speed
US20030037085A1 (en) Field processing unit
JPH05150979A (en) Immediate operand expansion system
US5349671A (en) Microprocessor system generating instruction fetch addresses at high speed
JPH05108345A (en) Branch instruction processor
JP2928680B2 (en) Compound condition processing method
US7058678B2 (en) Fast forwarding ALU
JPS63111535A (en) Data processor
JPH0375932A (en) Numerical arithmetic processing device
US6757813B1 (en) Processor
US5774740A (en) Central processing unit for execution of orthogonal and non-orthogonal instructions
JPH07110769A (en) Vliw type computer
JPS6116334A (en) Data processor
JPH0322028A (en) Numerical arithmetic processor
JP3431503B2 (en) Information processing apparatus and program control method
JPH04137169A (en) Information processor
JPS63276126A (en) Instruction decoding circuit
JPH0758459B2 (en) Micro program controller
JPH05165639A (en) Register reading method and register reading device for parallel processor