JPH0844538A - Method and apparatus for execution of precise rounding processing to divided result and extracted result of square root - Google Patents

Method and apparatus for execution of precise rounding processing to divided result and extracted result of square root

Info

Publication number
JPH0844538A
JPH0844538A JP7165167A JP16516795A JPH0844538A JP H0844538 A JPH0844538 A JP H0844538A JP 7165167 A JP7165167 A JP 7165167A JP 16516795 A JP16516795 A JP 16516795A JP H0844538 A JPH0844538 A JP H0844538A
Authority
JP
Japan
Prior art keywords
tuckerman
result
rounding
square root
operation result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP7165167A
Other languages
Japanese (ja)
Other versions
JP3541086B2 (en
Inventor
Peter Markstein
ピーター・マークステイン
H Karp Alan
アラン・エイチ・カープ
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.)
HP Inc
Original Assignee
Hewlett Packard Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US08/270,203 external-priority patent/US5671170A/en
Application filed by Hewlett Packard Co filed Critical Hewlett Packard Co
Publication of JPH0844538A publication Critical patent/JPH0844538A/en
Application granted granted Critical
Publication of JP3541086B2 publication Critical patent/JP3541086B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE: To provide a floating point arithmetic unit for applying the exact rounding processing to the quotient or square root of a highly precise number to a floating point number which is closest to the exact result. CONSTITUTION: A rounding processing is operated so that an arithmetic result is obtained with precision higher than that provided by floating point hardware. Before the rounding processing, hardware in a floating point arithmetic unit 100 exactly generates a highly precise mantissa, except for a final number byte. Next, a rounding processing technique is used, and an exactly rounding processing-operated arithmetic result is generated by using extended Tuckerman [phonetic 9147/28} inspection. In this extended Tuckerman inspection, a final small value ULP related with both square root and division is judged, while the check of early end is operated differently from in the conventional Tuckerman inspection. The advantage in checking the early end is the sharp decrease in calculating time required for deciding the rounding off processing.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は浮動小数点算術演算装置
を有するデータ処理システムに関し、より詳しくは高精
度の丸め処理を行なう方法、及び装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing system having a floating point arithmetic operation unit, and more particularly to a method and an apparatus for high precision rounding processing.

【0002】[0002]

【従来の技術】従来、浮動小数点演算装置は除算、及び
開平算を実行するためのハードウエア、又はソフトウエ
アを用いてきた。このハードウエアを用いたアプローチ
は、専用の除算回路と開平回路を用いるか、マイクロコ
ードを加算回路、減算回路と共に用いるかのどちらかで
ある。このマイクロコードは会話型の手順を実行するよ
う機能する。このような会話型手順の例としては、引き
放し級数拡張機構(nonrestoring series expansion)、
及びNewton-Raphsonがある。ソフトウエアによるアプロ
ーチではプログラム命令を用いて会話型手順が実行され
る。
2. Description of the Related Art Conventionally, a floating point arithmetic unit has used hardware or software for executing division and square root calculation. This hardware approach either uses a dedicated divider and square root circuit, or uses microcode with adder and subtractor circuits. This microcode functions to perform a conversational procedure. Examples of such an interactive procedure include a non-restoring series expansion mechanism,
And Newton-Raphson. The software approach uses program instructions to perform interactive procedures.

【0003】[0003]

【発明が解決しようとする課題】どのアプローチを用い
るかに関わらず、浮動小数点演算装置はほぼ近似的な結
果、即ち最後の数ビットにしか誤差のない結果を得るこ
とができる。従来のアプローチには、こうした浮動小数
点演算装置が、精度の高い数(例えば4倍精度の数)に
対して除算、又は開平算を行なって正確な結果に最も近
い浮動小数点数を得ることを要求される場合、最後の数
ビットについて正しい値を得るのに非常に多くの時間を
とられるという問題がある。例えば、既存の代表的なワ
ークステーションでは、近似値を約13サイクルで得るこ
とができるが、正確な結果に最も近い値を得るには約13
4サイクルを要する。
Regardless of which approach is used, the floating-point arithmetic unit can obtain an approximately approximate result, that is, an error-free result only in the last few bits. Traditional approaches require such floating point units to divide or square root high precision numbers (eg, quad precision numbers) to get the closest floating point number to the exact result. If so, the problem is that it takes too much time to get the correct value for the last few bits. For example, on a typical existing workstation, you can get an approximation in about 13 cycles, but about 13 cycles to get the closest accurate result.
It takes 4 cycles.

【0004】最後の数ビットについて正しい値を得るの
に要する非常に多くの時間のために、コンピュータ・メ
ーカーの中には最後の数ビットについて正しい値を求め
ようとしないものさえある。従来、妥当な時間内に得る
ことのできた精度は、多くのアプリケーションでは充分
とされる、小さな値のULP(ULPは最終桁位置における単
位の数値)までの精度であるが、中にはより高い精度を
必要とするアプリケーションもある。即ち、アプリケー
ションによっては演算結果の精度が1/2 ULP以下でなけ
ればならないものがある。
Due to the sheer amount of time it takes to obtain the correct value for the last few bits, some computer manufacturers even do not try to find the correct value for the last few bits. Conventionally, the accuracy that can be obtained in a reasonable time is the accuracy up to a small value ULP (ULP is a unit value at the last digit position), which is sufficient for many applications, but some of them are higher. Some applications require precision. That is, depending on the application, the accuracy of the calculation result must be 1/2 ULP or less.

【0005】問題は既知のアプローチでは最後の数ビッ
トの精度を効率的に決定することができないことであ
る。従来、精度を1ビット上げようとすれば、処理時間
もより多くかかっていた。特に、精度を上げるために、
追加的な繰り返しが行なわれうるが、最後の数ビットを
決定するためのこのような繰り返しは処理時間の観点か
らは非常に大きな犠牲を伴なうものである。
The problem is that the known approaches cannot efficiently determine the precision of the last few bits. Conventionally, if the accuracy is increased by 1 bit, it takes more processing time. In particular, to improve accuracy,
Although additional iterations may be performed, such iterations to determine the last few bits are very costly in terms of processing time.

【0006】既知のアプローチの他の問題点としては、
単調性を得ることが困難であることである。又、従来の
殆どのアプローチでは1/2 ULP以下の精度を有する演算
結果を得ることができない。しかし、演算結果が変わっ
てくる可能性があるため、本来のライブラリ関数を簡単
にアップグレードすることはできない。単調性、又は高
い精度(例えば1/2 ULP)が必要とされ、それが浮動小
数点算術演算装置で得られない場合、異なる演算結果が
生成されて、それによって、その結果値あるいは予測さ
れた値が返されない時、ユーザーに混乱を招く恐れがあ
る。
Another problem with the known approach is that
It is difficult to obtain monotonicity. Also, most of the conventional approaches cannot obtain a calculation result with an accuracy of 1/2 ULP or less. However, it is not possible to easily upgrade the original library function because the calculation result may change. If monotonicity, or high precision (eg, 1/2 ULP) is required and it is not available in the floating point arithmetic unit, a different operation result will be produced, and the result value or the predicted value Can be confusing to users when is not returned.

【0007】従って、正しく丸め処理が行われた高精度
の演算結果を効率的かつ安定的に生成する、丸め処理技
術が未だに必要とされている。
Therefore, there is still a need for a rounding technique that efficiently and stably produces a highly accurate calculation result that has been properly rounded.

【0008】[0008]

【課題を解決するための手段】本発明は浮動小数点算術
演算装置が商、又は平方根を高精度に計算することを可
能にするものであり、商、又は平方根は正確な演算結果
に最も近い浮動小数点数に正確に丸め処理される。本発
明によれば、ハードウエアによって提供されるものより
高い精度で丸め処理を行うことができる。
SUMMARY OF THE INVENTION The present invention enables a floating point arithmetic unit to calculate a quotient or square root with high precision, where the quotient or square root is the closest floating point to the exact result of the operation. Exactly rounded to a decimal point. According to the present invention, the rounding process can be performed with higher accuracy than that provided by the hardware.

【0009】丸め処理を行なう前に、浮動小数点算術演
算装置内のハードウエアが最後の数桁を除いて正しい高
精度の仮数を生成する。次に、本発明の丸め処理技術を
用いて正しく丸め処理された演算結果が生成される。本
発明は拡張タッカーマン検査を利用して、検査を早期に
終了するためのチェックを行ないながら、開平と除算の
両方に関して最後の小さな値のULPに関する正しい値を
得るものである。早期終了のための検査を行なうことの
利点は、丸め処理の判断が必要とされる平均計算時間が
大幅に低減されることである。
Prior to the rounding process, the hardware within the floating point arithmetic unit produces the correct high precision mantissa except for the last few digits. Next, the rounded processing technique of the present invention is used to generate a correctly rounded operation result. The present invention utilizes the extended Tuckerman test to obtain the correct value for the last small ULP for both square root and division, while performing checks to finish the test early. The advantage of doing the check for early termination is that the average computation time required to make rounding decisions is significantly reduced.

【0010】本発明の浮動小数点算術演算装置の一実施
例は、被除数を除数で割って正しく丸め処理された商を
得る除算と、ある値から正しく丸め処理された平方根を
得る開平算のうちの少なくとも1つを行なう。この算術
演算装置は、データを記憶するためのマルチポート記憶
装置、2つの数を乗算して積を求め、2つの数を加算し
て和を求めるための算術手段、除算と開平算のうちの少
なくとも1つに関して近似された演算結果を提供する近
似手段、拡張タッカーマン検査を用いて除算と開平算の
うちの少なくとも1つの近似された演算結果を正しく丸
め処理するための手順を含んだ丸め処理マイクロコー
ド、及びこの浮動小数点算術演算装置を制御するための
制御装置を有する。丸め処理マイクロコードは、まずこ
の近似された演算結果が過小評価されるよう保証し、次
にタッカーマン検査の中間結果に基づいてタッカーマン
検査を早く終了させることを可能にすることによって、
近似された演算結果に正確に丸め処理を施し、正確に丸
め処理された演算結果を生成する。
One embodiment of the floating point arithmetic unit of the present invention is one of division between dividing a dividend by a divisor to obtain a correctly rounded quotient and square root arithmetic to obtain a correctly rounded square root from a value. Do at least one. This arithmetic operation device is a multi-port storage device for storing data, an arithmetic means for multiplying two numbers to obtain a product, adding two numbers to obtain a sum, and a division and square root calculation. Approximation means for providing an approximated operation result with respect to at least one rounding process including a procedure for correctly rounding the approximated operation result of at least one of division and square root using an extended Tuckerman check It has microcode and a controller for controlling this floating point arithmetic unit. The rounding microcode first guarantees that this approximated operation result is underestimated, and then allows the Tuckerman test to finish early based on the intermediate result of the Tuckerman test.
The approximated calculation result is accurately rounded, and the correctly rounded calculation result is generated.

【0011】本発明は方法としても実施することができ
る。この方法は拡張タッカーマン検査を用いて除算、又
は開平算の演算結果の高精度な近似値を正確に丸め処理
するものである。この方法はデータ処理システムにおい
て実行され、除算、又は開平算の演算結果の近似値を求
めることから始まる。演算結果の近似値のビットの殆ど
は正しいことが保証される。次に、この方法ではこの演
算結果の近似値が実際の結果より過小評価されたもので
あるよう保証する。その後、拡張タッカーマン検査を実
行してこの演算結果の近似値をどのように丸め処理する
かを決定することによって、この演算結果の近似値を正
確に丸め処理して、正確に丸め処理された演算結果を生
成する。拡張タッカーマン検査は、タッカーマン検査の
中間結果の符号、及び/又は大きさに基づいて、その検
査を早く終了することができる場合、正しく丸め処理さ
れた演算結果を従来より速く得ることができるという点
で有益である。
The present invention can also be implemented as a method. This method uses an extended Tuckerman test to accurately round a highly accurate approximate value of a division or square root operation result. The method is performed in a data processing system and begins by finding an approximation of the result of a division or square root operation. It is guaranteed that most of the bits of the approximate value of the operation result are correct. Next, this method guarantees that the approximate value of this operation result is underestimated from the actual result. After that, by performing an extended Tuckerman test to determine how to round the approximate value of this operation result, the approximate value of this operation result is rounded exactly, and is rounded exactly. Generate the operation result. The extended Tuckerman test can obtain a correctly rounded operation result faster than before if the test can be terminated early based on the sign and / or the size of the intermediate result of the Tuckerman test. It is useful in that respect.

【0012】添付図面に関連して以下でなされる詳細な
説明により、本発明を容易に理解することができる。又
ここで参照する図面では、同一の構成要素に対して同一
の参照番号が付されている。
The invention can be readily understood by the following detailed description in connection with the accompanying drawings. Further, in the drawings referred to here, the same reference numerals are given to the same components.

【0013】[0013]

【実施例】本発明は浮動小数点算術演算装置に用いるこ
とを意図したものである。本発明を用いることによっ
て、浮動小数点算術演算装置はハードウエアによって得
られる精度の少なくとも2倍の精度を有する演算結果を
生成することができる。好適には、ハードウエアではN
ビットの精度の数しか直接演算することができないとこ
ろを、本発明では2Nビットの近似値を正確に丸め処理す
ることができる。例えば、ハードウエアが2倍精度の演
算結果を提供することができる場合、本発明は正確に丸
め処理された4倍精度の演算結果を提供できる。
DETAILED DESCRIPTION OF THE INVENTION The present invention is intended for use in a floating point arithmetic unit. By using the present invention, a floating point arithmetic unit can produce an operation result having at least twice the precision obtained by hardware. Preferably N in hardware
According to the present invention, an approximate value of 2N bits can be accurately rounded, where only a number with bit precision can be directly calculated. For example, if the hardware is capable of providing double precision results, the present invention can provide correctly rounded quad precision results.

【0014】本発明は多倍精度の数にも適用することが
できる。多倍精度の数は4倍精度より高い精度を有する
数である。このような数は単精度浮動小数点配列に記憶
することができる。一実施例において、この配列内の最
初のワードは整数の値を有する浮動小数点数であり、そ
の絶対値は仮数部にあるワード数を表わす。最初のワー
ドの符号は多倍精度の数の符号である。次のワードは基
数に関する指数を表わす整数の値を有する浮動小数点数
である。小数点は最初の仮数ワードの後にくる。既知の
ソフトウエア・ライブラリ・ルーチンを用いてこれらの
数に算術演算を実行することができる。例えば、1992年
5月にCalifornia州、Moffett Field、NASA Ames Resea
rch Center、NAS Applied Research Branchから刊行さ
れたRNR Technical Report RNR-90-022のBailey著“A P
ortable High Performance Multiprecision Package”
を参照されたい。
The present invention can also be applied to multiple precision numbers. A multiple precision number is a number that has greater precision than quad precision. Such numbers can be stored in a single precision floating point array. In one embodiment, the first word in this array is a floating point number with an integer value, the absolute value of which represents the number of words in the mantissa. The sign of the first word is the sign of the double precision number. The next word is a floating point number with an integer value representing the exponent for the radix. The decimal point comes after the first mantissa word. Arithmetic operations can be performed on these numbers using known software library routines. For example, NASA Ames Resea, Moffett Field, California, May 1992.
rch Center, Basley, RNR Technical Report RNR-90-022 from NAS Applied Research Branch “AP
ortable High Performance Multiprecision Package ”
Please refer to.

【0015】以下で、本発明の実施例を図1から図8に
関連して説明する。しかし、当業者には、本発明がこう
した実施例以外にも適用可能であるため、これらの図面
を参照してここで行なわれる詳細な説明は例示に過ぎな
いということが理解されるであろう。
An embodiment of the present invention will be described below with reference to FIGS. 1 to 8. However, those skilled in the art will appreciate that the detailed description given herein with reference to these figures is exemplary only, as the present invention is not limited to such embodiments. .

【0016】図1は浮動小数点算術演算装置100の第1
の実施例を示す。この実施例は4倍精度数を2つの倍精
度フォーマットで記憶するものである。この浮動小数点
算術演算装置100は乗算と加算用に個別の回路を有す
る。
FIG. 1 shows a first floating point arithmetic unit 100.
An example of is shown. This embodiment stores quad precision numbers in two double precision formats. The floating point arithmetic unit 100 has separate circuits for multiplication and addition.

【0017】マルチポート・レジスタ・ファイル102は
読み出しポートA、B、C、及びDと書き込みポートE、及
びFを有する。レジスタ・ファイル102はNビットのワー
ド・サイズを有するデータを記憶する。乗算装置104が
読み出しポートA、及びBに接続されて、それぞれが被乗
数と乗数を受信するようになっている。乗算装置104は
桁上げ伝搬加算器(CPA)106に高位部分積と低位部分積
を与える。次に、CPA 106によって生成された和が、丸
め処理インクリメンタ108によって2Nビットに丸め処理
される。丸め処理インクリメンタ108を用いることが好
適ではあるが、こうした中間の丸め処理は本発明には必
須ではない。
The multiport register file 102 has read ports A, B, C, and D and write ports E and F. Register file 102 stores data having a word size of N bits. Multiplier 104 is connected to read ports A and B such that each receives a multiplicand and a multiplier. The multiplier 104 provides the carry partial adder (CPA) 106 with the high and low partial products. The sum generated by CPA 106 is then rounded to 2N bits by rounding incrementer 108. Although it is preferred to use the rounding incrementer 108, such intermediate rounding is not essential to the invention.

【0018】丸め処理された演算結果は2つのNビット
の部分からなり、これらの部分はそれぞれ高位部分積ラ
ッチ110と低位部分積ラッチ112に保持される。多重装置
114はラッチ110、112からラッチされたNビットの部分を
受信する。多重装置114の出力はレジスタ・ファイル102
の書き込みポートEに接続され、これによって乗算によ
る2つのNビットの部分を、高位部分積と低位部分積に
関する、2つの書き込み動作でレジスタ・ファイル102
に記憶することができる。
The rounded operation result is composed of two N-bit parts, which are held in the high-order partial product latch 110 and the low-order partial product latch 112, respectively. Multiplexer
114 receives the latched N-bit portion from latches 110, 112. The output of the multiplexer 114 is the register file 102.
Of the register file 102 in two write operations, one for the high partial product and one for the low partial product.
Can be stored in.

【0019】従って、読み出しポートA、及びBは乗算装
置104に被乗数と乗数を提供する。乗算結果は2つのNビ
ット値からなり、これらが丸め処理されて、一時記憶の
ためにレジスタ・ファイル102の書き込みポートEに送ら
れる。
The read ports A and B thus provide the multiplier 104 with the multiplicand and the multiplier. The result of the multiplication consists of two N-bit values that are rounded and sent to write port E of register file 102 for temporary storage.

【0020】レジスタ・ファイル102の他のポートは浮
動小数点算術演算装置100の加算回路に対応する。位置
合わせシフタ116が、レジスタ・ファイル102の読み出し
ポートC、及びDから加数を受信し、加算を行なえるよう
にそれらを位置合わせする。次に桁上げ伝搬加算器(CP
A)118が、位置合わせされた値を加算して正規化シフタ
120に和を供給する。次に、正規化された和が丸め処理
インクリメンタ122によって2Nビットに丸め処理され
て、丸め処理された和が得られる。この場合も、丸め処
理インクリメンタ122は厳密な意味では必須ではない。
丸め処理された和の最初のNビットは高位部分ラッチ124
にラッチされ、次のNビットは低位部分ラッチ126にラッ
チされる。多重装置128がラッチ124、126からラッチさ
れた和を入力として受信し、それらを2パスで書き込み
ポートFに送信する。
The other port of the register file 102 corresponds to the adder circuit of the floating point arithmetic unit 100. Alignment shifter 116 receives the addends from read ports C and D of register file 102 and aligns them for addition. Then carry carry adder (CP
A) 118 adds the aligned values and normalizes shifter
Supply the sum to 120. Next, the normalized sum is rounded to 2N bits by the rounding incrementer 122 to obtain the rounded sum. Also in this case, the rounding incrementer 122 is not essential in a strict sense.
The first N bits of the rounded sum are the high part latch 124
And the next N bits are latched in the low order partial latch 126. Multiplexer 128 receives the latched sums from latches 124, 126 as inputs and sends them to write port F in two passes.

【0021】制御装置130が実行すべき命令を受信し、
図1に示す様々な回路に必要な制御信号132を提供す
る。従って、制御装置130は乗算、及び加算回路を制御
して命令を実行する。
Receiving a command to be executed by the controller 130,
It provides the control signals 132 necessary for the various circuits shown in FIG. Therefore, the controller 130 controls the multiplication and addition circuits to execute the instructions.

【0022】浮動小数点算術演算装置100が、高精度の
丸め処理を適当に実行するよう適応させるために、丸め
処理マイクロコード134が提供され、制御装置130へのア
クセスが可能となっている。この丸め処理マイクロコー
ド134に含まれる手順を次に詳細に説明する。
A rounding microcode 134 is provided to allow the floating point arithmetic unit 100 to adapt to perform high precision rounding operations appropriately, and access to the controller 130 is provided. The procedure included in the rounding microcode 134 will be described in detail below.

【0023】この丸め処理マイクロコード134は演算結
果の近似値をハードウエアによる精度より高い精度で正
確に丸め処理するよう動作する。この丸め処理の対象と
なる演算結果の近似値は、ある程度のビット数まで正確
であることが保証できれば、幾通りかの方法で生成され
うる。
The rounding processing microcode 134 operates so as to accurately perform the rounding processing on the approximate value of the calculation result with a higher precision than that of the hardware. The approximate value of the operation result that is the target of the rounding process can be generated by several methods as long as it can be guaranteed that the number of bits is accurate.

【0024】例えば、丸め処理の対象となる演算結果を
生成する方法の1つが“FLOATING POINT ARITHMETIC UN
IT USING MODIFIED NEWTON-RAPHSON TECHNIQUE FOR DIV
ISION AND SQUARE ROOT”と題する米国特許出願08/058,
164号に説明されており、この出願は、ここで参照する
ことによって本明細書に組み込まれる。このようなアプ
ローチを用いて、浮動小数点算術演算装置100の制御装
置130は除算、及び開平マイクロコード(図示せず)を
用いた精度の高い除算、及び開平算命令を実行する。除
算、及び開平マイクロコードは会話型手順を使用する。
この会話型手順は逆数、又は平方根の逆数(reciprocal
square root)の初期推定から始まるため、浮動小数点算
術演算回路100は逆数、及び平方根の逆数の初期推定テ
ーブル(図示せず)にもアクセスすることができる。こ
れらの初期推定値は、乗算回路、又は加算回路のどちら
かで使用できるようにレジスタ・ファイル102に供給さ
れる。
For example, one of the methods for generating the calculation result to be rounded is "FLOATING POINT ARITHMETIC UN.
IT USING MODIFIED NEWTON-RAPHSON TECHNIQUE FOR DIV
US Patent Application 08/058 entitled "ISION AND SQUARE ROOT"
No. 164, which application is hereby incorporated by reference. Using such an approach, the controller 130 of the floating point arithmetic unit 100 performs division and precision division using square root microcode (not shown) and square root instructions. Division and Kaihei microcode use an interactive procedure.
This interactive procedure is the reciprocal or reciprocal of the square root (reciprocal
Starting with an initial guess of the square root), the floating point arithmetic circuit 100 also has access to an initial guess table (not shown) of the reciprocal and the reciprocal of the square root. These initial estimates are provided to the register file 102 for use by either the multiply circuit or the add circuit.

【0025】図2は本発明の第2の実施例による浮動小
数点算術演算装置200のブロック図である。図2に示す
浮動小数点算術演算装置200は乗算加算融合(MAF)設計
のものである。即ち、乗算装置と加算器が融合されて乗
算と加算が1つの極小単位の動作として発生するもので
ある。
FIG. 2 is a block diagram of a floating point arithmetic unit 200 according to a second embodiment of the present invention. The floating point arithmetic unit 200 shown in FIG. 2 is of the Multiply-Add Fusion (MAF) design. In other words, the multiplication device and the adder are integrated so that multiplication and addition occur as operations in one minimum unit.

【0026】マルチポート・レジスタ・ファイル202は
読み出しポートA、B、及びCと、書き込みポートDを含
む。乗算装置204は読み出しポートA、及びBから被乗数
と乗数を受信して積を生成する。位置合わせシフタ206
が読み出しポートCから加数を受け取り、乗算装置204か
らの信号207を用いて、前記積の指数に従ってこの加数
を位置合わせする。
Multiport register file 202 includes read ports A, B, and C and write port D. Multiplier 204 receives the multiplicand and multiplier from read ports A and B and produces a product. Alignment shifter 206
Receives the addend from read port C and uses signal 207 from multiplier 204 to align the addend according to the exponent of the product.

【0027】3:2桁上げ保存型加算器208は乗算装置204
と位置合わせシフタ206からの入力を受信し、少なくと
も2Nビットの出力を桁上げ伝搬加算器(CPA)210に提供
する。桁上げ保存型加算器208からの先頭の2Nビットが
必要とされる。CPA 210は2Nビットの演算結果を生成
し、次にこれが正規化シフタ212によって正規化され、
丸め処理インクリメンタ214(これも厳密な意味で必須
ではない)によって2Nビットの演算結果に丸め処理され
る。次に、この丸め処理された演算結果が2つのNビッ
トの部分となって高位部分ラッチ216と低位部分ラッチ2
18にそれぞれ供給される。多重装置220がラッチ216、21
8からラッチされたNビットの部分を受信する。多重装置
220の出力は、2つのNビットの部分が高位部分と低位部
分のための2つの書き込み動作によってレジスタ・ファ
イル202に記憶されるように、レジスタ・ファイル202の
書き込みポートDに接続される。
3: The carry carry adder 208 is a multiplication unit 204
And an input from the alignment shifter 206 and providing an output of at least 2N bits to the carry propagate adder (CPA) 210. The first 2N bits from the carry save adder 208 are required. The CPA 210 produces a 2N-bit result that is then normalized by the normalization shifter 212,
The rounding incrementer 214 (which is not essential in the strict sense) rounds the 2N-bit operation result. Next, the rounded operation result becomes two N-bit parts, and the high-order partial latch 216 and the low-order partial latch 2
Supplied to 18 each. Multiplexer 220 has latches 216, 21
Receive the N-bit portion latched from 8. Multiplexer
The output of 220 is connected to write port D of register file 202 so that the two N-bit portions are stored in register file 202 by two write operations for the high and low portions.

【0028】制御装置222は様々な制御信号224を用い
て、浮動小数点算術演算装置200の回路を制御する。制
御装置222は特に、丸め処理を実行するために丸め処理
マイクロコード226を用いる。丸め処理の対象となる演
算結果の近似値は、浮動小数点算術演算装置200によっ
て生成され、丸め処理が行なわれるまでレジスタ・ファ
イル202内に保持される。
Controller 222 uses various control signals 224 to control the circuitry of floating point arithmetic unit 200. The controller 222 in particular uses the rounding microcode 226 to perform the rounding process. The approximate value of the operation result that is the target of the rounding process is generated by the floating-point arithmetic unit 200 and is held in the register file 202 until the rounding process is performed.

【0029】又、制御装置222は算術演算命令を実行す
る。制御装置222で受け取った命令が除算命令あるいは
開平命令である場合、制御装置222は乗算、及び加算回
路を用いて除算、及び開平算の実行に必要な会話型手順
を実行するために、除算、及び開平マイクロコード(図
示せず)にアクセスする。こうして、浮動小数点算術演
算装置200は丸め処理の対象となる演算結果の近似値を
生成することができる。
The controller 222 also executes arithmetic operation instructions. If the instruction received by the controller 222 is a divide instruction or a square root instruction, the controller 222 uses the multiplication and addition circuits to perform division, and division to perform the interactive procedure necessary to perform square root division. And access Kaihei microcode (not shown). In this way, the floating-point arithmetic operation device 200 can generate an approximate value of the operation result that is the target of the rounding process.

【0030】性能上の理由から、第1、及び第2の実施
例(図1、及び図2)を周知の回路を用いて更に拡張す
ることができる。例えば、パイプラインを導入して追加
ラッチを、レジスタ・ファイルと乗算装置あるいは位置
合わせシフタの間に設けることができる。又、乗算装置
あるいは位置合わせシフタに、より高速に入力を供給で
きるように、レジスタ・ファイル102と乗算装置104、及
び位置合わせシフタの間に多重装置を挿入することもで
きる。しかし、これらの、及びその他の様々な周知の拡
張は、本発明の一部をなすものではなく、むしろハード
ウエアに関する主要な設計上の選択の問題であり、従っ
てこれ以上詳細な説明は行わない。
For performance reasons, the first and second embodiments (FIGS. 1 and 2) can be further expanded with known circuits. For example, a pipeline may be introduced to provide an additional latch between the register file and the multiplier or alignment shifter. Also, a multiplexer can be inserted between the register file 102, the multiplier 104, and the alignment shifter to provide faster input to the multiplier or alignment shifter. However, these and various other well-known extensions do not form part of the present invention, but rather are a major design choice in terms of hardware, and thus will not be described in further detail. .

【0031】図3は制御装置130、222によって実行ある
いは制御される基本的手順のフローチャートである。制
御装置130、222が命令を受け取ると、浮動小数点算術演
算装置100、200内で様々な演算が行なわれる。まず、命
令が復号され(302)、そのオペランドが読み取られる
(304)。次に、特殊なケースが存在するかどうかの判
断(306)が行なわれる。オペランドが正規数でない場
合に、特殊なケースが存在する。そのオペランドが正規
数でない場合、演算はIEEE規格754-1985に従って「修
正」され(308)、フロー制御はこれらの数が始めから
正規数であったかのように続行される。例えば、これら
の数の1つが0.02×10-3である場合、この数は処理を続
行する前に0.2×10-4に「修正」(この場合は正規化)
される。
FIG. 3 is a flow chart of the basic procedure executed or controlled by the controller 130, 222. When the controllers 130, 222 receive the instructions, various operations are performed within the floating point arithmetic units 100, 200. First, the instruction is decoded (302) and its operand is read (304). Next, a determination (306) is made whether there is a special case. There is a special case when the operand is not a normal number. If the operand is not a normal number, then the operation is "modified" according to IEEE Standard 754-1985 (308) and flow control continues as if these numbers were originally normal. For example, if one of these numbers is 0.02 x 10 -3 , this number is "corrected" to 0.2 x 10 -4 (in this case, normalized) before continuing.
To be done.

【0032】次に、命令が除算命令であるかどうかに基
づいて判断(310)がなされる。その命令が除算命令で
ある場合、制御装置130、222は除算マイクロコードを実
行する(312)。その後、本発明によれば、この除算命
令の演算結果が丸め処理マイクロコード134、226を用い
て正確に丸め処理される(314)。
Next, a determination (310) is made based on whether the instruction is a divide instruction. If the instruction is a divide instruction, controllers 130, 222 execute the divide microcode (312). Then, according to the present invention, the operation result of this division instruction is accurately rounded using the rounding microcodes 134 and 226 (314).

【0033】判断310において、その命令が除算命令で
はないと判定されると、この命令が開平命令であるかど
うかが判断される(316)。この命令が開平命令である
場合、制御装置130、222は開平マイクロコードを実行し
(318)、その後丸め処理マイクロコード134、226を用
いてこの開平命令の演算結果を正確に丸め処理する(32
0)。一方、判断316において、この命令が開平命令でな
いと判定された場合、図1、及び図2に示す乗算装置10
4、204と加算器118、208によって従来の態様で乗算(32
2)及び/又は加算(324)が実行される。その後、演算
結果が一時的な記憶のためにレジスタ・ファイル102、2
02に書き戻される(326)。最後に、ブロック314、32
0、及び326の後で、制御フローはステップ302に戻って
次の命令を復号する。
If the decision 310 determines that the instruction is not a divide instruction, then it is determined whether the instruction is a square root instruction (316). If the instruction is a square root instruction, the controller 130, 222 executes the square root microcode (318) and then uses the rounding microcodes 134, 226 to accurately round the arithmetic result of the square root instruction (32).
0). On the other hand, if it is determined in decision 316 that this instruction is not a square root instruction, the multiplication device 10 shown in FIGS.
4, 204 and adders 118, 208 multiply in the conventional manner (32
2) and / or addition (324) is performed. After that, the operation result is stored in the register file 102, 2 for temporary storage.
It is written back to 02 (326). Finally, blocks 314, 32
After 0 and 326, control flow returns to step 302 to decode the next instruction.

【0034】次に、丸め処理マイクロコード134、226に
よって実行、又は起動される手順を図4、及び図6を参
照して詳細に説明する。一般に、丸め処理マイクロコー
ド134、226によって実行、又は起動される手順は、レジ
スタ内にどの様に数が記憶されているかによって異な
る。殆どの機械は数の記憶フォーマット(非拡張フォー
マット)と同じ桁数のレジスタを有し、その他の機械は
そのレジスタに追加のビットを有する(拡張フォーマッ
ト)。非拡張フォーマットであるか拡張フォーマットで
あるかによって実施態様が異なるため、これらを以下で
別個に説明する。
Next, the procedure executed or activated by the rounding processing microcodes 134 and 226 will be described in detail with reference to FIGS. 4 and 6. In general, the procedure performed or invoked by the rounding microcode 134, 226 depends on how the number is stored in the register. Most machines have a register with the same number of digits as the number storage format (non-extended format), other machines have additional bits in that register (extended format). Since different implementations depend on whether it is a non-extended format or an extended format, these are described separately below.

【0035】拡張フォーマットの丸め処理 拡張フォーマットを用いてIEEE規格754-1985を実施する
機械がある(例えばIntelのx87浮動小数点コプロセッ
サ)。こうした機械は拡張フォーマットに従って、記憶
フォーマットを越える桁数に対応するために更に数ビッ
ト多く保持できるレジスタを有する。
Rounding of Extended Formats Some machines implement IEEE Standard 754-1985 using extended formats (eg Intel's x87 floating point coprocessor). According to the extended format, such machines have a register that can hold a few more bits to accommodate the number of digits beyond the storage format.

【0036】この場合、本発明の総合的な目的は、(あ
らかじめ計算された)浮動小数点数の演算結果を、それ
が丸め処理をされた時に所望のビット数より多いビット
を有する場合に、正確な演算結果になるよう丸め処理を
することである。ここでは、拡張フォーマットを用いる
機械に関する丸め処理マイクロコード134、226によって
実行、又は起動される手順について説明する。
In this case, the general purpose of the invention is to ensure that the result of a (precomputed) floating point number is correct if it has more bits than desired when rounded. Rounding processing is performed so that a proper calculation result is obtained. The procedure performed or activated by the rounding microcode 134, 226 for machines using the extended format is described herein.

【0037】図4は拡張フォーマットの丸め処理400を
実行する時に、丸め処理マイクロコード134、226(及び
制御装置130、222)又はその他のソフトウエアによって
実行される基本的手順のフローチャートである。後述の
A:マイクロコードの疑似コード記述では高精度除算、
及び開平に関する基本的疑似コードを示す。まず、丸め
処理の対象となる演算結果の近似値が得られる(40
2)。この演算結果の近似値は、浮動小数点算術演算装
置によって実行される除算、又は開平算の浮動小数点数
の演算結果とすることができる。他のアプローチや設計
を用いることも可能であり、図1、及び図2に示す浮動
小数点算術演算装置は単なる例に過ぎない。演算結果の
近似値を求める方法はここでは重要ではない。演算結果
の近似値フォーマットが重要であり、殆ど(全てではな
い)が正確であることを保証された一定数の仮数ビット
から成る。
FIG. 4 is a flow chart of the basic steps performed by the rounding microcode 134, 226 (and controllers 130, 222) or other software when performing the extended format rounding process 400. A: Pseudo-code description of microcode, which will be described later, provides high precision division,
And basic pseudo code for Kaihei. First, the approximate value of the operation result to be rounded is obtained (40
2). The approximate value of this operation result can be the operation result of the floating point number of division or square root executed by the floating point arithmetic operation unit. Other approaches and designs can be used, and the floating point arithmetic units shown in FIGS. 1 and 2 are merely examples. The method of determining the approximate value of the calculation result is not important here. The approximate format of the result of the operation is important and consists mostly of a fixed number of mantissa bits (but not all) guaranteed to be accurate.

【0038】説明を行うために、ここではハードウエア
は2倍精度までを処理可能で、4倍精度の演算結果を得
ることのできる、2を基数とする演算を実行するものと
仮定する。即ち、ハードウエア(2倍精度)の仮数部は
メモリ内では53ビット幅であり、レジスタ内では64ビッ
ト幅であるものとする。又、これはレジスタがメモリ・
フォーマット以上のビットを記憶するため、いわゆる拡
張フォーマットと呼ばれる。この構成では、丸め処理を
されていない4倍精度の演算結果はレジスタ内では128
ビットである。更に、ハードウエア(恐らく除算、開平
算のための除算、開平マイクロコードを有する)は128
ビットの結果を生成し、そのうちの最初の125ビットは
正確であることが保証されている。この例の場合の目的
は、この演算結果を4倍精度の数に関するIEEEフォーマ
ットである、113の仮数ビットに正確に丸め処理するこ
とである。
For purposes of explanation, it is assumed here that the hardware is capable of processing up to double precision and performing operations in the radix of 2 that are capable of obtaining quadruple precision operation results. That is, the mantissa part of the hardware (double precision) is 53 bits wide in the memory and 64 bits wide in the register. In addition, this is a register memory
This is called an extended format because it stores more bits than the format. In this configuration, the result of quadruple precision that has not been rounded is 128 in the register.
Is a bit. In addition, the hardware (possibly with division, division for square root, square root microcode) has 128
It produces a bit result, of which the first 125 bits are guaranteed to be accurate. In the case of this example, the purpose is to accurately round the operation result to 113 mantissa bits, which is an IEEE format for quadruple precision numbers.

【0039】図5はこの例の演算結果の近似値500のフ
ォーマットを示す図である。この演算結果の近似値500
は、全部で128ビットを有し、そのうちの最初の125のビ
ット502は正確であることが保証されており、最後の3
ビット504は正確であることが保証されていない。この
例では、113ビットの結果のみを求めようとするため、
ビット114からビット125までの正確なビット506は余分
である。
FIG. 5 is a diagram showing the format of the approximate value 500 of the calculation result of this example. Approximate value of this operation result 500
Has a total of 128 bits, of which the first 125 bits 502 are guaranteed to be correct and the last 3
Bit 504 is not guaranteed to be accurate. In this example, we are trying to find only the 113-bit result, so
The exact bits 506 from bit 114 to bit 125 are redundant.

【0040】次に、判断404が行なわれる。この判断404
はこの利用可能であり、又余分で正確なビットを用い
て、丸め処理の判断を行うことが可能かの判断を行な
う。判断404が、この余分で正確なビットを用いて丸め
処理の判断を行なうことができる場合、余分で正確なビ
ットを用いて演算結果の近似値が正確に丸め処理され
(406)、正確に丸め処理された演算結果が生成され
る。
Next, a decision 404 is made. This decision 404
Determines whether it is possible to make a rounding decision using this available and extra accurate bit. If the decision 404 is able to make a rounding decision using this extra, accurate bit, then the extra, exact bit is used to accurately round the approximated result of the operation (406) and make an exact round. The processed calculation result is generated.

【0041】この余分で正確なビットを利用して、切り
捨てられた演算結果の近似値を正確に丸め処理すること
によって、本発明に最も忠実に従う丸め処理は通常、追
加の計算を必要としない。この例の場合の丸め処理手順
を表1に示す。
By taking advantage of this extra and accurate bit to accurately round the approximated value of the truncated operation result, the rounding process that most closely adheres to the present invention typically does not require additional computation. Table 1 shows the rounding procedure for this example.

【0042】[0042]

【表1】 [Table 1]

【0043】この例の場合、ビット114からビット125ま
でが、利用可能でかつ余分で正確なビット506である
(図5)。統計的に、この例では、2,048の数のうちの
1つを除く、この余分で正確なビット504全てを用い
て、丸め処理の判断を行なうことができる。この拡張フ
ォーマットを用いることによって、計算を用いずに正確
に丸め処理ができない12ビット・パターンが1つだけ
(即ち、2,048のうち1つの場合のみ)ある。従って、
殆どの場合、この拡張フォーマットによって利用可能に
なる余分で正確なビットは、丸め処理の判断を行なうの
に充分である。
In this example, bits 114 through 125 are the available and extra accurate bits 506 (FIG. 5). Statistically, in this example, all of these extra and accurate bits 504, except for one of the 2,048 numbers, can be used to make the rounding decision. By using this extended format, there is only one 12-bit pattern (that is, only one out of 2,048) that cannot be accurately rounded off without computation. Therefore,
In most cases, the extra and accurate bits made available by this extended format are sufficient to make rounding decisions.

【0044】判断404でこの余分で正確なビットを用い
て、丸め処理の判断ができないと判定された場合、更に
計算が必要となる。まず、余分で保証されていないビッ
ト(図5の504)が0にセットされて(408)、過小評価
された(又は等しい)演算結果を保証する。この例にお
ける過小評価された演算結果508が、0にセットされた
保証されていないビット126からビット128を有するもの
として図5に示されている。次に、この過小評価された
演算結果が、修正タッカーマン検査を用いて正確に丸め
処理され(410)、正確に丸め処理された結果が生成され
る。修正タッカーマン検査は、開平と除算の両方に関し
て機能し、早期の終了がチェックされることを除けば、
従来の開平に対するタッカーマン検査と同様の動作であ
る。その結果、タッカーマン検査が必要な場合でも、正
確に丸め処理された演算結果を生成するのに要する計算
時間は一般に、従来のタッカーマン検査に比べて大幅に
低減される。以下で、修正タッカーマン検査について詳
細に説明する。
If it is determined in decision 404 that the rounding process cannot be determined using the extra and accurate bits, further calculation is required. First, the extra, non-guaranteed bit (504 in FIG. 5) is set to 0 (408) to guarantee an underestimated (or equal) result. The underestimated operation result 508 in this example is shown in FIG. 5 as having non-guaranteed bits 126 through 128 set to zero. The underestimated operation result is then accurately rounded (410) using a modified Tuckerman test to produce an accurately rounded result. The modified Tuckerman test works for both square root and division, except that early termination is checked.
The operation is similar to the conventional Tuckerman inspection for square rooting. As a result, even when the Tuckerman inspection is required, the calculation time required to generate the correctly rounded operation result is generally significantly reduced as compared with the conventional Tuckerman inspection. The modified Tuckerman inspection will be described in detail below.

【0045】正確に丸め処理された演算結果(図5の51
0)がどのように生成されたかに拘わらず、いかなる場
合にも、この正確に丸め処理された演算結果が所望のビ
ット数に切り捨てられる(412)。図5に示す例では、
丸め処理された結果は113ビットを有することになるの
で、128ビットの正確に丸め処理された演算結果510は切
り捨てられて、最終的に113ビットの演算結果512にな
る。
Accurate rounding operation result (51 in FIG. 5)
Regardless of how 0) was generated, the exact rounded result is truncated to the desired number of bits (412). In the example shown in FIG.
Since the rounded result will have 113 bits, the 128-bit correctly rounded operation result 510 is truncated to a final 113-bit operation result 512.

【0046】タッカーマン検査は平方根の近似値を丸め
処理するのに用いることができることは周知である。今
日の浮動小数点算術演算装置では、開平命令はべき級数
評価、又はNewton-Raphson反復のいずれかを用いたソフ
トウエアで,通常実施される。どちらが使用されるにし
ても、最終ビットは適当な丸め処理モード(例えばIEEE
には4つの丸め処理モードがある)に正確に丸め処理さ
れなければならない。ここでは、最も近い値への丸め処
理モードが仮定されている。開平の場合には、2つの丸
め処理に関するアプローチが知られている。1つはNewt
on-Raphson法を更に反復するアプローチ(除算の場合に
も使用可能である)である。もう一つは、平方根の近似
値が正確に、最も近い値への丸め処理がなされている
か、又は変更されなければならないか(1ULPの切り上
げあるいは切り捨てを行なうべきか)を判定するための
正確な基準を提供するタッカーマン検査を用いるアプロ
ーチである。1990年1月のIBM Journal of Research an
d Development、Vol. 34、No. 1、111-119ページのMark
steinの“Computation of elementary functions onthe
IBM RISC System/6000 processor”を参照されたい。
この2つの周知のアプローチの問題点は、計算が集中す
ることである。
It is well known that the Tuckerman test can be used to round a square root approximation. In today's floating point arithmetic units, square root instructions are usually implemented in software using either power series evaluation or Newton-Raphson iteration. Whichever is used, the last bit is the appropriate rounding mode (eg IEEE
Has four rounding modes) and must be rounded exactly. The rounding mode to the nearest value is assumed here. In the case of Kaihei, two rounding approaches are known. One is Newt
It is an approach that further iterates the on-Raphson method (it can also be used in the case of division). The other is an accurate approximation of the square root to determine exactly whether it has been rounded to the nearest value or has to be changed (whether to round up or round down 1 ULP). It is an approach that uses the Tuckerman test to provide the criteria. IBM Journal of Research an, January 1990
d Development, Vol. 34, No. 1, Mark on pages 111-119
stein's “Computation of elementary functions on the
See IBM RISC System / 6000 processor ”.
The problem with these two known approaches is that they are computationally intensive.

【0047】Newton-Raphsonの追加反復は計算量が大き
い。これは、2倍精度の機械上でソフトウエアで実行さ
れなければならない4倍精度数の乗算を必要とするため
である。Newton-Raphson技法を簡単にするには、(y
n+1 + μ113)と(yn+1)の剰余を計算する方法があ
る。ここでμ113は求める数の最後のULP(即ち、ここで
は113番目のビット)を表わす。一般に、k回の反復の
後、除算の剰余は(B - Ayk)であり、開平の剰余は
(A - yk 2)である。剰余の小さいものが正確な演算
結果となる。(yn+1 + μ113)の剰余の方が小さけれ
ば、大きいほうの数(yn+1 + μ113)が正確な演算結
果である。(yn+1)の剰余の方が小さければ、小さい
ほうの数(yn+1)が正確な演算結果である。このアプ
ローチは、Newton-Raphson反復を完了して結果を生成す
るのに余分に必要となる乗算と加算を省略することによ
って計算時間を僅かに短縮させるものである。
The Newton-Raphson additional iteration is computationally expensive. This is because it requires multiplication of quad precision numbers that must be performed in software on the double precision machine. To simplify the Newton-Raphson technique, use (y
There is a method of calculating the remainder of ( n + 1 + μ 113 ) and (y n + 1 ). Where μ 113 represents the last ULP of the number sought (ie, the 113th bit here). In general, after k iterations, the remainder of the division is - (B Ay k), No. remainder is (Ay k 2). An accurate calculation result is obtained when the remainder is small. If the remainder of (y n + 1 + μ 113 ) is smaller, the larger number (y n + 1 + μ 113 ) is the accurate calculation result. If the remainder of (y n + 1 ) is smaller, the smaller number (y n + 1 ) is the correct calculation result. This approach reduces computation time slightly by eliminating the extra multiplications and additions required to complete Newton-Raphson iterations and produce results.

【0048】タッカーマン検査によれば、gをx1/2
推定値とすると、g(g - μ)<x≦g(g + μ)の時
(μは1ULP)にのみ、gは最も近い値に正確に丸め処
理される。この丸め処理の判断は、丸め処理をされてい
るビットの剰余の符号に基づいて行なわれる。このタッ
カーマン検査の剰余は(x - g2)である。この例では、
丸め処理の判断はyn+1 + μ113/2の剰余の符号に基づ
いて行なうことができる。この剰余の符号が正である場
合、大きい方の数(yn+1 + μ113)が所望の演算結果
である。この符号が負である場合、小さいほうの数(y
n+1)が所望の演算結果である。従来のタッカーマン検
査(フル・タッカーマン検査と呼ばれる)の問題点は、
処理時間の観点から見て計算量が多いということであ
る。特に、ハードウエアによってサポートされる精度よ
り高い精度のフル・タッカーマン検査を行なうことは、
追加のNewton-Raphson反復を行なうのと同程度に計算量
が多くなる。
According to the Tuckerman test, when g is an estimated value of x 1/2 , g is the most significant only when g (g − μ) <x ≦ g (g + μ) (μ is 1 ULP). Exactly rounded to a close value. The determination of the rounding process is performed based on the sign of the remainder of the bits that have been rounded. The remainder of this Tuckerman test is (x-g 2 ). In this example,
The rounding process can be determined based on the sign of the remainder of y n + 1 + μ 113/2 . When the sign of this remainder is positive, the larger number (y n + 1 + μ 113 ) is the desired calculation result. If this sign is negative, the smaller number (y
n + 1 ) is the desired calculation result. The problems of conventional Tuckerman inspection (called full Tuckerman inspection) are
This means that the amount of calculation is large in terms of processing time. In particular, performing a full Tuckerman test with a higher precision than the precision supported by the hardware
It is as computationally expensive as performing additional Newton-Raphson iterations.

【0049】本発明は、ハードウエアによってサポート
される精度より高い精度を有する演算結果を丸め処理す
る場合に、より良い性能が得られるようにフル・タッカ
ーマン検査を改良するものである。基本的には、本発明
は中間演算結果を用いて丸め処理の判断を行なう能力を
含むようにフル・タッカーマン検査を修正するものであ
る。そこで、この検査は修正(あるいは拡張)タッカー
マン検査と呼ばれる。
The present invention improves upon the Full Tuckerman test for better performance when rounding the results of operations with higher precision than that supported by the hardware. Basically, the present invention modifies the full Tuckerman test to include the ability to make rounding decisions using intermediate operation results. Therefore, this inspection is called a modified (or extended) Tuckerman inspection.

【0050】より詳細には、この修正タッカーマン検査
は早期終了条件をチェックする演算を含む。早期終了条
件の存在をチェックする場合、修正タッカーマン検査は
中間演算結果を所定の境界値と比較する。従って、拡張
フォーマット内の利用可能で余分なビットが丸め処理の
判断を行なうことができず、更に計算が必要な場合で
も、通常フル・タッカーマン検査を避けることができ
る。まず、中間演算結果が負あるいは0であるとタッカ
ーマン検査が停止されうる。この場合、より小さい値が
用いられる。次に、中間演算結果が正であり、かつ全て
負である剰余項の大きさに関する境界より大きい時にも
タッカーマン検査が停止されうる。この場合、より大き
な値が用いられる。
More specifically, this modified Tuckerman test includes an operation that checks for an early termination condition. When checking for the presence of an early termination condition, the modified Tuckerman test compares the intermediate operation result with a predetermined boundary value. Therefore, the full Tuckerman check can usually be avoided even if the extra bits available in the extended format cannot make rounding decisions and more computation is required. First, the Tuckerman inspection may be stopped if the intermediate operation result is negative or zero. In this case, a smaller value is used. Then, the Tuckerman check may be stopped when the intermediate operation result is positive and is larger than the boundary regarding the size of the remainder term that is all negative. In this case, a larger value is used.

【0051】η2より大きい全ての項を蓄積し、η3より
大きい全ての項を計算した後、中間演算結果をチェック
することが有益である。ここでηはレジスタ内の数の精
度を表わす。この例では、η=264である。従って、暗
黙の「1」を有する正規化されたIEEE浮動小数点数、2
倍精度数を用いる場合、仮数は「1」と「2」の間にあ
る。従って、η2とη3の係数は「10」より小さい。値
「10」は計算される必要のある項の数に、その最大値を
掛けることによって得られる。計算は、剰余が正であり
10η2より小さくなければ第1の項の集合の後に停止さ
せることができ、剰余が正であり10η3より小さくなけ
れば第2の項の集合の後に停止させることができる。
After accumulating all terms greater than η 2 and computing all terms greater than η 3 , it is useful to check the intermediate operation result. Where η represents the precision of the number in the register. In this example, η = 2 64 . Therefore, a normalized IEEE floating point number with an implicit "1", 2
When using double precision numbers, the mantissa lies between "1" and "2". Therefore, the coefficients of η 2 and η 3 are smaller than “10”. The value "10" is obtained by multiplying the maximum number by the number of terms that need to be calculated. The calculation is that the remainder is positive
It can be stopped after the first set of terms if it is not less than 10 η 2 , and after the second set of terms if the remainder is positive and not less than 10 η 3 .

【0052】従って、ランダムに剰余が分布する場合に
は、修正タッカーマン検査は16,384の入力のうちの1回
を除いては全て第1の検査の後に終了する。この例で
は、修正タッカーマン検査は早く終わる場合9つの演算
しか実行せず、そのうちの3つはハードウエアで行なう
ことのできる2倍精度の乗算である。
Therefore, if the remainders are randomly distributed, the modified Tuckerman test will all finish after the first test except for one of the 16,384 inputs. In this example, the modified Tuckerman check performs only 9 operations when finished early, three of which are double precision multiplications that can be done in hardware.

【0053】図8は本発明の修正タッカーマン検査の一
実施例のフローチャートである。この修正タッカーマン
検査800はタッカーマン検査の中間演算結果を計算する
(802)ことによって開始される。次に、この中間演算
結果の符号に基づいて判断804が行なわれる。この中間
演算結果の符号が負である場合、検査は早く終わり、こ
の丸め処理がされていない演算結果の近似値を切り上げ
るべきではないことが示される(806)。一方、中間演
算結果の符号が正である場合、別の判断808が行なわれ
る。この中間演算結果がこのタッカーマン検査の最終剰
余である場合、判断808によって、タッカーマン検査は
この丸め処理のなされていない演算結果の近似値を切り
上げるべきであることを示す(810)。
FIG. 8 is a flow chart of an embodiment of the modified Tuckerman inspection of the present invention. The modified Tuckerman test 800 begins by calculating (802) an intermediate operation result of the Tuckerman test. Next, a determination 804 is made based on the sign of this intermediate operation result. If the sign of this intermediate operation result is negative, the check ends early, indicating that the approximation of this unrounded operation result should not be rounded up (806). On the other hand, if the sign of the intermediate operation result is positive, another determination 808 is made. If this intermediate operation result is the final remainder of this Tuckerman check, decision 808 indicates that Tuckerman check should round up the approximation of this unrounded operation result (810).

【0054】中間演算結果がタッカーマン検査の最終剰
余でない場合、他の判断812が行なわれる。中間演算結
果が剰余項の大きさに関する境界より大きい場合、判断
812によって早期終了が発生する。この場合、早期終了
の結果、タッカーマン検査は丸め処理されていない演算
結果の近似値を切り上げるべきことを示す(810)。一
方、中間演算結果が剰余項の大きさに関する境界より大
きくない場合、タッカーマン検査の最終的な剰余が正で
あると予想することはできない。従って、判断812の結
果、処理はブロック802に戻ってタッカーマン検査の次
の中間演算結果の処理が開始される。
If the intermediate operation result is not the final residue of the Tuckerman test, another decision 812 is made. Judge if the intermediate operation result is larger than the boundary regarding the size of the remainder term
812 causes early termination. In this case, early termination indicates that the Tuckerman check should round up the approximation of the unrounded operation result (810). On the other hand, if the intermediate operation result is not larger than the boundary regarding the size of the remainder term, it cannot be expected that the final remainder of the Tuckerman test is positive. Therefore, as a result of the determination 812, the process returns to the block 802, and the process of the next intermediate operation result of the Tuckerman inspection is started.

【0055】後述のB:修正タッカーマン検査の実施態
様は、拡張あるいは非拡張フォーマットのどちらかを用
いて除算、及び開平算を行なうことのできる修正タッカ
ーマン検査の一実施例を示す。後述のB:修正タッカー
マン検査の実施態様に示すマイクロコード型のプログラ
ミングを図8に示す、より一般的な実施例と関係付ける
ことが有益であるが、必ずしも必要ではない。後述の
B:修正タッカーマン検査の実施態様にはハードウエア
の精度ηをnで示している。後述のB:修正タッカーマン
検査の実施態様に示す中間演算結果は変数gによって容
易に識別される。最後の中間演算結果g[27]も又タッカ
ーマン検査の最終剰余である。早期終了の判断804は、
例えば行16、及び行27のそれぞれによって実施すること
ができる。完全な実行の終了である判断808が、行38、
及び行39によって示されている。他の早期終了の判断81
2は、例えば行17、及び行28のそれぞれによって実施す
ることができ、ここで10η2と10η3がそれぞれの境界で
ある。「1」が戻ると、丸め処理されていない演算結果
の近似値が切り上げられ(即ち、演算結果の近似値のビ
ット内で「1」が検査される)、「0」が戻ると、丸め
処理されていない演算結果の近似値は切り上げられない
(即ち、演算結果の近似値のビット内で「0」が検査さ
れる)。
The embodiment B: Modified Tuckerman inspection described below shows an embodiment of the modified Tuckerman inspection capable of performing division and square root using either extended or non-extended format. It is useful, but not necessary, to relate the microcode-type programming shown in B: Modified Tuckerman inspection embodiment below to the more general embodiment shown in FIG. In the embodiment of B: modified Tuckerman inspection described later, the accuracy η of the hardware is indicated by n. The intermediate operation result shown in the embodiment of the B: modified Tuckerman inspection described later is easily identified by the variable g. The final intermediate operation result g [27] is also the final residue of the Tuckerman test. Early termination decision 804 is
For example, each of row 16 and row 27 can be implemented. The decision 808, which is the end of the full run, is line 38,
And line 39. Other early termination decisions 81
2 can be implemented, for example, by row 17 and row 28, respectively, where 10 η 2 and 10 η 3 are the boundaries of each. When "1" is returned, the approximate value of the unrounded operation result is rounded up (that is, "1" is checked in the bits of the approximate value of the operation result), and when "0" is returned, the rounding process is performed. The approximation value of the calculation result that has not been calculated is not rounded up (that is, “0” is checked in the bit of the calculation result approximation value).

【0056】多倍精度の計算についても、新規な本発明
による丸め処理を実施することが容易である。まず、本
発明では半分の精度の乗算4つだけが必要であり、残り
の演算は加算である。第2に、中間の計算は全て単一の
余分なワードを用いて行なうことができる。唯一問題に
なる状況としては、演算結果において隣の上の位のワー
ドの拡張になるよう正規化された、最も下の位のワード
が0から始まりその後が全て1である場合である。幸運
なことに、これはランダムに構成されたビットに関して
は264分の1の確率でしか発生しない。従って、タッカ
ーマン検査を行なう必要は殆どない(4倍精度のケース
より良好でさえある)。タッカーマン検査が必要な場合
でも、通常、上述したような中間演算結果をチェックす
ると検査は早く終了する。
Even for multi-precision calculation, it is easy to carry out the new rounding processing according to the present invention. First, the present invention requires only four multiplications with half precision, and the remaining operations are additions. Second, all intermediate calculations can be done with a single extra word. The only problematic situation is when the lowest order word, which is normalized to be an extension of the next higher order word in the result of the operation, starts at 0 and is all 1s thereafter. Fortunately, this happens only with a 1 in 2 64 probability for randomly constructed bits. Therefore, there is little need to perform a Tuckerman test (even better than the quad precision case). Even when the Tuckerman inspection is required, the inspection is usually completed early by checking the intermediate operation result as described above.

【0057】タッカーマン検査に関する以上の説明は主
として開平算の結果を丸め処理する場合についてであっ
たが、タッカーマン検査は除算にも適用できる。従来、
タッカーマン検査は開平にのみ適用可能で、除算には適
用できなかった。丸め処理のためのタッカーマン検査は
近似式(yn+1 + μ113/2)2 = yn+1(yn+1 + μ113)を
用いることによって開平用に公式化されている。しか
し、除算用にはこうした式はないが、レジスタ内の余分
なビットを用いて{B - A(yn+1 + μ113/2)}の符号が
検査される。このような適応がなされると、{B - A
(yn+1 + μ113/2)}が浮動小数点演算装置のレジスタに
適合するため、タッカーマン検査をハードウエア内で実
施することが可能になる。
The above description of the Tuckerman inspection was mainly about the case where the square root result is rounded, but the Tuckerman inspection can also be applied to division. Conventionally,
The Tuckerman test was applicable only to Kaihei and not to division. The Tuckerman test for the rounding process is formulated for square rooting by using the approximate expression (y n + 1 + μ 113/2 ) 2 = y n + 1 (y n + 1 + μ 113 ). However, there is no such expression for division, but the sign of {B-A (y n + 1 + μ 113/2 )} is checked using the extra bits in the register. When such an adaptation is made, {B-A
Since (y n + 1 + μ 113/2 )} matches the register of the floating point arithmetic unit, it becomes possible to perform the Tuckerman check in hardware.

【0058】余分で正確なビットを利用することによっ
て、本発明のアプローチは殆どの場合、タッカーマン検
査の実施を回避することができる。タッカーマン検査が
必要になる稀な場合では、修正タッカーマン検査が用い
られる。これは修正タッカーマン検査が実質的に丸め処
理の判断を行う速度を大幅に改善するためである。
By utilizing the extra and correct bits, the approach of the present invention can, in most cases, avoid performing a Tuckerman test. In rare cases where a Tuckerman test is needed, a modified Tuckerman test is used. This is because the modified Tuckerman inspection substantially improves the speed at which the rounding process is judged.

【0059】非拡張フォーマットの丸め処理 本実施例では、正確な平方根、又は商に最も近い浮動小
数点数が余分なビットを用いずに計算される。この実施
例に関して、4倍精度の数がメモリ、及びレジスタの両
方にそれぞれ53の仮数ビットを有する2つの2倍精度の
数として記憶されていると仮定する。ここで入力の長さ
は106ビットであり、最終的に丸め処理される演算結果
は106ビットに正確に丸め処理されなければならない。
Rounding Process in Non-Extended Format In this embodiment, the floating point number closest to the exact square root or quotient is calculated without the extra bits. For this example, assume that a quad precision number is stored as two double precision numbers with 53 mantissa bits each in both memory and register. Here, the input length is 106 bits, and the final rounded operation result must be exactly rounded to 106 bits.

【0060】例えば、上述した(従来の又は修正され
た)Newton-Raphson法は少なくとも102の正しいビット
を有する演算結果の近似値を生成する。4ビットもの誤
差がありうるため、標準的なタッカーマン検査を用いた
丸め処理を行なうことはできない。Newton-Raphson法を
更に2度繰り返せば正確な結果が得られるが、こうした
追加の繰り返しは上述したように処理時間の観点から見
て問題がある。その代わりに、本発明によれば、タッカ
ーマン検査を用いた丸め処理が、異なるビット位置で6
回適用される。
For example, the above-mentioned (conventional or modified) Newton-Raphson method produces an approximation of the operation result having at least 102 correct bits. Since there can be an error of 4 bits, the rounding process using the standard Tuckerman inspection cannot be performed. Repeating the Newton-Raphson method two more times will give accurate results, but these additional iterations are problematic in terms of processing time, as discussed above. Instead, according to the present invention, the rounding process using Tuckerman inspection is performed with 6 bits at different bit positions.
Applied once.

【0061】図6は非拡張フォーマットの丸め処理マイ
クロコード134、226によって実行される演算のフローチ
ャートである。まず、除算命令、又は開平命令の演算結
果の近似値が得られる(602)。図4のブロック402と同
様、この近似値はNewton-Raphson法に含まれる様々な方
法で生成することができる。ここでは、演算結果の近似
値は、全てではないが殆どのビットが正確であることが
保証される。この例では、106ビットの演算結果の近似
値のうち、最初の102ビットは正確であることが保証さ
れる。
FIG. 6 is a flow chart of the operations performed by the non-extended format rounding microcode 134, 226. First, an approximate value of the operation result of the division instruction or the square root instruction is obtained (602). Similar to block 402 of FIG. 4, this approximation can be generated by various methods included in the Newton-Raphson method. Here, it is guaranteed that most, if not all, of the approximate values of the operation results are accurate. In this example, the first 102 bits of the approximate value of the operation result of 106 bits are guaranteed to be accurate.

【0062】次に、この演算結果の近似値のうち正確で
あることが保証されないビットが0にセットされる(60
4)。その後、判断606が行なわれる。0にセットされた
全てのビットが個々に処理されていない場合、このビッ
トの隣にある未処理のビットが、早期終了のためのチェ
ックを行なう修正タッカーマン検査を用いて丸め処理さ
れる(608)。この修正タッカーマン検査については上
述し、かつ後述のA:マイクロコードの疑似コード記
述、及びB:修正タッカーマン検査の実施態様で詳細に
説明する。0にセットされたビットが全て個々に処理さ
れた後、ブロック606において、丸め処理が停止され
る。これは、正確に丸め処理された演算結果がすでに得
られたためである。
Next, the bit which is not guaranteed to be accurate among the approximated values of this operation result is set to 0 (60
Four). Thereafter, decision 606 is made. If all the bits set to 0 have not been individually processed, then the unprocessed bits next to this bit are rounded using a modified Tuckerman check that checks for early termination (608). ). This modified Tuckerman inspection is described in detail above and in the following embodiments of A: pseudocode description of microcode and B: modified Tuckerman inspection. After all the bits set to 0 have been processed individually, at block 606 the rounding process is stopped. This is because the rounded operation result has already been obtained.

【0063】図7は、この例における非拡張フォーマッ
ト丸め処理手順の動作を示す。602で得られる演算結果
の近似値は53ビットの仮数を有する2つの2倍精度の数
700、702からなる。これら2つの2倍精度数700、702は
一緒にされて、正確に丸め処理されるべき演算結果の近
似値704を形成する。ここで、最初の102ビット706は正
確であることが保証されているため、103番目、104番
目、105番目、及び106番目のビット708が0にセットさ
れる(604)。正確な演算結果は過小評価されているた
め、正確に丸め処理された102ビットの演算結果は102ビ
ットの数、又はこの102ビットの数にそのULPであるμ
102を加えた数のどちらかである。次に、初回のタッカ
ーマン検査が適用される。このタッカーマン検査でより
大きい数を用いるべきであることが示されると、103番
目のビットは1でなければならず、従ってこのビットは
μ103を加えることによって1にセットされる。この演
算結果は過小評価されたままであるが、103ビットに修
正される。同じ手順が103番目、104番目、及び105番目
のビットについても繰り返される。その後、タッカーマ
ン検査が最後に106番目のビットに適用されるが、ここ
で検査によって演算結果が小さ過ぎることが示された場
合、μ106が加算される。
FIG. 7 shows the operation of the non-extended format rounding processing procedure in this example. The approximate value of the operation result obtained in 602 is two double-precision numbers having a 53-bit mantissa.
It consists of 700 and 702. These two double precision numbers 700, 702 are combined to form an approximation 704 of the result of the operation to be rounded exactly. Here, since the first 102 bits 706 are guaranteed to be correct, the 103rd, 104th, 105th, and 106th bits 708 are set to 0 (604). The exact rounded result is underestimated, so the exactly rounded 102-bit rounded result is a 102-bit number, or its ULP to this 102-bit number μ
Either of the numbers plus 102 . The first Tuckerman inspection is then applied. If this Tuckerman check indicates that a higher number should be used, the 103rd bit must be 1, so this bit is set to 1 by adding μ 103 . The result of this operation remains underestimated but is modified to 103 bits. The same procedure is repeated for the 103rd, 104th, and 105th bits. Then the Tuckerman test is finally applied to the 106th bit, but if the test shows that the result of the operation is too small, then μ 106 is added.

【0064】この例ではタッカーマン検査は4回繰り返
されることに注目されたい。実行速度を上げるために、
後述のB:修正タッカーマン検査の実施態様に示す修正
タッカーマン検査を実施して繰り返すべき演算の数が低
減される。即ち、vk(検査が行なわれる点)に依存す
る項だけが再計算される。従って、初回の検査が成功す
る、最良の性能を有する場合では、最初の検査で9つの
演算が実行され、追加の検査1回につき1つの演算が実
行されるため、合計の演算数は13になる。最悪の性能を
有する場合では、最初の検査に27の演算、追加の検査そ
れぞれに9つの演算が必要であり、演算数は合計で63に
なる。通常、2回目の検査で最終的な結果が得られ、こ
の場合最初の検査に18の演算、追加の演算にそれぞれ4
つの演算が必要であり、演算数の合計は34となる。幸運
なことには、繰り返される演算には乗算がない。多倍精
度算術演算の場合これは重要である。従来、これと同じ
精度を得るためには、正確な106ビットの演算結果を得
るのにNewton-Raphson反復を更に2回行なって215ビッ
トを計算する必要があった。タッカーマン検査を繰り返
し適用する本発明のアプローチは、従来のアプローチよ
り明らかに高速である。
Note that in this example the Tuckerman test is repeated 4 times. To speed up execution,
The number of operations to be repeated by performing the modified Tuckerman inspection shown in B: Modified Tuckerman inspection mode described later is reduced. That is, only terms that depend on v k (the point at which the check is performed) are recomputed. Therefore, if the first check succeeds and has the best performance, nine operations are executed in the first check and one operation is executed for each additional check, so that the total number of operations is 13. Become. In the worst case case, the first check requires 27 operations and each additional check requires 9 operations, for a total of 63 operations. Usually the second test gives the final result, in this case 18 operations for the first test and 4 for each additional operation.
One operation is required, and the total number of operations is 34. Fortunately, repeated operations have no multiplication. This is important for multiple precision arithmetic. Conventionally, in order to obtain the same precision as this, it was necessary to perform 215 bits by performing Newton-Raphson iteration two more times to obtain an accurate 106-bit operation result. The inventive approach of iteratively applying the Tuckerman test is significantly faster than conventional approaches.

【0065】しかし、開始の演算結果の判定には注意し
なければならない。例えば、正確に丸め処理された演算
結果が16進ストリング“8000001”になる場合、2ULPだ
け過小評価された開始値は7FFFFFFHEXである。上述の手
順に従えば、丸め処理された演算結果は8000000HEXであ
る。この状況は、初期評価7FFFFF0HEXプラス10HEXをタ
ッカーマン検査を用いて検査することによって説明する
ことができる。タッカーマン検査によって過小評価であ
ることがわかれば、大きい方の値8000000HEXが初期評価
値として用いられ、過小評価でなければ小さい方の値7F
FFFF0HEXが用いられる。この追加の検査にはタッカーマ
ン検査を更に一度繰り返すことが必要である。
However, care must be taken in determining the calculation result of the start. For example, when the rounded operation result is the hexadecimal string “8000001”, the starting value underestimated by 2ULP is 7FFFFFF HEX . According to the above procedure, the rounded operation result is 8000000 HEX . This situation can be explained by examining the initial evaluation 7FFFFF0 HEX plus 10 HEX using the Tuckerman test. If the Tuckerman test shows that the value is underestimated, the larger value 8000000 HEX is used as the initial evaluation value, and if not underestimated, the smaller value 7F
FFFF0 HEX is used. This additional inspection requires the Tuckerman inspection to be repeated one more time.

【0066】拡張フォーマットの実施例と同様に、本実
施例の場合も、タッカーマン検査を除算に用いることは
より難しい。本実施例を拡張フォーマットの実施例のア
プローチで行なうと、yn+1 + μ106/2が用いられる
が、浮動小数点算術演算装置のレジスタには適合しな
い。その代わり、本実施例のハードウエアは拡張フォー
マットをサポートしないため、タッカーマン検査の剰余
はB - Ayn+1 - Aμ106から計算される。yn+1はB/
Aに対する非常に近似的な値であるため、最初の2つの
項はほぼ打ち消されて正の値が残る。これは正確な商が
過小評価されたためである。項Aμ106はハードウエア
によって簡単に計算、及び記憶することができる。これ
は演算結果が、アンダーフローがなければAを再び基準
化したものであるためである。
As with the extended format embodiment, it is more difficult to use the Tuckerman test for division in this embodiment as well. If this embodiment is carried out with the extended format embodiment approach, y n + 1 + μ 106/2 is used, but it is not compatible with the registers of the floating point arithmetic unit. Instead, since the hardware of this embodiment does not support the extended format, the Tuckerman test residue is calculated from B-Ay n + 1 -Aμ 106 . y n + 1 is B /
Since it is a very approximate value for A, the first two terms are nearly cancelled, leaving a positive value. This is because the exact quotient was undervalued. The term Aμ 106 can be easily calculated and stored by hardware. This is because the calculation result is a standardization of A again if there is no underflow.

【0067】一般的考慮事項 以上の説明は、正確な答えに最も近い浮動小数点演算結
果を返す「最も近い値への丸め処理」モードについて行
なった。IEEE浮動小数点規格、ANSI/IEEE 754-1985に
は、その他の3つの処理モード、即ち「ゼロへの丸め処
理」モード、「正の無限大への丸め処理」モード、及び
「負の無限大への丸め処理」モードがある。本発明は
「最も近い値への丸め処理」モードに関するものである
が、この浮動小数点演算装置は、オプションで他の丸め
処理モードを用いるようにも動作可能である。しかし、
そのためには上記の拡張フォーマットの実施例、及び非
拡張フォーマットの実施例(除算と開平算にNewton反復
を用いるものと仮定する)に以下の変更を行う必要があ
る。
GENERAL CONSIDERATIONS The above discussion is for the "round to nearest" mode, which returns the floating point result that is closest to the exact answer. The IEEE floating point standard, ANSI / IEEE 754-1985, has three other processing modes: "round to zero" mode, "round to positive infinity" mode, and "to negative infinity". There is a "rounding process" mode. Although the present invention relates to the "round to nearest" mode, the floating point unit can optionally operate with other rounding modes. But,
To do so, the following modifications need to be made to the extended format embodiment and the non-extended format embodiment (assuming Newton iteration is used for division and square root).

【0068】拡張フォーマットの実施例では、手順の違
いは次の通りである。
In the extended format embodiment, the differences in procedure are as follows.

【0069】-ゼロへの丸め処理:単にNewton反復から
の出力を返す。
Round to Zero: simply return the output from the Newton iteration.

【0070】-正の無限大への丸め処理:演算結果が正
である場合、Newton反復からの出力に1ULPを加算す
る。演算結果が負である場合は、単にNewton反復からの
出力を返す。
Round to positive infinity: If the result of the operation is positive, add 1 ULP to the output from the Newton iteration. If the result is negative, it simply returns the output from the Newton iteration.

【0071】-負の無限大への丸め処理:演算結果が負
である場合、Newton反復の出力から1ULPを減算する。
演算結果が正である場合は、単にNewton反復からの出力
を返す。
Rounding to negative infinity: If the result of the operation is negative, subtract 1 ULP from the output of the Newton iteration.
If the result is positive, simply return the output from the Newton iteration.

【0072】非拡張フォーマットの実施例では、手順は
(計算値を生成する)最初の5回のタッカーマン丸め処
理については同じであり、それ以降は次のように異な
る。
In the non-extended format embodiment, the procedure is the same for the first five Tuckerman rounding processes (which generate the calculated values), and thereafter it differs as follows.

【0073】-ゼロへの丸め処理:単に計算値を返す。Rounding to zero: simply return the calculated value.

【0074】-正の無限大への丸め処理:演算結果が負
である場合、計算値から1ULPを減算する。演算結果が
正である場合は、単に計算値を返す。
Rounding processing to positive infinity: When the operation result is negative, 1ULP is subtracted from the calculated value. If the operation result is positive, it simply returns the calculated value.

【0075】-負の無限大への丸め処理:演算結果が正
である場合、計算値に1ULPを加算する。演算結果が負
である場合は、単に計算値を返す。
Rounding process to negative infinity: When the operation result is positive, 1ULP is added to the calculated value. If the result of the operation is negative, it simply returns the calculated value.

【0076】これらの手順では、開始値が所望の丸め処
理された演算結果の過小評価された値であることを前提
としているため、これらの代替的手順によって正確な演
算結果が常に正しく処理されるわけではない。従って上
記の丸め処理を行なう前に1ULP(拡張フォーマットの
場合μ128、非拡張フォーマットの場合μ106)を減算す
ることによって、過小評価された値が確実に得られる。
Since these procedures assume that the starting value is an underestimated value of the desired rounded operation result, these alternative procedures always process the correct operation result correctly. Do not mean. Therefore, an underestimated value can be reliably obtained by subtracting 1 ULP (μ 128 for extended format, μ 106 for non-extended format) before performing the rounding process described above.

【0077】以上の説明は、浮動小数点演算装置が2つ
の2倍精度数に対する算術演算の4倍精度の演算結果を
返す命令を有することを前提としている。即ち、本発明
はハードウエアが2つのハードウエア精度数の積の全て
の桁、及び和の先頭の4倍(例えば2N)精度部を提供す
ることができることを前提としている。既存のコンピュ
ータの中には、2つの2倍精度数の乗算の4倍精度の結
果(即ち全ての桁)を返すハードウエア命令を有するも
のと、こうした命令を持たないものがある。又、コンピ
ュータによっては2つの数の和の4倍精度部を返す命令
を有するものもある(例えばIBM S/370)。
The above description is based on the assumption that the floating point arithmetic unit has an instruction that returns a quadruple precision operation result of an arithmetic operation for two double precision numbers. That is, the present invention is premised on that the hardware is capable of providing all digits of the product of two hardware precision numbers and a quadruple (eg, 2N) precision part of the beginning of the sum. Some existing computers have hardware instructions that return a quad precision result (ie, all digits) of the multiplication of two double precision numbers, and some do not. Also, some computers have instructions that return the quad precision part of the sum of two numbers (eg IBM S / 370).

【0078】ハードウエアがこれらの条件を満たすこと
が好適ではあるが、それが不可能である場合、ソフトウ
エアを併用してその条件を満たすようにすることもでき
る。2つの2倍精度数の積の4倍精度の演算結果を返す
ハードウエアを増強するのに用いることのできるコード
の例を表2に示す。より詳細には、表2には次のように
1つの単精度フォーマットに記憶された2つの2倍精度
数の積の全てのビットを返すためのC言語コードを示
す。この例では、変数は単精度数として記憶される。
It is preferable that the hardware satisfies these conditions, but if it is impossible, it is also possible to use software in combination to satisfy the conditions. Table 2 shows an example of code that can be used to augment the hardware that returns the quad precision result of the product of two double precision numbers. More specifically, Table 2 shows the C code for returning all bits of the product of two double precision numbers stored in one single precision format as follows: In this example, the variables are stored as single precision numbers.

【0079】[0079]

【表2】 [Table 2]

【0080】従って、演算結果は4つの単精度数c[0]、
c[1]、c[2]、及びc[3]として返される。このアプローチ
は、2倍精度フォーマットが2つの単精度数の積より少
なくとも2桁大きい桁数を有することを前提としてお
り、これはIEEEの浮動小数点の規格に適合する。
Therefore, the calculation result is four single precision numbers c [0],
Returned as c [1], c [2], and c [3]. This approach assumes that the double precision format has at least two digits greater than the product of two single precision numbers, which complies with the IEEE floating point standard.

【0081】和は指数が実質的に異なる場合、非常に大
きな桁数を有することがある。本発明ではこの演算結果
の先頭の4倍精度部(例えば2Nビット)を必要とする。
従って、ハードウエアがこの先頭の2Nビットを直接検索
することができない場合があるため、2つの2倍精度数
の和の先頭の4倍精度部を返すのに用いることのできる
C言語コードの一例を表3に示す。
The sum can have a very large number of digits if the exponents are substantially different. The present invention requires a quadruple precision part (for example, 2N bits) at the head of this operation result.
Therefore, the hardware may not be able to retrieve this leading 2N bit directly, so it can be used to return the leading quad precision part of the sum of two double precision numbers.
Table 3 shows an example of C language code.

【0082】[0082]

【表3】 [Table 3]

【0083】この例では、入力の上位部と下位部は別個
の単精度ワードに記憶され、次にこの上位部と下位部が
加算され、下位から上位への桁上げが生じる。その和が
4つの単精度数c[0]、c[1]、c[2]、及びc[3]として記憶
される。
In this example, the upper and lower parts of the input are stored in separate single precision words, then the upper and lower parts are added, resulting in a carry from lower to higher. The sum is stored as four single precision numbers c [0], c [1], c [2], and c [3].

【0084】従って、本発明では2つのハードウエア精
度数の積の全ての桁、及び和の先頭の2Nビット(例えば
4倍)精度部へのアクセスを必要とするが、本発明では
ハードウエアの欠点をソフトウエアで補うことができる
ため、浮動小数点算術演算装置内に(乗算器、及び加減
算装置以外の)特殊なハードウエアを必要としない。し
かし、こうしたソフトウエアを用いることによって性能
は低下する。
Therefore, the present invention requires access to all the digits of the product of two hardware precision numbers and the leading 2N-bit (eg, 4 times) precision part of the sum. No special hardware (other than the multiplier and adder / subtractor) is required in the floating point arithmetic unit because the drawbacks can be compensated by software. However, using such software reduces performance.

【0085】本発明の多くの特徴と利点は以上の説明か
ら明らかであろう。従って、特許請求の範囲にはこうし
た特徴と利点の全てが含まれているものである。更に、
当業者には本発明に対して様々な修正や変更を加えるこ
とが容易であるため、本発明はここに図示、及び説明し
た構造や動作に厳密に制限されるものではない。従っ
て、適切な変更、及び同等物の全ては本発明の範囲内に
含まれる。
Many features and advantages of the present invention will be apparent from the above description. Accordingly, the claims are intended to cover all such features and advantages. Furthermore,
The present invention is not strictly limited to the structures and operations shown and described herein, as a person skilled in the art can easily make various modifications and changes to the present invention. Accordingly, all suitable modifications and equivalents are included within the scope of the present invention.

【0086】A:マイクロコードの疑似コード記述 ここでは高精度の除算、及び開平算結果を得て、これを
正確に丸め処理するために制御ユニット134、226によっ
て実行されるマイクロコードの疑似コード記述を示す。
A: Pseudocode description of microcode Here, a pseudocode description of microcode executed by the control units 134 and 226 in order to obtain a high-precision division and square root calculation result and to accurately round the result. Indicates.

【0087】[0087]

【表4】 [Table 4]

【0088】関数u(A)、及びd(B,A)はそれぞれ最大で4
つのビットに誤差のある平方根、及び商を返す。ルーチ
ンtはULP uに修正タッカーマン検査を実行する。その
結果平方根Fと商Gが得られ、それぞれ演算結果の誤差
は1/2 ULP以下である。
The functions u (A) and d (B, A) each have a maximum of 4
Returns the square root with the error in one bit and the quotient. Routine t performs a modified Tuckerman check on ULP u. As a result, the square root F and the quotient G are obtained, and the error in the calculation results is 1/2 ULP or less.

【0089】[0089]

【表5】 [Table 5]

【0090】B:修正タッカーマン検査の実施態様 ここでは除算のための修正タッカーマン検査の実施態様
を示す。この実施態様は修正タッカーマン検査をマイク
ロコードで実施するよう定義するものである。より詳細
には、この実施態様は、UNIXデスクトップ計算機bc用
のC言語のようなプログラミング言語を用いるものとし
て記述される。この方法は演算に含まれるビット数を完
全に制御できるように整数を用いて実施される。下記の
実施態様にはUNIXデスクトップ計算機に用いられる2、
3のユーティリティ・ルーチンが組み込まれている。即
ち、ルーチンh(a,n)はaに基数nのobaseを有する第1
の桁を返し、ルーチンl(a,n)はaに基数nのobaseを有
する第2の桁を返す。ここで、obaseは出力に用いられ
る基数である。
B: Embodiment of Modified Tuckerman Inspection Here, an embodiment of the modified Tuckerman inspection for division is shown. This embodiment defines a modified Tuckerman test to be performed in microcode. More specifically, this embodiment is described as using a programming language such as C for the UNIX desktop computer bc. This method is implemented using integers so that the number of bits involved in the operation can be completely controlled. The following embodiment is used in a UNIX desktop computer 2.
Three utility routines are included. That is, the routine h (a, n) is the first with a base n of obase in a
And the routine l (a, n) returns the second digit with the base n of obase in a. Where obase is the radix used for output.

【0091】[0091]

【表6】 [Table 6]

【0092】B−2:修正タッカーマン検査-開平(a
1/2 開平のための修正タッカーマン検査は上記の除算のため
の実施態様と同様に実施することができる。唯一の相違
点はフォーマットがv(a,y,y,u)となることである。
B-2: Modified Tuckerman Inspection-Kaihei (a
1/2 ) The modified Tuckerman inspection for square rooting can be carried out in the same way as the embodiment for division above. The only difference is that the format is v (a, y, y, u).

【0093】以下に本発明の実施態様を列挙する。The embodiments of the present invention will be listed below.

【0094】1. 被除数を除数で除算して、正確に丸
め処理された商を生成する除算と、正確に丸め処理され
た平方根を生成する、ある値の開平算のうち少なくとも
1つを実行する浮動小数点算術演算装置であって、前記
算術演算装置が、データを記憶するためのマルチポート
記憶装置、2つの数を乗算して積を求め、2つの数を加
算して和を求める算術演算手段、除算、及び開平算のう
ちの少なくとも1つについて演算結果の近似値を提供す
る近似手段、タッカーマン検査を用いて除算、及び開平
算のうちの少なくとも1つの演算結果の近似値を正確に
丸め処理するための手順を含む丸め処理マイクロコー
ド、及び前記浮動小数点算術演算装置を制御する制御装
置からなり、前記丸め処理マイクロコードが、演算結果
の近似値が過小評価された値になるようにし、タッカー
マン検査を早期終了させることによって、演算結果の近
似値を正確に丸め処理して、正確に丸め処理された結果
を生成する、浮動小数点算術演算装置。
1. Floating-point arithmetic unit for performing division of a dividend by a divisor to produce an accurately rounded quotient and at least one square root of a value to produce an exactly rounded square root Wherein the arithmetic operation device is a multiport storage device for storing data, an arithmetic operation means for multiplying two numbers to obtain a product and adding two numbers to obtain a sum, a division and a square root Approximation means for providing an approximate value of the operation result for at least one of the arithmetic operations, division using a Tuckerman test, and a procedure for accurately rounding the approximate value of the operation result of at least one of the square root operations And a controller for controlling the floating-point arithmetic operation unit, so that the rounding microcode is such that the approximate value of the operation result is an underestimated value. And, by early termination of Tuckerman test, the calculation result of the approximation to accurately rounding, produces a result which is precisely rounding floating-point arithmetic unit.

【0095】2. 前記丸め処理マイクロコードが演算
結果の近似値を正確に丸め処理する手段を含み、前記丸
め処理手段が、タッカーマン検査を実行して演算結果の
近似値をどのように丸め処理するかを判定する手段、タ
ッカーマン検査の中間結果の符号をチェックする手段、
及び前記中間結果の符号に基づいて、タッカーマン検査
の実行終了を早め、演算結果の近似値を正確に丸め処理
する手段を含むことを特徴とする、項番1に記載の浮動
小数点算術演算装置。
2. The rounding processing microcode includes means for accurately rounding the approximate value of the operation result, and the rounding processing means performs a Tuckerman test to determine how to round the approximate value of the operation result. Means, means for checking the sign of the intermediate result of the Tuckerman inspection,
And a floating point arithmetic operation unit according to item 1, which includes means for accelerating the end of execution of the Tuckerman check and accurately rounding the approximate value of the operation result based on the sign of the intermediate result. .

【0096】3. 前記丸め処理マイクロコードが、演
算結果の近似値が正確に丸め処理された演算結果に対応
する、実際の演算結果を過小評価したものになるように
する過小評価手段を更に含むことを特徴とする、項番2
に記載の浮動小数点算術演算装置。
3. The rounding processing microcode further includes underestimation means for causing the approximate value of the operation result to correspond to the operation result that has been accurately rounded so that the actual operation result is underestimated. , No. 2
Floating point arithmetic unit described in.

【0097】4. 前記丸め処理マイクロコードが演算
結果の近似値を正確に丸め処理して、正確に丸め処理さ
れた演算結果を生成する、丸め処理手段を含み、前記丸
め処理手段が、タッカーマン検査を実行して演算結果の
近似値をどのように丸め処理するかを判定する手段、所
定の値をタッカーマン検査の中間結果と比較して比較結
果を生成する手段、及び前記比較結果に基づいてタッカ
ーマン検査の実行終了を早め、演算結果の近似値を正確
に丸め処理する手段を含むことを特徴とする、項番1に
記載の浮動小数点算術演算装置。
4. The rounding processing microcode accurately rounds the approximate value of the operation result to generate an accurately rounded operation result, including rounding processing means, the rounding processing means performing a Tuckerman test. Means for determining how to round the approximate value of the operation result, means for generating a comparison result by comparing a predetermined value with the intermediate result of the Tuckerman inspection, and Tuckerman inspection based on the comparison result. The floating-point arithmetic operation device according to item 1, further comprising means for accelerating the end of execution and accurately rounding the approximate value of the operation result.

【0098】5. 前記丸め処理マイクロコードが、演
算結果の近似値が正確に丸め処理された演算結果に対応
する、実際の演算結果を過小評価した値になるようにす
る過小評価手段を更に含むことを特徴とする、項番4に
記載の浮動小数点算術演算装置。
5. The rounding processing microcode further includes underestimation means for causing an approximate value of the computation result to correspond to the computation result that has been accurately rounded so as to be an underestimated value of the actual computation result. Floating point arithmetic operation unit according to item No. 4.

【0099】6. 拡張タッカーマン検査を用いて除
算、又は開平算の高精度の演算結果の近似値を、正確に
丸め処理して、正確に丸め処理された演算結果を生成す
る方法であって、前記方法がデータ処理システム内で実
行され、(a)除算、及び開平算の演算結果の近似値を受
信するステップ、(b)演算結果の近似値が正確に丸め処
理された演算結果に対応する、実際の演算結果を過小評
価した値になるようにするステップ、及び(c)拡張タッ
カーマン検査を実行して演算結果の近似値を正確に丸め
処理し、正確に丸め処理された演算結果を生成するステ
ップからなる方法。
6. A method of accurately rounding an approximate value of a high-precision operation result of division or square root extraction using an extended Tuckerman test to generate an operation result that is accurately rounded, wherein the method is a data An actual operation that is executed in the processing system and that (a) receives the approximate value of the operation result of division and square root calculation, and (b) the approximate value of the operation result corresponds to the accurately rounded operation result. From the step of making the result an underestimated value, and the step of (c) executing the extended Tuckerman check to accurately round the approximate value of the operation result and generating the operation result that has been accurately rounded. How to become.

【0100】7. 前記拡張タッカーマン検査の実行ス
テップ(c)によって中間演算結果が生成され、前記拡張
タッカーマン検査の実行ステップ(c)が、(c1)拡張タッ
カーマン検査の中間結果のうちの少なくとも1つの符号
をチェックするステップ、及び(c2)中間結果のうちの少
なくとも1つの符号に基づいて、前記拡張タッカーマン
検査の実行(c)終了を早め、演算結果の近似値を正確に
丸め処理するステップを含むことを特徴とする、項番6
に記載の方法。
7. An intermediate operation result is generated by the execution step (c) of the extended Tuckerman inspection, and the execution step (c) of the extended Tuckerman inspection includes (c1) at least one sign of the intermediate result of the extended Tuckerman inspection. The step of checking, and (c2) the step (c) of executing the extended Tuckerman check, based on at least one sign of the intermediate result, accelerating the end of the extended Tuckerman test and accurately rounding the approximate value of the operation result. No. 6 characterized by
The method described in.

【0101】8. 前記拡張タッカーマン検査の実行ス
テップ(c)が、(c3)所定の値を拡張タッカーマン検査の
中間結果のうちの1つと比較して比較結果を生成するス
テップ、及び(c4)前記比較結果に基づいて前記拡張タッ
カーマン検査の実行(c)終了を早め、演算結果の近似値
を正確に丸め処理するステップを更に含むことを特徴と
する、項番7に記載の方法。
8. The step (c) of performing the extended Tuckerman test includes (c3) comparing a predetermined value with one of intermediate results of the extended Tuckerman test to generate a comparison result, and (c4) adding the comparison result to the comparison result. The method according to item 7, further comprising the step of accelerating the execution (c) of the extended Tuckerman test based on the above and accurately rounding the approximate value of the operation result.

【0102】9. 前記所定の値が、拡張タッカーマン
検査によって計算されるべき剰余項の大きさに関する境
界であることを特徴とする、項番8に記載の方法。
9. Item 9. The method according to item No. 8, wherein the predetermined value is a boundary regarding a size of a residue term to be calculated by the extended Tuckerman check.

【0103】10. 前記の終了ステップ(c4)が、中間演
算結果が正であり、剰余項の大きさに関する境界より大
きい時に早期に発生することを特徴とする、項番9に記
載の方法。
10. Item 10. The method according to Item 9, wherein the ending step (c4) occurs early when the intermediate operation result is positive and is larger than the boundary regarding the size of the remainder term.

【0104】11. 前記拡張タッカーマン検査の実行ス
テップ(c)が、(c1)所定の値を拡張タッカーマン検査の
中間結果のうちの1つと比較して比較結果を生成するス
テップ、及び(c2)前記比較結果に基づいて、拡張タッカ
ーマン検査の実行(c)終了を早め、演算結果の近似値を
正確に丸め処理するステップを更に含む、項番6に記載
の方法。
11. The step (c) of performing the extended Tuckerman test includes (c1) comparing a predetermined value with one of intermediate results of the extended Tuckerman test to generate a comparison result, and (c2) the comparison result. 7. The method according to item 6, further comprising the steps of: (c) accelerating the end of the extended Tuckerman test based on the above and accurately rounding the approximate value of the calculation result.

【0105】12. 前記所定の値が、拡張タッカーマン
検査によって計算されるべき剰余項の大きさに関する境
界であることを特徴とする、項番11に記載の方法。
12. Item 12. The method according to Item 11, wherein the predetermined value is a boundary regarding a size of a residue term to be calculated by the extended Tuckerman check.

【0106】13. 前記終了ステップ(c2)が、中間演算
結果が正であり、剰余項の大きさに関する境界より大き
い時に早期に発生することを特徴とする、項番12に記載
の方法。
13. Item 13. The method according to Item 12, wherein the ending step (c2) occurs early when the intermediate operation result is positive and is larger than the boundary regarding the size of the remainder term.

【0107】14. 演算結果の近似値の殆どのビットが
正確であることを保証できることを特徴とする、項番6
に記載の方法。
14. Item No. 6 characterized by being able to guarantee that most of the bits of the approximate value of the operation result are accurate.
The method described in.

【0108】15. 拡張タッカーマン検査を用いて除
算、又は開平算の高精度の演算結果の近似値を正確に丸
め処理し、正確に丸め処理された演算結果を生成する方
法であって、前記方法がデータ処理システム内で実行さ
れ、(a)除算、又は開平算の演算結果の近似値を求める
ステップであって、前記演算結果の近似値が、正確に丸
め処理された演算結果に必要な桁数を越えた、余分で正
確な桁を有するステップ、(b)可能であれば、余分で正
確な桁の値を用いて、演算結果の近似値を正確に丸め処
理するステップ、(c)(b)が行なわれない時、拡張タッカ
ーマン検査を用いて演算結果の近似値を正確に丸め処理
するステップ、及び(d)正確に丸め処理された演算結果
を所望の桁数に切り捨てるステップからなる方法。
15. A method for accurately rounding an approximate value of a highly accurate operation result of division or square root extraction using an extended Tuckerman test, and generating an operation result that has been exactly rounded, said method being a data processing system. (A) a step of obtaining an approximate value of the operation result of division or square root operation, wherein the approximate value of the operation result exceeds the number of digits required for the operation result that has been accurately rounded. , Steps with extra and accurate digits, (b) Steps (c) and (b) that accurately round the approximate value of the operation result using the values of the extra and accurate digits, if possible. If not, a method of accurately rounding the approximate value of the operation result by using the extended Tuckerman test, and (d) a step of truncating the correctly rounded operation result to a desired number of digits.

【0109】16. 拡張タッカーマン検査を用いて除
算、又は開平算の高精度の演算結果の近似値を正確に丸
め処理し、正確に丸め処理された演算結果を生成する方
法であって、前記方法がデータ処理システム内で実行さ
れ、(a)除算、又は開平算の演算結果の近似値を求める
ステップ、(b)演算結果の近似値の、正確であることが
保証されていない桁を0にセットするステップ、及び
(c)拡張タッカーマン検査を用いて前記の0にセットさ
れた桁のそれぞれを連続して、かつ個々に正確に丸め処
理するステップからなる方法。
16. A method for accurately rounding an approximate value of a highly accurate operation result of division or square root extraction using an extended Tuckerman test, and generating an operation result that has been exactly rounded, said method being a data processing system. (A) a step of obtaining an approximate value of an operation result of division or square root operation, (b) a step of setting a digit of the approximate value of the operation result which is not guaranteed to be accurate to 0, as well as
(c) A method comprising the steps of accurately and sequentially rounding each of the digits set to 0 using the extended Tuckerman test.

【0110】17. 前記演算結果の近似値が、正確に丸
め処理された演算結果と同じ桁数を有することを特徴と
する、項番16に記載の方法。
17. Item 17. The method according to Item 16, wherein the approximate value of the calculation result has the same number of digits as the calculation result that has been rounded exactly.

【0111】18. 加算装置、乗算装置、及び制御装置
を有する浮動小数点算術演算回路であって、タッカーマ
ン検査を用いて開平算、又は除算の演算結果の近似値が
正確に丸め処理されて、正確に丸め処理された演算結果
が生成され、前記タッカーマン検査を、早期終了条件を
チェックするように修正する浮動小数点算術演算回路。
18. A floating-point arithmetic operation circuit having an addition device, a multiplication device, and a control device, wherein an approximate value of a square root or division operation result is accurately rounded using a Tuckerman test, and is accurately rounded. A floating-point arithmetic operation circuit, which generates an operation result and corrects the Tuckerman check so as to check an early termination condition.

【0112】[0112]

【発明の効果】本発明によって、高精度数の商、又は平
方根を正確な結果に最も近い浮動小数点数に、正確に丸
め処理を行うための浮動小数点算術演算装置が提供され
る。
As described above, the present invention provides a floating point arithmetic unit for accurately rounding a quotient or square root of a high precision number to a floating point number closest to an accurate result.

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

【図1】本発明の第1の実施例に従う、浮動小数点算術
演算装置のブロック図である。
FIG. 1 is a block diagram of a floating point arithmetic unit according to a first embodiment of the present invention.

【図2】本発明の第2の実施例に従う、浮動小数点算術
演算装置のブロック図である。
FIG. 2 is a block diagram of a floating point arithmetic unit according to a second embodiment of the present invention.

【図3】制御装置によって実行される基本動作のフロー
チャートである。
FIG. 3 is a flowchart of basic operations executed by the control device.

【図4】拡張フォーマットの本発明実施例によって実施
される動作のフローチャートである。
FIG. 4 is a flowchart of operations performed by an extended format embodiment of the present invention.

【図5】拡張フォーマットの実施例の一例に関する、切
り捨て動作の図である。
FIG. 5 is a diagram of a truncation operation for an example extended format embodiment.

【図6】非拡張フォーマットの本発明によって実施され
る動作のフローチャートである。
FIG. 6 is a flow chart of operations performed by the present invention in a non-extended format.

【図7】非拡張フォーマットの一例に関する、演算結果
の近似値を示す図である。
FIG. 7 is a diagram showing an approximate value of a calculation result regarding an example of a non-extended format.

【図8】本発明による修正タッカーマン検査の一実施例
のフローチャートである。
FIG. 8 is a flow chart of one embodiment of a modified Tuckerman inspection according to the present invention.

【符号の説明】[Explanation of symbols]

100、200 浮動小数点算術演算装置 102、202 レジスタ・ファイル 104、204 乗算装置 106、118、210 桁上げ伝搬加算器(CPA) 108、122、214 丸め処理インクリメンタ 110 高位部分積ラッチ 112 低位部分積ラッチ 116、206 位置合わせシフタ 120、212 正規化シフタ 124、216 高位部分ラッチ 126、218 低位部分ラッチ 114、128、220 多重装置 130、222 制御装置 134、226 丸め処理マイクロコード 100, 200 Floating Point Arithmetic Unit 102, 202 Register File 104, 204 Multiplier 106, 118, 210 Carry Propagate Adder (CPA) 108, 122, 214 Rounding Incrementer 110 High Partial Product Latch 112 Low Partial Product Latch 116, 206 Alignment shifter 120, 212 Normalization shifter 124, 216 High part latch 126, 218 Low part latch 114, 128, 220 Multiplexer 130, 222 Controller 134, 226 Rounding microcode

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】被除数を除数で除算して、正確に丸め処理
された商を生成する除算と、正確に丸め処理された平方
根を生成する、ある値の開平算のうち少なくとも1つを
実行する浮動小数点算術演算装置であって、前記算術演
算装置が、 データを記憶するためのマルチポート記憶装置、 2つの数を乗算して積を求め、2つの数を加算して和を
求める算術演算手段、 除算、及び開平算のうちの少なくとも1つについて演算
結果の近似値を提供する近似手段、 タッカーマン検査を用いて除算、及び開平算のうちの少
なくとも1つの演算結果の近似値を正確に丸め処理する
ための手順を含む丸め処理マイクロコード、及び前記浮
動小数点算術演算装置を制御する制御装置からなり、 前記丸め処理マイクロコードが、演算結果の近似値が過
小評価された値になるようにし、タッカーマン検査を早
期終了させることによって、演算結果の近似値を正確に
丸め処理して、正確に丸め処理された結果を生成する、
浮動小数点算術演算装置。
1. Performing at least one of a division of a dividend by a divisor to produce an exactly rounded quotient and a square root of a value to produce an exactly rounded square root. A floating-point arithmetic operation device, wherein the arithmetic operation device is a multi-port storage device for storing data, arithmetic operation means for multiplying two numbers to obtain a product, and adding two numbers to obtain a sum An approximation means that provides an approximate value of the operation result for at least one of division, square root calculation, and an accurate rounding of the approximate value of the operation result for at least one of division and square root calculation using a Tuckerman test. A rounding processing microcode including a procedure for processing, and a control device for controlling the floating point arithmetic operation device, wherein the rounding processing microcode is such that an approximate value of an operation result is underestimated. Was set to a value, by early termination of Tuckerman inspection, to accurately rounding the approximate value of the calculation results, it generates a result that is exactly rounding,
Floating point arithmetic unit.
JP16516795A 1994-07-01 1995-06-30 Method and apparatus for performing accurate rounding on division results and square root results Expired - Fee Related JP3541086B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US270203 1994-07-01
US08/270,203 US5671170A (en) 1993-05-05 1994-07-01 Method and apparatus for correctly rounding results of division and square root computations

Publications (2)

Publication Number Publication Date
JPH0844538A true JPH0844538A (en) 1996-02-16
JP3541086B2 JP3541086B2 (en) 2004-07-07

Family

ID=23030346

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16516795A Expired - Fee Related JP3541086B2 (en) 1994-07-01 1995-06-30 Method and apparatus for performing accurate rounding on division results and square root results

Country Status (1)

Country Link
JP (1) JP3541086B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342671A (en) * 2021-06-25 2021-09-03 海光信息技术股份有限公司 Method, device, electronic equipment and medium for verifying operation module

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342671A (en) * 2021-06-25 2021-09-03 海光信息技术股份有限公司 Method, device, electronic equipment and medium for verifying operation module
CN113342671B (en) * 2021-06-25 2023-06-02 海光信息技术股份有限公司 Method, device, electronic equipment and medium for verifying operation module

Also Published As

Publication number Publication date
JP3541086B2 (en) 2004-07-07

Similar Documents

Publication Publication Date Title
US5671170A (en) Method and apparatus for correctly rounding results of division and square root computations
US5515308A (en) Floating point arithmetic unit using modified Newton-Raphson technique for division and square root
JP2598507B2 (en) Division or square root calculator
US6138135A (en) Propagating NaNs during high precision calculations using lesser precision hardware
WO1990005335A1 (en) Apparatus for multiplication, division and extraction of square root
CN106250098B (en) Apparatus and method for controlling rounding when performing floating point operations
JPH08185309A (en) Execution method of quadruple-precision arithmetic
US5943249A (en) Method and apparatus to perform pipelined denormalization of floating-point results
US8060551B2 (en) Method and apparatus for integer division
US20080263336A1 (en) Processor Having Efficient Function Estimate Instructions
Nannarelli Tunable floating-point adder
Nannarelli Variable precision 16-bit floating-point vector unit for embedded processors
Agarwal et al. Series approximation methods for divide and square root in the Power3/sup TM/processor
Nannarelli Tunable floating-point for energy efficient accelerators
US6542915B1 (en) Floating point pipeline with a leading zeros anticipator circuit
US4996660A (en) Selection of divisor multipliers in a floating point divide circuit
Bruguera Low-latency and high-bandwidth pipelined radix-64 division and square root unit
US7016930B2 (en) Apparatus and method for performing operations implemented by iterative execution of a recurrence equation
JPH05241787A (en) Discrimination device for sticky bit value in arithmetic operation
US6598065B1 (en) Method for achieving correctly rounded quotients in algorithms based on fused multiply-accumulate without requiring the intermediate calculation of a correctly rounded reciprocal
US6175907B1 (en) Apparatus and method for fast square root calculation within a microprocessor
JP6919539B2 (en) Arithmetic processing unit and control method of arithmetic processing unit
JP3541086B2 (en) Method and apparatus for performing accurate rounding on division results and square root results
JPH02227726A (en) Apparatus and method for executing floating point division
US8005884B2 (en) Relaxed remainder constraints with comparison rounding

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040130

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040302

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040329

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees