JPH1139140A - Processor - Google Patents

Processor

Info

Publication number
JPH1139140A
JPH1139140A JP9196194A JP19619497A JPH1139140A JP H1139140 A JPH1139140 A JP H1139140A JP 9196194 A JP9196194 A JP 9196194A JP 19619497 A JP19619497 A JP 19619497A JP H1139140 A JPH1139140 A JP H1139140A
Authority
JP
Japan
Prior art keywords
data
registers
selection
pair
register
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP9196194A
Other languages
Japanese (ja)
Inventor
Haruo Kamimaki
春雄 上牧
Atsushi Kiuchi
淳 木内
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP9196194A priority Critical patent/JPH1139140A/en
Publication of JPH1139140A publication Critical patent/JPH1139140A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To accelerate the comparison of a pair of data and the selection of two resultant pairs of the data. SOLUTION: From four registers specified by a comparison and selection instruction inside a register circuit 2, a pair of data (a) and (b) are supplied to an arithmetic and logic circuit (ALU) 3 and a selection circuit 4, and the other pair of data (e) and (f) are supplied to a selection circuit 5. In the ALU 3, the size of the data (a) and (b) is compared. The selection circuits 4 and 5 select one, smaller one for instance, of the data (a) and (b) corresponding to the compared result, while the selection circuit 5 selects the smaller one of the data (e) and (f). Two data (c) and (g) selected in the selection circuits 4 and 5 are written in the predetermined pair of the registers inside the register circuit 2.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、マイクロコンピュ
ータやデジタルシグナルプロセッサ等のプログラムによ
り制御されるプロセッサに関する。
The present invention relates to a processor controlled by a program such as a microcomputer or a digital signal processor.

【0002】[0002]

【従来の技術】従来のマイクロコンピュータもしくはデ
ジタルシグナルプロセッサ等のプロセッサにおいて、比
較選択処理を行う場合、比較のための減算とそれに基づ
く分岐処理が必要であった。そこで、分岐処理をなくす
ために特開昭58−205253に記載されているよう
な、比較選択処理の高速化が行われるようになった。ま
た、近年のデジタル通信の発達により、プロセッサで行
う処理の中に最尤復号化処理(ビタビ処理とも言われ
る)というものがある。この最尤復号化処理とは、2種
類の予想される受け取るべきデータと、実際に受け取っ
たデータとの誤差をそれぞれ求め、誤差の少ない方を順
次選択していくことで復号化処理を行うというものであ
る。このため最尤復号化処理では、比較選択処理が複数
回行われている。比較選択処理を高速に行うために、テ
キサスインスツルメンツ社の”TMS320C54x
User’s Guide”の2.5.5項(P2−2
4,25,26)に記載されている様な、比較選択処理
機能もある。
2. Description of the Related Art In a conventional microcomputer or a processor such as a digital signal processor, when performing comparison and selection processing, subtraction for comparison and branch processing based on the subtraction are required. Therefore, in order to eliminate the branching process, the speed of the comparison and selection process has been increased as described in JP-A-58-205253. Further, due to the recent development of digital communication, there is a process called maximum likelihood decoding process (also referred to as Viterbi process) among processes performed by a processor. The maximum likelihood decoding process refers to performing a decoding process by calculating an error between two types of expected data to be received and actually received data, and sequentially selecting a smaller error. Things. Therefore, in the maximum likelihood decoding process, the comparison and selection process is performed a plurality of times. In order to perform the comparison and selection processing at high speed, Texas Instruments “TMS320C54x”
Section 2.5.5 of User's Guide ”(P2-2
4, 25, 26).

【0003】[0003]

【発明が解決しようとする課題】プロセッサを用いたプ
ログラムによるデジタル信号処理の一つとして、音声符
号化処理がある。この音声符号化処理方式の中にCEL
P方式と呼ばれる処理方式があり、デジタル携帯電話で
はこの方式が広く用いられている。このCELP方式で
は、音源コードブックの選択等において多くの比較選択
処理が行われる。ここで音源コードブックの選択は、音
源コードブック毎に復元音声を生成し、これと入力音声
との誤差の最も小さいものを選択する。この時の処理
は、まず復元音声と入力音声との誤差を求め、それ以前
に求めた誤差の最も小さかったものと比較し、新規に演
算して求めた誤差の方が小さければ、それを最小誤差と
して残し、さらにその誤差を求めるのに用いたコードブ
ックの番号を格納する。つまり、音源コードブックの検
索においては、音声の誤差の比較により、音声の誤差
と、コードブックの番号の二つを選択することになる。
つまり。一つの比較結果により二つの選択処理を行うこ
とになる。これに対し前記従来技術では、複数の命令に
より実行する必要がある。例えば”TMS320C54
x User’s Guide”に記載されている機能を
用いた場合でも、以下のような処理が必要になる。
As one of digital signal processing by a program using a processor, there is a voice coding processing. CEL is included in this audio coding system.
There is a processing method called a P method, and this method is widely used in digital mobile phones. In the CELP method, many comparison and selection processes are performed in selecting a sound source codebook and the like. Here, in the selection of the sound source codebook, a restored speech is generated for each sound source codebook, and the one with the smallest error between this and the input speech is selected. In this process, the error between the restored voice and the input voice is calculated first, compared with the previously obtained error which was the smallest, and if the newly calculated error is smaller, the error is minimized. The error is left as an error, and the codebook number used to determine the error is stored. That is, in the search for the sound source codebook, two of the speech error and the codebook number are selected by comparing the speech errors.
I mean. Two selection processes are performed based on one comparison result. On the other hand, in the above-mentioned conventional technology, it is necessary to execute by a plurality of instructions. For example, "TMS320C54
Even when the function described in “x User's Guide” is used, the following processing is required.

【0004】1)AとBの大きい方をBに格納する。1) The larger of A and B is stored in B.

【0005】2)もしCondition code C
== 1ならば4)へ分岐 3)AR1をAR2にコピー(コードブック番号の保
存) 4)次の処理 このように前記従来例では、二つの値を比較し、どちら
か一つを選択する比較選択処理は行えるが、コードブッ
ク検索のように一度の比較に対し2度の選択を比較選択
処理では処理ステップが多くなる。このため、処理ステ
ップの増大により、プロセッサの動作速度を高め消費電
力が増大したり、コードサイズの増大により必要メモリ
量が増大することになる。
[0005] 2) If Condition code C
== 1 then branch to 4) 3) Copy AR1 to AR2 (save codebook number) 4) Next processing As described above, in the above-mentioned conventional example, two values are compared and one of them is selected. Although the comparison and selection processing can be performed, the number of processing steps is increased in the comparison and selection processing in which selection is performed twice for one comparison as in a codebook search. For this reason, an increase in the number of processing steps increases the operating speed of the processor and increases power consumption, and an increase in code size increases a required memory amount.

【0006】本発明の目的は、一度の比較結果に基づい
て行う複数の選択処理を高速に実行できるプロセッサを
提供することを目的とする。
An object of the present invention is to provide a processor which can execute a plurality of selection processes based on a single comparison result at high speed.

【0007】[0007]

【課題を解決するための手段】前記目的を達成するため
に、本発明によるプロセッサは、比較選択命令に応答し
て、2対のデータをレジスタ回路から読み出し、その内
の一対のデータに対する比較と、その比較結果に基づ
く、上記一対のデータの一方の選択と、上記他の一対の
データの一方の選択とを実行するように構成される。す
なわち、本発明によるプロセッサは、命令で指定可能な
複数のレジスタを含むレジスタ回路と、一対のデータを
比較可能な演算器と、上記演算器による比較結果に応じ
て、上記一対のデータの一方を選択する第1の選択回路
と、上記演算器による比較結果に応じて、他の一対のデ
ータの一方を選択する第2の選択回路とを有する。
In order to achieve the above object, a processor according to the present invention reads two pairs of data from a register circuit in response to a comparison / selection instruction, and performs comparison between the two pairs of data. And selecting one of the pair of data and one of the other pair of data based on the comparison result. That is, a processor according to the present invention includes a register circuit including a plurality of registers that can be specified by an instruction, an arithmetic unit capable of comparing a pair of data, and one of the pair of data according to a comparison result by the arithmetic unit. There is a first selection circuit for selecting, and a second selection circuit for selecting one of the other pair of data according to the result of comparison by the arithmetic unit.

【0008】上記レジスタ回路は、比較選択命令に応答
して、上記複数のレジスタの内の、一対のレジスタから
上記一対のデータを上記演算器と上記第1の選択回路に
供給し、上記複数のレジスタ内の他の一対のレジスタか
ら上記他の一対のデータを上記第2の選択回路に供給
し、上記第1、第2の選択回路により選択された第1、
第2の選択結果データを上記複数のレジスタの内の異な
る二つのレジスタに格納する回路を有する。
The register circuit supplies the pair of data from the pair of registers to the arithmetic unit and the first selection circuit in response to the comparison / selection command. The other pair of data is supplied from another pair of registers in the register to the second selection circuit, and the first and second data selected by the first and second selection circuits are selected.
A circuit for storing the second selection result data in two different registers among the plurality of registers;

【0009】本発明は、一つの命令に指定された一対の
レジスタ内のそれぞれのデータを異なる部分に分け、そ
れぞれの部分に対して同じ演算を並行して行うプロセッ
サ(以下SIMD型プロセッサと言う)にも適用でき
る。
According to the present invention, a processor which divides each data in a pair of registers designated by one instruction into different parts and performs the same operation on each part in parallel (hereinafter referred to as a SIMD type processor). Also applicable to

【0010】[0010]

【発明の実施の形態】以下、本発明に係るプロセッサを
図面に示したいくつかの実施の形態を参照してさらに詳
細に説明する。なお、以下においては、同じ参照番号は
同じものもしくは類似のものを表すものとする。また、
第2の実施の形態以降では、第1の実施の形態との相違
点を主に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, a processor according to the present invention will be described in more detail with reference to some embodiments shown in the drawings. In the following, the same reference numerals represent the same or similar ones. Also,
In the second and subsequent embodiments, differences from the first embodiment will be mainly described.

【0011】<発明の実施の形態1>本発明の実施の形
態を図を用いて説明する。図1は本発明を適用したプロ
セッサである。このプロセッサは、一つの大規模集積回
路(LSI)上に形成される。本プロセッサは命令コー
ドを解読し、各ブロックに対する制御信号を生成する命
令デコード部1と、演算に用いる値や演算結果等を格納
するためのレジスタ回路2と、加減算を行うための算術
論理演算回路(ALU)3と、選択回路4、5と、メモ
リ8およびバス7とにより構成される。バス7は、メモ
リ8と命令デコード部1およびレジスタ回路2との間で
命令およびデータを転送するのに使用される。
<Embodiment 1> An embodiment of the present invention will be described with reference to the drawings. FIG. 1 shows a processor to which the present invention is applied. This processor is formed on one large-scale integrated circuit (LSI). The processor decodes an instruction code and generates a control signal for each block, an instruction decoding unit 1, a register circuit 2 for storing a value used for operation, an operation result, and the like, and an arithmetic and logic operation circuit for performing addition and subtraction. (ALU) 3, selection circuits 4 and 5, memory 8 and bus 7. Bus 7 is used to transfer instructions and data between memory 8 and instruction decode unit 1 and register circuit 2.

【0012】図2は選択回路4の構成である。選択回路
4は制御信号群104と、Nフラグ302より、選択信
号901、902を生成するデコード回路41と、前記
選択信号402、403により、二つの入力データ20
1、202のどちらかを選択し、出力401とする選択
器42により構成される。選択器42は選択信号402
が1であれば、入力データ201を出力401とし、4
03が1であれば入力データ202を出力401とす
る。
FIG. 2 shows the configuration of the selection circuit 4. The selection circuit 4 includes a control signal group 104, a decoding circuit 41 for generating selection signals 901 and 902 based on the N flag 302, and two input data 20 based on the selection signals 402 and 403.
1 and 202, and is configured by a selector 42 that selects an output 401. The selector 42 selects the selection signal 402
Is 1, the input data 201 is set to the output 401 and 4
If 03 is 1, the input data 202 is set as the output 401.

【0013】デコード回路41の構成を図3に示す。デ
コード回路41は、4つの論理積回路43、44、4
5、46と、二つの論理和回路47、48により構成さ
れる。また制御信号群104は二つの信号112、12
2よりなる。信号112はNフラグ302が1のときに
選択信号402を1にし、Nフラグ302が0のときに
選択信号403を1にする。逆に信号122はNフラグ
302が0のときに選択信号402を1にし、Nフラグ
302が1のときに選択信号403を1にする。また選
択回路5の構成は選択回路4と同じになる。このとき選
択回路4と選択回路5で、デコード回路41を共有する
ことが可能であることは自明である。
FIG. 3 shows the configuration of the decoding circuit 41. The decoding circuit 41 has four AND circuits 43, 44, 4
5 and 46 and two OR circuits 47 and 48. The control signal group 104 includes two signals 112 and 12
Consists of two. The signal 112 sets the selection signal 402 to 1 when the N flag 302 is 1, and sets the selection signal 403 to 1 when the N flag 302 is 0. Conversely, the signal 122 sets the selection signal 402 to 1 when the N flag 302 is 0, and sets the selection signal 403 to 1 when the N flag 302 is 1. The configuration of the selection circuit 5 is the same as that of the selection circuit 4. At this time, it is obvious that the decoding circuit 41 can be shared by the selection circuits 4 and 5.

【0014】図4はレジスタ回路2の構造を示す。バス
210とインタフェース回路21を介してバス7に接続
され、このデータ転送経路は、これらのレジスタに保持
されたデータをメモリ8に格納するのに使用される。こ
れらのレジスタは、さらにバス220とインタフェース
回路22を介してバス7に接続されている。このデータ
転送経路は、メモリ8に保持されたデータをこれらのレ
ジスタに格納するのに使用される。インタフェース回路
21、22は制御信号101に含まれた信号211、2
21によりそれぞれ制御される。
FIG. 4 shows the structure of the register circuit 2. The data transfer path is connected to the bus 7 via the bus 210 and the interface circuit 21, and is used to store the data held in these registers in the memory 8. These registers are further connected to the bus 7 via the bus 220 and the interface circuit 22. This data transfer path is used to store the data held in the memory 8 in these registers. The interface circuits 21 and 22 output signals 211 and 2 included in the control signal 101.
21 respectively.

【0015】これらのレジスタは、さらにバス201か
ら204に接続され、それぞれのレジスタは転送制御回
路(図示せず)を内蔵し、この転送制御回路は、制御信
号101に含まれた制御信号231、241、251、
261、271、281の一つによりバス201から2
04のいずれかへのデータの転送が指示されたときに、
そのバスにそのレジスタが保持するデータを送出する。
これらのレジスタは、さらにバス301に接続され、A
LU3による演算結果の格納に使用される。レジスタ2
7はさらにバス501に接続され、選択回路5により選
択されたデータの格納に使用される。さらにレジスタ2
8はバス401に接続され、選択回路4により選択され
たデータの格納に使用される。これらのレジスタ21か
ら28は、転送制御回路(図示せず)を内蔵し、この転
送制御回路は、制御信号101に含まれた制御信号23
2、242、252、262、272、282の一つに
よりバス301、401、501のいずれかの上のデー
タの取り込みが指示されたときに、そのバス上のデータ
をそのレジスタに取り込む。このように、本実施例で
は、選択回路4、5により選択されたデータを保持する
二つのレジスタをレジスタ28、27に固定している。
それにより、後に説明する比較選択命令が指定するレジ
スタの数を減らし、それにより命令長の増大を防いでい
る。
These registers are further connected to buses 201 to 204. Each of the registers has a built-in transfer control circuit (not shown). The transfer control circuit includes a control signal 231 and a control signal 231 included in the control signal 101. 241, 251,
261, 271 and 281 from the bus 201
04 is instructed to transfer data to
The data held by the register is transmitted to the bus.
These registers are further connected to the bus 301,
Used for storing the operation result by LU3. Register 2
7 is further connected to the bus 501 and is used for storing data selected by the selection circuit 5. Register 2
Reference numeral 8 is connected to the bus 401 and is used for storing data selected by the selection circuit 4. Each of these registers 21 to 28 has a built-in transfer control circuit (not shown).
When one of 2, 242, 252, 262, 272, and 282 instructs to take in data on any of the buses 301, 401, and 501, the data on that bus is taken into the register. As described above, in the present embodiment, the two registers holding the data selected by the selection circuits 4 and 5 are fixed to the registers 28 and 27.
As a result, the number of registers specified by the comparison / selection instruction described later is reduced, thereby preventing the instruction length from increasing.

【0016】本プロセッサの動作は次の通りである。ま
ず命令デコード部1は、バス7を介してメモリ8より読
み出した命令のコードを解読し、レジスタ回路2への制
御信号102と、ALU3への制御信号103、および
選択回路4と選択回路5への制御信号群104を生成し
出力する。レジスタ回路2は、ALU3の入力データ2
01、202、および選択回路5の入力データ203、
204として、内部のレジスタの中から制御信号102
に従い選んだレジスタに格納されている値を出力する。
ALU3は制御信号103に従い、入力データ201と
202を用いて演算を行い、演算結果301をレジスタ
回路2に出力する。レジスタ回路2はALU3の演算結
果301あるいは選択回路4、5の出力を、制御信号1
02に従い、レジスタ回路2内のレジスタに各々格納す
る。例えば、ALU3による通常の演算を行う命令の場
合には、レジスタa、bに保持されたデータがALU3
に読み出され、それらのデータの演算結果がレジスタc
に格納される。
The operation of the present processor is as follows. First, the instruction decode unit 1 decodes the code of the instruction read from the memory 8 via the bus 7, and outputs the control signal 102 to the register circuit 2, the control signal 103 to the ALU 3, and the selection circuits 4 and 5. Is generated and output. The register circuit 2 stores the input data 2 of the ALU 3
01, 202, and input data 203 of the selection circuit 5,
204, the control signal 102 from the internal register
And outputs the value stored in the register selected.
The ALU 3 performs an operation using the input data 201 and 202 according to the control signal 103, and outputs an operation result 301 to the register circuit 2. The register circuit 2 outputs the operation result 301 of the ALU 3 or the output of the selection circuits 4 and 5 to the control signal 1.
02, each is stored in a register in the register circuit 2. For example, in the case of an instruction for performing a normal operation by ALU3, the data held in registers a and b
And the operation result of the data is stored in the register c.
Is stored in

【0017】本実施例で新たに設けられた比較選択命令
は次のように実行される。この命令は、図1に示すよう
に、ALU3および選択回路4に供給されるべき二つの
データa、bを保持する一対のレジスタと選択回路5に
供給されるべきデータe、fを保持する他の一対のレジ
スタとを指定する。この命令は、データa、bの内、選
択回路4により選択されたデータdを保持すべきレジス
タおよびデータe、fの内、選択回路5により選択され
たデータを保持すべきレジスタを指定しない。これらの
データは命令デコード部1の制御により、それぞれレジ
スタ28、27(図4)に書き込まれるように定められ
ている。
The comparison / selection instruction newly provided in this embodiment is executed as follows. As shown in FIG. 1, this instruction includes a pair of registers for holding two data a and b to be supplied to the ALU 3 and the selection circuit 4, and a pair of registers for holding data e and f to be supplied to the selection circuit 5. And a pair of registers. This instruction does not specify a register to hold the data d selected by the selection circuit 4 among the data a and b and a register to hold the data selected by the selection circuit 5 among the data e and f. These data are determined to be written into the registers 28 and 27 (FIG. 4) under the control of the instruction decoding unit 1, respectively.

【0018】この命令の実行は以下のように命令デコー
ド部1の制御により実行される。まず制御信号101に
より、この命令が指定する二つのレジスタからデータ
a、bがそれぞれデータ201、202としてALU3
に読み出され、さらにこの命令が指定する他の二つのレ
ジスタからデータe、fが選択回路5にデータ203、
204として読み出される。制御信号103によりAL
U3において入力データ201から入力データ202を
減算させる。選択回路4は、制御信号群104と、演算
結果301が負の値になったことを表すNフラグ302
とを用いて、ALU3の入力データ201、202のど
ちらかを選んで出力401とする。さらに選択回路5
は、選択回路4と同様に制御信号群104とALU3が
出力するNフラグ302とを用いて、入力データ203
と204のどちらかを選んで出力501とする。
The execution of this instruction is executed under the control of the instruction decoding unit 1 as follows. First, according to the control signal 101, data a and b are converted into data 201 and 202 from the two registers designated by this instruction as data 201 and 202, respectively.
And data e and f from the other two registers specified by this instruction are supplied to the selection circuit 5 as data 203,
Read as 204. AL by control signal 103
In U3, the input data 202 is subtracted from the input data 201. The selection circuit 4 includes a control signal group 104 and an N flag 302 indicating that the operation result 301 has become a negative value.
, One of the input data 201 and 202 of the ALU 3 is selected as an output 401. Further selection circuit 5
, Using the control signal group 104 and the N flag 302 output by the ALU 3 as in the selection circuit 4,
And 204 are selected as output 501.

【0019】本実施の形態で使用する比較選択命令に
は、二つのデータの小さい方を選択する第1の比較選択
命令と、二つのデータの内、大きな方を選択する第2の
比較選択命令とがある。二つのデータが同じ値のときに
は、いずれの比較選択命令も予め定めた一方を選択す
る。あるいはいずれの選択命令もいずれのデータも選択
しないようにすることもできる。命令デコード部1が解
読した比較選択命令が第1の比較選択命令であるときに
は、命令デコード部1は、制御信号群104の中の信号
112を1とし、命令デコード部1が解読した比較選択
命令が第2の比較選択命令であるときには、命令デコー
ド部1は、信号122を1とするように構成されてい
る。また選択回路5では、選択回路4においてデータ2
01が選択されていればデータ203を選択し、選択回
路4においてデータ202が選択されていれば、データ
204を選択する。選択回路4、5で選択されたデータ
d、gは二つの予め定められたレジスタ28、27(図
4)に書き込まれる。こうして、一対のデータa、bの
比較、その一方の選択、他の一対のデータe、fの内の
一つの選択という比較選択処理が1命令で高速に実行で
きる。
The comparison / selection instruction used in the present embodiment includes a first comparison / selection instruction for selecting the smaller one of the two data, and a second comparison / selection instruction for selecting the larger one of the two data. There is. When the two data have the same value, any one of the comparison / selection commands selects a predetermined one. Alternatively, none of the selection commands and any data can be selected. When the comparison / selection instruction decoded by the instruction decoding unit 1 is the first comparison / selection instruction, the instruction decoding unit 1 sets the signal 112 in the control signal group 104 to 1, and the comparison / selection instruction decoded by the instruction decoding unit 1 Is the second comparison / selection instruction, the instruction decoding unit 1 is configured to set the signal 122 to 1. In the selection circuit 5, the data 2
If 01 is selected, data 203 is selected, and if data 202 is selected in the selection circuit 4, data 204 is selected. The data d and g selected by the selection circuits 4 and 5 are written into two predetermined registers 28 and 27 (FIG. 4). Thus, the comparison and selection process of comparing the pair of data a and b, selecting one of them, and selecting one of the other pair of data e and f can be executed at high speed with one instruction.

【0020】<発明の実施の形態2>本実施の形態で
は、選択回路4、5で選択されたデータを格納するレジ
スタを指定する比較選択命令を使用する。すなわち、図
5に示すように、この命令では、ALU3に供給すべき
一対のデータa、bを保持する二つのレジスタと、選択
回路5に供給されるべき他の一対のデータd、eを保持
する4つのレジスタを指定する。なお、これらの命令
は、選択回路4、5で選択されたデータを保持する他の
レジスタを指定しない。これらのデータはそれぞれデー
タb、eを保持するレジスタに書き込まれる。これらの
データb、eを格納するレジスタを他の任意のレジスタ
にする場合よりも命令長が短くて済む。
<Embodiment 2> In the present embodiment, a comparison / selection instruction for specifying a register for storing data selected by the selection circuits 4 and 5 is used. That is, as shown in FIG. 5, in this instruction, two registers for holding a pair of data a and b to be supplied to the ALU 3 and another pair of data d and e to be supplied to the selection circuit 5 are held. 4 registers to be specified. Note that these instructions do not specify another register that holds the data selected by the selection circuits 4 and 5. These data are written into registers holding data b and e, respectively. The instruction length is shorter than when the registers for storing these data b and e are set to any other registers.

【0021】図6は、この命令を実行するための、レジ
スタ回路2の構造を示す。図4との比較から明らかなよ
うに、全てのレジスタがバス401、501に接続さ
れ、いずれのレジスタも選択回路4、5の出力データを
取り込み可能になっている。なお、比較選択命令として
は、実施の形態1で説明した第1、第2の比較選択命令
が本実施の形態でも使用される。
FIG. 6 shows the structure of the register circuit 2 for executing this instruction. As is clear from the comparison with FIG. 4, all the registers are connected to the buses 401 and 501, and both registers can take in the output data of the selection circuits 4 and 5. Note that, as the comparison / selection command, the first and second comparison / selection commands described in the first embodiment are also used in the present embodiment.

【0022】CELP方式音声符号化処理のコードブッ
ク検索の比較選択処理にこの命令を適用した場合につい
て、この命令の実行態様を説明する。まずレジスタ回路
2の中のレジスタの中から、最も小さい誤差を格納する
レジスタ(以後レジスタaとする)と、新規誤差を格納
するレジスタ(以後レジスタbとする)と、誤差が最も
小さくなったときのコードブック番号を格納するレジス
タ(以後レジスタcとする)と、新規誤差を求めたとき
のその誤差に対応する識別番号としてのコードブック番
号を格納するレジスタ(以後レジスタdとする)の4つ
のレジスタを割り当てておく。比較選択命令として、こ
れらの4つのレジスタを指定し、二つのデータの小さい
方を選択する前述の第1の比較選択命令を使用する命令
を実行する。
A description will be given of an execution mode of this instruction in a case where this instruction is applied to the comparison and selection processing of the codebook search in the CELP system audio encoding processing. First, among the registers in the register circuit 2, a register storing the smallest error (hereinafter referred to as register a) and a register storing the new error (hereinafter referred to as register b) are used. (Hereinafter referred to as register c) and a register (hereinafter referred to as register d) for storing a codebook number as an identification number corresponding to a new error when the new error is obtained. Registers are allocated. As a comparison / selection instruction, an instruction using the above-mentioned first comparison / selection instruction for designating these four registers and selecting the smaller of the two data is executed.

【0023】この命令を実行することにより、レジスタ
bの値(新規誤差)をデータ201として、レジスタa
の値(最小誤差)をデータ202として、それぞれAL
U3と選択回路4に入れ、レジスタdの値(新規誤差を
求めたときのコードブック番号)をデータ203とし
て、レジスタcの値(最小誤差が求められたときのコー
ドブック番号)をデータ204として、それぞれ選択回
路5に入れる。その後、制御信号103により、ALU
3においてデータ201からデータ202を減算し、さ
らに制御信号群104の中の信号112を1にしてお
く。この時、ALU3の演算結果301が負の値なら
ば、選択回路4はデータ201を出力401とし、選択
回路5はデータ203を出力501とする。逆に演算結
果301が正の値ならば、選択回路4はデータ202を
出力401とし、選択回路5はデータ204を出力50
1とする。さらに選択回路4の出力401をそれまでの
最も小さい誤差を入れていたレジスタaに取り込むよう
にし、選択回路5の出力501をそれまでの最も小さい
誤差が求められたときのコードブック番号レジスタcに
取り込むようにする。
By executing this instruction, the value (new error) of the register b is set as data 201 and the register a
(Minimum error) as the data 202
The value of the register d (codebook number when a new error is obtained) is set as data 203 and the value of the register c (codebook number when the minimum error is obtained) is set as data 204. , Respectively. Thereafter, the control signal 103 causes the ALU
In 3, the data 202 is subtracted from the data 201, and the signal 112 in the control signal group 104 is set to 1. At this time, if the operation result 301 of the ALU 3 is a negative value, the selection circuit 4 outputs the data 201 as the output 401 and the selection circuit 5 outputs the data 203 as the output 501. Conversely, if the operation result 301 is a positive value, the selection circuit 4 outputs the data 202 as the output 401 and the selection circuit 5 outputs the data 204 as the output 50.
Let it be 1. Further, the output 401 of the selection circuit 4 is taken into the register a in which the smallest error has been stored, and the output 501 of the selection circuit 5 is stored in the codebook number register c when the smallest error has been obtained. Try to capture.

【0024】この結果、レジスタaの値がレジスタbの
値よりも大きければ、レジスタaにはレジスタbに入っ
ていた新規誤差が格納され、レジスタcにはレジスタd
に入っていた新規誤差を求めたときのコードブック番号
が格納される。逆にレジスタaの値がレジスタbの値よ
り大きくなければ、レジスタa、レジスタcは共に以前
の値を保持することになる。以上の処理により、一つの
比較結果による二つの選択処理が、1回の命令処理によ
り実行可能となる。しかも、比較選択処理により得られ
る二つの結果データをこの命令が指定するレジスタに格
納できる。
As a result, if the value of the register a is larger than the value of the register b, the new error stored in the register b is stored in the register a, and the register d is stored in the register c.
The codebook number at the time of finding the new error contained in the codebook is stored. Conversely, if the value of the register a is not larger than the value of the register b, both the registers a and c hold the previous values. With the above processing, two selection processings based on one comparison result can be executed by one instruction processing. In addition, two result data obtained by the comparison and selection processing can be stored in the register specified by this instruction.

【0025】この比較選択処理を異なる誤差データに対
して繰り返すことにより、多数の誤差データの中の最小
の誤差およびそれに対応するコードブック番号を高速に
求めることができる。なお、以上の第1の比較選択命令
に代えて、第2の比較選択命令を同様に実行すれば、複
数のデータの中の最大値と対応する識別番号の検出がで
きることは言うまでもない。
By repeating this comparison and selection process for different error data, the minimum error among a large number of error data and the codebook number corresponding thereto can be obtained at high speed. It is needless to say that the identification number corresponding to the maximum value among a plurality of data can be detected by executing the second comparison / selection command in the same manner instead of the first comparison / selection command.

【0026】<発明の実施の形態3>本実施の形態で
は、本発明を適用したSIMD型のプロセッサを提供す
る。ここでSIMD型のプロセッサとは、レジスタ回路
2内の命令が指定する二つのレジスタの各々の上半分の
データからなる上位側データと下半分の下位側データと
を独立のデータと見なして、それらのデータに対して同
じ演算を並行して実行し、得られた二つの演算結果を、
この命令が指定する一つのレジスタの上半分と下半分に
並行して格納する。したがって、命令はこれらの3つの
レジスタを指定するだけである。このように、SIMD
型プロセッサは、複数のレジスタオペランドに対して同
じ演算を並行して実行するプロセッサである。以下で
は、各レジスタは32ビットであると仮定する。
<Third Embodiment> In the present embodiment, an SIMD type processor to which the present invention is applied is provided. Here, the SIMD type processor refers to the upper data and the lower data of the lower half of each of the two registers specified by the instruction in the register circuit 2 as independent data. The same operation is performed in parallel on the data of
One register specified by this instruction stores data in the upper half and the lower half in parallel. Therefore, the instruction only specifies these three registers. Thus, SIMD
A type processor is a processor that executes the same operation on a plurality of register operands in parallel. In the following, it is assumed that each register is 32 bits.

【0027】図7において、本プロセッサはALU3a
には、命令が指定する二つのレジスタ内の32ビットデ
ータのそれぞれの上半分からなる二つの16ビットデー
タが線201a、202aを介して供給され、その演算
の結果16ビットのデータを生成し、線301aを介し
てレジスタ回路2に供給する。ALU3bは、全く同様
にそれらの二つのレジスタの下位側の16ビットのデー
タを線201b、202bから受信し、演算結果を線3
01bを介してレジスタ回路2に転送する。選択回路
4、5は、それぞれALU3a、3bに供給される一対
のデータが供給される。二つの選択回路4、5は、実施
の形態1と同様に、ALU3aが出力するNフラグ30
2と、制御信号群104に従い実施の形態1と同様に選
択処理を行う。本実施の形態では、前述の比較選択命令
は、他の命令と同じく、演算に使用する第1、第2のレ
ジスタと比較選択処理の結果データを格納する第3のレ
ジスタとを指定する。第1、第2のレジスタの上半分に
は、比較すべき第1、第2のデータを予め格納する。こ
れらのデータは、比較の結果により選択される一対のデ
ータでもある。第1、第2のレジスタの下半分には、比
較の結果により選択されるべき他の一対のデータを予め
格納する。
In FIG. 7, the processor is an ALU 3a
Is supplied via lines 201a and 202a with two 16-bit data consisting of the upper half of each of the 32-bit data in the two registers specified by the instruction, and generates 16-bit data as a result of the operation. The signal is supplied to the register circuit 2 via the line 301a. The ALU 3b receives the lower 16 bits of data of these two registers from the lines 201b and 202b in exactly the same manner, and transmits the operation result to the line 3b.
01b to the register circuit 2. The selection circuits 4 and 5 are supplied with a pair of data supplied to the ALUs 3a and 3b, respectively. As in the first embodiment, the two selection circuits 4 and 5 are connected to the N flag 30 output by the ALU 3a.
2 and the selection process is performed according to the control signal group 104 in the same manner as in the first embodiment. In the present embodiment, the above-mentioned comparison / selection instruction specifies the first and second registers used for the operation and the third register for storing the result data of the comparison / selection processing, like the other instructions. First and second data to be compared are stored in the upper halves of the first and second registers in advance. These data are also a pair of data selected based on the result of the comparison. Another pair of data to be selected based on the result of the comparison is stored in the lower half of the first and second registers in advance.

【0028】図8に示すように、命令が指定するレジス
タからバス201に読み出されたデータの上位側16ビ
ットと下位側16ビットはそれぞれ線201a、201
bに分離して供給される。命令が指定する他のレジスタ
からバス2010に読み出された他のデータについても
同じである。一方、ALU3a、3bでの通常の演算を
要求する命令が実行された場合には、ALU3a、3b
の出力301a、301bはそれぞれバス3010の上
位データ,下位データとして全てのレジスタに供給され
る。一方、前述の比較選択命令が実行された場合には、
選択回路4、5の出力401、501はそれぞれ302
0の上位データ,下位データとして全てのレジスタに転
送する。
As shown in FIG. 8, the upper 16 bits and lower 16 bits of the data read from the register designated by the instruction to the bus 201 are connected to lines 201a and 201, respectively.
b and supplied separately. The same applies to other data read to the bus 2010 from another register specified by the instruction. On the other hand, when an instruction requesting a normal operation in the ALU 3a, 3b is executed, the ALU 3a, 3b
Are supplied to all registers as upper data and lower data of the bus 3010, respectively. On the other hand, when the above-mentioned comparison / selection instruction is executed,
The outputs 401 and 501 of the selection circuits 4 and 5 are 302
It is transferred to all registers as upper data and lower data of 0.

【0029】以上から明らかなように、本SIMD型の
プロセッサにおいても、一つの比較に基づく二つの選択
処理を並列に実行可能となる。しかも、選択回路4、5
の出力を全てのレジスタに供給するために必要なレジス
タ回路2の構造の変更も少なくて済む。
As is clear from the above, even in the SIMD type processor, two selection processes based on one comparison can be executed in parallel. Moreover, the selection circuits 4, 5
The change of the structure of the register circuit 2 required for supplying the output of (1) to all the registers can be reduced.

【0030】<変形例>本発明は以上の実施の形態に限
定されるのではなく、いろいろの変形例によっても実現
可能であることは言うまでもない。例えば、各実施の形
態において、新たに比較器を設け、ALU3、3a等の
代わりに使用してもよい。
<Modifications> It is needless to say that the present invention is not limited to the above embodiment, but can be realized by various modifications. For example, in each embodiment, a new comparator may be provided and used instead of the ALUs 3 and 3a.

【0031】[0031]

【発明の効果】本発明によれば、一対のデータの値の比
較と、その比較結果に依存して、それらの一対のデータ
の一つおよび他の一対のデータの内の一つの選択とを1
命令で高速に実行できる。
According to the present invention, the comparison of the values of a pair of data and the selection of one of the pair of data and one of the other pair of data depending on the result of the comparison are performed. 1
High-speed execution with instructions.

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

【図1】本発明によるプロセッサの概略構成図。FIG. 1 is a schematic configuration diagram of a processor according to the present invention.

【図2】図1の装置に使用する選択回路のブロック図。FIG. 2 is a block diagram of a selection circuit used in the device of FIG.

【図3】図2の装置に使用する選択回路内の制御回路の
ブロック図。
FIG. 3 is a block diagram of a control circuit in a selection circuit used in the device of FIG. 2;

【図4】図1の装置に使用するレジスタ回路のブロック
図。
FIG. 4 is a block diagram of a register circuit used in the device of FIG. 1;

【図5】本発明による他のプロセッサの概略構成図。FIG. 5 is a schematic configuration diagram of another processor according to the present invention.

【図6】図5の装置に使用するレジスタ回路のブロック
図。
FIG. 6 is a block diagram of a register circuit used in the device of FIG. 5;

【図7】本発明によるさらに他のプロセッサの概略構成
図。
FIG. 7 is a schematic configuration diagram of still another processor according to the present invention.

【図8】図7の装置に使用するレジスタ回路のブロック
図。
FIG. 8 is a block diagram of a register circuit used in the device of FIG. 7;

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】命令で指定可能な複数のレジスタを含むレ
ジスタ回路と、 一対のデータを比較可能な演算器と、 上記演算器による比較結果に応じて、上記一対のデータ
の一方を選択する第1の選択回路と、 上記演算器による比較結果に応じて、他の一対のデータ
の一方を選択する第2の選択回路とを有し、 上記レジスタ回路は、比較選択命令に応答して、上記複
数のレジスタの内の、一対のレジスタから上記一対のデ
ータを上記演算器と上記第1の選択回路に供給し、上記
複数のレジスタ内の他の一対のレジスタから上記他の一
対のデータを上記第2の選択回路に供給し、上記第1、
第2の選択回路により選択された第1、第2の選択結果
データを上記複数のレジスタの内の異なる二つのレジス
タに格納する回路を有するプロセッサ。
A register circuit including a plurality of registers that can be specified by an instruction; an arithmetic unit capable of comparing a pair of data; and a second unit for selecting one of the pair of data according to a comparison result by the arithmetic unit. 1 selection circuit, and a second selection circuit that selects one of the other pair of data according to the comparison result by the arithmetic unit. The register circuit responds to a comparison / selection command, Among the plurality of registers, the pair of data is supplied from the pair of registers to the arithmetic unit and the first selection circuit, and the other pair of data is supplied from the other pair of registers in the plurality of registers. A second selection circuit supplies the first,
A processor having a circuit for storing first and second selection result data selected by a second selection circuit in two different registers among the plurality of registers.
【請求項2】上記一対のレジスタおよび上記他の一対の
レジスタはそれぞれ上記比較選択命令により指定された
レジスタである請求項1記載のプロセッサ。
2. The processor according to claim 1, wherein said pair of registers and said another pair of registers are registers specified by said comparison and selection instruction.
【請求項3】上記第1,第2の選択結果データを格納す
る上記二つのレジスタは予め定められたレジスタである
請求項2記載のプロセッサ。
3. The processor according to claim 2, wherein said two registers for storing said first and second selection result data are predetermined registers.
【請求項4】上記第1,第2の選択結果データを格納す
る上記二つのレジスタは上記命令により指定されたレジ
スタである請求項2記載のプロセッサ。
4. The processor according to claim 2, wherein said two registers for storing said first and second selection result data are registers specified by said instruction.
【請求項5】上記第1,第2の選択結果データを格納す
る上記二つのレジスタは、上記一対のレジスタの一方お
よび上記他の一対のレジスタとして上記命令により指定
されたレジスタと同じである請求項4記載のプロセッ
サ。
5. The two registers for storing the first and second selection result data are the same as the register specified by the instruction as one of the pair of registers and the other pair of registers. Item 5. The processor according to item 4.
【請求項6】上記演算器は、上記一対のデータの間の減
算を実行可能な算術論理演算器である請求項1から5の
いずれか一つに記載のプロセッサ。
6. The processor according to claim 1, wherein said arithmetic unit is an arithmetic and logic unit capable of executing subtraction between said pair of data.
【請求項7】他の演算器をさらに有し、 上記演算器および上記他の演算器は、上記複数のレジス
タの各々に保持可能なデータの一部に対して演算を実行
可能な演算器であり、 上記レジスタ回路は、演算命令に応答して、上記複数の
レジスタの内の、その演算命令が指定する一対のレジス
タのそれぞれの第1の部分を上記演算器に供給し、上記
一対のレジスタのそれぞれの第2の部分を上記他の演算
器に供給し、上記演算器および上記他の演算器から供給
される一対の演算結果データを上記演算命令が指定する
他のレジスタの第1、第2の部分に書き込み、 上記レジスタ回路は、上記比較選択命令に応答して、上
記複数のレジスタの内の、その命令が指定する一対のレ
ジスタのそれぞれの第1の部分を上記演算器と上記第1
の選択回路に供給し、上記一対のレジスタのそれぞれの
第2の部分を上記第2の選択回路に供給し、上記第1、
第2の選択回路から供給される一対のデータを上記演算
命令が指定する他のレジスタの第1、第2の部分に書き
込む請求項1記載のプロセッサ。
7. An arithmetic unit further comprising another arithmetic unit, wherein said arithmetic unit and said another arithmetic unit are capable of performing an arithmetic operation on a part of data that can be held in each of said plurality of registers. The register circuit supplies a first portion of each of a pair of registers specified by the operation instruction to the operation unit in response to the operation instruction, and Are supplied to the other operation unit, and a pair of operation result data supplied from the operation unit and the other operation unit are supplied to the first and second registers of another register designated by the operation instruction. 2, the register circuit responds to the comparison / selection command, and, in response to the comparison / selection command, the first part of each of a pair of registers specified by the command from the plurality of registers. 1
And a second portion of each of the pair of registers is supplied to the second selection circuit.
2. The processor according to claim 1, wherein a pair of data supplied from the second selection circuit is written to first and second portions of another register specified by the operation instruction.
JP9196194A 1997-07-22 1997-07-22 Processor Pending JPH1139140A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9196194A JPH1139140A (en) 1997-07-22 1997-07-22 Processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9196194A JPH1139140A (en) 1997-07-22 1997-07-22 Processor

Publications (1)

Publication Number Publication Date
JPH1139140A true JPH1139140A (en) 1999-02-12

Family

ID=16353765

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9196194A Pending JPH1139140A (en) 1997-07-22 1997-07-22 Processor

Country Status (1)

Country Link
JP (1) JPH1139140A (en)

Similar Documents

Publication Publication Date Title
EP0782071B1 (en) Data processor
JP3180075B2 (en) Apparatus and method for dynamic conversion between different instruction codes
EP1723543B1 (en) Method and apparatus for management of control flow in a simd device
JP2554050B2 (en) Data processing method
US6611909B1 (en) Method and apparatus for dynamically translating program instructions to microcode instructions
JP2000222206A (en) Data processor
KR100316078B1 (en) Processor with pipelining-structure
JPH05233271A (en) Data processor
US20050138327A1 (en) VLIW digital signal processor for achieving improved binary translation
JP3781519B2 (en) Instruction control mechanism of processor
US5253349A (en) Decreasing processing time for type 1 dyadic instructions
JPH0869377A (en) Electronic circuit and method for use of coprocessor
US4656581A (en) Vector mask control system
US6948049B2 (en) Data processing system and control method
US5390306A (en) Pipeline processing system and microprocessor using the system
US20030009652A1 (en) Data processing system and control method
JPH1139140A (en) Processor
JP2003316598A (en) Long instruction execution processor combined with high reliable mode operation
JP2848727B2 (en) Parallel processing unit
JP3540802B2 (en) Instruction generation method, instruction generation method, and information processing apparatus
US5768554A (en) Central processing unit
JP3524240B2 (en) Parallel instruction processing unit
JP2743947B2 (en) Micro program control method
JPH02206836A (en) Data processor
JPS63276126A (en) Instruction decoding circuit