JP2752081B2 - Electronic computer - Google Patents

Electronic computer

Info

Publication number
JP2752081B2
JP2752081B2 JP63059283A JP5928388A JP2752081B2 JP 2752081 B2 JP2752081 B2 JP 2752081B2 JP 63059283 A JP63059283 A JP 63059283A JP 5928388 A JP5928388 A JP 5928388A JP 2752081 B2 JP2752081 B2 JP 2752081B2
Authority
JP
Japan
Prior art keywords
instruction
tag
branch
register
value
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 - Fee Related
Application number
JP63059283A
Other languages
Japanese (ja)
Other versions
JPH01233523A (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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP63059283A priority Critical patent/JP2752081B2/en
Publication of JPH01233523A publication Critical patent/JPH01233523A/en
Application granted granted Critical
Publication of JP2752081B2 publication Critical patent/JP2752081B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】 〔発明の目的〕 (産業上の利用分野) 本発明はAI言語で書かれたプログラムを高速実行する
AIプロセサ等の電子計算機に関する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Industrial application field) The present invention executes a program written in an AI language at a high speed.
Related to electronic computers such as AI processors.

(従来の技術) 近年、人工知能の実用化の要求が高まり、人工知能用
言語で書かれたプログラムを高速に実行する電子計算機
の実用化が望まれている。人工知能言語例えばLisp,Pro
log等の高速実行のためには、計算機の扱かうデータに
データタイプをタグとして付加する事が行なわれ、デー
タタイプをタグ値から判定して、処理を変える事がひん
ぱんに行なわれる。人工知能用言語で書かれたプログラ
ムの高速実行のためには、タグによるプログラムの実行
制御の変更を効率良く行なう必要がある。
(Prior Art) In recent years, the demand for practical use of artificial intelligence has been increased, and practical use of an electronic computer that executes a program written in a language for artificial intelligence at high speed has been desired. Artificial intelligence languages such as Lisp, Pro
For high-speed execution of log or the like, a data type is added as a tag to data handled by a computer, and the data type is frequently determined by judging from the tag value and changing the processing. In order to execute a program written in an artificial intelligence language at high speed, it is necessary to efficiently change the execution control of the program by using a tag.

従来の計算機では、プログラムの実行制御の変更のた
めに、演算機での演算結果のステータスを保持する手段
と、そのステータスにより、ブランチを用なうコンディ
ショナルブランチ機能があった。この機能を使ってタグ
値によるプログラムの制御変更を行なう場合には、ま
ず、レジスタよりタグ付データを読み出し、タグ部
だけを切出し、切出されたタグ部とイミーディエイト
値の比較演算を演算機で行なわせ、比較演算結果のス
テータスを見て、ブランチをするか否かを決定するとい
う手順をふくまなくてはならず、多くのプログラムステ
ップを要し処理時間もかかっていた。
In a conventional computer, there is a means for holding a status of an operation result in an arithmetic unit in order to change the execution control of a program, and a conditional branch function using a branch according to the status. When using this function to change the control of a program using a tag value, first read the tagged data from the register, cut out only the tag part, and calculate the comparison operation between the clipped tag part and the immediate value And a procedure for determining whether or not to take a branch by checking the status of the comparison operation result, which requires many program steps and takes a long processing time.

(発明が解決しようとする課題) この様に従来の計算機ではプログラムの実行制御の変
更のために、多くのプログラムステップを要し処理時間
がかかるという欠点が有った。
(Problems to be Solved by the Invention) As described above, the conventional computer has a drawback that many program steps are required for changing the execution control of the program, and it takes a long processing time.

本発明はタグによるプログラム制御の変更をプログラ
ムステップ数を短かく、且つ高速に行なうことを目的と
する。
SUMMARY OF THE INVENTION It is an object of the present invention to change program control by a tag at a high speed with a short number of program steps.

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

(課題を解決するための手段) 本発明は、所定の命令を検出する検出手段と、タグの
値を保持する保持手段と、前記検出手段により検出され
る命令がタグロード命令である場合に、該タグロード命
令中の所定のフィールドによって指定された汎用レジス
タのタグ部を、前記保持手段にロードする手段と、前記
検出手段により検出される命令が分岐命令である場合
に、該分岐命令中のタグ値と前記保持手段中のタグ値と
を比較する比較手段と、この比較手段の比較結果により
プログラム実行の分岐先を変更する手段とを具備したこ
とを特徴とする電子計算機である。
(Means for Solving the Problems) The present invention provides a detecting means for detecting a predetermined instruction, a holding means for holding a value of a tag, and a case where the instruction detected by the detecting means is a tag load instruction. Means for loading the tag portion of the general-purpose register specified by a predetermined field in the tag load instruction into the holding means; and when the instruction detected by the detection means is a branch instruction, An electronic computer comprising: comparing means for comparing a tag value with a tag value in the holding means; and means for changing a branch destination of program execution based on a comparison result of the comparing means.

(作用) 本発明における計算機においては、タグレジスタと、
汎用レジスタ中のデータのタグ部をタグレジスタにロー
ドする手段と、タグレジスタ中のタグ値とブランチ命令
中で指定されたタグ値の比較を行なう手段と、比較結果
の真偽によりブランチするか否かを制御するハードウェ
アを持たせる。
(Operation) In the computer of the present invention, a tag register
Means for loading the tag portion of the data in the general-purpose register into the tag register, means for comparing the tag value in the tag register with the tag value specified in the branch instruction, and whether or not to branch depending on whether the comparison result is true or false Or have hardware to control it.

(実施例) 以下、図面を用いて本発明の一実施例の説明を行な
う。
(Embodiment) Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

第1図は本発明による32ビットプロセサの実施例の構
成図である。第1図において、1は命令が記憶されてい
るインストラクションメモリ,2はフェッチすべき命令ア
ドレスを保持しているプログラムカウンタでアドレス線
3を介してインストラクションメモリにフェッチアドレ
スを供給している。4はインストラクションレジスタ
で、命令データ線を通して、インストラクションメンモ
リより命令データを受け取り保持している。5は実行ユ
ニットで、インストラクションレジスタ4に保持してい
る命令に従がって演算を行なう。
FIG. 1 is a block diagram of an embodiment of a 32-bit processor according to the present invention. In FIG. 1, 1 is an instruction memory in which an instruction is stored, and 2 is a program counter holding an instruction address to be fetched, and supplies a fetch address to the instruction memory via an address line 3. An instruction register 4 receives and holds instruction data from an instruction memory via an instruction data line. Reference numeral 5 denotes an execution unit that performs an operation in accordance with the instruction held in the instruction register 4.

6は実行ユニット5の指示に従がって、実行ユニット
内のレジスタファイル中の指定されたレジスタ内容のタ
グ部を記憶しているタグレジスタ,7はタグ信号線9を通
して供給される命令中のタグフィールドの値とタグレジ
スタの内容を比較している比較器,8はインストラクショ
ンレジスタ4中の命令コードを監視しているブランチ命
令検出器,10はブランチ命令8の指示に従がって、ブラ
ンチする場合には命令中のブランチディスプレイスメン
トを、ブランチしない場合には‘1'をプログラムカウン
タアドレス加算器11に供給するディスプレイスメントジ
ェネレータである。プログラムカウンタアドレス加算器
はブランチする場合にはプログラムカウンタ2とブラン
チディスプレイスメントの和を、ブランチしない場合に
はプログラムカウンタ2の内容に1加わえた値が、それ
ぞれプログラムカウンタ2に供給される。
Reference numeral 6 denotes a tag register which stores a tag portion of the register contents specified in the register file in the execution unit 5 in accordance with the instruction of the execution unit 5, and 7 denotes a tag in the instruction supplied through the tag signal line 9. A comparator comparing the value of the tag field with the contents of the tag register, 8 is a branch instruction detector monitoring the instruction code in the instruction register 4, and 10 is a branch instruction according to the instruction of the branch instruction 8. This is a displacement generator that supplies a branch displacement in an instruction to the program counter address adder 11 when branching is performed, and “1” when not branching. The program counter address adder supplies the sum of the program counter 2 and the branch displacement to the program counter 2 when branching, and the value obtained by adding 1 to the contents of the program counter 2 when branching is not performed.

第2図に本計算機の命令フォーマットと命令セットの
一部を示す。本計算機の命令長は32bit固定であり上位
8ビットが、命令コードに対応している。下位24ビット
はオペランド部であるが、オペランド部のフォーマット
は命令コード毎に異なる。第2図(a)に示すアンコン
ディシュナルブランチ命令(B)に対応する命令コード
は、0x02であり、オペランドとして、24ビットのブラン
チディスプレイスメントを持っている。この命令は常に
ブランチを行なう命令で、ブランチ命令検出器8はイン
ストラクションレジスタ中のB命令を検出すると、ディ
スプレイスメントジェネレータにインストラクションレ
ジスタ中のb0〜b23からブランチディスプレイスメント
を生成するように指示を行ない、プログラムカウンタ2
の内容が無条件にプログラムカウンタ+24ビットブラン
チディスプレイスメントに書き変わる。
FIG. 2 shows a part of the instruction format and instruction set of the computer. The instruction length of this computer is fixed at 32 bits, and the upper 8 bits correspond to the instruction code. The lower 24 bits are the operand part, but the format of the operand part differs for each instruction code. The instruction code corresponding to the unconditional branch instruction (B) shown in FIG. 2A is 0x02, and has a 24-bit branch displacement as an operand. This instruction always performs a branch instruction, the branch instruction detector 8 detects the B instruction in instruction register, an instruction to generate a branch displacement from b 0 ~b 23 in the instruction register to the displacement generator Run, program counter 2
Is unconditionally rewritten into the program counter + 24-bit branch displacement.

第2図(b)に示すブランチオンタグマッチ命令に対
応する命令コードは0x03であり、ブランチ命令検出器8
は、インストラクションレジスタ中のBOTT命令を検出す
ると、さらにインストラクションレジスタ中のタグフィ
ールド(b20〜b23)とタグレジスタ6の内容を比較して
いるタグ比較器7の出力を見て、それが真だった場合に
は、ブンランチディスプレイスメントジェネレータ10に
対し、インストラクションレジスタ中のb0〜b13からブ
ランチディスプレイスメントを生成するように指示を行
ない、偽の場合にはブランチディスプレイスメントジェ
ネレータ10に対して“1"を出力するように指示を行な
う。その結果プログラムカウンタ2の値は命令中で指定
されているタグ値(b20〜b23)とタグレジスタ6の内容
が一致した場合にはプログラムカウンタ+20ビットブラ
ンチディスプレイスメントに書き変わるし(ブランチす
る)、一致しない場合にはプログラムカウンタ+“1"に
書き変わる。(ブランチしない) 第2図(c)に示すブランチオンタグミスマッチ命令
(BOTT)は、タグと比較器7の真偽の出力に対し、BOTT
命令と全く逆の動作つまり真の時ブランチせず、偽の時
ブランチする命令である。B,BOTT,BOTF命令以外の命令
に関しては、ブランチ命令検出器はプランチディスプレ
イスメントジェネレータに対し、常に‘1'を出力するよ
うに指示を行なう。
The instruction code corresponding to the branch-on tag match instruction shown in FIG. 2B is 0x03, and the branch instruction detector 8
True detects the BOTT instruction in the instruction register, a look further tag field in the instruction register and (b 20 ~b 23) the output of the tag comparator 7 which compares the contents of the tag register 6, it is If it was, compared Bun lunch displacement generator 10, carried out the instructions to generate a branch displacement from b 0 ~b 13 in the instruction register, for the branch displacement generator 10 in the case of false Instruct to output “1”. It Consequently the value of the program counter 2 is changed to write the program counter +20 bit branch displacement in the case where the content of the tag register 6 tag value (b 20 ~b 23) that is specified in the instruction is matched (branch ), If they do not match, rewrite to the program counter + "1". (No branch) The branch-on-tag mismatch instruction (BOTT) shown in FIG.
The operation is the opposite of the instruction, that is, the instruction does not branch when true, but branches when false. For instructions other than the B, BOTT, and BOTF instructions, the branch instruction detector instructs the planch displacement generator to always output '1'.

第2図(d)に示すグロード命令(LDT)は実行ユニ
ット5で実行制御が行なわれ、命令中のレジスタ指定フ
ィールドb13〜b23で指定された汎用レジスタのタグ部
が、タグレジスタ6にロードされる。本計算機ではB,BO
TT,BOTF,LDT以外にも通常の計算機で持っている一般的
命令(ADD,SUB,COMP etc)も命令セット中に持っている
が詳細な説明は省略する。
Gurodo shown in FIG. 2 (d) instructions (LDT) is carried out execution control execution unit 5, the tag portion of the general-purpose register specified by the register specifying field b 13 ~b 23 in instruction, the tag register 6 Loaded. In this computer, B, BO
In addition to TT, BOTF, and LDT, general instructions (ADD, SUB, COMP, etc.) possessed by ordinary computers are also included in the instruction set, but detailed description is omitted.

本実施例の計算機のデータ形式を第3図に示す。上位
4ビットがタグフィールドであり下位28ビットに値ある
いは値に対するポインタが格納されている。タグは全部
で16通りであるがPrologの実行に都合が良いようにタグ
を定義している。
FIG. 3 shows the data format of the computer of this embodiment. The upper 4 bits are a tag field, and the lower 28 bits store a value or a pointer to the value. There are 16 tags in total, but the tags are defined to be convenient for running Prolog.

Prologで書かれたプログラムをコンパイルして実行す
る場合の中間コードとして有名なものにD.H.D Warrenの
‘Abstruct Machine.Instruction set'があるが、その
中のswitch−on−term命令を計算機の機械語まで落とし
て実行する例を考える。switch−on−term命令の記述形
式は、第4図の通りである。Aoというアーギュメントレ
ジスタのデータのタグ部がコンスタンスならLc番地へ、
変数ならLv番地へ、リストならLe番地へ、ストラクチャ
ならLs番地へ、それ以外ならLF番地へブランチせよとい
う命令である。本発明の機構なしにこの機能を実現しよ
うとした場合には、switch−on−term命令は、第5図に
示すような命令列に落ちる。本発明の機構がある場合に
は、第6図のような命令列に落ち、第5図に比べ半分の
コード量となるし、COMPI命令が無くなる分処理を高速
化できる。
The famous intermediate code for compiling and executing a program written in Prolog is DHD Warren's 'Abstruct Machine.Instruction set'. Consider an example of dropping and executing. The description format of the switch-on-term instruction is as shown in FIG. Tag portion of the data argument register that A o is the Constance if L c address,
To a variable if L v address, list if to Le address, to the structure if L s address, is an instruction that the case branch to L F address otherwise. If this function is to be realized without the mechanism of the present invention, the switch-on-term instruction falls into an instruction sequence as shown in FIG. In the case where the mechanism of the present invention is provided, an instruction sequence as shown in FIG. 6 is dropped, the code amount is reduced by half compared to FIG. 5, and the processing can be speeded up by eliminating the COMPI instruction.

なお、タグレジスタ6は、ALUの演算ステータスを記
述するステータスレジスタを兼ねても良い。
Note that the tag register 6 may also serve as a status register that describes the operation status of the ALU.

〔発明の効果〕〔The invention's effect〕

以上述べた様に本発明によれば、タグ値によるブラン
チ処理部のコード量が減りかつ処理の高速化が可能とな
った。
As described above, according to the present invention, the code amount of the branch processing unit by the tag value is reduced, and the processing speed can be increased.

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

第1図は本発明の一実施例を示すブロック図、第2図は
同実施例において本発明に係わる命令のフォーマットを
示す図、第3図は同実施例の計算機の取扱かうデータ形
式を示す図、第4図はswitch−on−termの命令記述フォ
ーマットを示す図、第5図は本発明の機構が無い場合の
機械語コード展開例を示す図、第6図は同実施例におけ
る機械語コード展開例を示す図である。 1…インストラクションメモリ 2…プログラムカウンタ、3…アドレス線 4…インストラクションレジスタ 5…実行ユニット、6…タグレジスタ 7…比較器、8…ブランチ命令検出器 9…タグ信号線 10…ディスプレイスメントジェネレータ 11…プログラムカウンタアドレス加算器
FIG. 1 is a block diagram showing an embodiment of the present invention, FIG. 2 is a diagram showing a format of an instruction according to the present invention in the embodiment, and FIG. 3 is a data format handled by a computer of the embodiment. FIG. 4, FIG. 4 is a view showing a switch-on-term instruction description format, FIG. 5 is a view showing an example of a machine language code expansion without the mechanism of the present invention, and FIG. 6 is a machine language in the embodiment. It is a figure showing the example of code development. DESCRIPTION OF SYMBOLS 1 ... Instruction memory 2 ... Program counter, 3 ... Address line 4 ... Instruction register 5 ... Execution unit, 6 ... Tag register 7 ... Comparator, 8 ... Branch instruction detector 9 ... Tag signal line 10 ... Displacement generator 11 ... Program Counter address adder

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭60−107137(JP,A) 特開 昭63−41933(JP,A) 特開 昭61−68636(JP,A) 昭和60年度 人工知能学会全国大会 (第1回)論文集(1987)p.237−244 ────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-60-107137 (JP, A) JP-A-63-41933 (JP, A) JP-A-61-68636 (JP, A) 1985 Artificial intelligence National Conference of the Society (1st) Papers (1987) p. 237-244

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】所定の命令を検出する検出手段と、 タグの値を保持する保持手段と、 前記検出手段により検出される命令がタグロード命令で
ある場合に、該タグロード命令中の所定のフィールドに
よって指定された汎用レジスタのタグ部を、前記保持手
段にロードする手段と、 前記検出手段により検出される命令が分岐命令である場
合に、該分岐命令中のタグ値と前記保持手段中のタグ値
とを比較する比較手段と、 この比較手段の比較結果によりプログラム実行の分岐先
を変更する手段とを具備したことを特徴とする電子計算
機。
1. A detecting means for detecting a predetermined instruction, a holding means for holding a value of a tag, and when the instruction detected by the detecting means is a tag load instruction, a predetermined Means for loading a tag portion of a general-purpose register specified by a field into the holding means; and when the instruction detected by the detecting means is a branch instruction, a tag value in the branch instruction and a tag value in the holding means. An electronic computer comprising: comparison means for comparing a tag value; and means for changing a branch destination of program execution based on a comparison result of the comparison means.
JP63059283A 1988-03-15 1988-03-15 Electronic computer Expired - Fee Related JP2752081B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63059283A JP2752081B2 (en) 1988-03-15 1988-03-15 Electronic computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63059283A JP2752081B2 (en) 1988-03-15 1988-03-15 Electronic computer

Publications (2)

Publication Number Publication Date
JPH01233523A JPH01233523A (en) 1989-09-19
JP2752081B2 true JP2752081B2 (en) 1998-05-18

Family

ID=13108910

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63059283A Expired - Fee Related JP2752081B2 (en) 1988-03-15 1988-03-15 Electronic computer

Country Status (1)

Country Link
JP (1) JP2752081B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS599939B2 (en) * 1975-12-26 1984-03-06 日本電気株式会社 Data search
JPS55103645A (en) * 1979-01-31 1980-08-08 Toshiba Corp Microprogram control system
JPS60107137A (en) * 1983-11-15 1985-06-12 Nec Corp Data processor with tag
JPS6160132A (en) * 1984-08-31 1986-03-27 Fujitsu Ltd Data type control system
JPH065507B2 (en) * 1986-08-08 1994-01-19 工業技術院長 Inference calculator

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
昭和60年度 人工知能学会全国大会(第1回)論文集(1987)p.237−244

Also Published As

Publication number Publication date
JPH01233523A (en) 1989-09-19

Similar Documents

Publication Publication Date Title
US5848269A (en) Branch predicting mechanism for enhancing accuracy in branch prediction by reference to data
US6021273A (en) Interpreter generation and implementation utilizing interpreter states and register caching
US4860197A (en) Branch cache system with instruction boundary determination independent of parcel boundary
US4791550A (en) Higher order language-directed computer
US7580914B2 (en) Method and apparatus to improve execution of a stored program
US7458069B2 (en) System and method for fusing instructions
US6338160B1 (en) Constant pool reference resolution method
US6122638A (en) Object-oriented processor and method for caching intermediate data in an object-oriented processor
US4933847A (en) Microcode branch based upon operand length and alignment
US6026486A (en) General purpose processor having a variable bitwidth
US5860152A (en) Method and apparatus for rapid computation of target addresses for relative control transfer instructions
US5295248A (en) Branch control circuit
US5349671A (en) Microprocessor system generating instruction fetch addresses at high speed
US4245327A (en) Data processor having two types of carry flags
US6427231B1 (en) System and method for multiple entry point access to an object
US5390306A (en) Pipeline processing system and microprocessor using the system
JP2752081B2 (en) Electronic computer
JPH07239780A (en) One-clock variable length instruction execution process type instruction read computer
US5293499A (en) Apparatus for executing a RISC store and RI instruction pair in two clock cycles
US6408380B1 (en) Execution of an instruction to load two independently selected registers in a single cycle
KR960011669A (en) Central Processing Unit
Moreno Dynamic translation of tree-instructions into VLIWs
JPH03216735A (en) Apparatus and method for generating address in instruction decode cycle
JPH1173301A (en) Information processor
JPH0642198B2 (en) Data processing device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees