JPH0778723B2 - Information processing equipment - Google Patents

Information processing equipment

Info

Publication number
JPH0778723B2
JPH0778723B2 JP63281969A JP28196988A JPH0778723B2 JP H0778723 B2 JPH0778723 B2 JP H0778723B2 JP 63281969 A JP63281969 A JP 63281969A JP 28196988 A JP28196988 A JP 28196988A JP H0778723 B2 JPH0778723 B2 JP H0778723B2
Authority
JP
Japan
Prior art keywords
digit
operand
zero
data
digits
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP63281969A
Other languages
Japanese (ja)
Other versions
JPH02127726A (en
Inventor
明久 牧田
一正 田中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP63281969A priority Critical patent/JPH0778723B2/en
Publication of JPH02127726A publication Critical patent/JPH02127726A/en
Publication of JPH0778723B2 publication Critical patent/JPH0778723B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はメモリ上のパック形式の10進数の第2オペラン
ドを値が命令語で指定される数だけゼロの桁を上位に挿
入して第1オペランド位置に転送する命令の処理を行う
情報処理装置に関し、特に10進オーバーフロー例外の検
出を行う情報処理装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial field of use] The present invention inserts a second decimal operand in a packed format on a memory by inserting zero digits into the upper order by the number specified by an instruction word. The present invention relates to an information processing device that processes an instruction to be transferred to a 1-operand position, and particularly to an information processing device that detects a decimal overflow exception.

〔従来の技術〕[Conventional technology]

ある種の汎用計算機には、第4図(b)に示すように、
メモリ上の(l2+1)バイトのパック形式の10進数の第
2オペランドを上位にv1個のゼロの桁を挿入してメモリ
上の(l1+1)バイトの第1オペランド位置に転送する
命令(以下、ZAVL命令と記す)がある。このZAVL命令に
よるデータ転送の際、第2オペランドの符号は第1オペ
ランドの最下位の桁に転送される。数字の転送において
第2オペランドの桁が不足した場合には、符号桁を除く
第1オペランドの下位に値がゼロの桁が詰められ、第2
オペランドの桁が多かった場合には余った第2オペラン
ドの数字は転送されずに切り捨てられる。このとき、切
り捨てられた数字に有効数字がある場合、プログラム状
態語(PSW)内の10進オーバーフローマスクビットが1
であれば10進オーバーフロー例外となり、プロズラム割
込みを起す。
As shown in FIG. 4 (b), a general-purpose computer of a certain type:
The packed second decimal operand of (l 2 +1) bytes in memory is inserted into the upper digit of v 1 zero digit and transferred to the first operand position of (l 1 +1) bytes in memory There is an instruction (hereinafter referred to as ZAVL instruction). At the time of data transfer by this ZAVL instruction, the code of the second operand is transferred to the least significant digit of the first operand. When the digits of the second operand are insufficient in the transfer of numbers, the digits of zero value are packed in the lower order of the first operand excluding the sign digit,
When the number of digits of the operand is large, the number of the surplus second operand is truncated without being transferred. At this time, if the truncated digits have significant digits, the decimal overflow mask bit in the program status word (PSW) is 1
If so, it becomes a decimal overflow exception and causes a prozram interrupt.

従来、この種のZAVL命令の実行は、性能が要求されない
場合には1バイト単位に処理されていた。詳しくは、ま
ず1バイト単位にv1桁のゼロを第1オペランドの上位に
転送し、次にメモリから1バイト単位に第2オペランド
を上位から順次読み出し、先にゼロを転送した第1オペ
ランド位置の下位に転送する。この転送において、第2
オペランドが不足した場合には、後にゼロの桁を補って
転送する。逆に、第2オペランドが余った場合には、余
った桁は第1オペランド位置には転送されず、有効数字
を含んでいるかどうかが順次検査される。有効数字を含
んでいれば、10進オーバーフローマスクビットが1のと
きに10進オーバーフロー例外が検出される。転送の最後
のバイトの下位桁には第2オペランドの符号が入れら
れ、第1オペランドの符号として転送される。
Conventionally, the execution of this type of ZAVL instruction has been processed in 1-byte units when performance is not required. In detail, first v 1 digit zero is transferred to the upper part of the first operand in 1-byte units, then the second operand is read sequentially from the upper part in 1-byte units from the memory, and the first operand position where the zero was transferred first Transfer to the lower part of. In this transfer, the second
When there are not enough operands, they will be transferred after being filled with zeros. Conversely, if the second operand is left over, then the extra digits are not transferred to the first operand position, but are sequentially checked for containing significant digits. If it contains a significant digit, a decimal overflow exception is detected when the decimal overflow mask bit is 1. The sign of the second operand is put in the lower digit of the last byte of the transfer, and is transferred as the sign of the first operand.

一方、性能が要求される場合には、複数バイト、例えば
8バイト単位で第2オペランドの全てをメモリから読み
出し、演算回路内で右詰めになるように整列(シフト)
して演算回路に供給し、演算回路ではこれを(v1+2l2
−2l1)桁だけ右シフトし第1オペランドとして演算回
路内で右詰めされたデータを得る。ここで、v1,l1およ
びl2は、それぞれ第4図(a)に示すZAVL命令の命令語
で与えられるオフセット,(第1オペランドのバイト長
−1)および(第2オペランドのバイト長−1)であ
る。なお、(v1+2l2−2l1)が負の場合には、−(v1
2l2−2l1)桁の左シフトが行われる。(v1+2l2−2l1
が1以上の場合には、上記右シフトによって有効桁切り
捨てられる可能性があるため、シフトに先だって第2オ
ペランドの下位(v1+2l2−2l1)桁内に有効数字が含ま
れるかどうかをチェックする。このために、演算回路内
には、各桁の値のゼロを検出する回路と、この回路の出
力に基づいて下位に連なるゼロの桁の数mを数える回路
と、この数mと前記(v1+2l2−2l1)とを比較する回路
とをもつ。この比較回路による比較において、m<(v1
+2l2−2l1)ならば切り捨てられる有効桁があることを
示し、10進オーバーフローマスクビットが1ならば10進
オーバーフロー例外となる。上記右シフトされたデータ
は、最下位桁に第2オペランドの符号に相当する符号
(ただし、有効桁の切捨てが発生せずに第1オペランド
の値がゼロのときには正符号)が埋め込まれ、第1オペ
ランドのアドレスに合わせて整列されてメモリにストア
される。
On the other hand, when performance is required, all the second operands are read from the memory in units of multiple bytes, for example, 8 bytes, and aligned (shifted) so that they are right-justified in the arithmetic circuit.
And supply it to the arithmetic circuit, which is (v 1 + 2l 2
-2l 1 ) Shift right by digit and obtain right-justified data in the arithmetic circuit as the first operand. Here, v 1 , l 1 and l 2 are the offsets given by the instruction word of the ZAVL instruction shown in FIG. 4 (a), (the byte length of the first operand-1) and (the byte length of the second operand, respectively). -1). In addition, when (v 1 + 2l 2 −2l 1 ) is negative, − (v 1 +
2l 2 −2l 1 ) digits are shifted left. (V 1 + 2l 2 −2l 1 )
If 1 is 1 or more, significant digits may be truncated by the above right shift. Therefore, check whether significant digits are included in the lower (v 1 + 2l 2 −2l 1 ) digits of the second operand before shifting. To check. For this reason, in the arithmetic circuit, a circuit for detecting the zero of the value of each digit, a circuit for counting the number m of zero digits connected in the lower order based on the output of this circuit, and this number m and the above (v 1 + 2l 2 −2l 1 ) and a circuit for comparing with. In the comparison by this comparison circuit, m <(v 1
+ 2l 2 −2l 1 ) indicates that there is a significant digit to be truncated, and if the decimal overflow mask bit is 1, it is a decimal overflow exception. The right-shifted data has a code corresponding to the code of the second operand embedded in the least significant digit (provided that the plus sign is used when the value of the first operand is zero without truncation of significant digits), and The data is aligned according to the address of one operand and stored in the memory.

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

上述した従来の情報処理装置では、前者のバイト単位に
処理する場合には、1バイト単位に処理が実行されるの
で、処理の高速化が望めないという欠点がある。
In the above-described conventional information processing apparatus, when processing in the former byte unit, the processing is executed in 1-byte units, so that there is a drawback in that speeding up of the processing cannot be expected.

また、後者の複数バイト同時に処理する場合には、ZAVL
命令専用に第2オペランドの下位に連なる値がゼロの桁
の数を検出するための回路が必要になって金物量が増加
するか、または別にシフト回路により切り捨てられる桁
のみのデータを求めてそれがゼロかどうかをチェックす
る必要があるので、そのための処理時間が増加するとい
う欠点がある。
In the latter case, when processing multiple bytes at the same time, ZAVL
For the instruction only, a circuit for detecting the number of digits whose value is zero, which is connected to the lower order of the second operand, is required, and the amount of hardware increases. Since it is necessary to check whether or not is zero, there is a disadvantage that the processing time for that increases.

本発明の目的は、上述の点に鑑み、ZAVL命令のオーバー
フローの検出を他の10進命令のオーバーフローの検出と
同様に処理することにより、ZAVL命令を少ない金物量で
高速に処理することができるようにした情報処理装置を
提供することにある。
In view of the above points, an object of the present invention is to process the ZAVL instruction overflow detection in the same manner as other decimal instruction overflow detection, thereby enabling the ZAVL instruction to be processed at a high speed with a small amount of metal. It is to provide the information processing device.

〔課題を解決するための手段〕[Means for Solving the Problems]

本発明の情報処理装置は、最下位桁に符号桁を有するパ
ック形式の10進数の第2オペランドを命令語で指定され
た数だけ値がゼロの桁を上位に挿入して第1オペランド
位置に転送する命令の処理を行う情報処理装置におい
て、メモリから読み出した第2オペランドを演算回路内
で右詰めになるように整列する整列手段と、この整列手
段により整列された第2オペランドの符号桁をゼロにマ
スクするマスク手段と、このマスク手段によりマスクさ
れたデータを命令語で指定する桁数と第1オペランドお
よび第2オペランドの桁数とに応じて第1オペランドと
して演算回路内で右詰めになるようにローテーションシ
フトするローテーションシフト手段と、このローテーシ
ョンシフト手段によりローテーションシフトされたデー
タの各桁の値がゼロかどうかを検出する第1の桁ゼロ検
出手段と、この第1の桁ゼロ検出手段の出力から上位に
連なる値がゼロの桁の数を求め前記ローテーションシフ
ト手段によりローテーションシフトされたデータの有効
桁数を得る有効桁数取得手段と、前記ローテーションシ
フト手段によりローテーションシフトされたデータの最
下位の桁ゼロを検出する第2の桁ゼロ検出手段と、前記
有効桁数取得手段により得られた有効桁数と第1オペラ
ンドの桁数とを比較する比較手段と、この比較手段の出
力と前記第1の桁ゼロ検出手段の出力と前記第2の桁ゼ
ロ検出手段の出力と第2オペランドの符号と10進オーバ
ーフローマスクビットとに応答して条件コードを生成し
10進オーバーフロー例外を検出するオーバーフロー例外
検出手段と、前記ローテーションシフト手段によりロー
テーションシフトされたデータの最下位桁に結果符号を
埋め込む結果符号埋込み手段と、この結果符号埋込み手
段により結果符号が埋め込まれたデータを第1オペラン
ドのアドレスに合わせて整列し第1オペランドの長さだ
けメモリに格納する格納手段とを有する。
The information processing apparatus according to the present invention inserts the second operand of a packed decimal number having a code digit in the least significant digit into the upper digit by the number specified by the instruction word, and inserts the digit into the upper operand. In an information processing device that processes an instruction to be transferred, an aligning unit that aligns the second operand read from the memory so that it is right-justified in an arithmetic circuit, and a code digit of the second operand that is aligned by the aligning unit. The masking means for masking to zero, and the data masked by the masking means are right-justified in the arithmetic circuit as the first operand according to the number of digits designated by the instruction word and the number of digits of the first operand and the second operand. Rotation shift means for performing rotation shift so that the value of each digit of the data rotated by this rotation shift means is zero. First digit zero detecting means for detecting whether or not the number of digits in the upper-order value of zero is detected from the output of the first digit zero detecting means, and the effective digit number of the data rotation-shifted by the rotation shift means. Effective digit number obtaining means, second digit zero detecting means for detecting the least significant digit zero of the data rotation-shifted by the rotation shift means, and the effective digit number obtained by the effective digit number obtaining means. And a number of digits of the first operand, an output of the comparing means, an output of the first digit zero detecting means, an output of the second digit zero detecting means, and a sign of the second operand. Generate a condition code in response to the binary overflow mask bit
Overflow exception detecting means for detecting a decimal overflow exception, result code embedding means for embedding a result code in the least significant digit of data rotated by the rotation shift means, and result code embedding by the result code embedding means Storage means for aligning the data according to the address of the first operand and storing the data in the memory for the length of the first operand.

〔作用〕[Action]

本発明の情報処理装置では、整列手段がメモリから読み
出した第2オペランドを演算回路内で右詰めになるよう
に整列し、マスク手段が整列手段により整列された第2
オペランドの符号桁をゼロにマスクし、ローテーション
シフト手段がマスク手段によりマスクされたデータを命
令語で指定する桁数と第1オペランドおよび第2オペラ
ンドの桁数とに応じて第1オペランドとして演算回路内
で右詰めになるようにローテーションシフトし、第1の
桁ゼロ検出手段がローテーションシフト手段によりロー
テーションシフトされたデータの各桁の値がゼロかどう
かを検出し、第2の桁ゼロ検出手段がローテーションシ
フト手段によりローテーションシフトされたデータの最
下位の桁ゼロを検出し、有効桁数取得手段が第1の桁ゼ
ロ検出手段の出力から上位に連なる値がゼロの桁の数を
求めローテーションシフト手段によりローテーションシ
フトされたデータの有効桁数を得、比較手段が有効桁数
取得手段により得られた有効桁数と第1オペランドの桁
数とを比較し、オーバーフロー例外検出手段が比較手段
の出力と第1の桁ゼロ検出手段の出力と第2の桁ゼロ検
出手段の出力と第2オペランドの符号と10進オーバーフ
ローマスクビットとに応答して条件コードを生成し10進
オーバーフロー例外を検出し、結果符号埋込み手段がロ
ーテーションシフト手段によりローテーションシフトさ
れたデータの最下位桁に結果符号を埋め込み、格納手段
が結果符号埋込み手段により結果符号が埋め込まれたデ
ータを第1オペランドのアドレスに合わせて整列し第1
オペランドの長さだけメモリに格納する。
In the information processing apparatus of the present invention, the aligning means aligns the second operands read from the memory so that they are right-justified in the arithmetic circuit, and the masking means aligns the second operands.
An arithmetic circuit as a first operand according to the number of digits designated by the instruction word for the data masked by the masking means by the rotation shift means and the number of digits of the first operand and the second operand. The first digit zero detecting means detects whether the value of each digit of the data rotation-shifted by the rotation shifting means is zero, and the second digit zero detecting means The rotation shift means detects the lowest digit zero of the rotation-shifted data, and the effective digit number obtaining means obtains the number of digits having a value of zero from the output of the first digit zero detecting means to the rotation shift means. The effective digit number of the rotation-shifted data is obtained by the The effective digit number and the digit number of the first operand are compared, and the overflow exception detecting means outputs the output of the comparing means, the output of the first digit zero detecting means, the output of the second digit zero detecting means, and the second operand. In response to the sign and the decimal overflow mask bit to detect a decimal overflow exception, and the result code embedding means embeds the result code in the least significant digit of the data rotation-shifted by the rotation shift means. The storage unit aligns the data in which the result code is embedded by the result code embedding unit according to the address of the first operand, and first
Store only the length of the operand in memory.

〔実施例〕 次に、本発明について図面を参照して詳細に説明する。EXAMPLES Next, the present invention will be described in detail with reference to the drawings.

第1図は、本発明の一実施例の情報処理装置における演
算回路の構成を示す回路ブロック図である。この演算回
路は、メモリ1と、制御回路2と、アライナ3と、レン
グスレジスタ4と、符号レジスタ5と、データレジスタ
6〜8と、シフト量レジスタ9と、レングスデコーダ10
と、桁ゼロ検出回路11および12と、加算器13と、桁シフ
タ14と、比較回路15と、書込みマスクレジスタ16と、論
理和回路17と、データレジスタ18と、シフト回路19と、
条件コード生成回路20と、アライナ21と、結果符号埋込
み回路22とから構成されている。
FIG. 1 is a circuit block diagram showing a configuration of an arithmetic circuit in an information processing apparatus according to an embodiment of the present invention. This arithmetic circuit includes a memory 1, a control circuit 2, an aligner 3, a length register 4, a sign register 5, data registers 6 to 8, a shift amount register 9, and a length decoder 10.
A digit zero detection circuit 11 and 12, an adder 13, a digit shifter 14, a comparison circuit 15, a write mask register 16, an OR circuit 17, a data register 18, a shift circuit 19,
It is composed of a condition code generation circuit 20, an aligner 21, and a result code embedding circuit 22.

メモリ1は、プログラムを構成する命令語とオペランド
とを格納する。
The memory 1 stores instruction words and operands that form a program.

制御回路2は、ZAVL命令等に基づいて演算回路全体を制
御する。
The control circuit 2 controls the entire arithmetic circuit based on a ZAVL instruction or the like.

アライナ3は、メモリ1から読み出したオペランドをオ
ペランドアドレスに応じて以後の演算に都合のいい位置
に整列するとともに演算に不要な部分をゼロにマスクす
る。ZAVL命令の場合、メモリ1から読み出された8バイ
トの第2オペランドはアライナ3によって右詰めにシフ
トされるとともに、8バイトのデータのうちの第2オペ
ランドでない部分(符号桁を含む)にゼロが埋め込まれ
る。
The aligner 3 aligns the operands read from the memory 1 at a position convenient for the subsequent calculation according to the operand address, and masks a portion unnecessary for the calculation to zero. In the case of the ZAVL instruction, the 8-byte second operand read from the memory 1 is shifted right justified by the aligner 3, and the non-second operand portion of the 8-byte data (including the sign digit) is zero. Is embedded.

レングスレジスタ4は、オペランドのバイト長を保持す
るレジスタである。バイト長は制御回路2から供給され
る。
The length register 4 is a register that holds the byte length of the operand. The byte length is supplied from the control circuit 2.

符号レジスタ5は、10進データの符号を保持し、演算の
符号や条件コードの作成に使用される。ZAVL命令の場合
は、第2オペランドがアライナ3からデータレジスタ6
および7に転送されるタイミングでその符号が符号レジ
スタ5に取り込まれると同時に、符号桁をゼロに置き換
えたデータがデータレジスタ6および7に転送される。
The code register 5 holds the code of decimal data, and is used for creating a code for operation and a condition code. In the case of the ZAVL instruction, the second operand is from the aligner 3 to the data register 6
The code is taken into the code register 5 at the timing of being transferred to the data registers 7 and 7, and at the same time, the data in which the code digit is replaced with zero is transferred to the data registers 6 and 7.

データレジスタ6〜8は、演算用の8バイトのデータレ
ジスタであり、加算器13および桁シフタ14の入力レジス
タである。
The data registers 6 to 8 are 8-byte data registers for calculation, and are input registers of the adder 13 and the digit shifter 14.

シフト量レジスタ9は、桁シフタ14のシフト量を保持す
る。ZAVL命令の場合は、桁シフタ14のシフト量として
(2l1−2l2−v1)の値が制御回路2からシフト量レジス
タ9に供給される。
The shift amount register 9 holds the shift amount of the digit shifter 14. In the case of the ZAVL instruction, the value of (2l 1 −2l 2 −v 1 ) as the shift amount of the digit shifter 14 is supplied from the control circuit 2 to the shift amount register 9.

加算器13は、データレジスタ6および7の内容を10進加
算する加算回路である。
The adder 13 is an adder circuit that adds the contents of the data registers 6 and 7 in decimal.

桁シフタ14は、データレジスタ8の内容をシフト量レジ
スタ9に指示される桁数(2l1−2l2−v1)だけシフトす
るシフト回路である。シフト量(2l1−2l2−v1)が正の
ときは左シフトを、負のときは右シフトを行い、出力は
8バイトである。また、桁シフタ14は、制御回路2から
の指示に応じてローテーションシフトと単純シフトとを
選択的に実行可能である。ローテーションシフトの場
合、シフトによってこぼれた桁は反対側からのシフトイ
ンデータとなる。単純シフトの場合、シフトインデータ
はゼロである。ZAVL命令に限らず、10進命令は、演算回
路内で右詰めされた演算データを桁シフタ14と加算器13
とによって演算し、同じく右詰めされた演算結果を得
る。ZAVL命令の場合、第2図に示すように、(オペラン
ドのバイト長−1)l1,l2およびオフセットv1の値によ
り処理が異なる。第2図において、8バイトのローテー
ションシフト/単純シフトとは、桁シフタ14によって行
うローテーションシフト/単純シフトであり、16バイト
のローテーションシフト/単純シフトとは、16バイトの
第2オペランド(第2オペランドが16バイトに満たない
場合は上位にゼロを補って16バイトにしたもの)を桁シ
フタ14と加算器13とを使って行う16バイトのローテーシ
ョンシフト/単純シフトである。第2図において、(2l
1−2l2−v1)<0でかつl1>7およびl2>7のときに
は、オーバーフローの検出のために従来技術のやり方と
同じように右シフトによって切り捨てられる部分のデー
タを別に求め、その値がゼロかどうかをチェックしなけ
ればならない。
The digit shifter 14 is a shift circuit that shifts the contents of the data register 8 by the number of digits (2l 1 −2l 2 −v 1 ) designated by the shift amount register 9. When the shift amount (2l 1 −2l 2 −v 1 ) is positive, left shift is performed, and when it is negative, right shift is performed, and the output is 8 bytes. Further, the digit shifter 14 can selectively execute rotation shift and simple shift according to an instruction from the control circuit 2. In the case of rotation shift, the digit spilled by the shift becomes shift-in data from the opposite side. In the case of simple shift, the shift-in data is zero. Not only the ZAVL instruction but also the decimal instruction, the operation data right-justified in the operation circuit is digit shifter 14 and adder 13
The calculation is performed by and, and the right-justified calculation result is obtained. In the case of the ZAVL instruction, as shown in FIG. 2, the processing differs depending on the values of (operand byte length-1) l 1 and l 2 and the offset v 1 . In FIG. 2, an 8-byte rotation shift / simple shift is a rotation shift / simple shift performed by the digit shifter 14, and a 16-byte rotation shift / simple shift is a 16-byte second operand (second operand). Is less than 16 bytes, it is a 16-byte rotation shift / simple shift performed by using the digit shifter 14 and the adder 13 to add 16 to the upper byte to make 16 bytes. In Fig. 2, (2l
When 1 −2l 2 −v 1 ) <0 and l 1 > 7 and l 2 > 7, the data of the part to be truncated by the right shift is separately obtained in the same manner as in the prior art to detect overflow, We have to check if the value is zero.

桁ゼロ検出回路11は、データレジスタ6および7にそれ
ぞれ保持された8バイトの10進データを連結した16バイ
トの10進データの各桁毎にその値がゼロかどうかを示す
桁ゼロ信号Zi(i=0〜31)を検出する。さらに、桁ゼ
ロ信号Z0から始まり上位に連なる値が1の桁ゼロ信号Zi
の数を数えて出力する。例えば、Z0Z1Z2…Z31=11110…
1とするとZ0から始まる連続する1の数の4であるから
4を出力する。
The digit zero detection circuit 11 is a digit zero signal Z i that indicates whether the value of each digit of 16 bytes of decimal data, which is obtained by concatenating the 8 bytes of decimal data held in the data registers 6 and 7, is zero. (I = 0 to 31) is detected. Furthermore, the digit zero signal value continuous from the digit zero signal Z 0 at the beginning the higher is 1 Z i
Count and output. For example, Z 0 Z 1 Z 2 ... Z 31 = 11110 ...
When set to 1, 4 is output because it is 4 which is the number of consecutive 1s starting from Z 0 .

桁ゼロ検出回路12は、データレジスタ7の最下位の桁ゼ
ロを検出する。桁ゼロ検出回路12の出力は、上記の桁ゼ
ロ信号Z31と一致する。
The digit zero detection circuit 12 detects the least significant digit zero of the data register 7. The output of the digit zero detection circuit 12 matches the digit zero signal Z 31 described above.

比較回路15は、レングスレジスタ4内の第1オペランド
のバイト長を2倍したもの、すなわち第1オペランドの
桁数(l1+1)と、32から桁ゼロ検出回路11の出力を引
いたもの、すなわちデータレジスタ6および7内の16バ
イトのデータの有効桁数とを比較する。第1オペランド
の桁数の方が16バイトのデータの有効桁数より小さいと
きには、ストアの際に切り捨てられる有効桁があり10進
オーバーフロー例外を発生する可能性があるので、比較
回路15は1を出力し、それ以外のときには0を出力す
る。
The comparison circuit 15 doubles the byte length of the first operand in the length register 4, that is, the number of digits (l 1 +1) of the first operand, and 32 minus the output of the digit zero detection circuit 11, That is, the number of significant digits of 16-byte data in the data registers 6 and 7 is compared. When the number of digits of the first operand is smaller than the number of significant digits of 16-byte data, there is a possibility that a decimal digit overflow exception may occur due to truncation of significant digits when storing, so the comparator circuit 15 sets 1 to 1. Output, and 0 otherwise.

論理和回路17は、比較回路15の出力と桁ゼロ検出回路12
の出力との論理和をとる。ZAVL命令の場合、右方向のロ
ーテーションシフトを行ったときに最下位の符号桁にも
切り捨てられるべき有効数字が入る可能性があるため、
最下位桁の桁ゼロ信号もオーバーフロー発生の条件とし
て見る必要がある。
The OR circuit 17 includes the output of the comparison circuit 15 and the digit zero detection circuit 12
OR with the output of. In the case of the ZAVL instruction, significant digits to be truncated may be included in the least significant code digit when the right rotation shift is performed.
The digit zero signal of the least significant digit must also be seen as a condition for overflow occurrence.

条件コード生成回路20は、比較回路15,論理和回路17,符
号レジスタ5,桁ゼロ検出回路11および10進オーバーフロ
ーマスクビットからデータレジスタ6および7に得られ
た演算結果を第1オペランドとしてメモリ1にストアす
るときの条件コードの生成と例外の検出とを行う。すな
わち、桁ゼロ検出回路11の出力である桁ゼロ信号Zi(i
=0〜31)が全て1のときには演算結果はゼロであるか
ら、それを示す条件コード0を生成する。一方、オーバ
ーフローが発生しない場合で少なくとも1つの桁ゼロ信
号Ziが1でないときには、符号レジスタ5で示される正
負に応じて条件コードを生成する(正の場合は2、負の
場合は1)。さらに、比較回路15または論理和回路17に
よってオーバーフローの発生が検知される場合には、条
件コード3を生成し、10進オーバーフローマスクビット
が1のときには、さらに10進オーバーフロー例外を発生
させる。論理和回路17の出力は、ZAVL命令の場合にのみ
使用され、それ以外の10進命令のときには比較回路15の
出力のみがオーバーフローの検出に用いられる。
The condition code generation circuit 20 uses the operation result obtained from the comparison circuit 15, the logical sum circuit 17, the sign register 5, the digit zero detection circuit 11 and the decimal overflow mask bit in the data registers 6 and 7 as the first operand. Generates a condition code and stores an exception when storing in the. That is, the digit zero signal Z i (i
= 0 to 31) are all 1, the operation result is zero, so the condition code 0 indicating that is generated. On the other hand, when the overflow does not occur and at least one digit zero signal Z i is not 1, the condition code is generated according to the positive or negative value indicated by the sign register 5 (2 if positive, 1 if negative). Further, when the occurrence of overflow is detected by the comparison circuit 15 or the OR circuit 17, the condition code 3 is generated, and when the decimal overflow mask bit is 1, a decimal overflow exception is further generated. The output of the OR circuit 17 is used only for the ZAVL instruction, and for the other decimal instructions, only the output of the comparison circuit 15 is used for detecting the overflow.

レングスデコーダ10は、レングスレジスタ4の内容(オ
ペランドのバイト長)をデコードし、右端からレングス
レジスタ4の内容の数だけ1が連続した16ビットのデー
タを出力する。例えば、レングスレジスタ4の内容が3
のときには“0000000000000111"を出力する。これは、
演算回路の内部で演算結果は上位にゼロを拡張して16バ
イトとして扱われ、そのために演算結果が8バイト以内
でデータレジスタ7に入りきる場合にもデータレジスタ
6にゼロのデータを入れ、合わせて16バイトの演算結果
としてオーバーフローの検出を行うためである。レング
スデコーダ10の出力は、演算によって得られた右詰めデ
ータのうちの第1オペランドとしてメモリ1にストアさ
れるバイト位置を示している。例えば、前記の“000000
0000000111"のケースでは、右端の3バイトがストアさ
れることを示している。
The length decoder 10 decodes the content of the length register 4 (byte length of the operand), and outputs 16-bit data in which 1 is consecutive from the right end by the number of contents of the length register 4. For example, if the content of the length register 4 is 3
In the case of, "0000000000000111" is output. this is,
Inside the operation circuit, the operation result is treated as 16 bytes by extending the upper zero with 0. Therefore, even if the operation result can fit in the data register 7 within 8 bytes, put the zero data in the data register 6 and combine it. This is because overflow is detected as a result of the operation of 16 bytes. The output of the length decoder 10 indicates the byte position stored in the memory 1 as the first operand of the right-justified data obtained by the operation. For example, the above “000000
In the case of 0000000111 ", it indicates that the rightmost 3 bytes are stored.

書込みマスクレジスタ16は、レングスデコーダ10の出力
を保持する。
The write mask register 16 holds the output of the length decoder 10.

結果符号埋込み回路22は、桁シフタ14によりローテーシ
ョンシフトされ加算器13から出力されたストアデータの
最下位桁に結果符号を埋め込む回路である。
The result code embedding circuit 22 is a circuit for embedding the result code in the least significant digit of the store data that is rotation-shifted by the digit shifter 14 and output from the adder 13.

データレジスタ18は、演算によって得られたストアデー
タを保持するレジスタである。
The data register 18 is a register that holds the store data obtained by the calculation.

アライナ21は、データレジスタ18内の右詰めされた第1
オペランドであるストアデータを第1オペランドアドレ
スに合わせるために左シフトする回路である。これは、
制御回路2によってシフト量が与えられて制御される。
Aligner 21 is the first right-justified first in data register 18.
It is a circuit that shifts the store data, which is an operand, to the left to match the first operand address. this is,
A shift amount is given by the control circuit 2 and controlled.

シフト回路19は、アライナ21と同じように制御され、ア
ライナ21によってシフトされるデータに合わせて書込み
マスクレジスタ16の内容をシフトすることによって、メ
モリ1に送られる8バイトのデータのうちの実際にメモ
リ1に書き込みべきバイト位置を示す。そのために、メ
モリ1に送られる8バイトのデータが演算結果の下位の
8バイトのときには、シフト回路19の出力の下位の8ビ
ットが書込みマスク情報としてメモリ1に送られ、一
方、演算結果の上位の8バイトのときには、シフト回路
19の出力の上位の8ビットが書込みマスク情報としてメ
モリ1に送られる。
The shift circuit 19 is controlled in the same manner as the aligner 21, and shifts the contents of the write mask register 16 according to the data shifted by the aligner 21 so that the 8 bytes of data sent to the memory 1 are actually transferred. Indicates the byte position to be written in memory 1. Therefore, when the 8-byte data sent to the memory 1 is the lower 8 bytes of the operation result, the lower 8 bits of the output of the shift circuit 19 are sent to the memory 1 as the write mask information, while the upper result of the operation result is higher. 8 bytes, shift circuit
The upper 8 bits of the output of 19 are sent to the memory 1 as write mask information.

メモリ1は、8バイトのストアデータと8ビットの書込
みマスク情報とを受け取り、書込みマスク情報に1が立
っているビットに対応するバイトのみをその記憶素子内
に格納する。
The memory 1 receives 8-byte store data and 8-bit write mask information, and stores only the byte corresponding to the bit for which 1 is set in the write mask information in its storage element.

次に、このように構成された本実施例の情報処理装置の
動作について、第3図に示す具体例を用いて説明する。
Next, the operation of the information processing apparatus of this embodiment having the above configuration will be described with reference to the specific example shown in FIG.

第3図に示す具体例では、ZAVL命令は、4バイトの第2
オペランド(l2=3)を上位に8桁のゼロの桁(v1
8)を挿入して6バイトの第1オペランド位置(l1
5)に転送する。また、第2および第1オペランドアド
レスの下3ビットの値(有効数字を格納する先頭のバイ
ト位置(ゼロオリジン)を示す)は、それぞれ1および
2とする。l1,l2およびv1の値から、このケースは第2
図に示す1..(i)のケースに相当する。
In the specific example shown in FIG. 3, the ZAVL instruction is a 4-byte second
Operand (l 2 = 3) is placed in the upper 8 digits of zero (v 1 =
8) is inserted and the 6-byte first operand position (l 1 =
Transfer to 5). Further, the values of the lower 3 bits of the second and first operand addresses (indicating the leading byte position (zero origin) for storing significant figures) are 1 and 2, respectively. From the values of l 1 , l 2 and v 1 , this case is
Shown in 1. This corresponds to the case of (i).

メモリ1から読み出される第2オペランドは、第3図
(i)に示すように、8バイトのデータのうちの2バイ
ト目から始まる4バイトである。最下位桁のSは符号を
表す。この第2オペランドは、アライナ3によって右詰
めされるとともに符号桁にはゼロが埋め込まれて、第3
図(ii)に示すようになる。
The second operand read from the memory 1 is 4 bytes starting from the 2nd byte of the 8-byte data as shown in FIG. 3 (i). The lowest digit S represents a code. This second operand is right-justified by the aligner 3 and is padded with zeros in the code digit to obtain the third operand.
It becomes as shown in Figure (ii).

次に、制御回路2によって(2l1−2l2−v1)の値が計算
され、この場合には−4(=2×5−2×3−8)が得
られる。これが桁シフタ14のシフト量となり、第3図
(ii)のデータを右に4桁ローテーションシフトする
と、第3図(iii)に示すようになる。
Next, the value of (2l 1 −2l 2 −v 1 ) is calculated by the control circuit 2, and in this case, −4 (= 2 × 5-2 × 3-8) is obtained. This becomes the shift amount of the digit shifter 14, and when the data of FIG. 3 (ii) is rotated right by four digits, it becomes as shown in FIG. 3 (iii).

比較回路15は、このデータの有効桁数(=16)とレング
スレジスタ4内の第1オペランドのバイト長(=6)を
2倍した値とを比較する。この場合、前者の方が大きい
ためにオーバーフローの可能性があり、10進オーバーフ
ローマスクビットが1のときには10進オーバーフロー例
外を発生する。
The comparator circuit 15 compares the number of significant digits (= 16) of this data with a value obtained by doubling the byte length (= 6) of the first operand in the length register 4. In this case, since the former is larger, there is a possibility of overflow, and when the decimal overflow mask bit is 1, a decimal overflow exception is generated.

次に、結果符号埋込み回路22は、第3図(iv)に示すよ
うに、データの最下位の桁に結果符号Sを埋め込む。こ
の場合、データがゼロでないために、第2オペランドの
符号に相当する符号が埋め込まれる。
Next, the result code embedding circuit 22 embeds the result code S in the least significant digit of the data, as shown in FIG. 3 (iv). In this case, since the data is not zero, the code corresponding to the code of the second operand is embedded.

一方、書込みバイトを指定するために、レングスデコー
ダ10は、レングスレジスタ4の内容である第1オペラン
ドのバイト長(=6)をデコードした16ビットのパター
ンを書込みマスクレジスタ16に設定する(第3図(iv)
参照)。
On the other hand, in order to specify the write byte, the length decoder 10 sets a 16-bit pattern obtained by decoding the byte length (= 6) of the first operand, which is the content of the length register 4, in the write mask register 16 (third part). Figure (iv)
reference).

続いて、アライナ21およびシフト回路19によって右詰め
された演算結果および書込みマスク情報が、第3図
(v)に示すように、第1オペランドのアドレス位置に
シフトされる。
Subsequently, the operation result and the write mask information right-justified by the aligner 21 and the shift circuit 19 are shifted to the address position of the first operand, as shown in FIG. 3 (v).

このようにしてシフトされたデータおよび書込みマスク
情報はメモリ1に送られ、書込みマスク情報が1のビッ
トに対応したバイトのみが第1オペランドとしてメモリ
1に格納される。
The data and the write mask information thus shifted are sent to the memory 1, and only the byte corresponding to the bit having the write mask information of 1 is stored in the memory 1 as the first operand.

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

以上説明したように本発明は、ZAVL命令の処理におい
て、演算回路内で右詰めに整列された第2オペランドか
ら同じく右詰された第1オペランドを得るために右シフ
トが行われる際に右ローテーションシフトを行い、ロー
テーションシフトしたデータの有効桁数とストアされる
第1オペランドの桁数とを比較することによって有効数
字の切捨てによるオーバーフローの発生の検出を行うと
ともに、ローテーションシフトしたデータの最下位の桁
ゼロを調べることによって最下位の符号桁に切り捨てら
れるべき有効数字が入ったことによるオーバーフローの
検出を行うことにより、ZAVL命令をそれ以外の10進命令
のオーバーフローの検出と同じように処理でき、ZAVL命
令のオーバーフローの検出を少ない金物量の増加で高速
に行うことができる効果がある。
As described above, according to the present invention, in the processing of the ZAVL instruction, the right rotation is performed when the right shift is performed in order to obtain the right-justified first operand from the right-justified second operand in the arithmetic circuit. By performing a shift and comparing the number of significant digits of the rotation-shifted data with the number of digits of the first operand to be stored, the occurrence of overflow due to the truncation of the significant digits is detected, and the least significant digit of the rotation-shifted data is detected. The ZAVL instruction can be processed in the same way as the detection of the overflow of any other decimal instruction by detecting the overflow due to the fact that the significant digit to be truncated is entered in the least significant sign digit by checking the digit zero. The effect that ZAVL command overflow can be detected at high speed with a small increase in the amount of metal A.

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

第1図は本発明の一実施例の情報処理装置における演算
回路の構成を示すブロック図、 第2図は本実施例の情報処理装置によるZAVL命令の処理
のケース分けを説明するための図、 第3図は本実施例の情報処理装置によるZAVL命令の処理
を説明する図、 第4図(a)および(b)はZAVL命令のフォーマットお
よび動作を説明する図である。 図において、 1……メモリ、 2……制御回路、 3,21……アライナ、 4……レングスレジスタ、 5……符号レジスタ、 6〜8,18……データレジスタ、 9……シフト量レジスタ、 10……レングスデコーダ、 11,12……桁ゼロ検出回路、 13……加算回路、 14……桁シフタ、 15……比較回路、 16……書込みマスクレジスタ、 17……論理和回路、 19……シフト回路、 20……条件コード生成回路、 22……結果符号埋込み回路である。
FIG. 1 is a block diagram showing the configuration of an arithmetic circuit in an information processing apparatus according to an embodiment of the present invention, and FIG. 2 is a diagram for explaining case classification of ZAVL instruction processing by the information processing apparatus according to the present embodiment. FIG. 3 is a diagram for explaining the processing of a ZAVL instruction by the information processing apparatus of this embodiment, and FIGS. 4 (a) and 4 (b) are diagrams for explaining the format and operation of the ZAVL instruction. In the figure, 1 ... memory, 2 ... control circuit, 3,21 ... aligner, 4 ... length register, 5 ... sign register, 6-8,18 ... data register, 9 ... shift amount register, 10 …… length decoder, 11,12 …… digit zero detection circuit, 13 …… adder circuit, 14 …… digit shifter, 15 …… comparison circuit, 16 …… write mask register, 17 …… OR circuit, 19… ... shift circuit, 20 ... condition code generation circuit, 22 ... result code embedding circuit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】最下位桁に符号桁を有するパック形式の10
進数の第2オペランドを命令語で指定された数だけ値が
ゼロの桁を上位に挿入して第1オペランド位置に転送す
る命令の処理を行う情報処理装置において、 メモリから読み出した第2オペランドを演算回路内で右
詰めになるように整列する整列手段と、 この整列手段により整列された第2オペランドの符号桁
をゼロにマスクするマスク手段と、 このマスク手段によりマスクされたデータを命令語で指
定する桁数と第1オペランドおよび第2オペランドの桁
数とに応じて第1オペランドとして演算回路内で右詰め
になるようにローテーションシフトするローテーション
シフト手段と、 このローテーションシフト手段によりローテーションシ
フトされたデータの各桁の値がゼロかどうかを検出する
第1の桁ゼロ検出手段と、 この第1の桁ゼロ検出手段の出力から上位に連なる値が
ゼロの桁の数を求め前記ローテーションシフト手段によ
りローテーションシフトされたデータの有効桁数を得る
有効桁数取得手段と、 前記ローテーションシフト手段によりローテーションシ
フトされたデータの最下位の桁ゼロを検出する第2の桁
ゼロ検出手段と、 前記有効桁数取得手段により得られた有効桁数と第1オ
ペランドの桁数とを比較する比較手段と、 この比較手段の出力と前記第1の桁ゼロ検出手段の出力
と前記第2の桁ゼロ検出手段の出力と第2オペランドの
符号と10進オーバーフローマスクビットとに応答して条
件コードを生成し10進オーバーフロー例外を検出するオ
ーバーフロー例外検出手段と、 前記ローテーションシフト手段によりローテーションシ
フトされたデータの最下位桁に結果符号を埋め込む結果
符号埋込み手段と、 この結果符号埋込み手段により結果符号が埋め込まれた
データを第1オペランドのアドレスに合わせて整列し第
1オペランドの長さだけメモリに格納する格納手段と を有することを特徴とする情報処理装置。
1. A packed format 10 having a code digit in the least significant digit.
In an information processing device that processes an instruction that inserts a zero-valued number of digits into the first operand position by the number specified by the instruction word, the second operand of the base number is read from the memory. Aligning means for aligning to the right in the arithmetic circuit, masking means for masking the code digits of the second operand aligned by this aligning means to zero, and data masked by this masking means by an instruction word. Rotation shift means for performing rotation shift so that the first operand is right-justified in the arithmetic circuit according to the number of digits to be designated and the number of digits of the first operand and the second operand, and the rotation shift means performs rotation shift. A first digit zero detecting means for detecting whether the value of each digit of the data is zero, and the first digit zero Effective digit number acquisition means for obtaining the number of significant digits of the data rotation-shifted by the rotation shift means by obtaining the number of zero digits in the upper order from the output of the output means, and the data rotation-shifted by the rotation shift means. Second digit zero detecting means for detecting the least significant digit zero of, and comparing means for comparing the effective digit number obtained by the effective digit number obtaining means with the digit number of the first operand; A condition code is generated in response to the output, the output of the first digit zero detecting means, the output of the second digit zero detecting means, the sign of the second operand, and the decimal overflow mask bit, and a decimal overflow exception is generated. The overflow exception detecting means for detecting is connected to the lowest digit of the data rotation-shifted by the rotation shift means. And a result code embedding unit for embedding a code, and a storage unit for aligning the data in which the result code is embedded by the result code embedding unit according to the address of the first operand and storing the data in the memory for the length of the first operand. An information processing device characterized by:
JP63281969A 1988-11-08 1988-11-08 Information processing equipment Expired - Lifetime JPH0778723B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63281969A JPH0778723B2 (en) 1988-11-08 1988-11-08 Information processing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63281969A JPH0778723B2 (en) 1988-11-08 1988-11-08 Information processing equipment

Publications (2)

Publication Number Publication Date
JPH02127726A JPH02127726A (en) 1990-05-16
JPH0778723B2 true JPH0778723B2 (en) 1995-08-23

Family

ID=17646424

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63281969A Expired - Lifetime JPH0778723B2 (en) 1988-11-08 1988-11-08 Information processing equipment

Country Status (1)

Country Link
JP (1) JPH0778723B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4498338B2 (en) * 2002-06-28 2010-07-07 株式会社ルネサステクノロジ Data processing device
JP2014134179A (en) 2013-01-11 2014-07-24 Futaba Industrial Co Ltd Catalyst converter
US10235170B2 (en) * 2016-09-30 2019-03-19 International Business Machines Corporation Decimal load immediate instruction

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57197659A (en) * 1981-05-29 1982-12-03 Mitsubishi Electric Corp Data processing device
JPH0680487B2 (en) * 1984-08-15 1994-10-12 株式会社日立製作所 Processor

Also Published As

Publication number Publication date
JPH02127726A (en) 1990-05-16

Similar Documents

Publication Publication Date Title
US5481734A (en) Data processor having 2n bits width data bus for context switching function
US6128614A (en) Method of sorting numbers to obtain maxima/minima values with ordering
US4449184A (en) Extended address, single and multiple bit microprocessor
US5390307A (en) Apparatus for a multi-data store or load instruction for transferring multiple contiguous storage locations in one transfer operation
US4038643A (en) Microprogramming control system
US4710866A (en) Method and apparatus for validating prefetched instruction
US5745722A (en) Apparatus for decoding instruction immediate data to produce a string having a single bit different from other bit thereof
US5502827A (en) Pipelined data processor for floating point and integer operation with exception handling
US3675214A (en) Processor servicing external devices, real and simulated
JPH0248931B2 (en)
JP2889845B2 (en) Information processing device
JPH0145649B2 (en)
US6036350A (en) Method of sorting signed numbers and solving absolute differences using packed instructions
US5421029A (en) Multiprocessor including system for pipeline processing of multi-functional instructions
JPS63261449A (en) Data processor
US4670836A (en) Device for detecting an overlap of operands to be accessed
JPH0546383A (en) Data processor
US6757809B1 (en) Data processor having 2n bits width data bus for context switching functions
EP0144268A2 (en) Method for controlling buffer memory in data processing apparatus
JPH0778723B2 (en) Information processing equipment
JPH034936B2 (en)
US5396610A (en) Register address specifying circuit for simultaneously accessing two registers
JP2748957B2 (en) Data processing device
JPH027097B2 (en)
US6230238B1 (en) Method and apparatus for accessing misaligned data from memory in an efficient manner