JPS61208129A - Control system for preread of instruction - Google Patents

Control system for preread of instruction

Info

Publication number
JPS61208129A
JPS61208129A JP4736285A JP4736285A JPS61208129A JP S61208129 A JPS61208129 A JP S61208129A JP 4736285 A JP4736285 A JP 4736285A JP 4736285 A JP4736285 A JP 4736285A JP S61208129 A JPS61208129 A JP S61208129A
Authority
JP
Japan
Prior art keywords
instruction
branch
address
relative value
register
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
JP4736285A
Other languages
Japanese (ja)
Inventor
Tsukasa Furuya
古屋 司
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 JP4736285A priority Critical patent/JPS61208129A/en
Publication of JPS61208129A publication Critical patent/JPS61208129A/en
Pending legal-status Critical Current

Links

Classifications

    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00—Arrangements for program control, e.g. control units
    • G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3842—Speculative instruction execution
    • G06F9/3846—Speculative instruction execution using static prediction, e.g. branch taken strategy

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Advance Control (AREA)

Abstract

PURPOSE:To perform fast instruction execution with small hardware by determining whether or not an instruction sequence of an instruction preread is specified as a branch destination according to the relative value of the branch instruction. CONSTITUTION:A memory reads an instruction which is stored through address assignment from an advanced control circuit 2 decodes whether or not the instruction in the instruction buffer 5 is a branch instruction, and then transfers the instruction to an instruction execution part 4 and advances the contents of the instruction address register 3 by one instruction when the instruction is not the branch instruction. When the instruction is the branch instruction, the preread control circuit 2 checks the sign of the relative value supplied from a signal line 15. When the relative value is negative, the relative value is added to the contents of a register 23 to generate a minus branch address, and the contents of the address register are updated. When positive, the adder 24 is designated to increase the contents of the register 23 by one, thereby reading the instruction in a next address.

Description

【発明の詳細な説明】 〔発明の属する技術分野〕 本発明は、中央処理装置における命令先読制御方式に関
する。
DETAILED DESCRIPTION OF THE INVENTION [Technical field to which the invention pertains] The present invention relates to an instruction prefetch control method in a central processing unit.

〔従来技術〕[Prior art]

従来、メモリから命令を読出し、それを解読して実行す
る中央処理装置(以下CPUと呼ぶ)は。
Conventionally, a central processing unit (hereinafter referred to as a CPU) reads instructions from memory, decodes and executes them.

性能を向上させるために様々な機能を付加してきた。特
に、命令先取シ機能は命令の実行と2次の命令の読出し
を同時に行うことによシ性能を上げることができる。さ
らに、命令の先取シにおいて。
Various functions have been added to improve performance. In particular, the instruction prefetch function can improve performance by simultaneously executing an instruction and reading a secondary instruction. Furthermore, in preemption of orders.

命令シーケンスを乱す可能性がある分岐命令についても
、その分岐先きの命令シーケンスを読出しておけば、さ
らに高速になる。しかしながら1分岐命令において1分
岐した場合と、しない場合の両方の命令シーケンスを先
取シすることは、ノ・−ドウエアの増大を招きCPUを
高価だしてしまう。
Even for branch instructions that may disturb the instruction sequence, if the instruction sequence for the branch destination is read in advance, the processing speed will be further increased. However, preempting instruction sequences for both cases in which one branch is taken and cases in which one branch is not taken in a one-branch instruction increases the amount of hardware and makes the CPU expensive.

また1分岐命令の性質を考慮し1分岐先シーケ/ス、あ
るいは非分岐シーケンスのどちらかを先読みする機能は
、ハードウェアを増加しないが、定められた分岐/非分
岐に合致したソフトウェア設計上の配慮が要求されるな
どの欠点があった。
Furthermore, considering the nature of one-branch instructions, the function of prefetching either the one-branch destination sequence or the non-branch sequence does not increase the hardware, but it is possible to improve the software design according to the specified branch/non-branch instruction. There were drawbacks such as the need for consideration.

〔発明の目的〕[Purpose of the invention]

本発明の目的は1分岐命令の持つ相対アドレスフィール
ドが正のときは分岐せず、負のときは分岐先の命令シー
ケンスを選択することによシ、ハードウェア量の増大を
抑制し、高い実行性能を得ることのできる中央処理装置
における命令先読制御方式を提供することにある。
An object of the present invention is to suppress the increase in hardware amount and achieve high execution speed by not branching when the relative address field of a branch instruction is positive, and by selecting the branch destination instruction sequence when it is negative. An object of the present invention is to provide an instruction prefetch control method in a central processing unit that can obtain high performance.

〔発明の構成〕[Structure of the invention]

本発明による命令先読制御方式は、メモリから命令アド
レスレジスタの指すアドレスの命令を読出す手段と、上
記メモリから読出された命令を命令実行部に転送する手
段と、上記読出された命令の一部のフィールドに設定さ
れた相対アドレス値を持つ分岐命令において、相対値が
正の数のときは、上記命令アドレスレジスタを次の命令
を指すように更新し、負の数のときには、上記命令アド
レスレジスタを分岐先のアドレスに更新する手段とを備
えた点に特徴がある。
The instruction prefetch control system according to the present invention includes means for reading an instruction at an address indicated by an instruction address register from a memory, means for transferring the instruction read from the memory to an instruction execution section, and one of the instructions read from the memory. In a branch instruction with a relative address value set in the section field, if the relative value is a positive number, the above instruction address register is updated to point to the next instruction, and if it is a negative number, the above instruction address register is updated to point to the next instruction. A feature of this method is that it includes means for updating a register to a branch destination address.

〔発明の実施例〕[Embodiments of the invention]

次に2本発明による命令先読制御方式について図面を参
照して詳細に説明する。
Next, two instruction prefetch control systems according to the present invention will be described in detail with reference to the drawings.

第1図は本発明による実施例の構成をブロック図によシ
示しだものである。この図において、命令アドレスレジ
スタ3はメモリ1に格納されている読出すべき命令のア
ドレスを格納している。このアドレスはアドレス線13
によってメモリ1に供給される。メモリ1はアドレスの
指定により格納された命令を命令バッファ5に読出す。
FIG. 1 is a block diagram showing the configuration of an embodiment according to the present invention. In this figure, an instruction address register 3 stores the address of an instruction stored in the memory 1 to be read. This address is on address line 13
is supplied to memory 1 by. The memory 1 reads the stored instruction into the instruction buffer 5 according to the specified address.

先行制御回路2は命令バッファ5の命令が分岐命令であ
るか否かを解読し1分岐命令でない場合には、その命令
を命令実行部4に転送するとともに、命令アドレスレジ
スタ3の内容を1命令分だけ先に進める。以上の手順に
よシ、命令は命令実行部の動作と無関係に読出され、 
CPUの処理能力を向上させている。しかしながら、命
令バッファ5の内容が分岐命令の場合には分岐先の命令
シーケンスを先読みしておいた方がよシ性能が向上する
ことがある。分岐命令は一般に、何の命令であるかを示
ス命令コードフィールドと分岐先のアドレスを指定する
だめのフィールドを持っている。アドレスフィールドは
普通相対値形式で表わされ、その命令の持つメモリアド
レスとの差分(相対値)を有する。
The advance control circuit 2 decodes whether the instruction in the instruction buffer 5 is a branch instruction, and if it is not a 1-branch instruction, transfers the instruction to the instruction execution unit 4, and also transfers the contents of the instruction address register 3 to 1 instruction. Move forward by a minute. According to the above procedure, the instruction is read out regardless of the operation of the instruction execution unit.
Improves CPU processing power. However, when the contents of the instruction buffer 5 are branch instructions, performance may be improved by pre-reading the instruction sequence at the branch destination. A branch instruction generally has an instruction code field that indicates what kind of instruction it is, and a field that specifies the address of the branch destination. The address field is usually expressed in a relative value format and has a difference (relative value) from the memory address of the instruction.

第2図は、上記分岐命令の原理を説明するだめの図であ
る。この図において2分岐命令が正の差分を持つ“+8
#ならば1分岐は自命令よシ+8だけ下位のアドレスに
なる。もし、負の差分″−5#を持つときは、上位アド
レス方向に5だけ分岐することを意味し、その正負は差
分を有する相対値フィールドの最上位ビットが符号の役
目をしている。
FIG. 2 is a diagram for explaining the principle of the branch instruction. In this figure, the 2-branch instruction has a positive difference “+8
If it is #, the 1st branch will be an address lower by +8 than the own instruction. If there is a negative difference "-5#", it means branching by 5 in the direction of the upper address, and the most significant bit of the relative value field having the difference serves as the sign.

第3図は、第1図の命令バッファ5.先読制御回路2お
よび命令アドレスレジスタ3に関連スるよシ具体的な構
成をブロック図に示したものである。この図において、
命令バッファ5の命令が分岐命令である場合には、先読
制御回路2は信号線15から与えられる相対値の符号を
チェックし。
FIG. 3 shows the instruction buffer 5. of FIG. A block diagram showing a detailed configuration related to the prefetch control circuit 2 and the instruction address register 3 is shown. In this diagram,
If the instruction in the instruction buffer 5 is a branch instruction, the prefetch control circuit 2 checks the sign of the relative value given from the signal line 15.

符号が負を示すときには、その相対値とレジスタ23の
内容を加算器24で加算することによってマイナス方向
への分岐アドレスを作成し、アドレスレジスタを更新す
る。相対値が正の場合には。
When the sign is negative, the adder 24 adds the relative value and the contents of the register 23 to create a branch address in the negative direction and update the address register. if the relative value is positive.

加算器24はレジスタ23の+1動作が指定され。The adder 24 is designated to perform a +1 operation of the register 23.

アドレスレジスタは非分岐アドレス、即ち次のアドレス
の命令を読出すことになる。
The address register will read the instruction at the non-branch address, ie, the next address.

第4図は、上記実施例における命令分岐の判定手順を説
明するための簡単なフローチャートである。この図にお
いて、繰返しの処理においては比較的小さなループを形
成しやすいことから、Aで示す分岐命令は負の方向に分
岐することが多いと推定される。また、Dで示す分岐命
令はループを形成するよりも、むしろ単なる判定に使用
されるケースであシ、この場合の確率は1/2となる。
FIG. 4 is a simple flowchart for explaining the instruction branch determination procedure in the above embodiment. In this figure, it is presumed that the branch instruction indicated by A often branches in the negative direction because it is easy to form a relatively small loop in repetitive processing. Further, the branch instruction indicated by D is used for mere determination rather than forming a loop, and the probability in this case is 1/2.

なお、命令の先読みはどちらを採ろうとあまシ変らない
が、むしろ分岐しない方が良い場合がある。
Note that the prefetching of instructions is the same regardless of which method is used, but there are cases where it is better not to branch.

このことから、ソフトウェアの設計において、逐次処理
形式の計算機である限シ、負の方向への分岐はループを
形成するケースが高いと云える。当然のことながら1分
岐命令の認識において、無条件分岐命令は相対値が正で
あろうと負であろうと分岐先に進む処理をするべきであ
ることは言うまでもない。
From this, it can be said that in software design, as long as the computer is a sequential processing type computer, there are many cases where a branch in the negative direction forms a loop. Of course, when recognizing a single branch instruction, it goes without saying that an unconditional branch instruction should proceed to the branch destination regardless of whether the relative value is positive or negative.

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

以上の説明により明らかなように1本発明によれば1分
岐命令の相対値に従って命令先読みの命令シーケンスを
分岐先きにするか否かを決定することにより、少ないハ
ードウェア量で高速な命令実行が実現でき、経済性の向
上が得られる点において、その効果は大きい。
As is clear from the above description, according to the present invention, by determining whether or not the instruction sequence of instruction prefetch is to be directed to the branch destination according to the relative value of the branch instruction, high-speed instruction execution can be achieved with a small amount of hardware. The effect is significant in that it can be realized and economical efficiency can be improved.

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

第1図は本発明による実施例の構成を示すブロック図、
第2図は実施例における分岐命令の原理を説明するため
の図、第3図は、第1図の命令バッファ、先読制御回路
および命令アドレスレ・ゾスタに関連するより具体的な
構成を示すブロック図。 第4図は実施例における命令分岐の判定手順を説明する
だめの簡単なフローチャートである。 図において。
FIG. 1 is a block diagram showing the configuration of an embodiment according to the present invention;
FIG. 2 is a diagram for explaining the principle of branch instructions in the embodiment, and FIG. 3 shows a more specific configuration related to the instruction buffer, prefetch control circuit, and instruction address register in FIG. 1. Block Diagram. FIG. 4 is a simple flowchart for explaining the instruction branch determination procedure in the embodiment. In fig.

Claims (1)

【特許請求の範囲】[Claims] 1、メモリから命令アドレスレジスタの指すアドレスの
命令を読出す手段と、上記メモリから読出された命令を
命令実行部に転送する手段と、上記読出された命令の一
部のフィールドに設定された相対アドレス値を持つ分岐
命令において、相対値が正の数のときは、上記命令アド
レスレジスタを次の命令を指すように更新し、負の数の
ときには、上記命令アドレスレジスタを分岐先のアドレ
スに更新する手段とを備えた命令先読制御方式。
1. means for reading the instruction at the address pointed to by the instruction address register from the memory; means for transferring the instruction read from the memory to the instruction execution unit; For a branch instruction with an address value, if the relative value is a positive number, the above instruction address register is updated to point to the next instruction, and if it is a negative number, the above instruction address register is updated to the branch destination address. An instruction prefetch control system comprising:
JP4736285A 1985-03-12 1985-03-12 Control system for preread of instruction Pending JPS61208129A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4736285A JPS61208129A (en) 1985-03-12 1985-03-12 Control system for preread of instruction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4736285A JPS61208129A (en) 1985-03-12 1985-03-12 Control system for preread of instruction

Publications (1)

Publication Number Publication Date
JPS61208129A true JPS61208129A (en) 1986-09-16

Family

ID=12773000

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4736285A Pending JPS61208129A (en) 1985-03-12 1985-03-12 Control system for preread of instruction

Country Status (1)

Country Link
JP (1) JPS61208129A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6044455A (en) * 1996-10-25 2000-03-28 Ricoh Company, Ltd. Central processing unit adapted for pipeline process
US6076158A (en) * 1990-06-29 2000-06-13 Digital Equipment Corporation Branch prediction in high-performance processor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6076158A (en) * 1990-06-29 2000-06-13 Digital Equipment Corporation Branch prediction in high-performance processor
US6044455A (en) * 1996-10-25 2000-03-28 Ricoh Company, Ltd. Central processing unit adapted for pipeline process

Similar Documents

Publication Publication Date Title
EP0087978B1 (en) Information processing unit
US4775927A (en) Processor including fetch operation for branch instruction with control tag
JP2730007B2 (en) Data processing device and computer program execution method
KR900012155A (en) Data processing systems
US5146570A (en) System executing branch-with-execute instruction resulting in next successive instruction being execute while specified target instruction is prefetched for following execution
US5088030A (en) Branch address calculating system for branch instructions
EP0354585A2 (en) Instruction pipeline microprocessor
EP0240606B1 (en) Pipe-line processing system and microprocessor using the system
US6775762B1 (en) Processor and processor system
JPH01199233A (en) Conditional branch control system for pipeline processing
JPH0377137A (en) Information processor
JPS6240538A (en) Data processor
JPS60108973A (en) Method for finding the minimum value of array elements and element number of the minimum element
JPS60263238A (en) Information processor
JPH07120281B2 (en) Information processing equipment
JPS6361696B2 (en)
JPS63141131A (en) Pipeline control system
JP2507791B2 (en) Data processing device
JP2000250762A (en) Microcomputer
JPS6325373B2 (en)
JPS62121549A (en) OS simulator speed-up method
EP0825529A2 (en) System for preparing instructions for instruction parallel processor and system with mechanism for branching in the middle of a compound instruction
JPH02278428A (en) Branch control system
JPS6126692B2 (en)
JPH03263224A (en) Data processor