JPH0311423A - String data processing mechanism - Google Patents

String data processing mechanism

Info

Publication number
JPH0311423A
JPH0311423A JP14724589A JP14724589A JPH0311423A JP H0311423 A JPH0311423 A JP H0311423A JP 14724589 A JP14724589 A JP 14724589A JP 14724589 A JP14724589 A JP 14724589A JP H0311423 A JPH0311423 A JP H0311423A
Authority
JP
Japan
Prior art keywords
data
shifter
operand
register
read
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
JP14724589A
Other languages
Japanese (ja)
Inventor
Seiji Baba
馬場 清司
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP14724589A priority Critical patent/JPH0311423A/en
Publication of JPH0311423A publication Critical patent/JPH0311423A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To continuously process string data by providing two registers to hold the string data, and executing shift merge due to the beginning byte position of data alternately for two operands. CONSTITUTION:First of all, the data beginning byte positions of a first operand and a second operand are set respectively in a byte position registers 2, 3. Next, the data of the first operand is read in from main storage. The read-in data is inputted to a shifter 4 through a bus 8. The shifter 4 executes four kinds of shift functions according to the beginning byte position. The function of 'through' in the case of the byte position of 00, the function of 'left rotate' in the case of 01, the function of 'exchange' in the case of 10, and the function of 'right rotate' in the case of 11 are executed respectively. Next, the data of the second operand is similarly read in, and the merge is executed. After that, the first operand and the second operand are read in alternately, and the data read in the shifter 4 is inputted to the register 5 through the path 10.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、ストリングデータ処理機構、特にファームウ
ェア命令により制御されるプロセッサにおけるストリン
グデータの処理機構に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a string data processing mechanism, and particularly to a string data processing mechanism in a processor controlled by firmware instructions.

〔従来の技術〕[Conventional technology]

従来、この種のストリング処理機構は、ストリングデー
タを1バイクずつ処理する構成とするか、あるいは片方
のオペランドのデータの開始バイト位置に合わせてもう
一方のオペランドのデータを読み込んだ後に演算を行う
かの2通りの処理方式があった。
Traditionally, this type of string processing mechanism has either processed string data one bike at a time, or performed an operation after reading the data of one operand in line with the starting byte position of the data of the other operand. There were two processing methods.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来のストリグ処理方式のうち、ストリングデ
ータを1バイトずつ処理する場合においてはメモリアク
セス回数が増大し効率が悪く、実行速度も遅いという欠
点がある。
Among the conventional string processing methods described above, when string data is processed one byte at a time, the number of memory accesses increases, resulting in poor efficiency and slow execution speed.

また、オペランドのデータ開始バイト位置に合わせても
う一方のオペランドのデータを読む方式においては、開
始バイト位置の判定など処理が複雑であることから実行
速度の低下、バグの作り込みの可能性が高いという欠点
がある。
In addition, in the method of reading the data of the other operand according to the data start byte position of one operand, processing such as determining the start byte position is complicated, so there is a high possibility that execution speed will decrease and bugs will be introduced. There is a drawback.

〔課題を解決するための手段〕[Means to solve the problem]

本発明のストリングデータ処理機構は、2つのオペラン
ドのストリングデータについて、データの開始バイト位
置、バウンダリ等の意識をすることなく読み込み、演算
することを可能とする様構成されており、ストリングデ
ータの開始バイト位置を2つのオペランドについて保持
する手段と、開始バイト位置レジスタの内容に従い主記
憶から読み出したデータをシフトする手段と、シフタか
ら出力されたデータを第1のマージレジスタに保持する
手段と、シフタから出力されたデータ第2のマージレジ
スタに保持する手段と、第1のマージレジスタの出力を
第2のマージレジスタに再入力する手段と、主記憶から
読み出したデータと第2のマージレジスタの出力とをマ
ージする手段と、ファームウェア命令により前記ハード
ウェアに指示を行う手段とを含んで構成される。
The string data processing mechanism of the present invention is configured to be able to read and operate on the string data of two operands without being aware of the starting byte position of the data, boundaries, etc. means for holding byte positions for two operands; means for shifting data read from main memory according to contents of a start byte position register; means for holding data output from the shifter in a first merge register; means for holding data output from the main memory in a second merge register; means for re-inputting the output of the first merge register into the second merge register; and data read from the main memory and the output of the second merge register. and means for instructing the hardware using firmware instructions.

〔実施例〕〔Example〕

次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は本発明の一実施例のブロック図、第2図は第1
図に示すセレクタ7のマージ機能を示す模式図である。
FIG. 1 is a block diagram of one embodiment of the present invention, and FIG. 2 is a block diagram of an embodiment of the present invention.
FIG. 2 is a schematic diagram showing a merge function of the selector 7 shown in the figure.

1はデータバス、2,3はオペランドのデータ開始バイ
ト位置を格納するレジスタ、4はレジスタ2,3の内容
に従い主記憶からのデータをシフトするシフタ、5,6
は主記憶より読み出されたデータを保持するレジスタ、
7はレジスサ2,3の内容に従いレジスタ5からのデー
タと主記憶からのデータをマージするセレクタ、8,9
゜10.11はデータバスである。
1 is a data bus, 2 and 3 are registers that store the data start byte position of the operand, 4 is a shifter that shifts data from the main memory according to the contents of registers 2 and 3, 5 and 6
is a register that holds data read from main memory,
7 is a selector that merges data from register 5 and data from main memory according to the contents of registers 2 and 3; 8 and 9;
10.11 is a data bus.

次に動作について説明する。第3図は第1図に示すシフ
タ4に供給されるオペランドの一例を示す模式図、第4
図は第1図に示すレジスタの状態遷移を示す模式図であ
る。
Next, the operation will be explained. FIG. 3 is a schematic diagram showing an example of an operand supplied to the shifter 4 shown in FIG.
The figure is a schematic diagram showing the state transition of the register shown in FIG. 1.

ストリングデータは主記憶にバウンダリの制限もなく配
置されており、一方、主記憶からのデータ読み出しは通
常4バイト単位で行なわれる。
String data is arranged in the main memory without boundary restrictions, while data reading from the main memory is usually performed in units of 4 bytes.

そこで、ハードウェアにより主記憶上のストリングデー
タを4バイトそろえた形で処理する機構を考える。
Therefore, we will consider a mechanism that uses hardware to process string data on the main memory in the form of aligned 4 bytes.

ストリングデータの開始アドレスの最下位2ビトは、ス
トリングデータの開始バイト位置である。
The two least significant bits of the start address of the string data are the start byte position of the string data.

以後、2つのオペランドのストリングデータを演算する
場合を考える。
Hereinafter, a case will be considered in which the string data of two operands are operated.

まず、第1オペランド、第2オペランドのデータ開始バ
イト位置をバイト位置レジスタ2,3にそれぞれセット
する。次に第1オペランドのデータを主記憶より読み込
む。読込まれたデータはパス8を経由しシフタ4に入力
される。
First, the data start byte positions of the first and second operands are set in byte position registers 2 and 3, respectively. Next, the data of the first operand is read from the main memory. The read data is input to the shifter 4 via a path 8.

シフタ4では開始バイト位置により4種類のシフトファ
ンクションを実行する。バイト位置が00の場合、ファ
ンクションはスルー 01の場合はレフト・ローテート
、10の場合はエクスチェンジ、11の場合はライト・
ローテートを行う。
The shifter 4 executes four types of shift functions depending on the starting byte position. If the byte position is 00, the function is through, if it is 01, it is a left rotation, if it is 10, it is an exchange, and if it is 11, it is a right rotation.
Rotate.

第3図に示すストリングデータでは、データ開始バイト
位置が01であるなめシフタではレフト・ローテートが
行なわれ、タイミングT1の様にシフタ4にセットされ
る。
In the string data shown in FIG. 3, a left rotation is performed in the lick shifter where the data start byte position is 01, and the data is set in the shifter 4 at timing T1.

次に第1オペランドの次のデータを読み込み、シフタ4
の内容をレジスタ5に転送する。
Next, read the next data of the first operand and use shifter 4.
The contents of are transferred to register 5.

この時、シフタ4の内容とレジスタ5の内容のマージを
セレクタ7で行う。セレクタ7はバイト位置レジスタの
内容によりレジスタ5とシフタ4の各バイトのデータを
選択し、バイト位置が00の場合はレジスタ5の全バイ
トを、01の場合はレジスタ5の上位3バイトとシフタ
4の下位1バイト、10の場合はレジスタ5の上位2バ
イトとシフタ4の下位2バイト11の場合はレジスタ5
の上位1バイトとシフタ4の下位3バイトをそれぞれマ
ージする。
At this time, the contents of the shifter 4 and the contents of the register 5 are merged by the selector 7. Selector 7 selects the data in each byte of register 5 and shifter 4 according to the contents of the byte position register. If the byte position is 00, all bytes of register 5 are selected, and if the byte position is 01, the upper 3 bytes of register 5 and shifter 4 are selected. The lower 1 byte of 10, the upper 2 bytes of register 5 and the lower 2 bytes of shifter 4, 11, register 5
The upper 1 byte of shifter 4 and the lower 3 bytes of shifter 4 are merged.

次に第2オペランドのデータについても同様に読み込み
、タイミングT 3 、T 4の様にマージを行う。そ
の後は、第1オペランドと第2オペランドを交互に読み
込み、タイミングT s 、 T 6の様に、シフタ4
に読み込まれたデータはパス10を経由してレジスタ5
へ入力される。
Next, the data of the second operand is similarly read and merged at timings T3 and T4. After that, the first operand and the second operand are read alternately, and the shifter 4 is read at timing T s and T 6.
The data read into register 5 via path 10.
is input to.

この様にして最初のストリングデータの読み込みタイミ
ングT 1.T2 、T3 、T4の後は第1オペラン
ド、第2オペランドを交互に読み込むことにより、スト
リングデータを連続に演算することが可能となる。
In this way, the first string data reading timing T1. After T2, T3, and T4, by reading the first operand and the second operand alternately, it becomes possible to continuously calculate string data.

前記動作は全てファームウェアの指示により実行され、
タイミングT1は第1オペランドリードのファーストス
テップ、タイミングT2は第1オペランドリードのミド
ルステップ、タイミングT3は第2オペランドリードの
ファーストステ・ンブ、タイミングT4は第2オペラン
ドリードのミドルステップ、タイミングT 5. T 
6はそれぞれ第1、第2オペランドリードのミドルステ
・ンブに相当する。
All of the above operations are performed according to firmware instructions,
Timing T1 is the first step of reading the first operand, timing T2 is the middle step of reading the first operand, timing T3 is the first step of reading the second operand, timing T4 is the middle step of reading the second operand, timing T5. T
6 corresponds to the middle stage of the first and second operand reads, respectively.

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

以上説明したように本発明は、主記憶から読み出したス
トリングデータを保持するレジスタを2つ持ち、データ
の開始バイト位置によるシフトマージを2つのオペラン
ドに対し交互に行うことにより、効率良くメモリアクセ
スを行いながら連続的にストリングデータの処理を行う
ことを可能としたので、ストリングデータの処理・演算
速度を向上できる効果がある。
As explained above, the present invention has two registers that hold string data read from main memory, and performs shift-merging based on the starting byte position of the data alternately for two operands, thereby achieving efficient memory access. Since it is possible to continuously process string data while performing the above operations, it is possible to improve the processing and calculation speed of string data.

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

第1図は本発明の一実施例を示すブロック図、第2図は
第1図に示すセレクタのマージ機能を示す模式図、第3
図は第1図に示すシフタに供給されるオペランドの一例
を示す模式図、第4図は第1図に示すレジスタの状態遷
移を示す模式図である。 1・・・データバス、2,3・・・レジスタ、4・・・
シフタ、5.6・・・レジスタ、7・・・セレクタ、8
〜11・・データバス。
FIG. 1 is a block diagram showing one embodiment of the present invention, FIG. 2 is a schematic diagram showing the merging function of the selector shown in FIG. 1, and FIG.
1 is a schematic diagram showing an example of an operand supplied to the shifter shown in FIG. 1, and FIG. 4 is a schematic diagram showing a state transition of the register shown in FIG. 1. 1...Data bus, 2, 3...Register, 4...
Shifter, 5.6... Register, 7... Selector, 8
~11...Data bus.

Claims (1)

【特許請求の範囲】[Claims] ファームウェア命令の制御により動作するプロセッサに
おいて、前記ファームウェア命令の指示によりデータバ
スからのデータを取込み前記データをシフトして保持す
ることのできるシフタと、前記シフタの出力をファーム
ウェア命令の指示により格納することのできる第1のマ
ージレジスタと、ファームウェアの命令の指示により前
記シフタの出力または前記第1のマージレジスタの出力
のどちらかを選んで格納できる第2のマージレジスタと
、主記憶上のストリングデータの開始バイト位置をロー
ドできる2組のレジスタと、前記シフタの出力と前記第
2のマージレジスタの出力をファームウェア命令の指示
によって選択された前記バイト位置レジスタの値に従っ
てマージするセレクタとを有し、2つのオペランドのス
トリングデータを交互に該シフタに入力し、次に該デー
タを第1のマージレジスタに入力し、交互に前記オペラ
ンドを読み込みながらシフタの出力と前記第2のマージ
レジスタの出力とをマージすることにより連続してスト
リング演算を行うことを特徴とするストリングデータ処
理機構。
In a processor that operates under the control of a firmware instruction, a shifter capable of taking in data from a data bus and shifting and holding the data according to the instruction of the firmware instruction, and storing an output of the shifter according to the instruction of the firmware instruction. a first merge register that can store the output of the shifter or the output of the first merge register according to firmware instructions; two sets of registers into which a starting byte position can be loaded; and a selector for merging the output of the shifter and the output of the second merge register according to a value of the byte position register selected by an instruction of a firmware instruction; input string data of two operands alternately into the shifter, then input the data into a first merge register, and merge the output of the shifter with the output of the second merge register while reading the operands alternately. A string data processing mechanism characterized in that string operations are performed continuously by performing string operations.
JP14724589A 1989-06-08 1989-06-08 String data processing mechanism Pending JPH0311423A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14724589A JPH0311423A (en) 1989-06-08 1989-06-08 String data processing mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14724589A JPH0311423A (en) 1989-06-08 1989-06-08 String data processing mechanism

Publications (1)

Publication Number Publication Date
JPH0311423A true JPH0311423A (en) 1991-01-18

Family

ID=15425866

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14724589A Pending JPH0311423A (en) 1989-06-08 1989-06-08 String data processing mechanism

Country Status (1)

Country Link
JP (1) JPH0311423A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60225936A (en) * 1984-04-25 1985-11-11 Nec Corp Operation controlling system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60225936A (en) * 1984-04-25 1985-11-11 Nec Corp Operation controlling system

Similar Documents

Publication Publication Date Title
US5608881A (en) Microcomputer system for accessing hierarchical buses
JP2752076B2 (en) Programmable controller
RU2066067C1 (en) Central processor for multiple-processor computer system
JPH0311423A (en) String data processing mechanism
JPH03204030A (en) Processor for computor
US5893928A (en) Data movement apparatus and method
JPH03269728A (en) Instruction execution control system for pipeline computer
JPH06230963A (en) Memory access controller
JPH0654505B2 (en) Parallel processor
JP2982129B2 (en) Micro program controller
JPH0338613B2 (en)
JPH10207708A (en) Programmable controller
JPH0812601B2 (en) Data processing device
JPH0218732B2 (en)
JPH027129A (en) arithmetic processing unit
JPS62143176A (en) Vector register access control system
JPS61182135A (en) Process selecting system
JPH03156604A (en) Programmable controller
JPH04135237A (en) Microprogram control information processor
JPH0792902A (en) Programmable controller
JPH031234A (en) Information processor
JPS6112575B2 (en)
JPH02217924A (en) Store processing method of data processing device
JPH03164849A (en) Microprocessors and microprocessor systems
JPS5896346A (en) Hierarchical calculation method