JP2000512409A - Apparatus and method for detecting and decompressing instructions from a variable length compressed instruction set - Google Patents

Apparatus and method for detecting and decompressing instructions from a variable length compressed instruction set

Info

Publication number
JP2000512409A
JP2000512409A JP10501756A JP50175698A JP2000512409A JP 2000512409 A JP2000512409 A JP 2000512409A JP 10501756 A JP10501756 A JP 10501756A JP 50175698 A JP50175698 A JP 50175698A JP 2000512409 A JP2000512409 A JP 2000512409A
Authority
JP
Japan
Prior art keywords
instruction
compression
register
field
decompression
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
JP10501756A
Other languages
Japanese (ja)
Inventor
ウォーレル、フランク
ハルトビック エクナー
Original Assignee
エル エス アイ ロジック コーポレーション
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
Priority claimed from US08/661,003 external-priority patent/US5896519A/en
Priority claimed from US08/659,709 external-priority patent/US5794010A/en
Priority claimed from US08/659,708 external-priority patent/US5905893A/en
Application filed by エル エス アイ ロジック コーポレーション filed Critical エル エス アイ ロジック コーポレーション
Publication of JP2000512409A publication Critical patent/JP2000512409A/en
Pending 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
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/3017Runtime instruction translation, e.g. macros
    • G06F9/30178Runtime instruction translation, e.g. macros of compressed or encrypted instructions
    • 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/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/30149Instruction analysis, e.g. decoding, instruction word fields of variable length instructions
    • 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/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/3016Decoding the operand specifier, e.g. specifier format
    • G06F9/30167Decoding the operand specifier, e.g. specifier format of immediate specifier, e.g. constants
    • 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/30181Instruction operation extension or modification
    • G06F9/30189Instruction operation extension or modification according to execution mode, e.g. mode flag

Abstract

(57)【要約】 対応する非圧縮命令のサブセットを含む圧縮命令のセットをフェッチするようにマイクロプロセッサーが構成される。圧縮命令のセットは、可変長命令のセットであり、16ビット及び32ビットの命令を含む。32ビット命令は拡張オペコードを用いて符号化され、それは、フェッチされている命令が拡張された(例えば32ビット)命令であることを表す。圧縮命令のセットは、圧縮レジスタフィールドから非圧縮レジスタフィールドへの複数のレジスタ写像のセットをさらに含む。或る選択命令には、2つのオペコード符号、2つの対応するレジスタフィールドの写像のそれぞれについて1つずつ、が割り当てられる。圧縮レジスタフィールドは、非圧縮レジスタフィールドへと直接複写され、一方、非圧縮レジスタフィールドの残りの部分は、少数の論理ゲートを用いて作られる。圧縮命令セット内のサブルーチンコール命令は圧縮モードを含み、該モードは目的ルーチンが圧縮命令で符号化されているか否かを示す。圧縮モードは、プログラムカウンターレジスタに格納される。大域ポインタレジスタをベースレジスタとして有するロード/ストア命令に使用される即値フィールドの伸張は、混合された圧縮/非圧縮命令の実行のために最適化される。即値フィールドは非圧縮即値フィールドへと伸張され、そのために最上位ビットがセットされる。 (57) Abstract: A microprocessor is configured to fetch a set of compressed instructions including a corresponding subset of uncompressed instructions. The set of compression instructions is a set of variable length instructions, including 16-bit and 32-bit instructions. The 32-bit instruction is encoded using an extended opcode, which indicates that the instruction being fetched is an extended (eg, 32-bit) instruction. The set of compressed instructions further includes a set of multiple register mappings from the compressed register field to the uncompressed register field. Some select instructions are assigned two opcodes, one for each of the mappings of the two corresponding register fields. The compressed register field is copied directly into the uncompressed register field, while the rest of the uncompressed register field is made using a small number of logic gates. The subroutine call instructions in the compression instruction set include a compression mode, which indicates whether the target routine is encoded with compression instructions. The compression mode is stored in the program counter register. Decompression of immediate fields used in load / store instructions having the global pointer register as a base register is optimized for execution of mixed compressed / uncompressed instructions. The immediate field is decompressed into an uncompressed immediate field, for which the most significant bit is set.

Description

【発明の詳細な説明】 可変長圧縮命令セットから命令を検出し及び伸張する装置ならびに方法 発明の分野 本発明は、マイクロプロセッサの分野に関し、さらに詳細には、マイクロプロ セッサの命令セットの最適化に関する。 背景技術 マイクロプロセッサの構造(アーキテクチャ)は、一般に複雑命令セット電算 処理(CISC:complex instruction set computing)構造または縮小命令セ ット電算処理(RISC:reduced instruction set computing)構造の何れかに 分類されよう。CISC構造は、高水準の比較的複雑な命令からなる命令セット を含む。CISC構造を実施するマイクロプロセッサは、多くの場合、複雑な命 令をハードウェアで比較的容易に実行できる多数の比較的単純な動作へと分解す る。1つの命令に対応する分解された幾つかの動作を与えるのに、これまでチッ プ内蔵の読出し専用記憶装置(ROM)に格納されたマイクロコード化されたル ーチンが巧く利用されてきた。さらに最近は、複雑な命令を比較的単純な動作へ と分離するハードウェアデコーダが、一部のCISCマイクロプロセッサ設計者 によって採用された。x86マイクロプロセッサのアーキテクチャは、CISC 構造の一例である。 逆に、RISC構造は、低水準の比較的単純な命令からな る命令セットを含む。一般に、命令セットに含まれる各命令は、ハードウェアで 直接実行される。CISC方式に伴う複雑さは無く、より先進的なインプリメン テーションの設計が可能となる。さらに、命令の実行に用いられるハードウェア が単純なので、高い周波数での設計が比較的容易に可能となる。RISC構造の 例としては、MIPS RISCアーキテクチャがある。 必ずしも決定的な特徴ではないが、CISC構造と言えば可変長命令セットで あり、RISC構造と言えば固定長命令セットであると多くの場合思われてきた 。可変長命令セットでは、異なるビット数を用いて、命令セット中の種々の命令 だけでなく、命令に対するアドレス指定モードも符号化する。可変長命令セット においては、一般に、各命令の情報をその命令を表す1乃至複数のバイトに可能 な限り効率的に詰め込もうとする。これに対して、固定長命令セットでは、各命 令に同数のビットを用いる(このビット数は、一般に8の倍数であり、各命令が 固定数のバイトに完全に収まるようになっている)。幾つかの固定的な情報フィ ールド(固定フィールド)からなる少数の命令形式が、定義されるのが一般的で ある。これにより、各命令の復号処理は、各固定フィールドに対応するビットを そのフィールドを復号するために設計された論理回路に送ることへと簡単化され る。 固定長命令セットの各命令は、固定数のバイトからなるので、命令の位置の特 定も同様に簡単化される。特定の命 令に続く多数の命令の位置が、その特定の命令の位置によって暗に(即ち、その 特定の命令の位置からの一定のオフセットとして)示される。これに対して、2 番目の可変長命令の位置を特定するには、最初の可変長命令の終わりの位置を特 定する必要があり、3番目の可変長命令の位置を特定するには、2番目の可変長 命令の終わりの位置を特定する必要があると言う具合である。さらに、可変長命 令には、固定長命令の固定フィールド構造が無い。この固定フィールドの欠如に より、復号処理が一層複雑となる。 不幸なことに、固定長命令セットを用いるRISC構造は、可変長命令セット を用いるCISC構造には一般に当てはまらない問題点がある。各命令が固定長 であるため、極めて単純な命令の中には、その命令に関する情報を持たないバイ トを幾つも占有することによりメモリを事実上浪費するものも幾つかある。例え ば、多くの固定長命令セットにおけるある種の命令に対して「任意(don't care )」フィールドと指定されたフィールドは、メモリを浪費する。対照的に、可変 長命令セットでは、命令の情報が最小数のバイトに詰め込まれる。 さらに、RISC構造は、CISC構造で用いられる複雑な命令を含まないの で、RISC命令で符号化されたプログラムで使用される命令の数は、CISC 命令で符号化された同じプログラムで使用される命令の数より大きくなる。その プログラムのCISC版において符号化された比較的複雑な命令の各々は、その プログラムのRISC版の複数の命令によ って置き換えられる。したがって、プログラムのCISC版の方が、プログラム のRISC版よりかなり少ないメモリを占有することが多い。これに対応して、 プログラムを蓄積する装置、メモリおよびマイクロプロセッサの間の帯域幅は、 プログラムのCISC版よりプログラムのRISC版の方が、多く必要とする。 発明の概要 以上概観した問題点は、本発明によるマイクロプロセッサによって大部分が解 決される。本発明のマイクロプロセッサは、対応する非圧縮命令(non-compresse d instruction)セットの部分集合(サブセット)からなる圧縮された命令セット (以下「圧縮命令セット」とする)をフェッチするように構成される。その非圧 縮命令セットは、RISC構造に対して一般に付随する高周波動作や比較的単純 な実行資源をマイクロプロセッサが享受できるようなRISC命令セットでよい 。メモリから圧縮命令(compressed instruction)を読み込んで、マイクロプロセ ッサ内部で伸張することにより、与えられた性能水準(例えば、1秒当たり実行 される命令数)を達成するために必要なメモリ帯域幅が減少するので好都合であ る。さらに、圧縮命令が占めるメモリ量は、対応する非圧縮命令が占めるより比 較的少ない。 ここで述べる説明のための圧縮命令セットは、可変長命令セットである。一実 施例によれば、16ビット命令と32ビット命令の2つの異なる命令長を含む。 32ビット命 令は、拡張オペコードを用いて符号化され、ここで拡張オペコードとは、フェッ チ中の命令が拡張命令(32ビット命令)であることを示すものである。命令は 、16ビットの量としてフェッチしてもよい。前述の拡張オペコードを有する1 6ビット命令が読み込まれると、それに続く16ビットの命令がその拡張オペコ ードを有する命令に連結されて、32ビットの拡張命令を形成する。拡張命令は 、拡張されていない命令に関して強化した能力を有し、圧縮命令セットの柔軟性 および性能をさらに高める。これにより、拡張命令に含まれる能力を用いるルー チンを圧縮命令を用いて符号化することができる。 さらに圧縮命令セットには、圧縮されたレジスタフィールドから伸張されたレ ジスタフィールドへのレジスタ射像(割り当て)の多数の集合も含まれる。圧縮 レジスタフィールドで符号化された各値は、マイクロプロセッサ内部の異なるレ ジスタへと伸張される。一の実施例では、圧縮レジスタフィールドは、それぞれ 3ビットからなる。したがって、1つの命令に対し8個のレジスタがアクセス可 能である。ある種の選択命令に対して更なるレジスタへのアクセスを提供するに は、それらの選択命令に2つのオペコード符号化を割り当てる。それらのオペコ ード符号化の1つが、レジスタフィールドの第1の射像(割り当て)を示す一方 で、第2のオペコード符号化が、レジスタフィールドの第2の射像を示す。圧縮 レジスタフィールドには、比較的少数のビットを含めても良いし、8個以上の付 加的なレ ジスタへのアクセスが望まれる選択命令には、そのようなアクセスを与えること もできるので都合がよい。さらに、レジスタの射像は、レジスタフィールドの伸 張に用いられる論理回路を最小化するように、選択される。一実施例では、圧縮 レジスタフィールドは、伸張レジスタフィールドの一部に直接コピーされ、伸張 レジスタフィールドの残りの部分は、少数の論理ゲートを用いて生成する。 本発明のマイクロプロセッサは、圧縮命令で符号化されたルーチンと非圧縮命 令で符号化されたその他のルーチンとを有するプログラムを実行できるようにな っている。圧縮命令セットに含まれるサブルーチンのコール命令は、目的のルー チンが圧縮命令で符号化されているかどうかを示す圧縮モードを含む。サブルー チンコールによって指定される圧縮モードは、マイクロプロセッサにより、その ルーチンについての圧縮モードとして捕捉される。一の実施例においては、圧縮 モードは、フェッチアドレスビットの1つとして格納される(マイクロプロセッ サ内部のプログラムカウンタレジスタに格納される)。この場合の圧縮モードは 、フェッチアドレスの一部であり、且つサブルーチンコール命令が、そのサブル ーチンに対する戻りアドレスを格納することを含むので、呼び出し中のルーチン の圧縮モードは、サブルーチンコール命令の実行時に自動的に記憶される。これ により、サブルーチンのリターン命令が実行されると、呼び出し中のルーチンの 圧縮モードが自動的に復元される。 本マイクロプロセッサの実施例のもう1つの特徴は、広域(大域)ポインタレ ジスタをベースレジスタとして有するロード/ストア命令に用いられる即値フィ ールドの伸張である。即値フィールドは、伸張即値フィールドへと伸張され、そ の最上位ビットがセットされる。これにより、広域変数のアドレス空間の低い方 の境界にある部分範囲(サブレンジ)が、圧縮命令の広域変数に対して割り当て られる。圧縮されていない命令は、広域変数のアドレス空間の残りの部分に広域 変数を格納する。前述の部分範囲どうしは離れているので、特定のプログラムの 圧縮ルーチンと非圧縮ルーチンとの間の広域変数の割り当ては、比較的簡単にな り都合がよい。 本発明は、広く、命令伸張器を備えて、可変長圧縮命令セットからの命令を実 行する装置を企図する。命令伸張器は、可変長圧縮命令セットの要素である命令 を受信するように結合され、命令のオペコードフィールドを調べるように構成さ れる。命令伸張器は、その命令のオペコードフィールドが拡張オペコードとして 符号化されている場合には、その命令を第1の固定長を有する拡張命令であると 判断するように構成される。さらに、命令伸張器は、その命令のオペコードフィ ールドが拡張オペコードとは異なる第2のオペコードとして符号化されている場 合には、その命令を非拡張命令であると判断するように構成される。 本発明は、さらに圧縮命令を伸張された命令(以下「伸張命令」とする)に拡 張する方法を考察する。圧縮命令の オペコードフィールドが拡張オペコードならば、その圧縮命令は、第1の固定長 を有する拡張命令であると判断される。その圧縮命令のオペコードフィールドが 拡張オペコードとは異なる第2のオペコードである場合、その圧縮命令は、第2 の固定長を有する非拡張命令である。圧縮命令は、伸張命令へと伸張される。圧 縮命令が拡張命令である場合、その圧縮命令に含まれるバイト数は、第1の固定 長によって決定される。また、圧縮命令が非拡張命令ならば、そのバイト数は、 第2の固定長によって決まる。 さらに、本発明は、第1の判断手段、第2の判断手段および伸張手段を備えて 圧縮命令を伸張命令へと拡張する装置を企図する。第1の判断手段は、圧縮命令 のオペコードフィールドが拡張オペコードならば、その圧縮命令は、第1の固定 長を有する拡張命令であると判断する。第2の判断手段は、圧縮命令のオペコー ドフィールドが拡張オペコードとは異なる第2のオペコードである場合、その圧 縮命令は、第2の固定長を有する非拡張命令であると判断する。伸張手段は、圧 縮命令を伸張命令へと伸張する。圧縮命令が拡張命令である場合、その圧縮命令 に含まれるバイト数は、第1の固定長によって決定される。また、圧縮命令が非 拡張命令ならば、そのバイト数は、第2の固定長によって決まる。 さらに、本発明は、第1のルーチンおよび第2のルーチンを含むプログラムを マイクロプロセッサにおいて実行する方法を企図する。前記の第1のルーチンの 内部でサブル ーチンコール命令が実行される場合、このサブルーチンコール命令は、前記の第 2のルーチンがサブルーチンコール命令の目的アドレスを介して実行されるべき であることを示す。サブルーチンコール命令におけるある表示を検査する。その 表示が第1の状態であれば、第2のルーチンは、圧縮命令を用いて符号化されて いると判断する。そして、その表示が第1の状態とは異なる第2の状態であれば 、第2のルーチンは、非圧縮命令を用いて符号化されていると判断する。 さらに、本発明は、マイクロプロセッサにおいて実行手段および検査手段を備 え、且つ第1のルーチンおよび第2のルーチンを含むプログラムを実行する装置 を企図する。実行手段は、第1のルーチンの内部でサブルーチンコール命令を実 行する。このサブルーチンコール命令は、前記の第2のルーチンがサブルーチン コール命令の目的アドレスを介して実行されるべきであることを示す。検査手段 は、サブルーチンコール命令におけるある表示を検査する。検査手段は、その表 示が第1の状態にあれば、第2のルーチンが、圧縮命令を用いて符号化されてい ると判断する。そして、その表示が第2の状態にあれば、検査手段は、第2のル ーチンが、非圧縮命令を用いて符号化されていると判断する。 本発明は、さらに、マイクロプロセッサにおいて記憶装置およびモード検出器 を備えて圧縮命令および非圧縮命令をフェッチする装置を企図する。記憶装置は 、圧縮可能指 示子(compression enable indicator)を記憶する。モード検出器は、記憶装置に 結合されて、目的のルーチンを指定するサブルーチンコール命令のフェッチ時に 、目的ルーチンの圧縮モードを検出するように構成される。モード検出器は、検 出した圧縮モードをプロセッサのコアに知らせるように構成される。プロセッサ コアは、圧縮モードが圧縮を示す場合、圧縮命令をフェッチするように構成され る。さらに、プロセッサコアは、圧縮モードが非圧縮を示す場合、非圧縮命令を フェッチするように構成される。 本発明は、さらに、命令伸張器およびプロセッサコアを備えたマイクロプロセ ッサを企図する。命令伸張器は、可変長圧縮命令セットの要素である圧縮命令を フェッチするように結合される。命令伸張器は、受け取った各圧縮命令を対応す る伸張命令へと伸張するように構成される。プロセッサコアは、伸張命令を受信 するように結合され、その伸張命令を実行するように構成される。 さらに、本発明は、命令コードを実行する方法を企図する。圧縮命令がフェッ チされる。この圧縮命令は、可変長圧縮命令セットの要素である。圧縮命令は、 命令伸張器において伸張されることにより、対応する伸張命令を形成する。この 伸張命令が、プロセッサコアで実行される。 本発明は、さらに、フェッチ手段、伸張手段および実行手段を備えて命令コー ドを実行する装置を企図する。フェッチ手段は、可変長圧縮命令セットの要素で ある圧縮命令をフェッチする。伸張手段は、圧縮命令を伸張することに より、対応する伸張命令を形成する。実行手段は、その伸張命令を実行する。 さらに、本発明は、圧縮命令を伸張するように構成された命令伸張器を企図す る。圧縮命令のうちの第1の命令は、対応する非圧縮命令セットに対して定義さ れた第1のレジスタ部分集合にアクセスするように、符号化することができる。 さらに、圧縮命令のうちの第2の命令は、前記の第1のレジスタ部分集合にアク セスするように符号化できるうえ、第2のレジスタ部分集合にアクセスするよう に符号化することもできる。 本発明は、さらに、圧縮命令を伸張する方法を企図する。第1のレジスタフィ ールドを有する圧縮命令が第1のオペコードを用いて符号化されている場合には 、その圧縮命令は、圧縮されたレジスタ指示子から伸張されたレジスタ指示子へ の第1のレジスタ射像を用いて伸張される。第1のレジスタフィールドを有する 圧縮命令が第2のオペコードを用いて符号化されている場合には、その圧縮命令 は、圧縮されたレジスタ指示子から伸張されたレジスタ指示子への第2のレジス タ射像を用いて伸張される。 本発明は、さらに、伸張手段を備えて圧縮命令を伸張する装置を企図する。伸 張手段は、次のように構成される。即ち、第1のレジスタフィールドを有する圧 縮命令が第1のオペコードを用いて符号化されている場合には、圧縮レジスタ指 示子から伸張レジスタ指示子への第1のレジスタ射像を用いて、その圧縮命令を 伸張する。また、伸張手段 は、第1のレジスタフィールドを有する圧縮命令が第2のオペコードを用いて符 号化されている場合には、圧縮レジスタ指示子から伸張レジスタ指示子への第2 のレジスタ射像を用いて、その圧縮命令を伸張する。 本発明は、さらに、圧縮命令の圧縮レジスタフィールドを伸張命令の伸張レジ スタフィールドへと伸張するように構成された命令伸張器を企図する。圧縮レジ スタフィールドの伸張は、圧縮レジスタフィールドへと符号化された第1の値と 圧縮命令のオペコードフィールドへと符号化された第2の値とに依存する。 本発明は、さらに、圧縮命令の圧縮レジスタフィールドを伸張命令の伸張レジ スタフィールドへと伸張する方法を企図する。圧縮レジスタフィールドの少なく とも一部は、伸張レジスタフィールドの一部に直接コピーされる。伸張レジスタ フィールドの残りの部分は、圧縮レジスタフィールドに論理的に作用することに より生成される。 さらに、本発明は、第1の手段および第2の手段を備えて、圧縮命令の圧縮レ ジスタフィールドを伸張命令の伸張レジスタフィールドへと伸張する装置を企図 する。第1の手段は、圧縮レジスタフィールドの少なくとも一部を伸張レジスタ フィールドの一部に直接コピーする。第1の手段は、圧縮レジスタフィールドを 受信するように結合される。同様に、第2の手段も、圧縮レジスタフィールドを 受信するように結合されて、圧縮レジスタフィールドに作用して伸張レジスタフ ィールドの残りの部分を生成する。 さらに、本発明は、圧縮命令の圧縮レジスタフィールドを伸張命令の伸張レジ スタフィールドへと伸張するように構成された命令伸張器を企図する。この命令 伸張器は、圧縮レジスタフィールドの少なくとも一部を伸張レジスタフィールド の第1の部分にコピーすることにより、伸張レジスタフィールドの第1の部分を 形成する。さらに、命令伸張器は、圧縮レジスタフィールドに作用して伸張レジ スタフィールドの残りの部分を生成するように構成された論理ブロックを含む。 図面の簡単な説明 本発明のその他の目的および利点は、以下の詳細な説明を読み、且つ添付の図 面を参照することにより明らかとなるであろう。 図1は、マイクロプロセッサの一実施例のブロック図である。 図2は、マイクロプロセッサの第2の実施例のブロック図である。 図3Aは、図1および2に示したマイクロプロセッサの一実施例において許容 される第1の命令形式である。 図3Bは、図1および2に示したマイクロプロセッサの一実施例において許さ れる第2の命令形式である。 図3Cは、図1および2に示したマイクロプロセッサの一実施例において許さ れる第3の命令形式である。 図3Dは、図1および2に示したマイクロプロセッサの一実施例において許容 される第4の命令形式である。 図4Aは、図1および2に示したマイクロプロセッサの一実施例において許容 される第5の命令形式である。 図4Bは、図1および2に示したマイクロプロセッサの一実施例において許容 される第6の命令形式である。 図4Cは、図1および2に示したマイクロプロセッサの一実施例において許容 される第7の命令形式である。 図4Dは、図1および2に示したマイクロプロセッサの一実施例において許容 される第8の命令形式である。 図5A、5B、5C、5Dおよび5Eは、図3A、3B、3Cおよび3Dに示 した命令形式を用いる命令例の表である。 図6A、6B、6C、6D、6Eおよび6Fは、図4A、4B、4Cおよび4 Dに示した命令形式を用いる命令例の表である。 図7は、図1および2に示したマイクロプロセッサの一実施例による任意のレ ジスタおよび広域ポインタレジスタからのオフセットを示す図である。 図8は、即値フィールドを圧縮命令から伸張命令へと展開するハードウェア例 のブロック図である。 図9は、図1および2に示したマイクロプロセッサの一実施例により伸張した オフセットを示す図である。 図10は、図1および2に示したマイクロプロセッサの一実施例による即値フ ィールド用の伸張器の動作を示すフローチャートである。 図11は、図1および2に示したマイクロプロセッサの 一実施例に従いフェッチアドレスを生成するハードウェア例のブロック図である 。 図12は、図1および2に示したマイクロプロセッサの一実施例において用い られるレジスタ伸張論理回路を示すブロック図である。 図13は、その実施例を図1および2に示したマイクロプロセッサを含むコン ピュータシステムの例のブロック図である。 発明の詳細な説明 図1に、マイクロプロセッサ10Aの第1の実施例のブロック図を示す。マイ クロプロセッサ10Aは、命令伸張器12A、命令キャッシュ14Aおよびプロ セッサコア16を含む。命令伸張器12Aは、さらに命令キャッシュ14Aに結 合される。命令キャッシュ14Aは、プロセッサコア16に接合される。 一般に、マイクロプロセッサ10Aは、主メモリサブシステム(以下「主メモ リ」とする)から圧縮命令(圧縮された命令)を読み込むように構成される。読 み込まれた圧縮命令は、命令伸張器12Aを通されるが、この時、圧縮命令は、 伸張命令(decompressed instruction)へと伸張されて命令キャッシュ14Aに格 納される。圧縮命令の多くは、対応する伸張命令ほどはメモリ格納場所を占有し ないので、プログラムを格納するのに必要なメモリ量が少なくて済み好都合であ る。さらに、命令がマイクロプロセッサ10A内部で伸張されるので、圧縮命令 を主メモリから マイクロプロセッサ10Aへと転送するのに必要な帯域幅が減少する。マイクロ プロセッサ10Aは、比較的小さい主メモリを有するコンピュータシステムで用 いることができる。格納される命令が圧縮されるので、主メモリに比較的大きな プログラムを格納することができる。 一の実施例においては、マイクロプロセッサ10Aは、圧縮命令および非圧縮 命令の両方をルーチン毎に実行できるように構成される。換言すれば、ルーチン は、圧縮命令または非圧縮命令の何れを用いて符号化しても良い。圧縮命令セッ トで効率的に符号化できないルーチンは、非圧縮命令を用いて符号化し、圧縮命 令セットで効率的に符号化できるルーチンは、そのようにすればよいので、都合 がよい。マイクロプロセッサ10Aは、圧縮命令と非圧縮命令との混合を許すよ うにするために、広域ポインタレジスタをベースレジスタとして用いるロード/ ストア命令のための即値フィールドの伸張も許すようにしても良い。この伸張に ついては、詳細に後述する。さらに、命令伸張器12Aは、圧縮モードを検出す る。圧縮モードは、そのルーチンの符号化に用いられた命令セットが圧縮されて いるか、または圧縮されていないかを識別するものである。 命令の圧縮は、マイクロプロセッサ10Aにおいて利用可能な命令の符号化に 対してある制限を加えることによって行われる。命令の符号化を制限することに より、命令フィールドの大きさを縮小する(即ち、命令フィールド内のビット数 を削減する)ことができる。例えば、利用できる レジスタの数を減らして、圧縮命令セットを形成することができる。利用できる レジスタが少ないので、命令の出所オペランドおよび宛先オペランドとして用い るレジスタを符号化するのに比較的小さいフィールドを用いることができる。命 令伸張器12Aは、符号化されたレジスタフィールドを伸張レジスタフィールド へと伸張する。伸張レジスタフィールドは、伸張命令に含まれる。圧縮命令は、 縮小命令フィールドを用いることにより、プロセッサコア16で用いられるマイ クロプロセッサ構造により定義される本来の命令符号方式より少ないメモリ(即 ち、比較的少ないビット)しか占有しない。 命令伸張器12Aは、圧縮命令を受信し、その命令を本来の命令符号方式へと 伸張するように構成される。ある圧縮命令における各命令フィールドは、圧縮フ ィールドから対応する伸張命令内部の対応する伸張フィールドへと伸張される。 伸張された命令は、プロセッサコア16において許容される本来の命令形式で符 号化されている。 プロセッサコア16は、命令キャッシュ14Aから命令を読み込み、復号し、 そして実行するための回路を含む。プロセッサコア16で利用できる命令は、こ こで用いるマイクロプロセッサのアーキテクチャによって決定される。一の実施 例では、プロセッサコア16は、MIPS RISCアーキテクチャを採用する 。しかしながら、プロセッサコア16は、いかなるマイクロプロセッサ構造を用 いても良い。命令伸張器12Aは、命令を本来の命令形式に伸張するの で、プロセッサコア16は、以前に設計された処理コアから構成しても良い。換 言すれば、処理コアは、マイクロプロセッサ10Aに含めるために、実質的な変 更を必要とするわけではない。 MIPS RISCアーキテクチャは、32ビットの固定長命令からなる命令 セットを規定する。マイクロプロセッサ10Aに対して、可変長命令からなる圧 縮命令セットを定義する。それらの圧縮命令の多くは、16ビット命令である。 その他の圧縮命令は、後述する拡張命令に関連する32ビット命令である。16 ビットおよび32ビットの命令形式を幾つか定義する。なお、この実施例では1 6ビットおよび32ビットの圧縮命令を用いるが、別の実施例では異なる命令長 を用いても良い。圧縮命令により符号化されるのは、非圧縮命令の一部である。 圧縮命令セットにおいて許容される命令符号化は、極普通に符号化される命令の みならず、極普通に用いられるレジスタの多くを含み、プログラム中の多くのプ ログラムやルーチンが圧縮命令を用いて符号化できるようになっている。 一の実施例においては、マイクロプロセッサ10Aは、圧縮モードを用いる。 圧縮モードが活性ならば、圧縮命令が読み込まれて実行中である。命令伸張器1 2Aは、命令が主メモリから命令キャッシュ14Aに転送されるときに、それら の命令を伸張する。一方、圧縮モードが不活性の場合もある。この場合は、非圧 縮命令が読み込まれて実行されている。圧縮モードが不活性のときは、命令伸張 器12 Aは、迂回される。実施例によっては、圧縮モードをフェッチアドレスの1ビッ ト(例えば、ビット0)によって示す。現在のフェッチアドレスは、例えば、プ ロセッサコア16内部のPCレジスタ18に格納する。PCレジスタ18のビッ ト0により、マイクロプロセッサ10Aの圧縮モード(CM)を示す。 命令キャッシュ14Aは、伸張命令および非圧縮命令を格納するように構成さ れた高速キャッシュメモリである。命令キャッシュ14Aは如何なるキャッシュ 構造を用いても良いが、図1に示した実施例に対しては、セットアソシアティブ (set associative)構成か、またはダイレクトマッピング(direct mapping) 構成が適当であろう。 次に、図2は、マイクロプロセッサ10Bの第2の実施例を示す。マイクロプ ロセッサ10Bは、主メモリから命令バイトを受け取るように結合された命令キ ャッシュ14B、命令伸張器12Bおよびプロセッサコア16を含む。命令キャ ッシュ14Bは、命令伸張器12Bに結合され、これが、さらにプロセッサコア 16に接合されている。 マイクロプロセッサ10Bは、命令キャッシュ14Bとプロセッサコア16と の間に命令伸張器12Bを有する構成となっている。命令キャッシュ14Bは、 主メモリから転送される圧縮命令を格納する。このように、命令キャッシュ14 Bは、マイクロプロセッサ10Aにおいて命令キャッシュ14Aとして用いられ ている類似容量の命令キャッシュより大きい数の命令を格納することができる。 命令 伸張器12Bは、プロセッサコア16からの命令フェッチ要求に対応するフェッ チアドレスを受信して、そのフェッチ要求に応じて命令キャッシュ14Bにアク セスする。対応する圧縮命令は、命令伸張器12Bにより、伸張命令へと伸張さ れる。伸張命令は、プロセッサコア16に転送される。 マイクロプロセッサ10Aと同様に、マイクロプロセッサ10Bが圧縮モード を含む実施例もある。非圧縮命令が読み込まれて実行されているときは、命令伸 張器12Bは、迂回される。この実施例の場合、命令キャッシュ14Bは、圧縮 命令および非圧縮命令の両方を格納する。なお、命令キャッシュ14Bは、一般 に、キャッシュラインと称する一定の大きさの複数の記憶場所に命令のバイトを 格納する。したがって、ある特定のキャッシュラインは、幾つかの圧縮命令また は非圧縮命令を格納する。何れの場合も、複数の命令バイトが格納される。この ように、命令キャッシュ14Aおよび14Bは、類似の構造をしている。1つの キャッシュラインがアドレス指定されたときの圧縮モードは、その命令バイトが 圧縮命令と非圧縮命令の何れに解釈されるかを決定する。 マイクロプロセッサ10Bに代わる構成としては、プロセッサコア16の命令 復号論理部の中に命令伸張器12Bを含めることである。このような実施例にお いては、圧縮命令は、実際には伸張しなくでも良い。その代わり、圧縮命令は、 復号論理部により直接復号(デコード)すればよ い。復号された命令(以降「復号命令」と称する)は、圧縮命令に対応する非圧 縮命令に対して生成される復号命令と同様であろう。 なお、マイクロプロセッサ10Aおよび10Bは、圧縮命令で動作するマイク ロプロセッサ10の一実施例に過ぎない。この説明の以降の部分においては、マ イクロプロセッサ10、命令キャッシュ14および命令伸張器12を用いて、図 1および2の対応する要素を指すほか、マイクロプロセッサ10の他の実施例に 含まれる要素の、別の実施例も指す。 以上の説明において、伸張、圧縮命令、伸張命令および非圧縮命令なる用語を 用いたが、以降においても使用する。これまで用いたように、「圧縮命令」なる 用語は、メモリに圧縮された形式で記憶される命令を指す。圧縮命令は、一般に 、プロセッサコア16によって採用されたマイクロプロセッサ構造で定義された とおりに表現した命令を記憶するのに用いられるビット数より少ない数のビット を用いて記憶される。「伸張命令」なる用語は、圧縮命令をプロセッサコア16 によって採用されたマイクロプロセッサ構造で定義されるとおりの本来の符号へ と伸張した結果を指す。「非圧縮命令」なる用語は、圧縮命令をプロセッサコア 16によって採用されたマイクロプロセッサ構造で定義される符号で表された命 令を指す。非圧縮命令は、メモリにも同じ形式で記憶される(即ち、非圧縮命令 は決して圧縮されない)。最後に、「伸張」なる用語は、圧縮命令を 対応する伸張命令へと展開する過程を指す。 なお、命令伸張器12Aおよび12Bは、複数の圧縮命令を同時に伸張するよ うに構成しても良い。命令伸張器12のこのような実施例は、クロック周期毎に 複数の命令を実行するプロセッサコア16の実施例と共に用いても良い。 図3A〜3Dおよび4A〜4Dは、MIPS RISCアーキテクチャを用い たマイクロプロセッサ10の実施例による、それぞれ16ビットおよび32ビッ トの圧縮命令に対する命令形式の例を示す。実施例によっては、異なる命令形式 を用いても良い。図3A〜3Dに示した各命令形式は、この特定の実施例では、 16ビットからなる。一方、図4A〜4Dに示した各命令形式は、この特定の実 施例では、32ビットからなる。これらの命令形式を用いて符号化された圧縮命 令は、各命令に対してMIPS RISCアーキテクチャにより定義された命令 形式へと伸張される。 図3Aは、第1の命令形式20を示す。命令形式20は、オペコードフィール ド22、第1のレジスタフィールド24、第2のレジスタフィールド26および 機能フィールド28を含む。オペコードフィールド22は、その命令を識別する のに使用される。さらに、機能フィールド28はオペコードフィールド22があ る特定の符号であるときに、この符号に関連づけられて、その命令を識別するた めに用いられる。機能フィールド28およびオペコードフィールド22が、一体 となって命令に対するオペコードフィールドを形成すれば、効率的である。オペ コードフィールド2 2に、その特定の符号以外の符号が用いられると、機能フィールド28は、即値 フィールドとして使用される。 第1のレジスタフィールド24および第2のレジスタフィールド26により、 その命令に対するデスティネーションレジスタおよびソースレジスタを特定する 。また、デスティネーションレジスタは、一般にその命令に対するソースレジス タとしても用いられる。このように、2つのソースオペランドと1つのデスティ ネーションオペランドが、第1のレジスタフィールド24および第2のレジスタ フィールド26によって指定される。第1のレジスタフィールド24および第2 のレジスタフィールド26における「RT」および「RS」なる表記は、後述の 命令表におけるフィールドの用途を示す。その命令の符号によって、RTまたは RSの何れかがデスティネーションレジスタとなる。 一の実施例においては、オペコードフィールド22は5ビット、第1のレジス タフィールド24および第2のレジスタフィールド26はそれぞれ3ビット、そ して機能フィールド28は5ビットからなる。第1のレジスタフィールド24は 、2つの下位フィールド(RT0およびRT1と表記)に分割される。この実施 例では、RT1は2ビットからなり、RT0は1ビットからなる。RT1は、R T0に連結されて第1のレジスタフィールド24を形成する。下位フィールドR T1および第2のレジスタフィールド26は、命令形式20により符号化された 命令で使用されると、MIPS RISCアーキテクチャにおいて定義される3 2 個のレジスタの1つを示す。 図3Bは、第2の命令形式30を示す。命令形式30は、オペコードフィール ド22、第1のレジスタフィールド24および第2のレジスタフィールド26を 含む。さらに、第3のレジスタフィールド32および機能フィールド34を示し てある。第3のレジスタフィールド32は、一般に、命令形式30を用いる命令 に対するデスティネーションレジスタを識別するのに用いられる。したがって、 第1のレジスタフィールド24および第2のレジスタフィールド26は、命令形 式30に対するソースレジスタからなる。機能フィールド34は、機能フィール ド28と同様に用いられる。図示した実施例では、第3のレジスタフィールド3 2は3ビット、機能フィールド34は2ビットからなる。 第3の命令形式40を図3Cに示す。命令形式40は、オペコードフィールド 22および第2のレジスタフィールド26の他、即値フィールド42も含む。即 値フィールド42は、命令形式40によって指定される命令に対する即値データ (イミーディエイトデータ)を与えるのに使用される。即値データは、命令のオ ペランドであり、第1のレジスタフィールド24または第2のレジスタフィール ド26で指定されるレジスタに格納されている値と同様である。例えば、即値デ ータを用いる加算命令は、その即値データをデスティネーションレジスタに格納 されている値に加算し、結果として得た和をそのデスティネーションレジスタに 格納する。一の実施例では、即値フィールド42は、8 ビットからなる。即値フィールド42は、図3Cに示した命令形式では、2つの 下位フィールドIMM0およびIMM1に分割される。この下位フィールドによ り、第2のレジスタフィールド26を、命令形式40内部において、命令形式2 0および30において配置される場合と同じビット位置に配置することが可能と なる。第2のレジスタフィールド26は、それが用いられる16ビット命令の同 じ位置に常に見いだすことができるので、好都合である。したがって、下位フィ ールドIMM1は、2ビットからなり、下位フィールドIMM0は、6ビットか らなる。IMM1は、IMM0と連結されて即値を形成する。 図3Dは、第4の命令形式50を示す。命令形式50は、オペコードフィール ド22および即値フィールド52を含む。即値フィールド52は、即値フィール ド42と同様に、命令のオペランドとして用いられる。ただし、即値フィールド 52は、11ビットからなる。 図4Aは、第5の命令形式60を示す。命令形式60は、オペコードフィール ド22を含むが、このオペコードフィールド22は、拡張命令として符号化され る。命令伸張器12は、オペコードフィールド22内部に拡張命令オペコードを 認識すると、その命令を32ビット命令として取り扱う(即ち、拡張オペコード を含む命令中に含まれる16ビットと、拡張命令が含まれていなければプログラ ム順で次の命令を構成することになる16ビットとが、連結されて32ビット命 令が形成される)。したがって、圧縮命令 は、16ビット命令および32ビット命令からなる可変長命令セットであると見 ることができる。さらに、命令形式60は、6ビットからなるゼロフィールド6 2(すべて2進数の0に符号化される)、即値フィールド64およびBRフィー ルド66を含む。命令形式60は、BR命令(無条件分岐命令)の拡張形式を符 号化するのに用いられるので、BRフィールド66は、BR命令を示すオペコー ドフィールドである。一の実施例においては、BRオペコードは、16進数の0 2である。 拡張BR命令は、非拡張BR命令より大きい即値フィールドを持つので、非拡 張BR命令より大きいオフセットで符号化できる。分岐命令から遠い命令への分 岐が望まれる場合、この拡張BR命令が用いられる。また、近くの命令への分岐 には、非拡張BR命令を用いる。即値フィールド64は、その分岐命令の目的ア ドレスを生成するためにそのBR命令に続く命令のアドレスに加算される16ビ ットのオフセットとして用いられる。これに対して、非拡張BR命令は、11ビ ットのオフセットを含む(即ち、命令形式50を用いて符号化される)。 図4Bは、命令形式70を示し、これは、命令形式40の拡張版である。命令 形式70は、拡張オペコードとして符号化されるオペコードフィールド22のほ か、即値フィールド72、第1のレジスタフィールド74、第2のレジスタフィ ールド76および第2のオペコードフィールド78を含む。第1のレジスタフィ ールド74および第2のレ ジスタフィールド76は、図示した実施例では、それぞれ5ビットからなる。し たがって、MIPS RISCアーキテクチャで定義されるレジスタは、何れも 命令形式70を用いてアクセスできる。第2のオペコードフィールド78は、実 行中の命令を定義するもので、(オペコードフィールド22と同様に)5ビット からなる。最後に、即値フィールド72は、12ビットからなり、1ビットのI MM2下位フィールド、5ビットのIMM1下位フィールドおよび6ビットのI MM0下位フィールドに分割される。即値フィールド72は、図示した実施例に おいては、IMM2にIMM1を連結し、さらにIMM0を連結することによっ て形成される。 命令形式30に対応する拡張命令形式を図4Cに命令形式80として示す。命 令形式80は、命令形式70と同様にオペコードフィールド22、第1のレジス タフィールド74、第2のレジスタフィールド76および第2のオペコードフィ ールド78を含む。さらに、命令形式80は、第3のレジスタフィールド82お よび機能フィールド84も含む。第3のレジスタフィールド82は、5ビットか らなることを除けば、第3のレジスタフィールド32と同じである。したがって 、MIPS RISCアーキテクチャの任意のレジスタを第3のレジスタフィー ルド82で指定することができる。機能フィールド84は、6ビットであること を除けば、機能フィールド28および34と同じである。 第2のオペコードフィールド78は、命令形式70から 命令形式80を区別するために特定の値に符号化される。第2のオペコードフィ ールド78が、その特定の値に符号化された場合、命令伸張器12は、その命令 は命令形式80であると解釈する。逆に、第2のオペコードフィールド78が、 その特定の値とは別の値に符号化されている場合、命令伸張器12は、命令形式 70であると解釈する。一実施例では、その特定の値は、16進数の00である 。 命令形式80は、さらにCOP0ビット86を含む。COP0ビット86は、 これがセットされると、(MIPS RISCアーキテクチャで定義されている ような)ある種のコプロセッサゼロ命令が実行されていることを示す。後述の命 令表には、COP0ビット8をセットすることにより符号化される命令が定義さ れている。 命令形式20、30、40および50に対して定義されている命令により、一 般的なプログラムにおいて普通に行われる動作の多くを実行することができる。 しかし、ルーチンによっては、これらの命令では不可能な動作を行う必要がある こともある。ルーチン中の命令の大半は、命令形式20〜50を用いて符号化で きるが、幾つかの命令では、さらなる符号形態が必要となる。例えば、形式20 〜50において利用可能なレジスタの部分集合には含まれないレジスタへのアク セスが、必要な場合もある。形式20〜50を用いて符号化される命令に含まれ ない付加的な命令が、必要な場合もある。これらおよびその他の理由から、拡張 オペコードおよび拡張命令形式60〜80が定義されてい る。 命令伸張器12は、拡張オペコードを検出するために、オペコードフィールド 22を調べる。拡張オペコードは、本実施例における命令形式50を用いるため に定義されたオペコードの1つである。しかしながら、即値フィールド52に含 まれるビットは、特定の拡張命令に対して符号化される拡張命令形式によって異 なる解釈に割り当てられる。拡張命令形式には、特定の拡張命令を特定する第2 のオペコードフィールド(例えば、フィールド66および78)が含まれる。 拡張オペコードおよび拡張命令形式を加えることにより、多くの命令が、比較 的狭い命令形式20〜50を用いて符号化されるが、必要に応じて比較的広い拡 張命令形式の柔軟性を持つこともできるようになる。拡張命令形式に含まれる機 能を時折利用するプログラムでも、メモリ占有量を減らすことは可能である。そ れは、これらのプログラムも、圧縮命令を用いて符号化することができ、圧縮命 令の多くが16ビット圧縮命令からなるからである。 マイクロプロセッサ10の一実施例においては、16ビットの命令部分をフェ ッチして拡張オペコードを検出することにより、拡張命令を扱っても良い。拡張 オペコードを検出したときに、NOPをプロセッサコア16に転送して、拡張命 令の残りの16ビット部分をフェッチしても良い。その拡張命令は、伸張され、 前記のNOPの後に次の命令として与えられる。 さらに、命令伸張器12は、拡張命令の一部は利用できるが、第2の部分は利 用できないような場合を処理する。例えば、拡張命令の2つの部分が、命令キャ ッシュ14内部の2つの異なるキャッシュラインに存在することがある。したが って、その命令の一方の部分は、命令キャッシュ14から読み込まれるが、他方 の部分は、命令キャッシュ14の内部にない場合がある。最初の部分は、残りの 部分が利用できるようになるまで、命令伸張器12に格納する必要があるかも知 れない。 最後に、図4Dは、MIPS RISC命令セットのJAL命令を明示的に拡 張するために用いられる命令形式90である。JAL命令は、サブルーチンコー ル命令として用いられることが多い。サブルーチンは、呼び出し中のルーチンか ら(アドレス的に)大きな距離にあるメモリに格納される場合がある。したがっ て、(26ビットからなる即値フィールド92を介して)可能な限り大きな範囲 の相対オフセットを持つことは、JAL命令にとって重要である。さらに、命令 の符号には1つの交換ビット94が含まれる。交換ビットは、目的アドレスにあ る命令の圧縮/非圧縮性を示すのに用いられる。交換ビットがセットされている 場合、目標の命令は圧縮命令である。交換ビットがクリアされていれば、目標の 命令は非圧縮命令である。交換ビット94の値は、プロセッサコア16の内部で プログラムカウンタのビット0にコピーされる。プログラムカウンタのビット0 は、常にゼロであると仮定できる。なぜなら、16 ビットおよび32ビットの命令は、それぞれ少なくとも2バイトを占有し、且つ 命令は、連続したアドレスに格納されるからである。したがって、ビット0は、 現在のルーチンの圧縮モードを格納するには便利な場所である。プロセッサコア 16は、ビット0がセットされていれば、フェッチアドレスを(4に代えて)2 ずつ増やしていくことにより、16ビットの圧縮命令を命令伸張器12を介して フェッチする。 マイクロプロセッサ10によって用いられる圧縮命令セットの各命令は、図3 A〜3Dおよび図4A〜4Dに示した命令形式の少なくとも1つを使用する。な お、オペコードフィールド22は、各命令形式に含まれ、且つ各命令形式におい て同じ場所に位置する。オペコードフィールド22の符号化により、命令の残り の部分の解釈に何れの命令形式を用いるかが決定される。オペコードフィールド の符号形態の第1の様態が命令形式20に割り当てられる、オペコードフィール ド符号形態の第2の様態が命令形式30に割り当てられる、..と言う具合であ る。 ここで用いるように、「命令フィールド」なる用語は、グループ化され且つ1 グループとしてある解釈が割り当てられる命令内の1つ以上のビットを指す。例 えば、オペコードフィールド22は、命令のオペコードとして解釈されるビット 群である。さらに、第1および第2のレジスタフィールド24および26は、命 令のオペランドを格納するプロセッサコア16内の記憶場所を識別するレジスタ 識別 子からなる。さらに、「即値フィールド」なる用語は、その中に即値データが符 号化される命令フィールドを指す。即値データは、命令にオペランドを与えると 考えられる。また、即値データは、レジスタ値に加算されるべきオフセットとし て用いても良い。この加算により、アドレスが生成される。さらに、即値データ は、分岐命令に対するオフセットとして用いても良い。 図5A〜6Fは、マイクロプロセッサ10の特定の実施例で用いられる圧縮命 令セットの例を掲げた表である。特定の実施例では、プロセッサコア16内部に MIPS RISCアーキテクチャを採用する。したがって、これらの表の命令 欄100に掲載された命令ニューモニックは、MIPS RISCアーキテクチ ャで定義された[または、ケイン(Kane)およびハインリック(Heinrich)著、「M IPS RISCアーキテクチャ」、付録D、ニュージャージー州アッパーサド ルリバー、プレンティスホールPTR(Professional Technical Reference)出 版社、1992年(引用により本明細書に含まれる)に記述されたような命令ア センブラのために定義された]命令ニューモニックに対応する。但し、次の例外 がある。即ち、CMPI、MOVEI、MOVE、NEG、N0T.および拡張 である。これらの命令は、次のMIPS命令(RSおよびRTは、16ビットの RSおよびRTを指す)に翻訳できる。 さらに、添付の命令表には、幾つかの記号を用いてある。オペランド欄102 においては、記号rs、rt、xsおよびrdを用いた。rsおよびxsは、第 2のレジスタフィールド26(または第2のレジスタフィールド76)を指し、 rtおよびxtは、第1のレジスタフィールド24(または第1のレジスタフィ ールド74)を指す。同様に、rdは、第3のレジスタフィールド32(または 第3のレジスタフィールド82)を指す。前記の一実施例で述べたように、第1 のレジスタフィールド24、第2のレジスタフィールド26および第3のレジス タフィールド32は、それぞれ3ビットからなる。次の表1に、それぞれの記号 に対するMIPS RISCアーキテクチャにおけるフィールド符号(2進数で 掲載)のレジスタへの射像(割り当て)を掲げる。その他の射像も後に示すよう に企図する。MIPSアセンブラの慣例に従って割り当てた名称も表1に掲載す る。 表1:レジスタの割り当て 表1に示すとおり、レジスタフィールド24、26および32を有する圧縮命令 に対して、レジスタを16個まで使用することができる。各レジスタフィールド は3ビットであるから、所与のオペコードに対して、レジスタは8個だけ使用で きる。16個のレジスタ総てにアクセスし得る命令には、後述の命令表において 2つのオペコードが割り当てられる。これに関して言えば、レジスタの選択は、 レジスタフィールドおよびオペコードフィールド22の両方の関数である。レジ スタフィールドは、比較的少ないビットを用いて符号化できるが、大きいレジス タ群にアクセスできる選択命令を提供するので、好都合である。 オペランド欄102には、即値フィールド32、42、64および72に対す る記号も掲げてある。記号「imm」は、即値フィールドが含まれていることを 示す。「imm」の前に「s」が在る場合、その即値フィールドは、符号付きで あり、その即値フィールドの伸張命令への伸張は、そ の即値フィールドを符号拡張することによって行われる。「imm」の前に「s 」が無い場合、その即値フィールドは、符号無しであり、その即値フィールドの 伸張には、その即値フィールドのゼロ拡張を伴う。一の実施例においては、ロー ド/ストア命令に対する即値フィールドの伸張は、半ワードに付き1ビット、ワ ードに付き2ビットの右ローテーション、およびこれに続く、半ワードに付き1 ビット、ワードに付き2ビットの左シフトを即値ビットに行うことからなる。効 率的には、ワードに対して7ビットの即値フィールドを与え、半ワードに対して (16ビット命令形式の場合)6ビットの即値フィールドを与える。MIPS RISCアーキテクチャでは、ロード/ストア命令に対応するデータのアドレス は、圧縮命令セット例に含まれる各命令に対して一列に並べることを定めている 。したがって、(半ワードの)最下位ビットおよび(ワードの)最下位から2番 目のビットは、ゼロに設定されるので、これらのビットを指定するために、圧縮 された即値フィールドのビットを用いる必要はない。最後に、「imm」には、 その即値フィールドに含まれるビット数を示す数が後に付けられる。 オペコードフィールド22および機能フィールド28も伸張される。具体的に は、オペコードフィールド22および機能フィールド28により、図5A〜6F に示した表に従ってMIPS RISCアーキテクチャにおける命令が識別され る。伸張命令のオペコードフィールドおよび機能フィールドは、MIPS RI SCアーキテクチャの定義に従って符号 化される。 図5Aおよび5Bは、表110および112をそれぞれ示す。表110および 112は、図3Aに示した命令セット20を用いる、圧縮命令セット例からの命 令を掲載する。命令欄100およびオペランド欄102の他、オペコード欄10 6および機能欄104も含まれる。オペコード欄106および機能欄104は、 16進数を含み、オペコードフィールド22および機能フィールド28にそれぞ れ対応する。 表110には、機能欄104に「imm5」なる符号形態を有する命令が幾つ か含まれる。符号形態「imm5」は、表110のロード/ストア命令に対して 出現し、これらの命令に対しては、機能フィールド28が即値フィールドとして 用いられることを示す。その他の命令については、機能フィールド28は、圧縮 命令セット内の命令を識別するためにオペコードフィールド22と関連付けて使 用される。 さらに、表110において、オペコード「1d」は、「特別」とラベルが付け られている。特別な命令は、機能フィールド28に特定の解釈がある。特に、機 能フィールドの最上位ビットが0の場合、その命令は次のように定義される: ADDIU rt,rs,simm4 ただし、オペランド「simm4」は、機能フィールド28の残りのビットから 形成される。機能フィールド28の 最上位ビットが1の場合、2つの特殊な場合を除いて、その命令は次のように定 義される: ADDIU xt,xs,simm4 第2のレジスタフィールド26が0に符号化されている場合、その命令は次のよ うになる: MOVEI xt,imm4 この場合も、オペランドimm4は、機能フィールド28の残りのビットから形 成される。最後に、第2のレジスタフィールド26が、5(16進数)と符号化 されている場合、その命令は次のように定義される: ADDIU sp,simm9 ただし、オペランドsimm9は、機能フィールド28の残りのビットおよび第 1のレジスタフィールド24から形成される。オペランドsimm9の下位の2 ビットは、0に設定される。 なお、表110に示した命令SLTおよびSLTUのデスティネーションは、 一実施例によれば、t8レジスタ(レジスタ$24)である。 表112においては、幾つかの命令に対して、オペランド「imm3」および 「imm6」が示されている。オペランドimm3は、第2のレジスタフィール ド26に符号化され、imm6は、第2のレジスタフィールド26と第1のレジ スタフィールド24との両方に符号化される。 さらに、表112は、ジャンプレジスタ(JR)命令を含む。この命令は、オ ペランドとして第2のレジスタフィ ールド26を有する。しかし、実施例においては、MIPS RISCアーキテ クチャのレジスタの何れかをJR命令用に指定するために、第1のレジスタフィ ールド24の下位フィールドRT1を第2のレジスタフィールド26と関連付け て用いるので、注意を要する。 図5Cにおいて、表114は、命令欄100、オペランド欄102、オペコー ド欄106および機能欄104を含む。表114には、図3Bに示す命令形式3 0を用いる、命令セット例からの命令を掲載する。表114の一部の命令は、ハ ード的に符号化されたデスティネーションレジスタを有する(即ち、プログラマ は、別のオペコードを用いる以外に、デスティネーションレジスタを選択できな い)。これらの命令に対しては、第3のレジスタフィールド32を機能フィール ド34に結合して、機能欄104に示した機能フィールド符号を格納する。さら に、機能欄104およびオペランド欄102に即値オペランドを有する命令が1 つある。この命令は、機能フィールド34との関連で第2のレジスタフィールド 26を用いて、この命令で用いられる対応する即値フィールドを符号化する。 図5Dおよび5Eは、命令形式40および50をそれぞれ用いる、圧縮命令セ ットからの命令を示す表116および118である。表118には、拡張命令が 示されている。しかしながら、この拡張命令は、その命令が命令形式60、70 および80のうちの1つを用いる32ビット圧縮命令であることを実際に示して いる。 図6Aおよび6Bには、表120および122を示す。表120および122 は、図4Bに示した命令形式70を用いて符号化される、圧縮命令セットからの 命令を示す。 表120は、命令欄100およびオペランド欄102を含み、さらにオペコー ド欄108を含む。オペコード欄108は、この欄に示されたオペコード符号が オペコードフィールド78に対応することを除けば、オペコード欄106と同様 である。 表122は、第1のレジスタフィールド74に対応するRT欄109を含む。 表122に示された命令のRTフィールドの符号は、何れの命令が選択されるか を示す。表122に示された命令は、オペコードフィールド78にある符号を共 有する。一の実施例では、この符号は、00(16進数)である。 図6C、6D、6Eおよび6Fは、命令形式80によって符号化される、圧縮 命令セット例からの命令を示す表124、126、128および130である。 表124、126および130は、機能フィールド84の符号に対応する機能欄 107を含む。表128は、さらに詳細に後述するRSおよびRT欄105を含 む。 表124のオペランド欄102は、一部の命令について即値オペランドを含む 。オペランド「imm5」は、第2のレジスタフィールド76へと符号化される 。オペランドimm15は、第1のレジスタフィールド74、第2のレジスタフ ィールド76および第3のレジスタフィールド8 2の組み合わせに符号化される。 表128に掲げた命令は、RS、RT欄105に示したように、第2のレジス タフィールド76の符号を介して識別される。ある命令は、第1のレジスタフィ ールド74との関連で第2のレジスタフィールド76を介して識別される。RS 、RT欄105がRT部分に対してアスタリスクを含む命令は、第2のレジスタ フィールド76を介して識別される。また、RS、RT欄105がアスタリスク を含まない命令は、第1のレジスタフィールド74に関連付けて第2のレジスタ フィールド76により識別される。第1のレジスタフィールド74を介して識別 されない命令は、オペランドの符号化に第1のレジスタフィールド74を用いる ことができる。表128および130に掲げた命令は、COP0ビット86がセ ットされた命令であり、表124および126に掲げた命令は、COP0ビット 86がクリアされる。 表128の命令の一部は、オペランドimm6を含む。オペランド「imm6 」は、機能フィールド84へと符号化される。さらに、第2のレジスタフィール ド76が1x(16進数、xはこのビットが任意の値であることを示す)に符号 化された場合、機能フィールド84を用いて、表130に示した命令を示す。 図7は、マイクロプロセッサ10の一実施例に従う第1のアドレシングウィン ドウ150および第2のアドレシングウィンドウ152を示す。アドレシングウ ィンドウ15 0の中心は、ベースレジスタ(アドレシングウィンドウ150の左側にRegと 表す)の値である。ベースレジスタの値により、主メモリ内のアドレスを特定す る。アドレシングウィンドウ150は、非圧縮命令セットの一実施例に従う非圧 縮命令セットにおけるロード/ストア命令がアクセスできるベースレジスタの値 を中心とするアドレス範囲を表す。非圧縮命令セットは、ロード/ストア命令が 、ベースレジスタに格納されている値と16ビットの符号付き即値フィールドの 和によりメモリオペランドのアドレスを形成することを規定する。このような実 施例においては、そのアドレス範囲は、ベースレジスタより32767大きい上 限およびベースレジスタより32768小さい下限を有する。実施例によっては 、これより大きい範囲や小さい範囲を含んでも良い。ここで用いたように、「ベ ースレジスタ」なる用語は、ベースアドレスを格納するときにロード/ストア命 令により指定されるレジスタを指すが、このベースアドレスに符号付きの即値フ ィールドを加算して、その命令によって操作されるメモリオペランドのアドレス を形成する。 例えば表110に示すように、圧縮命令セット例の16ビットの部分に含まれ るロード/ストア命令は、5ビットの即値フィールドを含む。このフィールドは 、ワード長のメモリオペランドに対して、2ビット右に回転された後、左に2ビ ットシフトされて、7ビット(一実施例に従い5ビットを用いて形成される即値 フィールドの最大)の即値 フィールドを形成する。次に、7ビットの即値フィールドは、ゼロ拡張されて、 対応する伸張命令におけるベースレジスタから正のオフセットを形成する。した がって、サブレンジ154が、圧縮命令によるアクセスに利用できる。アドレシ ングウインドウ150において、サブレンジ154は、ベースレジスタより12 7大きい上限およびベースレジスタの下限を有する。しかしながら、サブレンジ 154の大きさは、実施例毎に変わり得る。 サブレンジ154は、多くのロード/ストア命令に対して良好に作用するが、 異なるアドレス範囲を広域ポインタレジスタと共に用いても良い。広域ポインタ レジスタは、広域変数の格納に用いるメモリ領域を指定するためにソフトウェア の慣例で割り当てられるレジスタである。広域変数は、プログラム内の何れのル ーチンからもアクセスに利用できる変数である。これに対して、局所変数は、一 般に、特定のルーチンまたはルーチン群にしかアクセスできない。MIPS命令 セットにおいては、例えばレジスタ$28が、広域ポインタレジスタとしてしば しば使用される。 したがって、広域ポインタレジスタを中心としたメモリ領域は、広域変数の表 として見ることができる。各広域変数は、表の内部でオフセットが割り当てられ る。このオフセットは、広域変数を特定するために広域ポインタレジスタに加算 される即値フィールド値に対応する。例えば図7に示した実施例に対しては、ア ドレシングウィンドウ150および152の左側に示したように、広域変数のた めに 64Kバイトの表を割り当てても良い。 圧縮された即値フィールドが、アドレシングウィンドウ150について説明し たように伸張された場合、その広域変数表は、非圧縮命令にアクセス可能な2つ のサブレンジ156および158に挟まれた、圧縮命令にアクセス可能な区画( サブレンジ154に対応する)を含む。前述のように、マイクロプロセッサ10 は、一部のルーチンが非圧縮命令で符号化され、他のルーチンが圧縮命令で符号 化されたプログラムを利用できるようにしても良い。あるプログラムにおいて広 域変数を割り当てることは、アドレシングウィンドウ150の非圧縮広域変数の サブレンジ156および158の分割により複雑になる。広域変数は、例えばサ ブレンジ158に割り当てた後、(非圧縮命令に対する)サブレンジ156にお いて広域変数の割り当てが継続しなければならない。換言すれば、非圧縮命令に アクセスできる広域変数のために、サブレンジ154を迂回する必要がある。 マイクロプロセッサ10は、広域ポインタ(GP)レジスタを用いるロード/ ストア命令に対する圧縮された即値フィールドの伸張を用いることができ、この 伸張により、アドレシングウィンドウ152がもたらされる。アドレシングウィ ンドウ152は、圧縮命令にアクセス可能なサブレンジ160および非圧縮命令 にアクセス可能なサブレンジ162を含む。サブレンジ162は、隣接するメモ リブロックなので、好都合である。非圧縮命令によるアクセス のための広域変数をサブレンジ162に割り当てる一方で、圧縮命令によるアク セスのための広域変数をサブレンジ160に割り当てることができる。本質的に 、サブレンジ160およびサブレンジ162は、圧縮命令および非圧縮命令によ るアクセスのための広域変数の異なる表をそれぞれ形成する。 前述のように、アドレシングウィンドウ152は、圧縮即値フィールドを伸張 することによりもたらされる。ただし、伸張された即値フィールドの最上位ビッ トがセットされる。もし、圧縮即値フィールドが2進数のゼロで符号化されてい れば、伸張された即値フィールドは、8000(16進数)となる。伸張即値フ ィールドは、ロード/ストア命令に対する符号付きフィールドとして解釈される ので、8000という値は、伸張即値フィールドにおいて利用可能な最も負の数 である。圧縮即値フィールドがゼロ以外に符号化されている場合は、その圧縮即 値フィールドは、サブレンジ160を形成する負の数へと伸張される。図7の実 施例に示したように、サブレンジ160は、アドレシングウィンドウ152によ って表されるアドレス範囲の下限を形成する。 これまで用いたように、メモリオペランドなる用語は、主メモリ内部のあるメ モリ位置に記憶された値を指す。メモリオペランドをマイクロプロセッサ10内 部のレジスタに転送するためには、ロード命令が用いられることになる。逆に、 レジスタに格納されている値をメモリオペランドの 記憶場所に転送するには、ストア命令が用いられる。メモリオペランドは、種々 の大きさ(即ち、バイト数)を取り得る。一実施例では、3種類の大きさが利用 できる。即ち、バイト、半ワードおよびワードである。半ワードは2バイトから なり、ワードは4バイトからなる。実施例によっては、他の大きさのメモリオペ ランドも考えられる。 図8には、ロード/ストア命令の即値フィールドを伸張する命令伸張器12内 部のハードウェア例のブロック図を示す。なお、複数のロード/ストア命令を同 時に伸張するために、図8に示したハードウェア例を複数用いても良い。図8に 示したハードウェア例は、マイクロプロセッサ10Bに関して記載されている。 しかし、同様のハードウェアをマイクロプロセッサ10Aの内部に採用しても良 い。このハードウェア例は、即値フィールド伸張器170およびレジスタ復号器 172を含む。 命令が命令キャッシュ14Bから命令伸張器12Bに転送されると、ロード/ ストア命令に対する圧縮即値フィールドからなる命令の一部が、圧縮即値バス1 74により即値フィールド伸張器170に運ばれる。図3A〜6Fにおいて説明 した命令セット例に対して、圧縮即値フィールドは、機能フィールド28(図3 Aに示す)からなる。さらに、圧縮されたロード/ストア命令のベースレジスタ フィールドは、ベースレジスタバス176で送られる。図3A〜6Fに示した命 令セット例に対して、ベースレジスタフィールドは、第2のレジスタフィールド 26からなる。 レジスタ復号器172は、ベースレジスタバス176上で特定されるレジスタ を復号する。ベースレジスタが、広域ポインタレジスタならば、レジスタ復号器 172は、即値フィールド伸張器170へのGP線178上のGP信号を活性に する。それ以外の場合、レジスタ復号器172は、GP信号を不活性にする。 即値フィールド伸張器170は、圧縮即値フィールドをGP信号に応じて2通 りの内の1つの方法で伸張する。GP信号が不活性の場合、即値フィールド伸張 器170は、伸張即値フィールドの最上位ビットをクリアする。逆に、GP信号 が活性の場合、即値フィールド伸張器170は、即値フィールドの最上位ビット をセットする。したがって、ベースレジスタとして広域ポインタレジスタ以外の レジスタが使用されている場合、正のオフセットが生成される。また、ベースレ ジスタとして広域ポインタレジスタが使用されている場合、負のオフセットが生 成される。即値フィールド伸張器170は、伸張した即値フィールドを伸張即値 バス180に送出する。 図9に、圧縮命令セット例の一実施例に従うロード/ストア命令に対して生成 された伸張即値フィールドを例示する。ベースレジスタとして広域ポインタレジ スタを使用しないロード/ストア命令の圧縮即値フィールドは、参照番号182 によって示されるように伸張される。バイト、半ワードおよびワードに対する伸 張を、伸張即値フィールド(またはオフセット)の各ビット位置を数字またはL で表 して、個別に示した。圧縮即値フィールドからのビットは、伸張されたフィール ドのそれぞれのビット位置に数字によって示した。圧縮即値フィールドの最下位 ビツトは、数0によって表し、圧縮即値フィールドの最上位ビットは、4によっ て表す。文字Lは、2進数のゼロに設定されたビット位置を示すのに用いる。 ベースレジスタとして広域ポインタレジスタを用いるロード/ストア命令に対 するバイト、半ワードおよびワードに対応する伸張即値フィールドを参照番号1 84によって示した。参照番号182で示した伸張フィールドと同様に、参照番 号184によって示した伸張フィールドは、圧縮即値フィールドからの1つのビ ットで満たされたビット位置に数を示し、文字Lを用いて、2進数0に設定され たビット位置を示す。さらに、伸張された各オフセットの最上位ビットは、2進 数の1(文字Hで示す)に設定される。 次に、図8に示した実施例に従い命令の伸張を行うために命令伸張器12によ り行われる動作を示すフローチャートを図10示す。図10に示すステップは性 質上順番に示したが、各種ステップは並列に行っても良い。 命令伸張器12は、受信した命令がロード/ストア命令かどうかを判断する( 判断ブロック190)。その命令がロード/ストア命令でない場合、(図3A〜 6Fに示したような)圧縮命令と対応する伸張命令との間の射像に従って、その 命令を拡張する(ステップ192)。その命令がロード/ストア命令である場合 、その命令によって指定さ れるベースレジスタを調べる(判断ブロック196)。ベースレジスタが広域ポ インタレジスタならば、即値フィールドを図9の参照番号184で示したように 伸張する(ステップ194)。また、ベースレジスタが広域ポインタレジスタで ない場合、即値フィールドを図9の参照番号182で示したように伸張する(ス テップ192)。 広域ポインタレジスタに対して異なる方法でロード/ストア用オフセットを伸 張することに加えて、マイクロプロセッサ10は、何れの(即ち、圧縮または非 圧縮)タイプの命令を実行しているかを示す圧縮モードも使用可能とする。図1 1は、命令伸張器12の一実施例の一部を示すブロック図である。図示した部分 は、マイクロプロセッサ10によって実行されている各ルーチンに対する圧縮モ ードを判断する。図示した部分は、マイクロプロセッサ10Bに適しており、同 様の部分をマイクロプロセッサ10Aで用いることも可能である。図11はモー ド検出器200を示す。 プロセッサコア16により命令がフェッチされると、その命令は、命令バス2 02上でモード検出器200により受信される。モード検出器200は、ジャン プアンドリンク(JAL)命令のフェッチ時を検出し、さらに交換ビット94を 検査する。交換ビット94がセットされている場合には、JAL命令の目的アド レスにあるルーチンは、圧縮命令からなる。したがって、その目的ルーチンの圧 縮モードは「圧縮」である。また、交換ビット94がクリアさ れていることもある。この場合は、その目的ルーチンの圧縮モードは「非圧縮」 である。 JAL命令は、目的ルーチンに対する圧縮モードを指定する他、JAL命令に より、JAL命令に続く命令のアドレスがMIPS RISCアーキテクチャの レジスタ$31に格納されるようになる。後に、このレジスタは、目的ルーチン から戻るJR命令と共に用いられる。この実施例では、圧縮モードは、アドレス の一部として格納されるので、コール元のルーチンの圧縮モードは、JR命令の 実行時に復元される。圧縮命令で符号化されたルーチンは、非圧縮命令で符号化 されたルーチンと混合できるので、好都合である。新たな圧縮モードは、圧縮モ ード線206でプロセッサコア16に送られる。なお、代わりの実施例として、 モード検出器200は、命令伸張器12の代わりにプロセッサコア16の一部と して含めても良い。 図11に示したモード検出器200の実施例には、圧縮許可(イネーブル)ビ ットのための記憶場所204が含まれる。圧縮がイネーブルである場合、圧縮許 可ビットはセットされる。命令が圧縮モードでフェッチされ、且つ圧縮がイネー ブルである場合、命令伸張器12は、その命令を伸張する。許可ビットがクリア されている場合、マイクロプロセッサ10は、命令の圧縮が禁止される。命令の 伸張が禁止されている場合、命令伸張器12は迂回される。さらに、モード検出 器200は、命令の圧縮が禁止されている場合、圧縮モードが非圧縮であること を示す。 これまで用いたように、ルーチンは、マイクロプロセッサ10による実行のた めに順序付けられた符号化された命令の集合である。このルーチンは、圧縮命令 または非圧縮命令の何れかで符号化することが許され、且つサブルーチンコール 命令およびリターン命令によって区切られる。区切りとなるサブルーチンコール 命令は、そのルーチンに含まれない。その代わり、サブルーチンコール命令は、 そのサブルーチンコール命令に含まれる目的アドレスによって、そのルーチンの 始まりを示す。そのルーチンの最初の命令が、目的アドレスに格納される。さら に、サブルーチンコール命令を含むルーチンの内部の命令のアドレスを退避させ て、呼び出し中のルーチンに戻るためにリターン命令を実行できるようにする。 図3A〜6Fに示した圧縮命令セット例において、JAL命令は、サブルーチン コール命令の役目を果たすことができる。あるいは、jalr命令が、サブルーチン コール命令の役を果たすことができる。 ルーチンはリターン命令で終了する。このリターン命令により、続く命令の実 行は、対応するサブルーチンコール命令の実行時に退避されたアドレスへと戻る 。換言すれば、リターン命令の目的アドレスは、退避されたアドレスである。圧 縮命令セット例に付いて言えば、jr命令は、リターン命令としての役を果たす ことができる。一般に、目的アドレスは、その目的アドレスに対応する命令の実 行時に命令のフェッチが始まるアドレスである。 次に、図12に、レジスタフィールド伸張の一実施例の ブロック図を示す。レジスタフィールド伸張の別の実施例を考察する。ある命令 に対応する圧縮レジスタフィールドは、圧縮レジスタフィールドバス210で転 送される。レジスタ伸張ブロック212が、圧縮レジスタフィールドを受信する 。さらに、圧縮レジスタフィールドの少なくとも一部が、伸張レジスタフィール ドに包含され、この伸張レジスタフィールドが、伸張レジスタフィールドバス2 14上に転送される。これにより、伸張レジスタフィールドが、圧縮レジスタフ ィールドの少なくとも一部をレジスタ伸張ブロック212によって生成される値 に連結することにより、形成される。 一実施例においては、圧縮レジスタフィールド全体が伸張レジスタフィールド に連結される。さらに、伸張レジスタフィールドの残りの部分は、その命例が何 れのレジスタセット(例えば、xs vs.rsおよびxt vs.rt)にア クセスするかに依存する。セット選択信号は、xs(xt)レジスタ集合または rs(rt)レジスタ集合の何れを用いるべきかを示し、セット選択バス216 上で各レジスタについて受信される。このセット選択信号が活性である場合、x s(xt)が選択される。その他の場合は、rs(rt)が選択される。セット 選択信号は、図5A〜6Fに示した圧縮命令セット例に従って伸張されている命 令のオペコードに基づいて、活性であったり不活性であったりする。例えば、表 1に示した圧縮命令と非圧縮命令との間のレジスタ射像を用いても良い。そのよ うな例の 場合、レジスタ伸張器212は、次の論理を用いることができる。 DR[4:3]={RH,(RH&CR[2]|!CR[2:0])} ここで、DRは伸張レジスタフィールドを表し、CRは圧縮レジスタフィールド を表し、及びRHは対応するセット選択信号値を表す。 その他のレジスタ射像も幾つか考察し、レジスタ射像(レジスタの割り当て) の例を、対応するヴェラログ(Verilog)論理式と共に、以下の表2〜4に示す。 なお、マイクロプロセッサ10の種々の実施例において、何れのレジスタ射像を 用いても良い。 表2:第2のレジスタ割り当て例 表3:第3のレジスタ割り当て例表4:第4のレジスタ割り当て例 表1〜4においてアセンブラ指定の名称で示したように、ソフトウェアの慣例 によって、様々なレジスタが種々の機能に割り当てられる。例えば、MIPSア センブラでは、レ ジスタに次の意味が割り当てられている。 表5:レジスタ名に対するソフトウェア上の慣例 レジスタ ソフトウェア名 用途 $0 なし ハード的にゼロに固定 $1 $at アセンブラで使用 $2...$3 v0-v1 関数の結果またはスタテ ィックリンク $4...$7 a0-a3 サブルーチンへの引数 $8...$15 t0-t9 一時的レジスタ、サブ ルーチン間で退避されず $24...$25 $16...$23,$30 s0-s8 サブルーチン間で退避 される $26...$27 k0-k1 オペレーティングシス テムで予約済み $28 gp 広域ポインタ $29 sp スタックポインタ $31 ra リターンアドレス 圧縮命令で符号化されたルーチンに対し、一時的レジスタおよび退避されるレ ジスタの両方へのアクセスを与えることが望ましい。さらに、既存のソフトウェ アと共に動作するためには、v0-v1、a0-a3、gp、spおよびraへのアクセスが必要 である。先に示したレジスタ射像により、これ らの質とレジスタ伸張器212が相当少数のゲートを占有するようにしたいとい う要望との間の均衡がとられる。MIPSレジスタセットから有用なレジスタの 集合を選択する一方で、レジスタ伸張器212内部のゲート数をなおも少なく維 持しているので、好都合である。 次に、図13に、マイクロプロセッサ10を含むコンピュータシステムの実施 例220を示す。マイクロプロセッサ10を用いた他の多くのコンピュータシス テムを考えることができる。コンピュータシステム220において、マイクロプ ロセッサ10は、多数のI/Oインタフェース222A〜222Nと共に半導体 基板224上に組み込まれている。I/Oインタフェースは、基板224の外部 のI/O装置へのインタフェースを与える。I/Oインタフェース222Aの例 としては、汎用非同期送受信装置(UART:universal asynchronous receiver /transmitter)がある。 マイクロプロセッサ10は、I/Oインタフェース222Aに結合されて、こ れらと通信を行う。さらに、マイクロプロセッサ10は、外部のインタフェース 論理部226に接続しても良く、該インタフェース論理部226は、さらに1乃 至それ以上のダイナミックランダムアクセスメモリ(DRAM)モジュール22 8へとインタフェースを取っている。DRAMモジュール228は、圧縮命令お よび/または非圧縮命令を格納するだけでなく、圧縮命令、非圧縮命令またはこ れらの両方の符号で表されたプログラム で使用するためのデータも格納する。 なお、この説明において、種々の信号の活性に言及する場合がある。信号が、 特定の状態を示す値を持っている場合、その信号は、「活性」である。逆に、信 号が、特定の状態の欠如を示す値を持っている場合、その信号は、「不活性」で ある。信号は、論理0の値を持っている場合を活性と定義し、論理1の値を持っ ている場合を逆に定義してもよい。 圧縮命令セットの特定の例を示して説明したが、説明のための圧縮命令セット は、多くの変形、拡張および修正を行っても良い。これらの変形、拡張および修 正が考えられる。 次のヴェラログのリストは、命令伸張器12の論理例の説明である。この論理 の多くの異なる実施例が考えられるが、ここに示したヴェラログのリストが、好 適な一例である。 以上の開示により、圧縮命令セットおよび非圧縮命令セットの両方からの命令 を実行するマイクロプロセッサを説明した。このマイクロプロセッサは、圧縮命 令を伸張命令へと展開し、また圧縮命令を直接復号することもできる。圧縮命令 セットを用いて符号化されたルーチンは、非圧縮命令で符号化された対応するル ーチンより少ないメモリ量しか占有しないので、都合がよい。そのようなルーチ ンによって以前に占有されていたメモリが解放されるので、他のルーチンやそれ らのルーチンによって操作されるデータが使用できるようになる。以上の開示内 容を一旦完全に理解すれば、多くの変形および修正が、当業者にとって明らかと なるであろう。請求の範囲は、そのような変更および修正を総て包含するように 解釈するべきである。DETAILED DESCRIPTION OF THE INVENTION Apparatus and method for detecting and decompressing instructions from a variable length compressed instruction set                                Field of the invention   The present invention In the field of microprocessors, More specifically, Micropro Sessa instruction set optimization.                                 Background art   The structure (architecture) of a microprocessor is Complicated instruction set computation Processing (CISC: complex instruction set computing) structure or reduced instruction set Computer processing (RISC: reduced instruction set computing) structure Let's be classified. The CISC structure is Instruction set consisting of high-level, relatively complex instructions including. The microprocessor implementing the CISC structure is: In many cases, Complex life Instructions into a number of relatively simple actions that can be performed relatively easily in hardware. You. To give several decomposed operations corresponding to one instruction, Until now Microcoded rules stored in a read-only memory (ROM) Have been used successfully. More recently, Turn complex instructions into relatively simple actions Hardware decoder that separates Some CISC microprocessor designers Adopted by The architecture of the x86 microprocessor is: CISC It is an example of a structure.   vice versa, The RISC structure is Low-level, relatively simple instructions Instruction set. In general, Each instruction in the instruction set is By hardware Executed directly. There is no complexity associated with the CISC method, More advanced implementation The design of the station becomes possible. further, Hardware used to execute instructions Is simple, Design at high frequencies is relatively easy. RISC structure For example, There is a MIPS RISC architecture.   Although not necessarily a defining feature, Speaking of CISC structure, variable length instruction set Yes, RISC structures are often thought of as fixed-length instruction sets . In the variable length instruction set, Using different numbers of bits, Various instructions in the instruction set not only, The addressing mode for the instruction is also encoded. Variable length instruction set In In general, Information for each instruction can be one or more bytes representing that instruction Try to pack as efficiently as possible. On the contrary, In the fixed-length instruction set, Each life Use the same number of bits in the instruction (the number of bits is Generally a multiple of 8, Each instruction is It fits perfectly in a fixed number of bytes). Some fixed information fields Fields (fixed fields), Is generally defined is there. This allows The decoding process of each instruction The bit corresponding to each fixed field is Simplified to send that field to a logic circuit designed to decode You.   Each instruction in the fixed-length instruction set is Since it consists of a fixed number of bytes, Instruction location features Determination is similarly simplified. Specific life The position of a number of instructions following the instruction Depending on the location of that particular instruction, implicitly (ie, That (As a constant offset from the position of the particular instruction). On the contrary, 2 To locate the second variable-length instruction, Specify the end position of the first variable-length instruction. Must be set, To locate the third variable length instruction: Second variable length It is necessary to specify the position of the end of the instruction. further, Variable long life In the order, There is no fixed field structure for fixed length instructions. Due to the lack of this fixed field Than, The decoding process becomes more complicated.   Unfortunately, The RISC structure using a fixed length instruction set is Variable length instruction set There is a problem that does not generally apply to the CISC structure using. Each instruction is fixed length Because Some very simple instructions include Buy without information about the order Some actually waste memory by occupying multiple resources. example If For some instructions in many fixed-length instruction sets, "don't care ) "Field Waste memory. In contrast, variable In the long instruction set, Instruction information is packed into a minimum number of bytes.   further, The RISC structure is Does not include complex instructions used in CISC structure so, The number of instructions used in the program encoded with the RISC instruction is CISC It is larger than the number of instructions used in the same program encoded in the instruction. That Each of the relatively complex instructions encoded in the CISC version of the program is: That By multiple instructions in the RISC version of the program Is replaced by Therefore, The CISC version of the program is program Occupies significantly less memory than the RISC version of Correspondingly, Device for storing programs, The bandwidth between memory and microprocessor is The RISC version of the program is better than the CISC version of the program. Need more.                                Summary of the Invention   The problems outlined above are: Mostly solved by the microprocessor according to the invention. Is decided. The microprocessor of the present invention comprises: The corresponding non-compresse instruction d instruction) a compressed instruction set consisting of a subset of the set (Hereinafter referred to as “compressed instruction set”). Its non-pressure The reduced instruction set is High frequency operation and relatively simple operations commonly associated with RISC structures A RISC instruction set that allows the microprocessor to enjoy the optimal execution resources . Reads a compressed instruction from memory, Microprocessor By stretching inside the For a given performance level (for example, Run per second The number of instructions to be performed). You. further, The amount of memory occupied by compressed instructions is More than the corresponding uncompressed instructions occupy Relatively small.   The compressed instruction set for the description described here is It is a variable length instruction set. One fruit According to the example, Includes two different instruction lengths, a 16-bit instruction and a 32-bit instruction. 32-bit life The decree is Encoded using an extended opcode, Here, the extended opcode is Fe This indicates that the instruction being executed is an extension instruction (32-bit instruction). The instruction is , It may be fetched as a 16-bit quantity. 1 having the aforementioned extended opcode When the 6-bit instruction is read, The 16-bit instruction that follows is the extended operation Linked to the instruction with the code Form a 32-bit extended instruction. Extension instructions , Have enhanced capabilities with respect to unextended instructions, Compression instruction set flexibility And further enhance performance. This allows A rule that uses the abilities contained in the extension The chin can be encoded using a compression instruction.   Furthermore, the compressed instruction set includes The decompressed register from the compressed register field Multiple sets of register projections (assignments) to the register field are also included. compression Each value encoded in the register field is Different levels inside the microprocessor It is stretched to the Jista. In one embodiment, The compression register field is Respectively It consists of 3 bits. Therefore, Eight registers can be accessed for one instruction Noh. To provide access to additional registers for certain select instructions Is Assign two opcode encodings to those select instructions. Those opeco One of the code encodings is While indicating the first projection (allocation) of the register field so, The second opcode encoding is 5 shows a second projection of the register field. compression In the register field, You can include a relatively small number of bits, 8 or more Additional Select instructions for which access to the register is desired include: Giving such access This is convenient. further, The projection of the register is Register field expansion In order to minimize the logic circuit used for extension, Selected. In one embodiment, compression The register field is Copied directly into part of the decompression register field, Extension The rest of the register field is Generated using a small number of logic gates.   The microprocessor of the present invention comprises: Routine encoded with compression instruction and uncompressed instruction Program with other routines encoded by the ing. Subroutine call instructions included in the compressed instruction set are: The desired route Includes a compression mode that indicates whether the chin is encoded with a compression instruction. Subroutine The compression mode specified by the thinning is With the microprocessor, That Captured as the compression mode for the routine. In one embodiment, compression The mode is Stored as one of the fetch address bits (microprocessor Stored in the program counter register inside the server). The compression mode in this case is , Part of the fetch address, And the subroutine call instruction is Its sable Including storing the return address for the routine Calling routine The compression mode of It is automatically stored when a subroutine call instruction is executed. this By When the subroutine return instruction is executed, Of the calling routine The compressed mode is automatically restored.   Another feature of an embodiment of the microprocessor is that Wide area (global) pointer Immediate file used for load / store instructions having a register as a base register Field expansion. The immediate field is Expanded to the immediate field So Is set. This allows The lower of the address space of the global variable The subrange at the boundary of is Assignment to global variable of compression instruction Can be Uncompressed instructions are: Global to the rest of the global variable address space Stores variables. Since the above subranges are far apart, Of a specific program The assignment of global variables between compression and uncompression routines is Relatively easy It is more convenient.   The present invention Wide, Equipped with a command expander, Executes instructions from the variable-length compression instruction set. A device to perform is contemplated. The instruction expander Instructions that are members of the variable-length compression instruction set Are combined to receive Configured to examine the opcode field of the instruction It is. The instruction expander The opcode field of the instruction is an extended opcode If encoded, If the instruction is an extended instruction having a first fixed length It is configured to determine. further, The instruction expander Opcode file of the instruction Field is encoded as a second opcode different from the extended opcode. If The instruction is configured to be determined to be a non-extended instruction.   The present invention In addition, the compression instruction is expanded to an expanded instruction Consider the method of stretching. Compression instruction If the opcode field is an extended opcode, The compression instruction is First fixed length Is determined to be an extended instruction having The opcode field of the compression instruction is If it is a second opcode different from the extended opcode, The compression instruction is Second Is a non-extended instruction having a fixed length. The compression instruction is Decompressed to a decompression instruction. Pressure If the contraction instruction is an extension instruction, The number of bytes included in the compression instruction is First fixed Determined by length. Also, If the compression instruction is a non-extended instruction, The number of bytes is Determined by the second fixed length.   further, The present invention First determining means, With the second judgment means and the expansion means An apparatus for expanding a compression instruction into a decompression instruction is contemplated. The first determining means is Compression instruction If the opcode field is an extended opcode, The compression instruction is First fixed It is determined that the extended instruction has a length. The second determining means is Operation instruction of compression instruction Field is a second opcode different from the extended opcode, That pressure The contraction instruction is It is determined that the instruction is a non-extended instruction having the second fixed length. The extension means Pressure Decompress a decompression instruction into a decompression instruction. If the compression instruction is an extension instruction, The compression instruction Contains the number of bytes It is determined by the first fixed length. Also, Non-compression instruction For extended instructions, The number of bytes is Determined by the second fixed length.   further, The present invention A program including a first routine and a second routine A method that executes in a microprocessor is contemplated. Of the first routine Internally sable When the call instruction is executed, This subroutine call instruction The above Routine 2 should be executed via the destination address of the subroutine call instruction It is shown that. Check certain indications in subroutine call instructions. That If the display is in the first state, The second routine is Encoded using compression instructions Judge that there is. And If the display is in a second state different from the first state , The second routine is It is determined that encoding is performed using an uncompressed instruction.   further, The present invention The microprocessor has execution means and inspection means. e, For executing a program including a first routine and a second routine Is intended. The execution means is Execute subroutine call instruction inside the first routine Run. This subroutine call instruction The second routine is a subroutine. Indicates that the call instruction should be executed via the destination address. Inspection means Is Check certain indications in subroutine call instructions. The inspection means The table If the indication is in the first state, The second routine is Encoded using compression instructions Judge that And If the display is in the second state, The inspection means 2nd le - It is determined that encoding is performed using an uncompressed instruction.   The present invention further, Storage device and mode detector in microprocessor And an apparatus for fetching compressed and uncompressed instructions comprising: Storage device , Compressible finger An indicator (compression enable indicator) is stored. The mode detector is In storage Combined, When fetching a subroutine call instruction that specifies the target routine , The target routine is configured to detect a compression mode. The mode detector is Inspection It is configured to inform the processor core of the issued compression mode. Processor The core is If the compression mode indicates compression, Configured to fetch compressed instructions You. further, The processor core is If the compression mode indicates uncompressed, Uncompressed instructions It is configured to fetch.   The present invention further, Microprocessor with instruction decompressor and processor core Contemplate Sessa. The instruction expander Compression instructions that are elements of the variable-length compression instruction set Combined to fetch. The instruction expander Each compression instruction received corresponds to It is configured to decompress to a decompression instruction. The processor core is Receive expansion command Combined to It is configured to execute the decompression instruction.   further, The present invention A method of executing an instruction code is contemplated. If the compression instruction Is touched. This compression instruction This is an element of the variable length compression instruction set. The compression instruction is By being decompressed in the instruction decompressor, Form the corresponding decompression instruction. this The decompression instruction is Executed on the processor core.   The present invention further, Fetch means, An instruction code including expansion means and execution means. Devices that perform the code are contemplated. Fetch means, In the variable length compression instruction set Fetch a compression instruction. The extension means To expand the compression instruction Than, Form the corresponding decompression instruction. The execution means is Execute the decompression instruction.   further, The present invention Contemplates an instruction decompressor configured to decompress compressed instructions You. The first of the compression instructions is Defined for the corresponding uncompressed instruction set To access the first subset of registers Can be encoded. further, The second of the compression instructions is: Access the first subset of registers Can be encoded to access Access the second subset of registers Can also be encoded.   The present invention further, A method of decompressing a compressed instruction is contemplated. First register If the compressed instruction with the field is encoded using the first opcode, , The compression instruction is From compressed register specifier to decompressed register specifier Is expanded using the first register projection of Has a first register field If the compressed instruction is encoded using the second opcode, The compression instruction Is Second register from compressed register indicator to decompressed register indicator The image is expanded using the projection image.   The present invention further, An apparatus for decompressing compressed instructions with decompression means is contemplated. Extension Zhang means, It is configured as follows. That is, Pressure with first register field If the reduced instruction is encoded using the first opcode, Compression register finger Using the first register projection from the indicator to the decompression register indicator, The compression instruction To stretch. Also, Extension means Is A compressed instruction having a first register field is encoded using a second opcode. If it is Second from compression register indicator to decompression register indicator Using the register projection of Decompress the compression instruction.   The present invention further, Set the compression register field of the compression instruction to the expansion register of the expansion instruction. An instruction decompressor configured to decompress into Staffield is contemplated. Compression cash register The extension of Stafield A first value encoded into a compression register field; And the second value encoded into the opcode field of the compression instruction.   The present invention further, Set the compression register field of the compression instruction to the expansion register of the expansion instruction. A method of stretching to Stafield is contemplated. Fewer compression register fields And some Copied directly into part of the decompression register field. Decompression register The rest of the field is Working logically on the compression register field Generated.   further, The present invention Comprising first means and second means, Compression level of compression instruction A device for expanding the register field into the expansion register field of the expansion instruction is intended. I do. The first means is Decompress register at least part of the compression register field Copy directly to part of the field. The first means is Compression register field Combined to receive. Similarly, The second means, Compression register field Combined to receive, Operates on the compression register field to decompress the register Generate the rest of the field.   further, The present invention Set the compression register field of the compression instruction to the expansion register of the expansion instruction. An instruction decompressor configured to decompress into Staffield is contemplated. This instruction The stretcher is Decompress register field at least part of compression register field By copying to the first part of The first part of the decompression register field Form. further, The instruction expander Decompression register acting on compression register field Includes a logic block configured to generate the rest of the stafield.                             BRIEF DESCRIPTION OF THE FIGURES   Other objects and advantages of the present invention are: Read the detailed description below, And attached figure It will become clear by referring to the plane.   FIG. FIG. 2 is a block diagram of one embodiment of a microprocessor.   FIG. FIG. 4 is a block diagram of a second embodiment of the microprocessor.   FIG. 3A Acceptable in one embodiment of the microprocessor shown in FIGS. This is the first instruction format.   FIG. 3B Allowed in one embodiment of the microprocessor shown in FIGS. This is a second instruction format.   FIG. 3C Allowed in one embodiment of the microprocessor shown in FIGS. This is the third instruction format.   FIG. Acceptable in one embodiment of the microprocessor shown in FIGS. This is the fourth instruction format.   FIG. 4A shows Acceptable in one embodiment of the microprocessor shown in FIGS. This is the fifth instruction format.   FIG. 4B Acceptable in one embodiment of the microprocessor shown in FIGS. This is the sixth instruction format to be executed.   FIG. Acceptable in one embodiment of the microprocessor shown in FIGS. This is the seventh instruction format.   FIG. 4D Acceptable in one embodiment of the microprocessor shown in FIGS. This is an eighth instruction format.   FIG. 5A, 5B, 5C, 5D and 5E are FIG. 3A, 3B, Shown in 3C and 3D 5 is a table of an example of an instruction using the instruction format shown in FIG.   FIG. 6A, 6B, 6C, 6D, 6E and 6F are FIG. 4A, 4B, 4C and 4 6 is a table of an example of an instruction using the instruction format shown in FIG.   FIG. Any of the embodiments of the microprocessor shown in FIGS. FIG. 4 is a diagram showing an offset from a register and a global pointer register.   FIG. Hardware example of expanding immediate field from compression instruction to decompression instruction It is a block diagram of.   FIG. Expanded by one embodiment of the microprocessor shown in FIGS. It is a figure showing an offset.   FIG. An immediate buffer according to one embodiment of the microprocessor shown in FIGS. It is a flowchart which shows operation | movement of the expander for fields.   FIG. The microprocessor shown in FIGS. FIG. 4 is a block diagram of an example hardware that generates a fetch address according to one embodiment. .   FIG. Used in one embodiment of the microprocessor shown in FIGS. FIG. 3 is a block diagram showing a register expansion logic circuit to be used.   FIG. An embodiment thereof is shown in FIG. 1 and FIG. It is a block diagram of an example of a pewter system.                             Detailed description of the invention   In FIG. FIG. 2 shows a block diagram of a first embodiment of a microprocessor 10A. My The cross processor 10A Instruction expander 12A, Instruction cache 14A and professional Including the sessa core 16. The instruction expander 12A Furthermore, it is linked to the instruction cache 14A. Are combined. The instruction cache 14A It is joined to the processor core 16.   In general, The microprocessor 10A includes: Main memory subsystem (hereinafter referred to as “Main memo ) Is read from a compressed instruction (compressed instruction). Reading The embedded compression instruction is Through the command expander 12A, At this time, The compression instruction is Expanded to a decompressed instruction and stored in the instruction cache 14A. Will be delivered. Many of the compression instructions are The corresponding decompression instructions occupy more memory space Since there is no, It requires less memory to store the program. You. further, Since the instructions are decompressed inside the microprocessor 10A, Compression instruction From main memory The bandwidth required to transfer to microprocessor 10A is reduced. micro The processor 10A includes: For computer systems with relatively small main memory Can be. Since the stored instructions are compressed, Relatively large in main memory Can store programs.   In one embodiment, The microprocessor 10A includes: Compressed instructions and uncompressed Both instructions are configured to be executable on a routine-by-routine basis. In other words, routine Is Encoding may be performed using either a compression instruction or a non-compression instruction. Compression instruction set Routines that cannot be efficiently encoded in Encoded using uncompressed instructions, Compression life The routines that can be efficiently encoded in the instruction set are: I just need to do that, Convenience Is good. The microprocessor 10A includes: Allows a mix of compressed and uncompressed instructions In order to Load using global pointer register as base register / The expansion of the immediate field for the store instruction may be allowed. To this stretch About Details will be described later. further, The instruction expander 12A Detect compression mode You. The compression mode is The instruction set used to encode the routine is compressed Or Or, it is to identify whether or not the data is compressed.   Instruction compression is For encoding instructions available in microprocessor 10A This is done by imposing certain restrictions. To restrict instruction encoding Than, Reduce the size of the instruction field (ie, Number of bits in instruction field Can be reduced). For example, Available Reduce the number of registers, A compressed instruction set can be formed. Available Because there are few registers, Used as the source and destination operands of the instruction A relatively small field can be used to encode the register. life The stretcher 12A is Decompress the encoded register field to the register field Stretch to. The decompression register field is Included in decompression instructions. The compression instruction is By using the reduced instruction field, My core used in the processor core 16 Less memory than the original instruction encoding defined by the microprocessor architecture (immediate Chi Relatively few bits).   The instruction expander 12A Receiving the compression instruction, The instruction to the original instruction encoding system It is configured to stretch. Each instruction field in a compression instruction is Compression The field is decompressed into the corresponding decompression field inside the corresponding decompression instruction. The decompressed instruction is The original instruction format allowed in the processor core 16 Has been encoded.   The processor core 16 Reads an instruction from the instruction cache 14A, Decrypt, And a circuit for execution. The instructions available in processor core 16 are: This It is determined by the architecture of the microprocessor used here. One implementation In the example, The processor core 16 Adopt MIPS RISC architecture . However, The processor core 16 Uses any microprocessor structure May be. The instruction expander 12A Decompress the instruction to its original form so, The processor core 16 It may be composed of a processing core designed before. Exchange In other words, The processing core is For inclusion in microprocessor 10A, Substantial change No further changes are required.   The MIPS RISC architecture is Instructions consisting of 32-bit fixed-length instructions Specify the set. For the microprocessor 10A, Pressure consisting of variable length instructions Define a reduced instruction set. Many of those compression instructions are It is a 16-bit instruction. Other compression instructions are This is a 32-bit instruction related to an extension instruction described later. 16 Several bit and 32 bit instruction formats are defined. In addition, In this embodiment, 1 Using 6-bit and 32-bit compression instructions, Different embodiments have different instruction lengths May be used. What is encoded by the compression instruction is Part of the uncompressed instruction. The instruction encoding allowed in the compressed instruction set is: Very commonly encoded instructions Not only Including many of the most commonly used registers, Many programs in the program Programs and routines can be encoded using compression instructions.   In one embodiment, The microprocessor 10A includes: Use compressed mode. If the compression mode is active, The compression instruction has been read and is being executed. Instruction expander 1 2A is When an instruction is transferred from main memory to instruction cache 14A, Those Extend the instruction. on the other hand, In some cases, the compression mode is inactive. in this case, Non-pressure The reduced instruction has been read and executed. When the compression mode is inactive, Instruction extension Table 12 A is Bypassed. In some embodiments, Set the compression mode to 1 bit of the fetch address. (For example, Indicated by bit 0). The current fetch address is For example, Step It is stored in the PC register 18 inside the processor core 16. Bit of PC register 18 To 0 3 shows a compression mode (CM) of the microprocessor 10A.   The instruction cache 14A Configured to store decompressed and uncompressed instructions High-speed cache memory. The instruction cache 14A is any cache Although a structure may be used, For the embodiment shown in FIG. Set associative (Set associative) configuration or Or direct mapping A configuration would be appropriate.   next, FIG. 9 shows a second embodiment of the microprocessor 10B. Microp The processor 10B Instruction key combined to receive instruction bytes from main memory Cache 14B, It includes an instruction expander 12B and a processor core 16. Instruction The brush 14B is Coupled to the instruction expander 12B, This is, Further processor core 16.   The microprocessor 10B includes: The instruction cache 14B and the processor core 16 And a command decompressor 12B. The instruction cache 14B Stores compressed instructions transferred from main memory. in this way, Instruction cache 14 B is Used as instruction cache 14A in microprocessor 10A It can store more instructions than a similar instruction cache of similar capacity. order The expander 12B Fetch corresponding to an instruction fetch request from the processor core 16 Receiving the switch address, The instruction cache 14B is accessed in response to the fetch request. Access. The corresponding compression instruction is With the command expander 12B, Expanded to decompression instruction It is. The decompression instruction is The data is transferred to the processor core 16.   Like the microprocessor 10A, Microprocessor 10B is in compression mode In some embodiments. When uncompressed instructions are loaded and executed, Command extension The tensioner 12B Bypassed. In this example, The instruction cache 14B compression Stores both instructions and uncompressed instructions. In addition, The instruction cache 14B General To Bytes of an instruction are stored in a fixed number of storage locations called cache lines. Store. Therefore, One particular cache line is Some compression instructions or Stores uncompressed instructions. In either case, Multiple instruction bytes are stored. this like, Instruction caches 14A and 14B It has a similar structure. One The compression mode when a cache line is addressed is The instruction byte is Determines whether to be interpreted as a compressed instruction or an uncompressed instruction.   As an alternative to the microprocessor 10B, Instruction of processor core 16 The instruction decompressor 12B is included in the decoding logic. In such an embodiment, And The compression instruction is Actually, it does not need to be stretched. Instead, The compression instruction is Decoding directly by decoding logic No. The decrypted instruction (hereinafter referred to as the “decryption instruction”) Non-compression corresponding to compression instruction It will be similar to the decoding instruction generated for the reduced instruction.   In addition, The microprocessors 10A and 10B Microphone operated by compression instruction This is merely one embodiment of the microprocessor 10. In the remainder of this description, Ma Microprocessor 10, Using the instruction cache 14 and the instruction decompressor 12, Figure In addition to the corresponding elements of 1 and 2, In another embodiment of the microprocessor 10 Of the included element, Another embodiment is also referred to.   In the above description, Stretching, Compression instructions, Decompression and non-compression instructions Used It will be used later. As used previously, "Compression instruction" The term is Refers to instructions stored in compressed form in memory. The compression instruction is In general , Defined by the microprocessor structure employed by processor core 16 Fewer bits than the number of bits used to store the instructions Is stored. The term "stretch instruction" Compress instruction to processor core 16 To the original code as defined by the microprocessor structure adopted by And the result of the expansion. The term "uncompressed instruction" Compression instruction processor core 16 as the code defined by the microprocessor structure employed by Refers to the order. The uncompressed instruction is It is stored in memory in the same format (ie, Uncompressed instructions Is never compressed). Finally, The term "stretch" Compression instruction Refers to the process of expanding to the corresponding decompression instruction.   In addition, The instruction decompressors 12A and 12B Decompress multiple compression instructions at the same time It may be configured as follows. Such an embodiment of the instruction decompressor 12 is: Every clock cycle It may be used with embodiments of the processor core 16 that execute multiple instructions.   3A to 3D and 4A to 4D Using MIPS RISC architecture According to an embodiment of the microprocessor 10 16 bit and 32 bit respectively Here is an example of the instruction format for the compression instruction of In some embodiments, Different instruction formats May be used. Each of the instruction formats shown in FIGS. In this particular example, It consists of 16 bits. on the other hand, Each instruction format shown in FIGS. This particular fruit In the example, It consists of 32 bits. Compressed instructions encoded using these instruction formats The decree is Instructions defined by the MIPS RISC architecture for each instruction Expanded to format.   FIG. 3A The first instruction format 20 is shown. Instruction format 20 is Opcode feel C22, A first register field 24, A second register field 26 and A function field 28 is included. The operation code field 22 Identify the instruction Used for further, The function field 28 has an operation code field 22. Is a certain sign, Associated with this code, To identify the order Used for The function field 28 and the operation code field 22 Oneness To form an opcode field for the instruction, It is efficient. Operation Code field 2 Two, If a code other than that particular code is used, The function field 28 immediate Used as a field.   By the first register field 24 and the second register field 26, Identify the destination and source registers for the instruction . Also, The destination register is Generally the source register for the instruction It is also used as data. in this way, Two source operands and one destination The nation operand is First register field 24 and second register Specified by field 26. The first register field 24 and the second The notation “RT” and “RS” in the register field 26 of See below Indicates the use of the field in the instruction table. By the sign of the instruction, RT or Any one of RS becomes a destination register.   In one embodiment, The operation code field 22 has 5 bits, First Regis Field 24 and second register field 26 each have 3 bits, So The function field 28 is composed of 5 bits. The first register field 24 , It is divided into two lower fields (denoted RT0 and RT1). This implementation In the example, RT1 consists of 2 bits, RT0 consists of one bit. RT1 is R Connected to T0 to form a first register field 24. Lower field R T1 and the second register field 26 Encoded by instruction format 20 When used in an instruction, 3 defined in the MIPS RISC architecture 2 Shows one of the registers.   FIG. 3B The second instruction format 30 is shown. The instruction format 30 is Opcode feel C22, First register field 24 and second register field 26 Including. further, 3 shows a third register field 32 and a function field 34. It is. The third register field 32 In general, Instruction using instruction format 30 Used to identify the destination register for Therefore, The first register field 24 and the second register field 26 Imperative form It consists of a source register for equation 30. The function field 34 Function feel Used in the same manner as in the field 28. In the illustrated embodiment, Third register field 3 2 is 3 bits, The function field 34 consists of 2 bits.   The third instruction format 40 is shown in FIG. 3C. The instruction format 40 is Opcode field 22 and the second register field 26, An immediate field 42 is also included. Immediately The value field 42 is Immediate data for the instruction specified by instruction format 40 (Immediate data). Immediate data is Instruction Peland, First register field 24 or second register field This is the same as the value stored in the register specified by the code 26. For example, Immediate data Addition instruction using data Store the immediate data in the destination register Is added to the value Store the resulting sum in its destination register Store. In one embodiment, The immediate field 42 is 8 Consists of bits. The immediate field 42 is In the instruction format shown in FIG. 3C, Two It is divided into lower fields IMM0 and IMM1. This lower field And The second register field 26 is Within the instruction format 40, Instruction format 2 Can be placed in the same bit position as if it were placed at 0 and 30 Become. The second register field 26 It is the same as the 16-bit instruction used. Can always be found in the same position, It is convenient. Therefore, Lower level Field IMM1 Consists of two bits, The lower field IMM0 is 6 bits Become. IMM1 is Connected to IMM0 to form an immediate.   FIG. A fourth instruction format 50 is shown. The instruction format 50 is Opcode feel And an immediate field 52. The immediate field 52 Immediate feel Like C42, Used as an instruction operand. However, Immediate field 52 is It consists of 11 bits.   FIG. 4A shows 5 shows a fifth instruction format 60. The instruction format 60 is Opcode feel Includes This opcode field 22 is Encoded as an extension instruction You. The instruction expander 12 Extended instruction opcode in the opcode field 22 When you recognize, Treat the instruction as a 32-bit instruction (ie, Extended opcode 16 bits included in the instruction including If no extended instructions are included, program 16 bits that constitute the next instruction in system order 32-bit instructions concatenated Order is formed). Therefore, Compression instruction Is The variable-length instruction set consisting of 16-bit instructions and 32-bit instructions Can be further, The instruction format 60 is Zero field 6 consisting of 6 bits 2 (all encoded to binary 0), Immediate field 64 and BR fee Field 66. The instruction format 60 is The extended form of the BR instruction (unconditional branch instruction) Is used to encode The BR field 66 is Opeco showing BR instruction Field. In one embodiment, BR opcode is Hexadecimal 0 2.   The extended BR instruction is Since it has an immediate field larger than the non-extended BR instruction, Non-expansion It can be encoded with an offset larger than the Zhang BR instruction. Minute from branch instruction to far instruction If you want a tree, This extended BR instruction is used. Also, Branch to nearby instruction In Use a non-extended BR instruction. The immediate field 64 The purpose of the branch instruction 16 bits added to the address of the instruction following the BR instruction to generate the address This is used as the offset of the unit. On the contrary, The non-extended BR instruction is 11 be Include the offset of the Encoded using the instruction format 50).   FIG. 4B Shows instruction format 70, this is, This is an extended version of the instruction format 40. order Format 70 is Near the opcode field 22 that is encoded as an extended opcode Or Immediate field 72, A first register field 74, Second register file Field 76 and a second opcode field 78. First register Field 74 and the second level Gistafield 76 In the illustrated embodiment, Each consists of 5 bits. I Therefore, Registers defined in the MIPS RISC architecture are: Any It can be accessed using the instruction format 70. The second opcode field 78 Real Defines the instruction in the line, 5 bits (similar to opcode field 22) Consists of Finally, The immediate field 72 Consists of 12 bits, 1-bit I MM2 lower field, 5 bit IMM1 lower field and 6 bit I It is divided into MM0 lower fields. The immediate field 72 In the illustrated embodiment In addition, Connect IMM1 to IMM2, By further connecting IMM0, Formed.   An extended instruction format corresponding to the instruction format 30 is shown as an instruction format 80 in FIG. 4C. life Order form 80 As in the instruction format 70, the operation code field 22, First Regis Tafield 74, The second register field 76 and the second opcode file Field 78. further, The instruction format 80 is The third register field 82 and And a function field 84. The third register field 82 5 bits Except that It is the same as the third register field 32. Therefore , Replace any register of the MIPS RISC architecture with a third register fee Field 82. The function field 84 6 bits Except for Same as function fields 28 and 34.   The second opcode field 78 From instruction format 70 The instruction format 80 is encoded to a specific value to distinguish it. The second opcode file Field 78, If encoded to that particular value, The instruction expander 12 That instruction Is interpreted as the command format 80. vice versa, The second opcode field 78 is If it is encoded to a different value than that particular value, The instruction expander 12 Instruction format Interpret as 70. In one embodiment, That particular value is Hexadecimal 00 .   The instruction format 80 is Also includes a COP0 bit 86. COP0 bit 86 is When this is set, (Defined in the MIPS RISC architecture Indicates that some sort of coprocessor zero instruction is being executed. Life later In the order table, The instruction encoded by setting COP0 bit 8 defines the instruction Have been.   Instruction format 20, 30, With the instructions defined for 40 and 50, one It can perform many of the operations commonly performed in general programs. But, Depending on the routine, You need to do something impossible with these instructions Sometimes. Most of the instructions in the routine are By encoding using instruction formats 20 to 50 But In some instructions, Additional code forms are required. For example, Format 20 Access to registers not included in the subset of available registers Seth, May be necessary. Included in instructions encoded using formats 20-50 There are no additional instructions, May be necessary. For these and other reasons, Extension Operation codes and extended instruction formats 60 to 80 are defined. You.   The instruction expander 12 To detect extended opcodes, Opcode field Examine 22. The extended opcode is To use the instruction format 50 in the present embodiment This is one of the opcodes defined in. However, Included in immediate field 52 The bits to be Depends on the extension instruction format encoded for a specific extension instruction. Assigned to the interpretation. The extended instruction format includes Second to specify a specific extension instruction Opcode field (for example, Fields 66 and 78) are included.   By adding extended opcodes and extended instruction formats, Many instructions are Comparison It is encoded using narrow instruction formats 20 to 50, Relatively wide expansion if necessary The flexibility of Zhang command format can also be provided. Machines included in the extended instruction format Even programs that occasionally use Noh, It is possible to reduce the memory occupancy. So Is These programs also Can be encoded using a compression instruction, Compression life This is because most instructions consist of 16-bit compression instructions.   In one embodiment of the microprocessor 10, 16-bit instruction part Switch to detect extended opcodes, Extended instructions may be handled. Extension When an opcode is detected, By transferring the NOP to the processor core 16, Extended life The remaining 16-bit portion of the instruction may be fetched. The extension instruction is Stretched, It is given as the next instruction after the above NOP.   further, The instruction expander 12 Some of the extended instructions are available, The second part is profit Handle cases that cannot be used. For example, The two parts of the extension instruction are Instruction May reside on two different cache lines within the cache 14. But What One part of the instruction is Read from the instruction cache 14, The other Part is It may not be inside the instruction cache 14. The first part is Remaining Until the part is available It may be necessary to store it in the instruction expander 12. Not.   Finally, FIG. 4D Explicitly extend the JAL instruction in the MIPS RISC instruction set. This is an instruction format 90 used for extension. The JAL instruction is Subroutine call It is often used as an instruction. The subroutine is The calling routine May be stored in a memory at a large distance (in terms of address). Accordingly hand, Largest possible range (via 26-bit immediate field 92) Having a relative offset of Important for JAL instructions. further, order Include one exchange bit 94. The exchange bit is Destination address Used to indicate the compression / incompressibility of the instruction. Exchange bit is set If The target instruction is a compression instruction. If the exchange bit is clear, Goal The instruction is an uncompressed instruction. The value of the exchange bit 94 is Inside the processor core 16 Copied to bit 0 of program counter. Bit 0 of the program counter Is It can be assumed that it is always zero. Because 16 Bit and 32-bit instructions are: Each occupy at least 2 bytes, and The instruction is This is because they are stored at consecutive addresses. Therefore, Bit 0 is A convenient place to store the compression mode of the current routine. Processor core 16 is If bit 0 is set, Change the fetch address to 2 (instead of 4) By increasing by one, A 16-bit compressed instruction is transmitted through the instruction decompressor 12 Fetch.   Each instruction of the compressed instruction set used by microprocessor 10 is FIG. A to 3D and at least one of the instruction formats shown in FIGS. 4A to 4D are used. What Oh The operation code field 22 Included in each instruction format, And in each instruction format Located in the same place. By encoding the opcode field 22, The rest of the instruction Which instruction format is used for interpreting the part is determined. Opcode field Is assigned to the instruction format 20; Opcode feel A second aspect of the code form is assigned to the instruction form 30; . . And so on You.   As used herein, the term "instruction field" is grouped and Refers to one or more bits in an instruction to which certain interpretations are assigned as a group. An example For example, the opcode field 22 contains bits interpreted as the opcode of the instruction. Group. In addition, the first and second register fields 24 and 26 Register for identifying a storage location in processor core 16 for storing the instruction operand identification Consists of children. In addition, the term "immediate field" has immediate data in it. Points to the instruction field to be encoded. Immediate data is obtained by giving an operand to an instruction. Conceivable. The immediate data is the offset to be added to the register value. May be used. By this addition, an address is generated. In addition, immediate data May be used as an offset for a branch instruction.   5A-6F illustrate a compression scheme used in a particular embodiment of the microprocessor 10. It is the table which raised the example of the order set. In certain embodiments, the processor core 16 includes Adopt MIPS RISC architecture. Therefore, the instructions in these tables The instruction mnemonic listed in column 100 is the MIPS RISC Architecture [Or Kane and Heinrich, "M IPS RISC Architecture, Appendix D, Upper Sad, NJ Le River, Prentice Hall PTR (Professional Technical Reference) Edition, 1992 (hereby incorporated by reference). Corresponds to the instruction mnemonic defined for the assembler. However, the following exceptions There is. That is, CMPI, MOVEI, MOVE, NEG, N0T. And extensions It is. These instructions are the following MIPS instructions (RS and RT are 16 bit RS and RT).  Further, some symbols are used in the attached instruction table. Operand column 102 In, symbols rs, rt, xs and rd were used. rs and xs are the first 2 register field 26 (or second register field 76), rt and xt are stored in the first register field 24 (or the first register field). Field 74). Similarly, rd is the third register field 32 (or Third register field 82). As described in the above embodiment, the first Register field 24, second register field 26 and third register Each of the data fields 32 is composed of 3 bits. In Table 1 below, Field code (in binary) in the MIPS RISC architecture for (Registered) to the register in the above). Other projections will be shown later Intention to. The names assigned according to MIPS assembler conventions are also listed in Table 1. You.   Table 1: Register assignment As shown in Table 1, Register field 24, Compressed instruction with 26 and 32 For Up to 16 registers can be used. Each register field Is 3 bits, For a given opcode, Only 8 registers are used Wear. Instructions that can access all 16 registers include: In the instruction table below Two operation codes are assigned. In this regard, Register selection is It is a function of both the register field and the opcode field 22. cash register Stafield, It can be encoded using relatively few bits, Big Regis Provides a selection instruction that can access the data group, It is convenient.   In the operand field 102, Immediate field 32, 42, For 64 and 72 Symbol is also shown. The symbol "imm" That an immediate field is included Show. If "s" precedes "imm", Its immediate field is Signed Yes, The expansion of the immediate field to the expansion instruction is So This is performed by sign-extending the immediate field of "S" before "imm" Is missing, Its immediate field is Unsigned, Of its immediate field To stretch, With zero extension of its immediate field. In one embodiment, Low Decompression of immediate field for load / store instruction 1 bit per halfword, Wa 2-bit right rotation per mode, And following this, 1 for half a word bit, It consists of performing a 2-bit left shift on the immediate bits per word. Effect Effectively, Give a 7 bit immediate field for the word, For half a word (In the case of a 16-bit instruction format) A 6-bit immediate field is provided. MIPS In the RISC architecture, Address of data corresponding to load / store instruction Is Stipulates that each instruction included in the compressed instruction set example be lined up . Therefore, Least significant bit (of halfword) and 2nd least significant (of word) The eyes bit Since it is set to zero, To specify these bits, compression It is not necessary to use the bits of the immediate field that has been set. Finally, "Imm" A number indicating the number of bits included in the immediate field is appended.   The opcode field 22 and the function field 28 are also expanded. Specifically Is The operation code field 22 and the function field 28 5A to 6F The instructions in the MIPS RISC architecture are identified according to the table shown in You. The opcode field and function field of the decompression instruction are MIPS RI Sign according to SC architecture definition Be transformed into   5A and 5B Tables 110 and 112 are shown respectively. Table 110 and 112 is Using the instruction set 20 shown in FIG. 3A, Life from compressed instruction set examples Post the decree. In addition to the instruction column 100 and the operand column 102, Opcode column 10 6 and a function column 104 are also included. The operation code column 106 and the function column 104 Including hexadecimal numbers, The opcode field 22 and the function field 28 Corresponding.   In Table 110, In the function column 104, there are several instructions having the code form "imm5". Or included. The code form “imm5” is For load / store instructions in Table 110 Appear, For these instructions, Function field 28 as immediate field Indicates that it is used. For other instructions, The function field 28 compression Used in association with opcode field 22 to identify instructions in the instruction set. Used.   further, In Table 110, The operation code "1d" Labeled "Special" Have been. The special order is There is a specific interpretation in function field 28. In particular, Machine If the most significant bit of the function field is 0, The instruction is defined as:         ADDIU rt, rs, simm4 However, The operand “simm4” is From the remaining bits of the function field 28 It is formed. Function field 28 If the most significant bit is 1, Except in two special cases, The instructions are defined as follows: Be justified:       ADDIU xt, xs, simm4 If the second register field 26 is coded to 0, The instruction is Become:       MOVEI xt, imm4 Again, The operand imm4 is Form from remaining bits of function field 28 Is done. Finally, The second register field 26 5 (hexadecimal) and encoding If so, The instruction is defined as:       ADDIU sp, simm9 However, The operand simm9 is The remaining bits of the function field 28 and the One register field 24 is formed. Lower 2 of operand simm9 The bits are Set to 0.   In addition, The destinations of the instructions SLT and SLTU shown in Table 110 are: According to one embodiment, This is a t8 register (register # 24).   In Table 112, For some instructions, Operands "imm3" and “Imm6” is shown. The operand imm3 is Second register feel Code 26, imm6 is The second register field 26 and the first register It is encoded into both the stafield 24.   further, Table 112 Includes a jump register (JR) instruction. This instruction: Oh The second register figure as Peland Field 26. But, In the example, MIPS RISC Architect To specify one of the registers in the structure for the JR instruction, First register Field RT1 of field 24 is associated with second register field 26 To use Be careful.   In FIG. 5C, Table 114 shows Command column 100, Operand field 102, Opeco And a function column 104. In Table 114, Instruction format 3 shown in FIG. 3B Using 0, The instructions from the instruction set examples are listed. Some instructions in Table 114 are: C It has a destination register coded like a code (i.e. Programmer Is In addition to using different opcodes, Destination register cannot be selected No). For these instructions, Function field of third register field 32 Coupled to C The function field code shown in the function column 104 is stored. Further To The instruction having an immediate operand in the function column 104 and the operand column 102 is 1 There are two. This instruction: Second register field in relation to function field 34 Using 26, Encode the corresponding immediate field used in this instruction.   5D and 5E illustrate Using instruction formats 40 and 50, respectively. Compression instruction Tables 116 and 118 show the instructions from the packet. In Table 118, Extension instruction It is shown. However, This extension instruction: The instruction has an instruction format 60, 70 And that it is a 32-bit compressed instruction that uses one of I have.   6A and 6B, Tables 120 and 122 are shown. Tables 120 and 122 Is Encoded using the instruction format 70 shown in FIG. 4B, From the compressed instruction set Indicates an instruction.   Table 120 is An instruction column 100 and an operand column 102; Further Opeco Field 108 is included. The operation code column 108 If the opcode symbol shown in this column is Except for corresponding to opcode field 78, Same as the operation code column 106 It is.   Table 122 shows that An RT column 109 corresponding to the first register field 74 is included. The sign of the RT field of the instruction shown in Table 122 is: Which instruction is selected Is shown. The instructions shown in Table 122 are: The code in the operation code field 78 is Have. In one embodiment, This code is 00 (hexadecimal).   FIG. 6C, 6D, 6E and 6F are Encoded by the instruction format 80, compression Table 124, which shows the instructions from the example instruction set, 126, 128 and 130. Table 124, 126 and 130 are Function column corresponding to the sign of the function field 84 107. Table 128 shows Includes the RS and RT columns 105 described in more detail below. No.   The operand field 102 of the table 124 is Include immediate operand for some instructions . The operand “imm5” is Encoded into second register field 76 . The operand imm15 is A first register field 74, Second register Field 76 and third register field 8 2 is encoded.   The instructions listed in Table 128 are: RS, As shown in the RT column 105, Second Regis Data field 76. One instruction is First register Field 74 is identified through a second register field 76. RS , Instructions where the RT column 105 contains an asterisk for the RT portion: Second register Identified via field 76. Also, RS, RT column 105 is asterisk Instructions that do not include A second register associated with the first register field 74 Identified by field 76. Identification via first register field 74 Instructions that are not Use first register field 74 to encode operands be able to. The instructions listed in Tables 128 and 130 are: COP bit 86 is set Instructions, The instructions listed in Tables 124 and 126 are: COP0 bit 86 is cleared.   Some of the instructions in Table 128 are: Includes operand imm6. Operand "imm6 " Encoded into function field 84. further, Second register feel C is 1x (hexadecimal, x indicates that this bit is an arbitrary value) If it is Using the function field 84, The instructions shown in Table 130 are shown.   FIG. First addressing window according to one embodiment of microprocessor 10 Shows a dove 150 and a second addressing window 152. Addressing Window 15 The center of 0 is Base register (Reg on the left side of the addressing window 150 ). Depending on the value of the base register, Identify addresses in main memory You. The addressing window 150 is Uncompressed according to one embodiment of uncompressed instruction set Base register value accessible by load / store instructions in the reduced instruction set Represents an address range centered at. The uncompressed instruction set is Load / store instruction , Between the value stored in the base register and the 16-bit signed immediate field Specifies that the address of the memory operand is formed by the sum. Such a real In the example, The address range is 32767 larger than base register Has a lower bound 32768 less than the limit and base registers. In some embodiments , A range larger or smaller than this may be included. As used here, "Be The term "register" Load / store order when storing base address The register specified by the This base address has a signed immediate Field and add Address of the memory operand operated by the instruction To form   For example, as shown in Table 110, Included in the 16-bit part of the compressed instruction set example Load / store instructions Includes a 5-bit immediate field. This field is , For a word-length memory operand, After being rotated two bits to the right, 2 to the left Is shifted 7 bits (immediate value formed using 5 bits according to one embodiment Immediate value of the field maximum) Form a field. next, The 7-bit immediate field is Zero extended, Form a positive offset from the base register in the corresponding decompression instruction. did So, Subrange 154 It can be used for access by compressed instructions. Addressi In the window 150, Subrange 154 is 12 from the base register It has an upper limit of 7 and a lower limit of the base register. However, Subrange The size of 154 is It may vary from embodiment to embodiment.   Subrange 154 is Works well for many load / store instructions, Different address ranges may be used with the global pointer register. Global pointer The registers are Software to specify the memory area used to store global variables Is a register allocated according to the convention. Global variables are Any rule in the program This variable can be used for access from the routine. On the contrary, Local variables are one Generally, Only specific routines or routines can be accessed. MIPS instruction In the set, For example, if the register $ 28 is As a global pointer register Often used.   Therefore, The memory area centered on the global pointer register is Table of global variables Can be seen as Each global variable is An offset is assigned inside the table You. This offset is Add to global pointer register to identify global variable Corresponding to the immediate field value to be processed. For example, for the embodiment shown in FIG. A As shown on the left side of the dressing windows 150 and 152, Global variables To A table of 64 Kbytes may be allocated.   The compressed immediate field is The addressing window 150 will be described. When stretched as The global variable table is Two that can access uncompressed instructions Between the sub-ranges 156 and 158 of Partition accessible to compression instructions ( (Corresponding to sub-range 154). As aforementioned, Microprocessor 10 Is Some routines are encoded with uncompressed instructions, Other routines sign with compression instruction It may be possible to use a computerized program. Wide in certain programs Assigning an area variable Of the uncompressed global variable in the addressing window 150 The division of sub-ranges 156 and 158 adds complexity. Global variables are For example, After assigning to Brange 158, In subrange 156 (for uncompressed instructions) And the assignment of global variables must continue. In other words, Uncompressed instructions For global variables that can be accessed, It is necessary to bypass the subrange 154.   The microprocessor 10 Load using Global Pointer (GP) register / Decompression of the compressed immediate field for store instructions can be used, this By extension An addressing window 152 is provided. Addressing wi Window 152, Subrange 160 and uncompressed instructions accessible to compressed instructions Include a subrange 162 accessible to Subrange 162 is Adjacent note Because it is re-locked, It is convenient. Access with uncompressed instructions While assigning a global variable for to subrange 162 Access by compression instruction Global variables for access can be assigned to subrange 160. Essentially , Subrange 160 and subrange 162 are Compression and non-compression instructions Create different tables of global variables for each access.   As aforementioned, The addressing window 152 Expand compressed immediate field It is brought by doing. However, Most significant bit of the expanded immediate field Is set. if, The compressed immediate field is encoded with binary zeros If The expanded immediate field is 8000 (hexadecimal). Immediate expansion Fields Interpreted as a signed field for load / store instructions So The value of 8000 is The most negative number available in the stretch immediate field It is. If the compressed immediate field is encoded to a non-zero value, The compression immediately The value field is It is stretched to a negative number forming subrange 160. Fig. 7 As shown in the example, Subrange 160 is According to the addressing window 152 Form the lower limit of the address range represented by   As used previously, The term memory operand is Some memory inside main memory Refers to the value stored in the memory location. Memory operand in microprocessor 10 To transfer to the register of A load instruction will be used. vice versa, The value stored in the register is To transfer to a storage location, A store instruction is used. The memory operand is varied Size (ie, Bytes). In one embodiment, Available in three different sizes it can. That is, Part-Time Job, Half word and word. Half words start with 2 bytes Become Words consist of 4 bytes. In some embodiments, Other size memory operations Land is also conceivable.   In FIG. In the instruction expander 12 for expanding the immediate field of the load / store instruction FIG. 3 is a block diagram illustrating an example of hardware of a unit. In addition, Multiple load / store instructions Sometimes to stretch A plurality of hardware examples shown in FIG. 8 may be used. In FIG. The hardware example shown is It is described with respect to microprocessor 10B. But, Similar hardware may be employed inside the microprocessor 10A. No. This hardware example is Immediate field expander 170 and register decoder 172.   When an instruction is transferred from the instruction cache 14B to the instruction decompressor 12B, Road/ Part of the instruction consisting of the compressed immediate field for the store instruction is Compressed immediate bus 1 It is conveyed to immediate field expander 170 by 74. 3A to 6F Instruction set example, The compressed immediate field is Function field 28 (FIG. 3) A). further, Base register for compressed load / store instructions The fields are Sent on base register bus 176. The life shown in FIGS. 3A-6F For example, The base register field is Second register field 26.   The register decoder 172 is Register specified on base register bus 176 Is decrypted. The base register is For the global pointer register, Register decoder 172 is Activate GP signal on GP line 178 to immediate field expander 170 I do. Otherwise, The register decoder 172 is Deactivate the GP signal.   The immediate field expander 170 Two compressed immediate fields according to GP signal Stretch in one of the ways. If the GP signal is inactive, Immediate field expansion The vessel 170 Clear the most significant bit of the decompressed immediate field. vice versa, GP signal Is active The immediate field expander 170 Most significant bit of immediate field Is set. Therefore, Other than the global pointer register as the base register If registers are used, A positive offset is generated. Also, Basle If the global pointer register is used as a register, Raw negative offset Is done. The immediate field expander 170 Decompress immediate field by expanding Send it to the bus 180.   In FIG. Generated for load / store instructions according to one embodiment of the compressed instruction set example 9 illustrates an expanded decompressed immediate field. Wide-area pointer register as base register The immediate field of the load / store instruction that does not use the Reference number 182 Stretched as indicated by. Part-Time Job, Halfword and word expansion Zhang, Each bit position of the decompressed immediate field (or offset) is represented by a number or L In table do it, Shown individually. The bits from the compressed immediate field are Stretched feel Each bit position in the code is indicated by a number. Bottom of compressed immediate field The bits are Represented by the number 0, The most significant bit of the compressed immediate field is By 4 To represent. The letter L is Used to indicate a bit position set to binary zero.   For load / store instructions that use the global pointer register as the base register Bytes to do, Reference number 1 to half word and decompressed immediate field corresponding to word Indicated by 84. Similar to the decompression field indicated by reference numeral 182, Reference number The decompression field, indicated by number 184, One video from the compressed immediate field Indicates the number in the bit position filled with Using the letter L, Set to binary 0 Indicates the bit position. further, The most significant bit of each decompressed offset is Binary It is set to the number 1 (indicated by the letter H).   next, The instruction decompressor 12 performs instruction decompression according to the embodiment shown in FIG. FIG. 10 is a flowchart showing the operations performed. The steps shown in FIG. Although shown in qualitative order, The various steps may be performed in parallel.   The instruction expander 12 Determine whether the received instruction is a load / store instruction ( Decision block 190). If the instruction is not a load / store instruction, (FIG. 3A- According to the projection between the compression instruction and the corresponding decompression instruction (as shown in 6F) That The instruction is extended (step 192). If the instruction is a load / store instruction , Specified by that instruction The base register to be checked is checked (decision block 196). Base register is global If it is an inter register, The immediate field is represented by reference numeral 184 in FIG. It is expanded (step 194). Also, The base register is a global pointer register If not, The immediate field is decompressed as indicated by reference numeral 182 in FIG. Step 192).   Expand load / store offset for global pointer register in different ways In addition to stretching, The microprocessor 10 Which (ie, Compressed or non A compression mode indicating whether a (compression) type instruction is being executed is also enabled. FIG. 1 is FIG. 3 is a block diagram showing a part of an embodiment of the instruction decompressor 12. Part shown Is A compression module for each routine executed by the microprocessor 10. Judge the code. The part shown is Suitable for microprocessor 10B, same Such a part can be used in the microprocessor 10A. FIG. FIG.   When an instruction is fetched by the processor core 16, The order is Instruction bus 2 02 is received by the mode detector 200. The mode detector 200 Jean Detect the fetch time of the PUNLINK (JAL) instruction, Replacement bit 94 inspect. If the exchange bit 94 is set, Purpose add of JAL instruction The routine in the less Consists of compression instructions. Therefore, The pressure of its purpose routine The compression mode is “compression”. Also, Replacement bit 94 cleared Sometimes it is. in this case, The compression mode of the target routine is "uncompressed" It is.   The JAL instruction is In addition to specifying the compression mode for the target routine, JAL instruction Than, The instruction address following the JAL instruction is the MIPS RISC architecture The data is stored in register # 31. later, This register Objective routine Used with the JR instruction to return from. In this example, The compression mode is address Is stored as part of The compression mode of the calling routine is Of JR instruction Restored at runtime. The routine encoded with the compression instruction is Encode with uncompressed instructions Can be mixed with routines It is convenient. The new compression mode is Compression module The data is sent to the processor core 16 via the code line 206. In addition, As an alternative embodiment, The mode detector 200 A part of the processor core 16 instead of the instruction expander 12 May be included.   The embodiment of the mode detector 200 shown in FIG. Compression enable (enable) A storage location 204 is included for the user. If compression is enabled, Compression The enable bit is set. The instruction is fetched in compressed mode, And compression is good Bull, The instruction expander 12 Decompress that instruction. Enable bit clear If so, The microprocessor 10 Instruction compression is prohibited. Instructional If stretching is prohibited, Instruction expander 12 is bypassed. further, Mode detection The vessel 200 If instruction compression is prohibited, The compression mode is uncompressed Is shown.   As used previously, The routine is Execution by the microprocessor 10 Is a set of encoded instructions ordered in order. This routine Compression instruction Or encoded with any of the uncompressed instructions, And subroutine call Separated by command and return command. Subroutine call that serves as a break The instruction is Not included in that routine. Instead, The subroutine call instruction is Depending on the destination address included in the subroutine call instruction, Of that routine Show the beginning. The first instruction in the routine is It is stored at the destination address. Further To Save the address of the instruction inside the routine including the subroutine call instruction hand, Enables execution of a return instruction to return to the calling routine. In the example of the compressed instruction set shown in FIGS. The JAL instruction is subroutine Can serve as a call instruction. Or, jalr instruction subroutine Can serve as a call instruction.   The routine ends with a return instruction. With this return instruction, The following instruction The line is Return to the address saved when the corresponding subroutine call instruction was executed . In other words, The destination address of the return instruction is This is the saved address. Pressure Speaking of a reduced instruction set example, The jr instruction is Serve as return instruction be able to. In general, The destination address is The execution of the instruction corresponding to the destination address This is the address where instruction fetching starts at line time.   next, In FIG. One embodiment of register field decompression FIG. Consider another embodiment of register field decompression. An instruction The compression register field corresponding to Compression register field bus 210 Sent. The register expansion block 212 Receive compression register field . further, At least part of the compression register field is Extension register feel Included in the This decompression register field is Extension register field bus 2 14. This allows The decompression register field is Compression register The value generated by the register decompression block 212 to at least part of the field. By connecting to It is formed.   In one embodiment, The entire compression register field is the expansion register field Linked to further, The rest of the decompression register field is What is the case Register set (for example, xs vs. rs and xt vs.. rt) Access. The set selection signal is an xs (xt) register set or The rs (rt) register set indicates which set to use and a set select bus 216 Received for each register above. If this set select signal is active, x s (xt) is selected. Otherwise, rs (rt) is selected. set The selection signal is a command that has been expanded according to the example of the compressed instruction set shown in FIGS. It may be active or inactive based on the opcode of the order. For example, the table The register projection between the compressed instruction and the uncompressed instruction shown in FIG. 1 may be used. That's it Such as In this case, the register expander 212 can use the following logic.       DR [4: 3] = {RH, (RH & CR [2] |! CR [2: 0])} Here, DR indicates a decompression register field, and CR indicates a compression register field. And RH represents the corresponding set select signal value.   Considering some other register projections, register projections (register allocation) Are shown in Tables 2-4 below, along with the corresponding Verilog formula. It should be noted that in various embodiments of the microprocessor 10, May be used. Table 2: Example of second register allocation Table 3: Example of third register allocationTable 4: Fourth register allocation example   As shown by the names specified by the assembler in Tables 1-4, the conventions of software Thus, various registers are assigned to various functions. For example, MIPS In the assembler, The following meanings have been assigned to the registers: Table 5: Software conventions for register names   register Software name Use   $ 0 None Hardly fixed to zero   $ 1 $ at Used by assembler   $ 2 ... $ 3 v0-v1 Function result or status                                            Quick link   $ 4 ... $ 7 a0-a3 Subroutine arguments   $ 8 ... $ 15 t0-t9 Temporary register, sub                                            Not saved between routines   $ 24 ... $ 25   $ 16 ... $ 23, $ 30 s0-s8 Save between subroutines                                            Be done   $ 26 ... $ 27 k0-k1 Operating system                                            Reserved in system   $ 28 gp global pointer   $ 29 sp stack pointer   $ 31 ra return address   For routines coded with compression instructions, temporary registers and saved It is desirable to provide access to both of the registers. In addition, existing software Requires access to v0-v1, a0-a3, gp, sp and ra to work with It is. According to the register projection shown earlier, Want to ensure that their quality and the register expander 212 occupies a fairly small number of gates. A balance between demands. Useful registers from MIPS register set While selecting a set, keep the number of gates inside the register expander 212 still small. It is convenient because it has.   Next, FIG. 13 shows an implementation of a computer system including the microprocessor 10. Example 220 is shown. Many other computer systems using microprocessor 10 You can think of a system. In the computer system 220, the microprocessor The processor 10 includes a semiconductor with many I / O interfaces 222A to 222N. It is incorporated on a substrate 224. The I / O interface is located outside the board 224 Interface to the I / O device. Example of I / O interface 222A Is a universal asynchronous receiver (UART). / transmitter).   Microprocessor 10 is coupled to I / O interface 222A, Communicate with them. Further, the microprocessor 10 has an external interface. The interface logic unit 226 may further be connected to the logic unit 226. Dynamic random access memory (DRAM) module 22 or more 8 interface. The DRAM module 228 stores the compression instruction and And / or store compressed, uncompressed, or uncompressed instructions. Programs represented by both of these symbols Also stores data for use in.   In this description, the activities of various signals may be referred to. The signal A signal is "active" if it has a value indicating a particular state. Conversely, If the signal has a value indicating a lack of a particular state, the signal is "inactive". is there. A signal is defined as active when it has a logic 0 value and has a logic 1 value. May be defined in reverse.   Although a specific example of the compressed instruction set has been shown and described, the compressed instruction set May make many variations, extensions and modifications. These transformations, extensions and fixes Positive is considered.   The following list of veralogs is a description of a logical example of instruction expander 12. This logic Many different embodiments are possible, but the list of Veralog given here is This is a suitable example.   With the above disclosure, instructions from both the compressed and uncompressed instruction sets A microprocessor that performs the above has been described. This microprocessor uses a compression The instruction can be expanded into a decompression instruction, and the compression instruction can be directly decoded. Compression instruction Routines coded using sets are the corresponding routines coded with uncompressed instructions. This is convenient because it occupies less memory than the routine. Such a luch Frees the memory previously occupied by the The data operated by these routines becomes available. Above disclosure Once fully understood, many variations and modifications will become apparent to those skilled in the art. Will be. The claims are intended to cover all such changes and modifications. Should be interpreted.

───────────────────────────────────────────────────── フロントページの続き (31)優先権主張番号 08/661,003 (32)優先日 平成8年6月10日(1996.6.10) (33)優先権主張国 米国(US) (31)優先権主張番号 08/661,027 (32)優先日 平成8年6月10日(1996.6.10) (33)優先権主張国 米国(US) (81)指定国 EP(AT,BE,CH,DE, DK,ES,FI,FR,GB,GR,IE,IT,L U,MC,NL,PT,SE),AL,AM,AT,A U,BA,BB,BG,CA,CH,CN,CU,CZ ,DE,DK,EE,ES,FI,GB,GE,HU, IL,IS,JP,KE,KG,KP,KR,KZ,L C,LK,LR,LS,LT,LU,LV,MD,MG ,MK,MN,MW,MX,NO,NZ,PL,PT, RO,RU,SD,SE,SG,SI,SK,TJ,T M,TR,TT,UA,UG,UZ,VN 【要約の続き】 に使用される即値フィールドの伸張は、混合された圧縮 /非圧縮命令の実行のために最適化される。即値フィー ルドは非圧縮即値フィールドへと伸張され、そのために 最上位ビットがセットされる。────────────────────────────────────────────────── ─── Continuation of front page    (31) Priority claim number 08 / 661,003 (32) Priority date June 10, 1996 (June 6, 1996) (33) Priority country United States (US) (31) Priority claim number 08 / 661,027 (32) Priority date June 10, 1996 (June 6, 1996) (33) Priority country United States (US) (81) Designated countries EP (AT, BE, CH, DE, DK, ES, FI, FR, GB, GR, IE, IT, L U, MC, NL, PT, SE), AL, AM, AT, A U, BA, BB, BG, CA, CH, CN, CU, CZ , DE, DK, EE, ES, FI, GB, GE, HU, IL, IS, JP, KE, KG, KP, KR, KZ, L C, LK, LR, LS, LT, LU, LV, MD, MG , MK, MN, MW, MX, NO, NZ, PL, PT, RO, RU, SD, SE, SG, SI, SK, TJ, T M, TR, TT, UA, UG, UZ, VN [Continuation of summary] The immediate field decompression used for / Optimized for execution of uncompressed instructions. Immediate fee Field is decompressed into an uncompressed immediate field, The most significant bit is set.

Claims (1)

【特許請求の範囲】 (1)可変長圧縮命令セットからの命令を実行する装置であって、 可変長圧縮命令セットの要素である命令を受信するように結合された命令伸張 器を備え、 ここで前記命令伸張器は、特定の命令のオペコードフィールドを調べるよう に構成され、且つ前記命令伸張器は、前記オペコードフィールドが拡張オペコー ドとして符号化されている場合には、前記特定の命令が第1の固定長を有する拡 張命令であると判断するように構成され、及び、前記命令伸張器は、前記オペコ ードフィールドが前記拡張オペコードとは異なる第2のオペコードとして符号化 されている場合には、前記特定の命令が非拡張命令であると判断するように構成 されされている、 可変長圧縮命令セットからの命令を実行する装置。 (2)前記第1の固定長が、第1のバイト数であり、該第1のバイト数は前記 第2の固定長に相当する第2のバイト数よりも大きい、請求項1記載の装置。 (3)前記第1のバイト数が、第2のバイト数より整数因子だけ大きい請求項 2記載の装置。 (4)前記整数因子が2である請求項3記載の装置。 (5)前記拡張命令が、拡張命令セット内の特定の拡張命令を定義する第2の オペコードフィールドを含む請求項1記載の装置。 (6)前記命令伸張器が、前記特定の拡張命令の伸張方法を決定するために前 記第2のオペコードフィールドを調べるように構成された請求項5記載の装置。 (7)伸張命令を実行するように構成されたプロセッサコアをさらに備えた請 求項1記載の装置。 (8)各圧縮命令が、1つの伸張命令に対応する請求項7記載の装置。 (9)圧縮命令を伸張命令へと伸張する方法であって、 圧縮命令のオペコードフィールドが拡張オペコードである場合には、前記圧縮 命令が第1の固定長を有する拡張命令であると判断するステップ; 前記圧縮命令の前記オペコードフィールドが前記拡張オペコードとは異なる第 2のオペコードである場合には、前記圧縮命令が第2の固定長を有する非拡張命 令であると判断するステップ;および 前記圧縮命令を伸張命令へと伸張する伸張ステップであて、ここで前記圧縮命 令が前記拡張命令である場合には、前記圧縮命令に含まれるバイトの数が前記第 1の固定長によって決定され、且つ前記圧縮命令が前記非拡張命令である場合に は、前記のバイトの数が前記第2の固定長によって決定される、伸張ステップ; を含む、圧縮命令を伸張命令へと伸張する方法。 (10)前記第1の固定長が、前記第2の固定長より大きい請求項9記載の方 法。 (11)前記第1の固定長が、第2の固定長より整数の バイト数だけ大きい請求項10記載の方法。 (12)前記整数が2である請求項11記載の方法。 (13)前記第2の固定長により決定される量で圧縮命令をフェッチするステ ップをさらに含む請求項11記載の方法。 (14)前記非拡張命令が検出された場合には、前記拡張オペコードが検出さ れた第1の前記量および前記第1の前記量に直ちに続く第2の前記量から前記非 拡張命令を形成する請求項13記載の方法。 (15)前記拡張命令が、前記拡張命令を特定の拡張命令として識別する第2 のオペコードフィールドを含む請求項9記載の方法。 (16)前記伸張ステップが、前記の特定の拡張命令に対応する拡張命令形式 を識別するステップを含む請求項15記載の方法。 (17)前記伸張ステップが、前記拡張命令形式における複数の命令フィール ドに従って前記の特定の拡張命令内部のビットを解釈するステップをさらに含む 請求項16記載の方法。 (18)前記伸張ステップが、前記オペコードフィールドの符号形態から前記 非拡張命令に対応する非拡張命令形式を特定するステップを含む請求項9記載の 方法。 (19)前記伸張ステップが、前記非拡張命令形式における第2の複数の命令 フィールドに従って前記非拡張命令からのビットを解釈するステップをさらに含 む請求項18 記載の方法。 (20)圧縮命令のオペコードフィールドが拡張オペコードである場合には、 前記圧縮命令が第1の固定長を有する拡張命令であると判断する第1の判断手段 ; 前記圧縮命令の前記オペコードフィールドが前記拡張オペコードとは異なる第 2のオペコードである場合には、前記圧縮命令が第2の固定長を有する非拡張命 令であると判断する第2の判断手段;および 前記圧縮命令を伸張命令へと伸張する伸張手段であって、ここで、前記圧縮命 令が前記拡張命令である場合には、前記圧縮命令に含まれるバイトの数が前記第 1の固定長によって決定され、且つ前記圧縮命令が前記非拡張命令である場合に は、前記のバイトの数が前記第2の固定長によって決定される、伸張手段; を備えた圧縮命令を伸張命令へと伸張する装置。 (21)マイクロプロセッサにおいて第1のルーチンおよび第2のルーチンを 含むプログラムを実行する方法であって、 前記第1のルーチン内のサブルーチンコール命令を実行するステップであって 、ここで前記第2のルーチンが前記第1のルーチンに含まれる前記サブルーチン コール命令の目的アドレスを介して実行されるべきことを前記サブルーチンコー ル命令が示す、ステップ;および 前記サブルーチンコール命令における表示を調べるステップであって、ここで 前記表示が第1の状態にある場合に は、前記第2のルーチンが圧縮命令を用いて符号化されていると判断し、および 前記表示が前記第1の状態とは異なる第2の状態にある場合には、前記第2のル ーチンが非圧縮命令を用いて符号化されていると判断する、ステップ; を含む、マイクロプロセッサにおいて第1のルーチンおよび第2のルーチンを 含むプログラムを実行する方法。 (22)前記表示が1ビットを含み、且つ前記第1の状態が、前記1ビットが セットされていることからなる請求項21記載の方法。 (23)前記第2の状態が、前記1ビットがクリアされていることからなる請 求項22記載の方法。 (24)前記表示を前記マイクロプロセッサ内部のプログラムカウンタに格納 するステップをさらに含む請求項21記載の方法。 (25)前記表示が、前記第2のルーチンに対する圧縮モードとして機能する 請求項21記載の方法。 (26)前記圧縮モードが圧縮を示す場合には、前記第2のルーチンからの命 令を伸張するステップをさらに含む請求項25記載の方法。 (27)前記第2のルーチンの完了時に第2の目的アドレスを含むリターン命 令を実行するステップをさらに含む請求項21記載の方法。 (28)前記第2の目的アドレスにおける第2のビットを調べるステップであ って、ここで前記第2のビットが第1の状態にある場合には、前記第1のルーチ ンが圧縮命令 を用いて符号化されていると判断し、および前記第2のビットが前記第1の状態 とは異なる第2の状態にある場合には、前記第1のルーチンが非圧縮命令を用い て符号化されていると判断するステップをさらに含む請求項27記載の方法。 (29)マイクロプロセッサにおいて第1のルーチンおよび第2のルーチンを 含むプログラムを実行する装置であって、 前記第1のルーチン内のサブルーチンコール命令を実行する手段であって、こ こで前記第2のルーチンが前記第1のルーチンに含まれる前記サブルーチンコー ル命令の目的アドレスを介して実行されるべきことを前記サブルーチンコール命 令が示す、手段;および 前記サブルーチンコール命令における表示を調べる手段であって、前記表示が 第1の状態にある場合には、前記第2のルーチンが圧縮命令を用いて符号化され ていると判断し、および前記表示が前記第1の状態とは異なる第2の状態にある 場合には、前記第2のルーチンが非圧縮命令を用いて符号化されていると判断す る手段; を含む、マイクロプロセッサにおいて第1のルーチンおよび第2のルーチンを 含むプログラムを実行する装置。 (30)マイクロプロセッサにおいて圧縮命令および非圧縮命令をフェッチす る装置であって、 圧縮イネーブル指示子を記憶するように構成された記憶装置; 前記記憶装置に結合され、目的ルーチンを指定するサブルーチンコール命令の フェッチ時に前記目的ルーチンの圧縮モードを検出するように構成され、さらに 前記圧縮モードをプロセッサコアに伝えるように構成されたモード検出器;およ び 前記モード検出器に結合され、前記圧縮モードが圧縮を示す場合は圧縮命令を フェッチするように構成され、さらに前記圧縮モードが非圧縮を示す場合は非圧 縮命令をフェッチするように構成されたプロセッサコア; を備えた、圧縮命令および非圧縮命令をフェッチする装置。 (31)前記サブルーチンコール命令の特定のビットにより、前記圧縮モード を識別する請求項30記載の装置。 (32)前記プロセッサコアがPCレジスタを含み、且つ前記プロセッサコア が前記圧縮モードを前記PCレジスタ内部に格納するように構成された請求項3 1記載の装置。 (33)前記圧縮モードが、前記PCレジスタ内部に格納されたフェッチアド レスの最下位ビットとして記憶される請求項32記載の装置。 (34)前記圧縮モードが圧縮を示す場合には、前記プロセッサコアは、前記 フェッチアドレスを第1の固定量だけ増加させ、前記圧縮モードが非圧縮を示す 場合には、前記プロセッサコアは、前記フェッチアドレスを第2の固定量だけ増 加させる請求項33記載の装置。 (35)可変長圧縮命令セットの要素である圧縮命令を 受信するように結合され、且つ受信した各圧縮命令を対応する伸張命令へと伸張 するように構成された命令伸張器;および 伸張命令を受信するように結合され、且つ前記伸張命令を実行するように構成 されたプロセッサコア; を備えたマイクロプロセッサ。 (36)前記命令伸張器と前記プロセッサコアとの間に結合され、且つ前記の 対応する伸張命令を記憶するように構成された命令キャッシュをさらに備えた請 求項35記載の装置。 (37)前記命令伸張器に結合され、且つ前記圧縮命令を記憶するように構成 された命令キャッシュをさらに備えた請求項35記載の装置。 (38)前記可変長圧縮命令セットが、第1の固定長を有する第1の複数の命 令および第2の固定長を有する第2の複数の命令を含む請求項35記載の装置。 (39)前記第1の固定長が、前記第2の固定長より長い請求項38記載の装 置。 (40)前記第1の固定長が、前記第2の固定長より整数因子だけ長い請求項 39記載の装置。 (41)前記整数因子が2である請求項40記載の装置。 (42)前記プロセッサコアが、前記第2の固定長に従って命令をフェッチす る請求項40記載の装置。 (43)前記命令伸張器が、前記第1の複数の命令の1つのフェッチを検出す るように構成された請求項42記載 の装置。 (44)前記命令伸張器が、前記第1の複数の命令の前記1つの検出に応じて NOPを伝え、且つ前記第1の複数の命令の前記1つの第2の部分を前記プロセ ッサコアのフェッチ動作を介して待つように構成され、これにより前記複数の命 令の前記1つを分割して受信する請求項43記載の装置。 (45)前記プロセッサコアが、非圧縮命令を実行するようにさらに構成され た請求項35記載の装置。 (46)前記非圧縮命令が、前記命令伸張器を迂回する請求項45記載の装置 。 (47)可変長圧縮命令セットの要素である圧縮命令をフェッチするステップ ; 命令伸張器において前記圧縮命令を伸張し、もって対応する伸張命令を形成す るステップ;および プロセッサコアにおいて前記伸張命令を実行するステップ; を含む、命令符号を実行する方法。 (48)各圧縮命令が、1つの伸張命令に対応する請求項47記載の方法。 (49)前記可変長圧縮命令セットが、第1の固定長を有する命令および第2 の固定長を有する別の命令を含む請求項48記載の方法。 (50)前記第1の固定長が、前記第2の固定長より長い請求項49記載の方 法。 (51)非圧縮命令をフェッチするステップをさらに含む請求項47記載の方 法。 (52)前記非圧縮命令を実行するステップをさらに含む請求項51記載の方 法。 (53)前記非圧縮命令がフェッチされたときには、前記命令伸張器を迂回す るステップをさらに含む請求項52記載の方法。 (54)可変長圧縮命令セットの要素である圧縮命令をフェッチするフェッチ 手段; 前記圧縮命令を伸張し、もって対応する伸張命令を形成する伸張手段;および 前記伸張命令を実行する実行手段; を備えた、命令符号を実行する装置。 (55)圧縮命令を伸張するように構成された命令伸張器であって、ここで圧 縮命令のうち第1の命令は、対応する非圧縮命令セットに対して定義された第1 のレジスタ部分集合にアクセスするように符号化することが可能であり、前記圧 縮命令のうち第2の命令は、前記第1のレジスタ部分集合にアクセスするように 符号化することが可能であるとともに、第2のレジスタ部分集合にアクセスする ように符号化することも可能である、圧縮命令を伸張するように構成された命令 伸張器。 (56)前記圧縮命令の前記第2の命令に、第1のオペコード符号および第2 のオペコード符号が割り当てられる請求項55記載の命令伸張器。 (57)前記第1のオペコード符号が、前記圧縮命令の前記第2の命令が前記 第1のレジスタ部分集合の1つにアクセスするように符号化されることを示す請 求項56記載の命令伸張器。 (58)前記命令伸張器が、圧縮レジスタ符号の伸張レジスタ符号への第1の 射像を用いて前記圧縮命令の前記第2の命令を伸張し、ここで前記第1の射像は 各圧縮レジスタ符号を前記第1の部分集合内の1つの伸張レジスタ符号へと割り 当てる、請求項57記載の命令伸張器。 (59)前記第2のオペコード符号が、前記圧縮命令の前記第2の命令は前記 第2のレジスタ部分集合の1つにアクセスするように符号化されることを示す請 求項58記載の命令伸張器。 (60)前記命令伸張器が、圧縮レジスタ符号の伸張レジスタ符号への第2の 射像を用いて前記圧縮命令の前記第2の命令を伸張し、ここで前記第2の射像は 、前記圧縮レジスタ符号の各々を前記第2のレジスタ部分集合の1つの伸張レジ スタ符号へと割り当てる請求項59記載の命令伸張器。 (61)前記圧縮命令の前記第2の命令が、第1のレジスタフィールドおよび 第2のレジスタフィールドを含む請求項56記載の命令伸張器。 (62)前記第1のオペコード符号が用いられている場合には、前記命令伸張 器が、前記第1のレジスタ部分集合に従って前記第1のレジスタフィールドを伸 張する請求項 61記載の命令伸張器。 (63)前記第2のオペコード符号が用いられている場合には、前記命令伸張 器が、前記第2のレジスタ部分集合に従って前記第1のレジスタフィールドを伸 張する請求項62記載の命令伸張器。 (64)前記圧縮命令の前記第2の命令が第3のオペコード符号を割り当てら れ、前記第3のオペコード符号が用いられている場合には、前記命令伸張器が、 前記第2のレジスタ部分集合を用いて前記第2のレジスタフィールドを伸張する 請求項63記載の命令伸張器。 (65)前記圧縮命令の前記第2の命令が、第4のオペコード符号を割り当て られ、前記第4のオペコード符号が用いられている場合、前記命令伸張器が、前 記第2のレジスタ部分集合を用いて前記第1のレジスタフィールドおよび前記第 2のレジスタフィールドを伸張する請求項64記載の命令伸張器。 (66)前記第1のオペコード符号および前記第2のオペコード符号が、前記 圧縮命令の前記第2の命令の機能フィールドに含まれるビットにおいて相違する 請求項56記載の命令伸張器。 (67)圧縮命令を伸張する方法であって、 第1のレジスタフィールドを有する特定の圧縮命令が第1のオペコードを用い て符号化されている場合には、前記第1のレジスタフィールドを伸張するために 、圧縮レジスタ指示子から伸張レジスタ指示子への第1のレジスタ射像 を用いて、前記第1のレジスタフィールドを有する特定の圧縮命令を伸張するス テップ;および 前記第1のレジスタフィールドを有する特定の圧縮命令が第2のオペコードを 用いて符号化されている場合には、前記第1のレジスタフィールドを伸張するた めに、圧縮レジスタ指示子から伸張レジスタ指示子への第2のレジスタ射像を用 いて前記第1のレジスタフィールドを有する特定の圧縮命令を伸張するステップ ; を含む、圧縮命令を伸張する方法。 (68)前記の特定の圧縮命令が、第2のレジスタフィールドをさらに含む請 求項67記載の方法。 (69)前記の特定の圧縮命令が第3のオペコードを用いて符号化されている 場合には、前記第2のレジスタ射像を用いて前記第2のレジスタフィールドを伸 張するステップをさらに含む請求項68記載の方法。 (70)前記の特定の圧縮命令が第4のオペコードを用いて符号化されている 場合には、前記第2のレジスタ射像を用いて前記第2のレジスタフィールドおよ び前記第1のレジスタフィールドを伸張するステップをさらに含む請求項69記 載の方法。 (71)第2の特定の圧縮命令を前記第1のレジスタ射像を用いて伸張するス テップをさらに含む請求項67記載の方法。 (72)前記第2の特定の圧縮命令が、1つのオペコード符号を含む請求項7 1記載の方法。 (73)伸張手段を備えた圧縮命令を伸張する装置であって、ここで前記伸張 手段は、第1のレジスタフィールドを有する特定の圧縮命令が第1のオペコード を用いて符号化されている場合には、前記第1のレジスタフィールドを伸張する ために、圧縮レジスタ指示子から伸張レジスタ指示子への第1のレジスタ射像を 用いて前記第1のレジスタフィールドを有する特定の圧縮命令を伸張するように 構成され、且つ前記伸張手段は、前記第1のレジスタフィールドを有する特定の 圧縮命令が第2のオペコードを用いて符号化されている場合には、前記第1のレ ジスタフィールドを伸張するために、圧縮レジスタ指示子から伸張レジスタ指示 子への第2のレジスタ射像を用いて前記の特定の圧縮命令を伸張するように構成 されている、圧縮命令を伸張する装置。 (74)圧縮命令の圧縮レジスタフィールドを伸張命令の伸張レジスタフィー ルドへと伸張するように構成された命令伸張器であって、ここで前記圧縮レジス タフィールドの伸張が、前記圧縮レジスタフィールドへと符号化される第1の値 と前記圧縮命令のオペコードフィールドへと符号化される第2の値とに依存する 、命令伸張器。 (75)前記命令伸張器が、前記第2の値に応じて、圧縮レジスタフィールド の符号から伸張レジスタフィールドの符号への多数の射像のうちの1つを選択す るように構成された請求項74記載の命令伸張器。 (76)前記命令伸張器が、前記第1の値に応じて前記 多数の射像の前記1つから前記伸張レジスタフィールド符号の1つを選択する、 請求項75記載の命令伸張器。 (77)特定の命令が第1のオペコード符号および第2のオペコード符号を割 り当てられ、且つ、ここで前記命令伸張器が、前記第1のオペコード符号を有す る前記特定の命令を受信したときに、前記圧縮レジスタフィールドの伸張のため に前記多数の射像の前記1つを選択する、請求項76記載の命令伸張器。 (78)前記命令伸張器が、前記第2のオペコード符号を有する前記特定の命 令を受信したときに、前記圧縮レジスタフィールドの伸張のために前記多数の射 像のうちの他の一つの射像を選択する、請求項77記載の命令伸張器。 (79)圧縮命令の圧縮レジスタフィールドを伸張命令の伸張レジスタフィー ルドへと伸張する方法であって、 前記圧縮レジスタフィールドの少なくとも一部を前記伸張レジスタフィールド の一部へ直接コピーするステップ;および 前記伸張レジスタフィールドの残りの部分を生成するために前記圧縮レジスタ フィールドに論理的操作を施すステップ; を含む、圧縮命令の圧縮レジスタフィールドを伸張命令の伸張レジスタフィー ルドへと伸張する方法。 (80)前記圧縮レジスタフィールドの前記一部が、前記圧縮レジスタフィー ルドの仝体からなる、請求項79記載の方法。 (81)前記圧縮レジスタフィールドの前記全体を受け取る前記伸張レジスタ フィールドの前記一部は、前記伸張レジスタフィールドの複数の下位ビットから なる、請求項80記載の方法。 (82)前記複数の下位ビットの数が、前記圧縮命令フィールドを構成するビ ットの数に等しい、請求項81記載の方法。 (83)前記伸張レジスタフィールドの前記の残りの部分を生成するために前 記圧縮命令のオペコードフィールドに論理操作を施すステップをさらに含む請求 項79記載の方法。 (84)前記のオペコードフィールドに論理操作を施すステップが、前記オペ コードフィールドにおける第1のオペコード符号に応じて第1のレジスタ射像を 選択するステップからなる請求項83記載の方法。 (85)前記のオペコードフィールドに論理操作を施すステップが、前記オペ コードフィールドにおける第2のオペコード符号に応じて第2のレジスタ射像を 選択するステップをさらに含む請求項84記載の方法。 (86)前記第1のオペコード符号および前記第2のオペコード符号を特定の 命令に割り当てる請求項85記載の方法。 (87)圧縮命令の圧縮レジスタフィールドを伸張命令の伸張レジスタフィー ルドへと伸張する装置であって、 前記圧縮レジスタフィールドを受信するように結合され ており、前記圧縮レジスタフィールドの少なくとも一部を前記伸張レジスタフィ ールドの一部へ直接コピーする第1の手段;および 前記圧縮レジスタフィールドを受信するように結合されており、前記伸張レジ スタフィールドの残りの部分を生成するために前記圧縮レジスタフィールドに論 理操作を施す第2の手段; を含む、圧縮命令の圧縮レジスタフィールドを伸張命令の伸張レジスタフィー ルドへと伸張する装置。 (88)前記圧縮レジスタフィールドの前記一部が、前記圧縮レジスタフィー ルドの全体からなる、請求項87記載の装置。 (89)前記圧縮レジスタフィールドの前記全体を受け取る前記伸張レジスタ フィールドの前記一部は、前記伸張レジスタフィールドの複数の下位ビットから なる、請求項88記載の装置。 (90)圧縮命令の圧縮レジスタフィールドを伸張命令の伸張レジスタフィー ルドへと伸張するように構成された命令伸張装置であって、ここで前記命令伸張 装置は、前記圧縮レジスタフィールドの少なくとも一部を前記伸張レジスタフィ ールドの第1の部分にコピーすることにより、前記伸張レジスタフィールドの前 記第1の部分を形成し、且つ前記命令伸張装置は、前記圧縮レジスタフィールド に作用して前記伸張レジスタフィールドの残りの部分を生成するように構成され た論理ブロックを含む、圧縮命令の圧縮 レジスタフィールドを伸張命令の伸張レジスタフィールドへと伸張するように構 成された命令伸張装置。 (91)前記圧縮レジスタフィールドの前記一部が、前記圧縮レジスタフィー ルドの全体からなる、請求項90記載の命令伸張装置。 (92)前記論理ブロックが、前記命令伸張装置から受信した信号に応じて、 圧縮レジスタフィールド符号から伸張レジスタフィールド符号へのレジスタ射像 を選択する請求項90記載の命令伸張装置。 (93)特定の命令に割り当てられた第1のオペコードを検出すると、これに 応じて前記信号を活性にし、且つ前記特定の命令に割り当てられた第2のオペコ ードを検出すると、これに応じて前記信号を不活性にするように構成された、請 求項92記載の命令伸張装置。 (94)前記圧縮レジスタフィールドの前記一部を受け取る前記伸張レジスタ フィールドの前記部分が、前記伸張レジスタフィールドの複数の下位ビットから なる請求項90記載の命令伸張装置。 (95)前記複数の下位ビットの数が、前記圧縮レジスタフィールドを構成す るビット数に等しい請求項94記載の命令伸張装置。[Claims]   (1) An apparatus for executing an instruction from a variable-length compressed instruction set,   Instruction decompression combined to receive instructions that are members of a variable length compressed instruction set Equipped with     Here, the instruction decompressor looks at the opcode field of a particular instruction. And the instruction decompressor has an operation code field that is an extended operation code. If the particular instruction is an extension having a first fixed length. And the instruction decompressor is configured to determine that the Code field is encoded as a second opcode different from the extended opcode. Is configured to determine that the specific instruction is a non-extended instruction. Has been A device that executes instructions from the variable length compression instruction set.   (2) the first fixed length is a first number of bytes, and the first number of bytes is The apparatus of claim 1, wherein the number of bytes is greater than a second number of bytes corresponding to a second fixed length.   (3) The first number of bytes is larger than the second number of bytes by an integer factor. 3. The apparatus according to 2.   (4) The device according to claim 3, wherein the integer factor is 2.   (5) a second extended instruction defining a specific extended instruction in an extended instruction set; The apparatus of claim 1, including an opcode field.   (6) the instruction decompressor has to pre-determine how to decompress the particular extended instruction. The apparatus of claim 5, wherein the apparatus is configured to examine the second opcode field.   (7) A contractor further comprising a processor core configured to execute a decompression instruction. The device of claim 1.   (8) The apparatus according to claim 7, wherein each compression instruction corresponds to one decompression instruction.   (9) A method of expanding a compression instruction into an expansion instruction,   If the opcode field of the compressed instruction is an extended opcode, Determining that the instruction is an extended instruction having a first fixed length;   The opcode field of the compression instruction is different from the extended opcode. 2, the compressed instruction is a non-extended instruction having a second fixed length. Determining that the order is a decree; and   A decompression step of decompressing the compression instruction into a decompression instruction, wherein the compression instruction If the instruction is the extension instruction, the number of bytes included in the compression instruction is 1 and the compressed instruction is the non-extended instruction Decompressing, wherein said number of bytes is determined by said second fixed length;   A method for decompressing a compression instruction into a decompression instruction.   (10) The method according to claim 9, wherein the first fixed length is larger than the second fixed length. Law.   (11) The first fixed length is an integer greater than the second fixed length. 11. The method of claim 10, wherein the number is greater by a number of bytes.   (12) The method according to the above (11), wherein the integer is 2.   (13) A step of fetching a compressed instruction in an amount determined by the second fixed length. The method of claim 11, further comprising a tip.   (14) When the non-extended instruction is detected, the extended opcode is detected. The first amount and the second amount immediately following the first amount. 14. The method of claim 13, forming an extension instruction.   (15) a second instruction for identifying the extended instruction as a specific extended instruction; 10. The method of claim 9, comprising the following opcode field:   (16) The extended instruction format in which the decompression step corresponds to the specific extended instruction The method of claim 15 including the step of identifying   (17) The decompression step includes a plurality of instruction fields in the extended instruction format. Further comprising the step of interpreting bits within said particular extension instruction according to the The method of claim 16.   (18) The decompression step is performed based on a code form of the operation code field. The method of claim 9, further comprising the step of identifying a non-extended instruction format corresponding to the non-extended instruction. Method.   (19) The decompression step is performed by using a second plurality of instructions in the non-extended instruction format. Interpreting the bits from the non-extended instruction according to the field. Claim 18 The described method.   (20) If the opcode field of the compression instruction is an extended opcode, First determining means for determining that the compressed instruction is an extended instruction having a first fixed length ;   The opcode field of the compression instruction is different from the extended opcode. 2, the compressed instruction is a non-extended instruction having a second fixed length. A second judging means for judging that it is an order; and   Expansion means for expanding the compression instruction into an expansion instruction, wherein the compression instruction If the instruction is the extension instruction, the number of bytes included in the compression instruction is 1 and the compressed instruction is the non-extended instruction Decompressing means, wherein said number of bytes is determined by said second fixed length;   A device that decompresses a compression instruction with a decompression instruction into a decompression instruction.   (21) The microprocessor executes the first routine and the second routine. A method of executing a program comprising:   Executing a subroutine call instruction in the first routine, Wherein the second routine is included in the first routine. The subroutine code to be executed via the destination address of the call instruction Step indicated by the instruction; and   Examining the display in the subroutine call instruction, wherein When the display is in the first state Determines that the second routine is encoded using a compression instruction, and If the display is in a second state different from the first state, the second rule is displayed. Determining that the routine is encoded using an uncompressed instruction;   A first routine and a second routine in a microprocessor, including: How to run the program, including.   (22) The indication includes one bit, and the first state indicates that the one bit is 22. The method of claim 21, comprising setting.   (23) The second state may include a condition that the one bit is cleared. 23. The method of claim 22.   (24) The display is stored in a program counter inside the microprocessor. 22. The method of claim 21, further comprising the step of:   (25) The display functions as a compression mode for the second routine. A method according to claim 21.   (26) If the compression mode indicates compression, a command from the second routine is issued. 26. The method of claim 25, further comprising the step of extending the decree.   (27) A return instruction including a second destination address upon completion of the second routine 22. The method of claim 21, further comprising the step of executing a command.   (28) examining a second bit in the second destination address Thus, if the second bit is in the first state, the first Is a compression instruction And that the second bit is in the first state If the second routine is in a second state different from the first state, the first routine uses an uncompressed instruction. 28. The method of claim 27, further comprising determining that the data has been encoded.   (29) The microprocessor executes the first routine and the second routine. An apparatus for executing a program including:   Means for executing a subroutine call instruction in the first routine, Here, the second routine includes the subroutine code included in the first routine. Subroutine call instruction to be executed via the destination address of the Means indicated by the decree; and   Means for checking a display in the subroutine call instruction, wherein the display is If in the first state, the second routine is encoded using a compression instruction. And the display is in a second state different from the first state In this case, it is determined that the second routine is encoded using the non-compressed instruction. Means;   A first routine and a second routine in a microprocessor, including: A device that executes the program that contains it.   (30) Fetching compressed and uncompressed instructions in the microprocessor Device   A storage device configured to store a compression enable indicator;   A subroutine call instruction that is coupled to the storage device and specifies a target routine. Configured to detect a compression mode of the target routine at the time of fetching; A mode detector configured to communicate the compressed mode to a processor core; and And   A compression instruction coupled to the mode detector if the compression mode indicates compression. Fetching, and if the compression mode indicates uncompressed, A processor core configured to fetch reduced instructions;   An apparatus for fetching a compressed instruction and a non-compressed instruction, comprising:   (31) The compression mode is determined by a specific bit of the subroutine call instruction. 31. The device of claim 30, wherein the device identifies   (32) The processor core includes a PC register, and the processor core Is configured to store the compression mode inside the PC register. An apparatus according to claim 1.   (33) The compression mode is a fetch address stored in the PC register. 33. The device of claim 32, wherein the device is stored as a least significant bit of the address.   (34) When the compression mode indicates compression, the processor core Increasing the fetch address by a first fixed amount, wherein the compression mode indicates no compression In the case, the processor core increases the fetch address by a second fixed amount. 34. The device of claim 33, wherein said device is added.   (35) Compression instruction which is an element of the variable length compression instruction set Decompress each received compressed command into a corresponding decompress command, coupled to receive An instruction expander configured to:   Coupled to receive the decompression command and configured to execute the decompression command Processor core;   A microprocessor with a.   (36) coupled between the instruction decompressor and the processor core, and A contract further comprising an instruction cache configured to store a corresponding decompression instruction. 36. The apparatus of claim 35.   (37) configured to be coupled to the instruction decompressor and to store the compressed instruction; The apparatus of claim 35, further comprising a configured instruction cache.   (38) The variable-length compressed instruction set includes a first plurality of instructions having a first fixed length. The apparatus of claim 35, comprising an instruction and a second plurality of instructions having a second fixed length.   (39) The device according to (38), wherein the first fixed length is longer than the second fixed length. Place.   (40) The first fixed length is longer than the second fixed length by an integer factor. 39. The apparatus according to claim 39.   (41) The apparatus according to (40), wherein the integer factor is 2.   (42) The processor core fetches an instruction according to the second fixed length. 41. The device of claim 40.   (43) The instruction decompressor detects one fetch of the first plurality of instructions. 43. The method of claim 42, wherein Equipment.   (44) The instruction expander responds to the detection of the one of the first plurality of instructions. Signal the NOP and pass the one second portion of the first plurality of instructions to the processor. Waiting via a fetch operation of the processor core, whereby the plurality of instructions are 44. The apparatus of claim 43, wherein the one of the instructions is split and received.   (45) The processor core is further configured to execute an uncompressed instruction. 36. The device of claim 35.   46. The apparatus of claim 45, wherein the uncompressed instruction bypasses the instruction decompressor. .   (47) Step of fetching a compressed instruction that is an element of the variable-length compressed instruction set ;   Decompressing the compressed instruction in an instruction decompressor to form a corresponding decompression instruction Steps; and   Executing the decompression instruction in a processor core;   A method for executing an instruction code, comprising:   48. The method according to claim 47, wherein each compression instruction corresponds to one decompression instruction.   (49) The variable-length compressed instruction set includes an instruction having a first fixed length and a second 49. The method according to claim 48, comprising another instruction having a fixed length.   (50) The method according to claim 49, wherein the first fixed length is longer than the second fixed length. Law.   51. The method of claim 47, further comprising the step of fetching an uncompressed instruction. Law.   52. The method of claim 51, further comprising the step of executing said uncompressed instruction. Law.   (53) Bypass the instruction decompressor when the uncompressed instruction is fetched 53. The method of claim 52, further comprising the step of:   (54) Fetch for fetching a compressed instruction that is an element of the variable-length compressed instruction set means;   Decompression means for decompressing the compression instruction and thereby forming a corresponding decompression instruction; and   Execution means for executing the decompression instruction;   An apparatus for executing an instruction code, comprising:   (55) An instruction decompressor configured to decompress a compressed instruction, wherein the decompressor is The first of the compressed instructions is the first instruction defined for the corresponding uncompressed instruction set. Can be coded to access a subset of registers of The second of the reduced instructions may access the first subset of registers. Access to a second subset of registers that can be encoded An instruction configured to decompress a compressed instruction, which may also be encoded as Stretcher.   (56) The second instruction of the compressed instruction includes a first opcode code and a second 56. The instruction decompressor according to claim 55, wherein an operation code of   (57) the first operation code code is the second instruction of the compressed instruction A signature indicating that one of the first subset of registers will be encoded to be accessed. 57. The instruction decompressor according to claim 56.   (58) The instruction decompressor is configured to convert a compression register code into a first decompression register code. Decompressing the second instruction of the compression instruction using a projection, wherein the first projection is Dividing each compression register code into one decompression register code in the first subset 58. The instruction decompressor of claim 57.   (59) the second operation code code is the second instruction of the compressed instruction A signature indicating that one of the second register subsets is to be encoded to be accessed. 59. The instruction expander according to claim 58.   (60) the instruction decompressor is configured to convert a compression register code into a decompression register code by a second Decompressing the second instruction of the compression instruction using a projection, wherein the second projection is , Each of the compression register codes to one decompression register of the second subset of registers. The instruction decompressor according to claim 59, wherein the instruction decompressor is assigned to a star code.   (61) The second instruction of the compression instruction includes a first register field and 57. The instruction expander of claim 56, comprising a second register field.   (62) When the first operation code is used, the instruction decompression is performed. Expands the first register field according to the first register subset. Claim to extend 61. The instruction expander according to 61.   (63) When the second operation code is used, the instruction decompression is performed. Expands the first register field according to the second subset of registers. 63. The command decompressor of claim 62, wherein the command decompressor expands.   (64) The second instruction of the compressed instruction is assigned a third operation code. When the third opcode code is used, the instruction decompressor includes: Decompressing the second register field using the second register subset The instruction decompressor of claim 63.   (65) the second instruction of the compressed instruction allocates a fourth opcode code And when the fourth opcode code is used, the instruction decompressor The first register field and the second register subset using the second register subset. 65. The instruction expander of claim 64, wherein the two register fields are expanded.   (66) The first operation code code and the second operation code code are Differ in the bits included in the function field of the second instruction of the compressed instruction The instruction decompressor according to claim 56.   (67) A method of expanding a compression instruction,   A particular compression instruction having a first register field uses a first opcode If it has been encoded, to expand the first register field, , First register projection from compression register indicator to decompression register indicator To decompress a particular compressed instruction having the first register field. Step; and   The specific compression instruction having the first register field is used to execute a second operation code. If the first register field has been decompressed using the Use the second register projection from the compression register indicator to the decompression register indicator Decompressing a particular compressed instruction having said first register field ;   A method for decompressing compressed instructions, including:   (68) The contract that the specific compression instruction further includes a second register field. 72. The method of claim 67.   (69) The specific compression instruction is encoded using a third operation code. In this case, the second register field is used to expand the second register field. 70. The method of claim 68, further comprising the step of tensioning.   (70) The specific compression instruction is encoded using a fourth operation code. In the case, the second register field and the second register field are used using the second register image. 70. The method of claim 69, further comprising the step of: expanding the first register field. The method described.   (71) A process for expanding a second specific compression instruction by using the first register projection. 68. The method of claim 67, further comprising a step.   (72) The second specific compression instruction includes one opcode code. The method of claim 1.   (73) An apparatus for decompressing a compression instruction provided with decompression means, wherein the decompression is performed. The means may be arranged such that the particular compression instruction having the first register field has a first opcode , The first register field is decompressed. Therefore, the first register projection from the compression register indicator to the decompression register indicator is Using a specific compression instruction having the first register field to decompress And the decompression means comprises a specific register having the first register field. If the compressed instruction is encoded using the second opcode, the first instruction Decompression register instruction from compression register indicator to decompress the register field Configured to decompress the particular compression instruction using a second register projection to the child Device that decompresses compressed instructions.   (74) Expand the compression register field of the compression instruction An instruction decompressor configured to decompress to the compression register. A first value encoded into the compression register field And a second value encoded into an opcode field of the compression instruction. , Command expander.   (75) The instruction decompressor has a compression register field according to the second value. One of a number of projections from the sign of the decompression register field to the sign of the decompression register field The instruction decompressor of claim 74, configured to:   (76) The instruction decompressor, according to the first value, Selecting one of the decompression register field codes from the one of a number of projections; The instruction decompressor of claim 75.   (77) The specific instruction assigns the first opcode code and the second opcode code. And the instruction decompressor has the first opcode code. Upon receiving the particular instruction, to decompress the compression register field. 77. The instruction decompressor of claim 76, wherein the one of the multiple projections is selected.   (78) The instruction decompressor includes the second instruction code having the second opcode code. Upon receipt of the command, the multiple injections to expand the compression register field. 78. The instruction decompressor of claim 77, wherein the instruction selects another one of the images.   (79) The compression register field of the decompression instruction Method to stretch to the field,   At least a part of the compression register field is the decompression register field. Copying directly to a part of the file; and   The compression register to generate the rest of the decompression register field Performing a logical operation on the field;   The compression register field of the compression instruction How to stretch to the field.   (80) The part of the compression register field is the compression register field. 80. The method of claim 79, wherein the method consists of the 仝 body of a field.   (81) The decompression register for receiving the entirety of the compression register field The portion of the field is derived from a plurality of lower bits of the decompression register field. 81. The method of claim 80, comprising:   (82) The number of the plurality of lower bits is the number of bits forming the compression instruction field. 82. The method of claim 81, wherein said number is equal to the number of units.   (83) Before generating the remaining portion of the decompression register field, Performing a logical operation on the opcode field of the compressed instruction. Item 79. The method according to Item 79.   (84) The step of performing a logical operation on the operation code field includes the operation The first register projection according to the first opcode code in the code field. 84. The method of claim 83, comprising the step of selecting.   (85) The step of performing a logical operation on the operation code field comprises the step of: A second register projection according to a second opcode code in the code field. The method of claim 84, further comprising the step of selecting.   (86) The first opcode code and the second opcode code are specified The method of claim 85, wherein the method is assigned to an instruction.   (87) The compression register field of the decompression instruction Device that extends to the field   Coupled to receive the compression register field At least a portion of the compression register field First means for copying directly to a part of the field; and   The decompression register coupled to receive the compression register field. The compression register field is discussed in order to generate the rest of the Second means for performing a logical operation;   The compression register field of the compression instruction A device that extends to the field.   (88) The part of the compression register field is the compression register field. 90. The apparatus of claim 87, wherein the apparatus comprises an entire field.   (89) the decompression register for receiving the entirety of the compression register field The portion of the field is derived from a plurality of lower bits of the decompression register field. 90. The apparatus of claim 88.   (90) Expand the compression register field of the compression instruction A command decompression device configured to decompress the command to the The apparatus may include at least a portion of the compression register field with the decompression register file. Field before the decompression register field. Forming a first part, and wherein said instruction decompression unit comprises a compression register field. To generate the rest of the decompression register field. Compression of compressed instructions, including corrupted logical blocks Configure the register field to expand to the expansion register field of the expansion instruction. Command decompression device made.   (91) The part of the compression register field is the compression register field. 91. The instruction decompression device of claim 90, wherein the instruction decompression device comprises an entire field.   (92) The logic block, according to a signal received from the command decompression device, Register projection from compression register field code to decompression register field code 90. The instruction decompression device according to claim 90, wherein:   (93) When the first opcode assigned to the specific instruction is detected, Responsively activates the signal, and assigns the second instruction assigned to the particular instruction A signal configured to deactivate the signal in response to detecting the code. 90. The instruction decompression device according to claim 92.   (94) The decompression register for receiving the part of the compression register field The portion of the field is derived from a plurality of lower bits of the decompression register field. 90. The instruction decompression device according to claim 90.   (95) The number of the plurality of lower bits constitutes the compression register field. The instruction decompression device according to claim 94, wherein the number of bits is equal to the number of bits.
JP10501756A 1996-06-10 1997-06-10 Apparatus and method for detecting and decompressing instructions from a variable length compressed instruction set Pending JP2000512409A (en)

Applications Claiming Priority (9)

Application Number Priority Date Filing Date Title
US66102796A 1996-06-10 1996-06-10
US08/661,003 US5896519A (en) 1996-06-10 1996-06-10 Apparatus for detecting instructions from a variable-length compressed instruction set having extended and non-extended instructions
US08/659,709 US5794010A (en) 1996-06-10 1996-06-10 Method and apparatus for allowing execution of both compressed instructions and decompressed instructions in a microprocessor
US08/661,003 1996-06-10
US08/659,708 1996-06-10
US08/659,709 1996-06-10
US08/659,708 US5905893A (en) 1996-06-10 1996-06-10 Microprocessor adapted for executing both a non-compressed fixed length instruction set and a compressed variable length instruction set
US08/661,027 1996-06-10
PCT/US1997/009984 WO1997048041A1 (en) 1996-06-10 1997-06-10 An apparatus and method for detecting and decompressing instructions from a variable-length compressed instruction set

Publications (1)

Publication Number Publication Date
JP2000512409A true JP2000512409A (en) 2000-09-19

Family

ID=27505302

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10501756A Pending JP2000512409A (en) 1996-06-10 1997-06-10 Apparatus and method for detecting and decompressing instructions from a variable length compressed instruction set

Country Status (4)

Country Link
JP (1) JP2000512409A (en)
AU (1) AU3480897A (en)
GB (1) GB2329495B (en)
WO (1) WO1997048041A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010526383A (en) * 2007-05-09 2010-07-29 エックスモス リミテッド Compact instruction set encoding
JP2013546036A (en) * 2010-09-24 2013-12-26 インテル コーポレイション Processor power management based on instruction class and content

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6189090B1 (en) * 1997-09-17 2001-02-13 Sony Corporation Digital signal processor with variable width instructions
SE9704476L (en) * 1997-12-02 1999-06-23 Ericsson Telefon Ab L M Extended instruction decoding
EP0942357A3 (en) 1998-03-11 2000-03-22 Matsushita Electric Industrial Co., Ltd. Data processor compatible with a plurality of instruction formats
WO2000008554A1 (en) * 1998-08-07 2000-02-17 Koninklijke Philips Electronics N.V. Apparatus with program memory and processor
US9361097B2 (en) 2013-10-18 2016-06-07 Via Technologies, Inc. Selectively compressed microcode
US9372696B2 (en) 2013-10-18 2016-06-21 Via Technologies, Inc. Microprocessor with compressed and uncompressed microcode memories
GB2586258A (en) 2019-08-15 2021-02-17 1Inspiries Tech Ltd Efficient processor machine instruction handling
US11204768B2 (en) 2019-11-06 2021-12-21 Onnivation Llc Instruction length based parallel instruction demarcator

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4437149A (en) * 1980-11-17 1984-03-13 International Business Machines Corporation Cache memory architecture with decoding
JPH07121352A (en) * 1993-10-21 1995-05-12 Canon Inc Arithmetic processor
GB2284492B (en) * 1993-12-06 1998-05-13 Graeme Roy Smith Improvements to computer control units
GB2289353B (en) * 1994-05-03 1997-08-27 Advanced Risc Mach Ltd Data processing with multiple instruction sets

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010526383A (en) * 2007-05-09 2010-07-29 エックスモス リミテッド Compact instruction set encoding
JP2013546036A (en) * 2010-09-24 2013-12-26 インテル コーポレイション Processor power management based on instruction class and content

Also Published As

Publication number Publication date
AU3480897A (en) 1998-01-07
GB2329495B (en) 2000-09-20
GB2329495A (en) 1999-03-24
GB9825726D0 (en) 1999-01-20
WO1997048041A1 (en) 1997-12-18

Similar Documents

Publication Publication Date Title
US5905893A (en) Microprocessor adapted for executing both a non-compressed fixed length instruction set and a compressed variable length instruction set
US5867681A (en) Microprocessor having register dependent immediate decompression
US5896519A (en) Apparatus for detecting instructions from a variable-length compressed instruction set having extended and non-extended instructions
US6412066B2 (en) Microprocessor employing branch instruction to set compression mode
US9003422B2 (en) Microprocessor architecture having extendible logic
US7664934B2 (en) Data processor decoding instruction formats using operand data
US6351806B1 (en) Risc processor using register codes for expanded instruction set
US5794010A (en) Method and apparatus for allowing execution of both compressed instructions and decompressed instructions in a microprocessor
US6408382B1 (en) Methods and apparatus for abbreviated instruction sets adaptable to configurable processor architecture
JP3556556B2 (en) Instruction code conversion device and information processing system
CN102207849B (en) Method and apparatus for performing logical compare operation
US8533433B2 (en) Microprocessor for executing byte compiled java code
US6076156A (en) Instruction redefinition using model specific registers
JPH11503846A (en) Method and apparatus for transitioning between instruction sets in a processor
US6230259B1 (en) Transparent extended state save
JP2004506263A (en) CPU accessing extended register set in extended register mode
JP2004054585A (en) Data processor
JP2000512409A (en) Apparatus and method for detecting and decompressing instructions from a variable length compressed instruction set
JPH11194950A (en) Device and method for object conversion and program recording medium
JP3773470B2 (en) Handling of coprocessor instructions in a data processor
KR19980069757A (en) Microprocessor and Multiprocessor Systems
JP2669158B2 (en) Data processing device
JP2682469B2 (en) Instruction code encoding method
JPH11212787A (en) Processor architecture system maximizing usable operation code and realizing various addressing modes and instruction set
WO1997048041A9 (en) An apparatus and method for detecting and decompressing instructions from a variable-length compressed instruction set