JPH06124207A - サブルーチン分岐命令実行方法 - Google Patents

サブルーチン分岐命令実行方法

Info

Publication number
JPH06124207A
JPH06124207A JP4301692A JP30169292A JPH06124207A JP H06124207 A JPH06124207 A JP H06124207A JP 4301692 A JP4301692 A JP 4301692A JP 30169292 A JP30169292 A JP 30169292A JP H06124207 A JPH06124207 A JP H06124207A
Authority
JP
Japan
Prior art keywords
instruction
subroutine
branch
program counter
destination 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.)
Granted
Application number
JP4301692A
Other languages
English (en)
Other versions
JP3211423B2 (ja
Inventor
Shinji Nanba
慎二 難波
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP30169292A priority Critical patent/JP3211423B2/ja
Priority to KR1019930020686A priority patent/KR100301391B1/ko
Publication of JPH06124207A publication Critical patent/JPH06124207A/ja
Priority to US08/862,842 priority patent/US5819081A/en
Application granted granted Critical
Publication of JP3211423B2 publication Critical patent/JP3211423B2/ja
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/32Address formation of the next instruction, e.g. by incrementing the instruction counter
    • G06F9/322Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3802Instruction prefetching
    • G06F9/3804Instruction prefetching for branches, e.g. hedging, branch folding
    • G06F9/3806Instruction prefetching for branches, e.g. hedging, branch folding using address prediction, e.g. return stack, branch history buffer

Landscapes

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

Abstract

(57)【要約】 【目的】 サブルーチン分岐命令の実行サイクル数を削
減し、その命令を高速に実行できるようにしたサブルー
チン分岐命令実行方法を提供する。 【構成】 命令読出し用とデータの読み書き用にデータ
バス4を共用し、少なくとも命令フェッチと命令実行の
間に1つ以上のステージがあるパイプライン処理装置に
おいて、サブルーチン分岐時に、アドレスバス5に分岐
先アドレスを載せて、分岐先命令をフェッチし、プログ
ラムカウンタA7の内容をプログラムカウンタB8に一
時的に退避し、次いで新しい分岐先アドレスでプログラ
ムカウンタA7の内容を更新し、しかる後プログラムカ
ウンタB8の内容(=復帰先アドレス)をメモリ3上に
退避する。

Description

【発明の詳細な説明】
【0001】
【産業上の利用分野】本発明は、サブルーチン分岐命令
実行方法に関し、特に命令読出し用とデータの読み書き
用のバスを共用し、少なくとも命令フェッチと命令実行
の間に1つ以上のステージがあるパイプライン処理装置
におけるサブルーチン分岐命令実行方法に関する。
【0002】
【従来の技術】図3は、従来のサブルーチン分岐命令実
行方法が適用されるパイプライン処理装置の構成の一例
を示すブロック図である。ここで、図3に示すような構
造を持つCPU1において、図4のようなパイプライン
をもってサブルーチン分岐命令を実行する場合を考え
る。図4においては、第2番目の命令がサブルーチン分
岐命令であり、第3番目の命令はサブルーチン分岐後の
最初の命令である。サブルーチン分岐命令では、 プログラムカウンタ7が新しい分岐先アドレスで更
新される前のプログラムカウンタの内容(=復帰先アド
レス)をメモリ3上に退避する。すなわち、プログラム
カウンタ7に格納されている復帰先アドレスは、経路
d、データバス4および経路eを経てメモリ3上に退避
される。このとき、このとき、スタックポインタ9のス
タックアドレスが、経路h、アドレスバス5および経路
fを経てメモリ3に与えられる。
【0003】 新しい分岐先アドレスでプログラムカ
ウンタ7を更新する。すなわち、分岐先アドレス発生器
6で発生された分岐先アドレスは、経路a、アドレスバ
ス5および経路bを経てプログラムカウンタ7に供給さ
れることにより、プログラムカウンタ7の内容を更新す
る。 アドレスバス(AB)5に分岐先アドレスを載せ
て、分岐先命令をフェッチする。すなわち、分岐先アド
レス発生器6で発生された分岐先アドレスは、経路a、
アドレスバス5および経路fを経てメモリ3に与えら
れ、またメモリ3から読み出された分岐先の命令は、経
路c、データバス4および経路gを経て命令レジスタ2
に取り込まれる。
【0004】
【発明が解決しようとする課題】このように、従来のサ
ブルーチン分岐命令実行方法では、サブルーチン分岐を
行う際に、サブルーチンからの復帰先アドレスをメモリ
3上に退避した後、分岐先の命令フェッチを行っていた
ので、図4の例のように、上記,の各動作を同時に
行った場合には、サブルーチン分岐命令3サイクル後に
しか次の命令(第3番目の命令)を実行できなかった。
すなわち、サブルーチンからの復帰先アドレスの退避と
命令フェッチは同一のバスを使用することから、同一サ
イクルに実行できないため、復帰先アドレスの退避から
次の命令の実行までには4サイクル必要であった。
【0005】本発明は、上述した点に鑑みてなされたも
のであり、サブルーチン分岐命令の実行サイクル数を削
減し、その命令を高速に実行できるようにしたサブルー
チン分岐命令実行方法を提供することを目的とする。
【0006】
【課題を解決するための手段】本発明によるサブルーチ
ン分岐命令実行方法は、命令読出し用とデータの読み書
き用のバスを共用し、少なくとも命令フェッチと命令実
行の間に1つ以上のステージがあるパイプライン処理装
置において、サブルーチン分岐時に、サブルーチンから
の復帰先アドレスの退避に先立って分岐先の命令フェッ
チを行い、分岐先の命令フェッチとその命令実行の間に
サブルーチンからの復帰先アドレスの退避を行うように
する。
【0007】
【作用】サブルーチン分岐時に、サブルーチンからの復
帰先アドレスの退避に先立って分岐先の命令フェッチを
行い、分岐先の命令フェッチとその命令実行の間にサブ
ルーチンからの復帰先アドレスの退避を行うことで、分
岐先の命令フェッチとその命令実行の間のステージであ
るデコードと並行してサブルーチンからの復帰先アドレ
スの退避を行えることになるので、サブルーチン分岐命
令2サイクル後に次の命令を実行できる。その結果、従
来よりもサブルーチン分岐命令の実行サイクル数が少な
くて済むため、その命令を高速に実行できる。
【0008】
【実施例】以下、本発明の実施例を図面に基づいて詳細
に説明する。図1は、本発明によるサブルーチン分岐処
理実行方法が適用されるパイプライン処理装置の構成の
一例を示すブロック図である。図1において、CPU
(中央処理装置)1は、命令レジスタ2からの命令読出
し用とメモリ3に対するデータの読み書き用としてデー
タバス(DB)4を共用した構成となっている。そし
て、CPU1内の処理は、少なくとも命令フェッチと命
令実行の間に1つ以上のステージがあるパイプライン処
理構造を採っている。
【0009】ここで、上記のパイプライン処理構造にお
いて、次のような順序〜でサブルーチン分岐命令を
実行することとする。 アドレスバス(AB)5に分岐先アドレスを載せ
て、分岐先命令をフェッチする。すなわち、分岐先アド
レス発生器6で発生された分岐先アドレスは、経路a、
アドレスバス5および経路fを経てメモリ3に与えら
れ、またメモリ3から読み出された分岐先の命令は経路
c、データバス4および経路gを経て命令レジスタ2に
取り込まれる。
【0010】 プログラムカウンタA7の内容をプロ
グラムカウンタB8に一時的に退避する。すなわち、プ
ログラムカウンタA7に格納されている復帰先アドレス
は、経路cを経てプログラムカウンタB8に一時的に退
避される。 新しい分岐先アドレスでプログラムカウンタA7の
内容を更新する。すなわち、分岐先アドレス発生器6で
発生された分岐先アドレスは、経路a、アドレスバス5
および経路bを経てプログラムカウンタA7に供給され
ることにより、プログラムカウンタA7を更新する。 プログラムカウンタB8の内容(=復帰先アドレ
ス)をメモリ3上に退避する。すなわち、プログラムカ
ウンタB8に一時的に退避された復帰先アドレスは、経
路d、データバス4および経路eを経てメモリ3上に退
避される。このとき、スタックポインタ9のスタックア
ドレスが、経路h、アドレスバス5および経路fを経て
メモリ3に与えられる。
【0011】ここで、,の動作を同時に行うことは
全く問題ない。また、プログラムカウンタA7,B8が
いわゆるフリップフロップ動作をなすので、の動作も
同時に行うことができる。結局、 ,,→ のような順序でサブルーチン分岐命令を実行すれば、図
2に示すような実行が得られる。図2においても、第2
番目の命令がサブルーチン分岐命令であり、第3番目の
命令はサブルーチン分岐後の最初の命令である。
【0012】上述したように、データバス4を命令読出
し用とデータ読み書き用に共用し、命令フェッチと命令
実行の間にステージ(本例では、デコード)があるパイ
プライン処理装置において、サブルーチン分岐時に、分
岐先の命令フェッチをサブルーチンからの復帰先アドレ
スの退避に先立って行うようにしたことにより、分岐先
の命令フェッチとその命令実行の間のデコードと並行し
てサブルーチンからの復帰先アドレスの退避を行えるこ
とになるので、分岐先命令の実行までのサイクル数は3
サイクルで済む。すなわち、サブルーチン分岐命令2サ
イクル後に次の命令(第3番目の命令)を実行できるた
め、従来よりも、サブルーチン分岐命令の実行サイクル
数が少なくて済み、命令実行の高速化が図れる。
【0013】
【発明の効果】以上説明したように、本発明によれば、
命令読出し用とデータの読み書き用のバスを共用し、少
なくとも命令フェッチと命令実行の間に1つ以上のステ
ージがあるパイプライン処理装置において、サブルーチ
ン分岐時に、サブルーチンからの復帰先アドレスの退避
に先立って分岐先の命令フェッチを行い、分岐先の命令
フェッチとその命令実行の間にサブルーチンからの復帰
先アドレスの退避を行うようにしたことにより、サブル
ーチン分岐命令2サイクル後に次の命令を実行できるの
で、サブルーチン分岐命令の実行サイクル数が少なくて
済み、その命令を高速に実行できることになる。
【図面の簡単な説明】
【図1】本発明によるサブルーチン分岐処理実行方法が
適用されるパイプライン処理装置の構成の一例を示すブ
ロック図である。
【図2】本発明に係るシーケンス図である。
【図3】従来のサブルーチン分岐処理実行方法が適用さ
れるパイプライン処理装置の構成の一例を示すブロック
図である。
【図4】従来例に係るシーケンス図である。
【符号の説明】
1 CPU(中央処理装置) 2 命令レジスタ 3 メモリ 4 データバス 5 アドレスバス 6 分岐先アドレス発生器 7,8 プログラムカウンタ

Claims (2)

    【特許請求の範囲】
  1. 【請求項1】 命令読出し用とデータの読み書き用のバ
    スを共用し、少なくとも命令フェッチと命令実行の間に
    1つ以上のステージがあるパイプライン処理装置におい
    て、 サブルーチン分岐時に、サブルーチンからの復帰先アド
    レスの退避に先立って分岐先の命令フェッチを行い、 分岐先の命令フェッチとその命令実行の間にサブルーチ
    ンからの復帰先アドレスの退避を行うことを特徴とする
    サブルーチン分岐命令実行方法。
  2. 【請求項2】 前記パイプライン処理装置は、分岐先ア
    ドレスを格納する第1のプログラムカウンタと、前記第
    1のプログラムカウンタに格納された分岐先アドレスを
    復帰先アドレスとして一時的に退避する第2のプログラ
    ムカウンタとを具備したことを特徴とする請求項1記載
    のサブルーチン分岐命令実行方法。
JP30169292A 1992-10-13 1992-10-13 分岐命令実行方法および分岐命令実行装置 Expired - Fee Related JP3211423B2 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP30169292A JP3211423B2 (ja) 1992-10-13 1992-10-13 分岐命令実行方法および分岐命令実行装置
KR1019930020686A KR100301391B1 (ko) 1992-10-13 1993-10-07 서브루틴분기명령실행방법및그장치
US08/862,842 US5819081A (en) 1992-10-13 1997-05-23 Method of executing a branch instruction of jumping to a subroutine in a pipeline control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30169292A JP3211423B2 (ja) 1992-10-13 1992-10-13 分岐命令実行方法および分岐命令実行装置

Publications (2)

Publication Number Publication Date
JPH06124207A true JPH06124207A (ja) 1994-05-06
JP3211423B2 JP3211423B2 (ja) 2001-09-25

Family

ID=17900001

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30169292A Expired - Fee Related JP3211423B2 (ja) 1992-10-13 1992-10-13 分岐命令実行方法および分岐命令実行装置

Country Status (3)

Country Link
US (1) US5819081A (ja)
JP (1) JP3211423B2 (ja)
KR (1) KR100301391B1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100381876B1 (ko) * 1995-07-03 2003-07-18 텍사스 인스트루먼츠 인코포레이티드 프로그램카운팅시스템및카운터의동작방법
KR100413674B1 (ko) * 1996-12-05 2004-02-14 삼성전자주식회사 하드와이어드 서브루틴 생성장치

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100480384B1 (ko) * 1997-11-22 2005-07-18 엘지산전 주식회사 피엘씨전용마이크로프로세서의프로그램제어방법
EP0953898A3 (en) * 1998-04-28 2003-03-26 Matsushita Electric Industrial Co., Ltd. A processor for executing Instructions from memory according to a program counter, and a compiler, an assembler, a linker and a debugger for such a processor
US20040167786A1 (en) * 2002-03-08 2004-08-26 Grace John J. System for optimizing selection of a college or a university and a method for utilizing the system provided by a program

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3789365A (en) * 1971-06-03 1974-01-29 Bunker Ramo Processor interrupt system
US3967104A (en) * 1974-11-26 1976-06-29 Texas Instruments Incorporated Direct and indirect addressing in an electronic digital calculator
US4003033A (en) * 1975-12-22 1977-01-11 Honeywell Information Systems, Inc. Architecture for a microprogrammed device controller
US4179737A (en) * 1977-12-23 1979-12-18 Burroughs Corporation Means and methods for providing greater speed and flexibility of microinstruction sequencing
US4394729A (en) * 1980-10-16 1983-07-19 Ncr Corporation Jump return stack
US4399507A (en) * 1981-06-30 1983-08-16 Ibm Corporation Instruction address stack in the data memory of an instruction-pipelined processor
US4488227A (en) * 1982-12-03 1984-12-11 Honeywell Information Systems Inc. Program counter stacking method and apparatus for nested subroutines and interrupts
US4821183A (en) * 1986-12-04 1989-04-11 International Business Machines Corporation A microsequencer circuit with plural microprogrom instruction counters
DE3726192A1 (de) * 1987-08-06 1989-02-16 Otto Mueller Stacksteuerung
US4910664A (en) * 1987-11-27 1990-03-20 Mitsubishi Denki Kabushiki Kaisha Data processor with apparatus for reducing loop processing time
US5193205A (en) * 1988-03-01 1993-03-09 Mitsubishi Denki Kabushiki Kaisha Pipeline processor, with return address stack storing only pre-return processed address for judging validity and correction of unprocessed address
US5202967A (en) * 1988-08-09 1993-04-13 Matsushita Electric Industrial Co., Ltd. Data processing apparatus for performing parallel decoding and parallel execution of a variable word length instruction
JPH0778735B2 (ja) * 1988-12-05 1995-08-23 松下電器産業株式会社 キャッシュ装置と命令読出し装置
US5127091A (en) * 1989-01-13 1992-06-30 International Business Machines Corporation System for reducing delay in instruction execution by executing branch instructions in separate processor while dispatching subsequent instructions to primary processor
JP2570859B2 (ja) * 1989-05-25 1997-01-16 日本電気株式会社 データ処理装置
US5317700A (en) * 1992-05-01 1994-05-31 Unisys Corporation Program history for pipelined processor including temporary storage queues for storing branch addresses

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100381876B1 (ko) * 1995-07-03 2003-07-18 텍사스 인스트루먼츠 인코포레이티드 프로그램카운팅시스템및카운터의동작방법
KR100413674B1 (ko) * 1996-12-05 2004-02-14 삼성전자주식회사 하드와이어드 서브루틴 생성장치

Also Published As

Publication number Publication date
KR100301391B1 (ko) 2001-10-22
US5819081A (en) 1998-10-06
JP3211423B2 (ja) 2001-09-25
KR940009822A (ko) 1994-05-24

Similar Documents

Publication Publication Date Title
EP0592404B1 (en) Apparatus and method for providing a stall cache
JPH0248732A (ja) 命令パイプライン方式のマイクロプロセッサ
JPS62115542A (ja) 情報処理装置
JPH06124207A (ja) サブルーチン分岐命令実行方法
JPS6324327A (ja) 命令フエツチ処理方式
JP2006515446A (ja) 関連アプリケーションを相互参照するカルテシアンコントローラを有するデータ処理システム
JP2812610B2 (ja) パイプライン制御方式
JPS61250754A (ja) 簡易型キヤツシユメモリ
JP2000020309A (ja) デジタルシグナルプロセッサ
JP3325309B2 (ja) サブルーチンリターン命令処理装置
KR100246465B1 (ko) 마이크로프로세서 스택 명령어의 수행사이클을 줄이기 위한 장치 및 그 방법
JPS6086625A (ja) デ−タ処理装置
JP2738683B2 (ja) データ処理装置
JP2522562B2 (ja) プログラマブルコントロ―ラ
JPS5999552A (ja) マイクロコンピユ−タ
JP2522564B2 (ja) プログラマブルコントロ―ラ
JPS61161509A (ja) 高速シ−ケンス演算方式及びその装置
JPH0353322A (ja) 情報処理装置
JPH023822A (ja) データ処理装置
JPS58205256A (ja) データ処理方法
JPH03154929A (ja) 中央処理装置
JPS58154045A (ja) 情報処理装置
JPH0236421A (ja) シーケンサの基本命令処理方式
JPH04287227A (ja) 演算処理装置
JPH0442327A (ja) 先行制御装置

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080719

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090719

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090719

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100719

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100719

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110719

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110719

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120719

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees