JPS6297031A - Matching system for bit number of mantissa part - Google Patents

Matching system for bit number of mantissa part

Info

Publication number
JPS6297031A
JPS6297031A JP23795885A JP23795885A JPS6297031A JP S6297031 A JPS6297031 A JP S6297031A JP 23795885 A JP23795885 A JP 23795885A JP 23795885 A JP23795885 A JP 23795885A JP S6297031 A JPS6297031 A JP S6297031A
Authority
JP
Japan
Prior art keywords
bits
mantissa
computer system
mantissa part
accuracy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP23795885A
Other languages
Japanese (ja)
Inventor
Katsumi Yamamoto
克己 山本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP23795885A priority Critical patent/JPS6297031A/en
Publication of JPS6297031A publication Critical patent/JPS6297031A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To eliminate an extreme delay compared with a case where a mantissa part has the same number of bits by obtaining the same number of bits at a compiling stage after validating an automatic accuracy increasing function and also cutting the lower bits of the mantissa part. CONSTITUTION:In its own system an automatic accuracy increasing function is validated by a validating means of a complier when it is recognized that the number of bits of the mantissa part of another system is larger than that of its own system. As a result, the data of the single accuracy is turned into the data of the double accuracy and furthermore the data of the double accuracy is turned into the data of the quadruple accuracy respectively When a source program is supplied, an object program is produced while the lower bits of the matissa part are cut (the lower bits of the mantissa part are set O as necessary). In such a way, the result of execution to secure the same number of bits without a delay extremely reduced compared with a case where the mantissa part has the same number of bits is obtained.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、浮動lト数点表示における仮数部のビット数
が異なる他の計算機システム用プログラムを実行しよう
とするときの仮数部のビット数整合方式に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention provides a method for determining the number of bits of the mantissa when executing a program for another computer system having a different number of bits of the mantissa in floating point representation. Regarding matching method.

(従来の技術) 浮動小数点演算においては、同じ数を表現するときに仮
数部のビット数の違いにより、計算機システム用プログ
ラムの実行結果が大幅に異なってくる場合がある。した
がって、仮数部のビット数が異なる他の計算機システム
で動作するように作成されたプログラムを実行させ、出
力結果が異なる場合には、その原因は仮数部のビット数
の相異にあるのか、または他にあるのかの判断がつきか
ねることになる。
(Prior Art) In floating point arithmetic, when expressing the same number, the execution results of a program for a computer system may differ significantly depending on the number of bits in the mantissa part. Therefore, if you run a program created to run on another computer system with a different number of bits in the mantissa and the output results are different, the cause may be the difference in the number of bits in the mantissa, or It becomes difficult to determine whether there are others.

このため、従来は他計算機システム用プログラムを実行
するときに、各命令をシミュレーションして仮数部のビ
ット数を整合するようにしている。
For this reason, conventionally, when executing a program for another computer system, each instruction is simulated to match the number of bits in the mantissa.

(発明が解決しようとする問題点) このような従来方式においては、命令ごとにビット操作
をする必要があるため、その手段が大がかりなものにな
るし、″1几実行時間も極めて長くなってしまうという
問題点がある。
(Problems to be Solved by the Invention) In such a conventional method, it is necessary to perform bit manipulation for each instruction, so the means for doing so is large-scale, and the execution time for one process is extremely long. There is a problem with storing it away.

(問題点を解決するための手段) 本発明の方式は、浮動小数点表示における仮数部のビッ
ト数が異なる他の計算機システム用プログラムを実行し
ようとするときの仮数部のビット数整合方式において、
当該計算機システムのコンパイラに、入力された仮数部
のビット数の相異を認識する手段と、この認識の結果に
より他計算機システムの仮数部のビット数が自計算機シ
ステムのそれより多い場合には精度自動拡張機能を働か
せる手段と、他計算機システム用プログラムの定数を内
部値に変換後に仮数部の有効ビット数が他計算機システ
ムのそれと同じになるまで仮数部の右側のピッ町を0に
する手段と、浮動小数点演算命令の実行後に演算結果の
有効ビット数が他計算機システムのそれと同じになるま
で仮数部の右側のビットを0にするような命令を目的プ
ログラムの命令列中に挿入する手段とを設けたことを特
徴とする。
(Means for Solving the Problems) The method of the present invention is a method for matching the number of mantissa bits when executing a program for another computer system in which the number of bits of the mantissa in floating point representation is different.
The compiler of the computer system has a means for recognizing the difference in the number of bits of the input mantissa, and as a result of this recognition, if the number of bits of the mantissa of another computer system is greater than that of the own computer system, the precision means for activating an automatic extension function; and means for converting a constant of a program for another computer system into an internal value, and then setting the number of bits on the right side of the mantissa to 0 until the number of effective bits of the mantissa becomes the same as that of the other computer system. , means for inserting into the instruction string of the target program an instruction that sets the bits on the right side of the mantissa to 0 until the number of effective bits of the operation result becomes the same as that of another computer system after execution of the floating point operation instruction. It is characterized by having been established.

(実施例) 次に本発明の実施例について図面を参照して説明する。(Example) Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明の一実施例の処理フo −f示す流れ図
である。
FIG. 1 is a flowchart showing the processing steps o-f in one embodiment of the present invention.

浮動小数点表示における仮数部のビット数が異なる他の
計算機システム(以下単にシステムと記す)で動作する
ように作成されたプログラムを実行しようとするときに
は、先ず、他のシステムの仮数部のビット数を、たとえ
ばワークステーション等からパラメータ入力する。いま
プログラムを実行しようとしているシステム(自システ
ムと記す)は、当然自身の仮数部のビット数を認識して
いるから、パラメータ入力によって認識された(第1図
のステップ■)他システムの仮数部のビット数との大小
比較(ステップ■)が可能である。
When trying to run a program created to run on another computer system (hereinafter simply referred to as a system) that has a different number of bits in the mantissa in floating point representation, first check the number of bits in the mantissa in the other system. , for example, input parameters from a workstation or the like. The system that is currently trying to execute the program (referred to as the local system) naturally recognizes the number of bits in its own mantissa, so the number of bits in the mantissa of another system recognized by parameter input (step ■ in Figure 1) It is possible to compare the size with the number of bits (step ■).

その結果により、他システムの仮数部のビット数、が自
システムのそれより多くなければ、ステップ■からステ
ップ■に移行するが、多ければステップ■からステップ
■に移行する。ステップ■においては、浮動小数点演算
機能を有する計算機システムが一般に備えている精度自
動拡張機能を有効化する。精度自動拡張機能とは、周知
のように、データの型式を自動的に1段だけ高精度のも
のにする機能であり、この結果、たとえば単精度のデー
タは倍精度のデータに、また倍精度のデータは4倍精度
のデータになる。
According to the result, if the number of bits in the mantissa part of the other system is not greater than that of the own system, the process moves from step (2) to step (2), but if it is greater, the process moves from step (2) to step (3). In step (2), an automatic accuracy extension function, which is generally provided in computer systems having a floating-point arithmetic function, is enabled. As is well-known, the automatic precision extension function is a function that automatically changes the data format to one step higher in precision.As a result, for example, single precision data becomes double precision data, and double precision The data will be quadruple precision data.

次にソースプログラムが入力される(ステップ■)と、
仮数部の下位ビットの切捨て処理を伴ないつつオブジェ
クトプログラムが生成されていく(ステップ■)。下位
ビットの切捨て処理とは、仮数部の下位ビン)1必要な
だけ0にする処理である。
Next, when the source program is input (step ■),
The object program is generated while the lower bits of the mantissa are truncated (step 2). The process of truncating the lower bits is the process of reducing the lower bits (1) of the mantissa to 0 as many times as necessary.

たとえば、他システムの仮数部のビット数が単精度で2
1ビツト、倍精度で50ビツトであり、自システムの仮
数部のビット数が単精度で24ビツト、倍精度で56ビ
ツトである場合には、ステップ■からステップ■をバイ
パスしてステップ■に移行し、ステップ■における下位
ビットの切捨て処理において、他システムのビット数と
同じに々るように、単精度は3(−24−21)ビット
、倍精度は6(=56−50)ビットだけ切捨てられる
For example, the number of bits in the mantissa of another system is 2 in single precision.
1 bit, double precision is 50 bits, and if the number of bits of the mantissa part of the local system is 24 bits for single precision and 56 bits for double precision, move from step ■ to step ■, bypassing step ■. However, in the process of truncating the lower bits in step (■), 3 (-24-21) bits are truncated for single precision, and 6 (=56-50) bits are truncated for double precision, so that they are the same as the number of bits in other systems. It will be done.

また、他システムの仮数部のビット数が単精度で27ビ
ツト、倍精度で63ビツトであり、自システムの仮数部
のビット数が単精度で24ビツト、倍精度で56ビツト
である場合には、他システムのビット数の方が多いため
、ステップ■からステップ■へ移行し、精度自動拡張機
能が有効化される。その後、ステップ■を経てステップ
■に移行すると、自システムの仮数部のビット数は、先
ず精度自動拡張機能によシ単精度は56ビツト、倍精度
は112ビツトになる。しかる後に、下位ビットの切捨
て処理が行なわれ、他システムのビット数と同じになる
ように、単精度は29(−56−27)ビット、倍精度
は49 (= 112−63 )ビットだけ切捨てられ
る。
Also, if the number of bits in the mantissa of the other system is 27 bits for single precision and 63 bits for double precision, and the number of bits for the mantissa of the own system is 24 bits for single precision and 56 bits for double precision, then , Since the number of bits of the other system is larger, the process moves from step ■ to step ■, and the automatic precision expansion function is enabled. Thereafter, when proceeding to step (2) via step (2), the number of bits in the mantissa of the own system is first changed to 56 bits for single precision and 112 bits for double precision due to the precision automatic extension function. After that, the lower bits are truncated, and single precision is truncated by 29 (-56-27) bits, and double precision is truncated by 49 (= 112-63) bits, so that the number of bits is the same as that of other systems. .

以上に述べ友ようなビット数の切捨て処理は以下のよう
なコンパイラの処理段階及びコンパイラが目的プログラ
ム中に生成する命令列中で行なわれる。
The bit number truncation processing as described above is performed in the following processing steps of the compiler and in the instruction sequence generated by the compiler in the target program.

先ず、浮動小数点表示の実定数や複素定数は、コンパイ
ラの処理段階で行なわれ自システムの内部値に変換した
後にその内部値に対して行なわれる。
First, real constants and complex constants in floating point representation are converted to internal values of the own system at the compiler processing stage, and then converted to internal values.

また、実数型や複素数型の代入文に対しては、その右辺
の値を計算し、計算結果を左辺の変数あるいは配列要素
に代入するとき、その計算結果に対して行なわれる。た
とえば、代入文A=BsC*Dにおいては、先ずBの値
を所定のレジスタRに入力し、次にレジスタR*Ci計
算してその計算結果をレジスタRに入力し、次にレジス
タR*Di計算してその計算結果をレジスタRに入力し
、最後にレジスタRを人とするときにビット数の切捨て
処理が行彦われる。
Also, for real number type or complex number type assignment statements, when the value on the right side is calculated and the result of the calculation is assigned to the variable or array element on the left side, the calculation is performed on the result of the calculation. For example, in the assignment statement A=BsC*D, first input the value of B to a predetermined register R, then calculate register R*Ci and input the calculation result to register R, then register R*Di The calculation result is input into register R, and finally, when register R is set to a person, the number of bits is rounded down.

ま之、入力文による実数値や複素数値の入力に対しては
、入力直後にその入力した実数値や複素数値に対して行
なわれる。
However, when a real value or a complex value is input by an input sentence, the input real value or complex value is processed immediately after the input.

(発明の効果) 本発明によれば、以上に述べたように、浮動小数点表示
における仮数部のビット数が異なる他システム用プログ
ラムを実行しようとするときに、コンパイル段階で、ビ
ット数を同数化するような命令を生成するため、従来方
式におけるように、命令実行段階で命令ごとのシミーレ
ーションを行なうのに比べると、完全には同じ計算をし
ていないまでもはy同じ実行結果を、小規模な手段の追
加のみでかつ仮数部のビット数の相異が無い場合と比べ
て極端に遅延することなく得られるという効果がある。
(Effects of the Invention) According to the present invention, as described above, when attempting to execute a program for another system in which the number of bits of the mantissa in floating point representation is different, the number of bits is equalized at the compilation stage. In order to generate instructions that perform This has the advantage that it can be obtained without excessive delay compared to the case where there is no difference in the number of bits of the mantissa and only by adding large-scale means.

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

第1図は本発明の一実施例の処理フローを示す図である
。 代理人 弁理士  内 原   晋 半 1  図
FIG. 1 is a diagram showing a processing flow of an embodiment of the present invention. Agent Patent Attorney Shinhan Uchihara 1 Figure

Claims (1)

【特許請求の範囲】 浮動小数点表示における仮数部のビット数が異なる他の
計算機システム用プログラムを実行しようとするときの
仮数部のビット数整合方式において、 当該計算機システムのコンパイラに、 入力された前記仮数部のビット数の相異を認識する手段
と、 該認識の結果により前記他計算機システムの仮数部のビ
ット数が自計算機システムのそれより多い場合には精度
自動拡張機能を働かせる手段と、前記他計算機システム
用プログラムの定数を内部値に変換後に仮数部の有効ビ
ット数が前記他計算機システムのそれと同じになるまで
仮数部の右側のビットを0にする手段と、 浮動小数点演算命令の実行後に演算結果の有効ビット数
が前記他計算機システムのそれと同じになるまで仮数部
の右側のビットを0にするような命令を目的プログラム
の命令列中に挿入する手段とを設けたことを特徴とする
仮数部のビット数整合方式。
[Claims] In a method for matching the number of mantissa bits when a program for another computer system having a different number of bits of the mantissa in floating point representation is to be executed, the above input to the compiler of the computer system means for recognizing a difference in the number of bits of the mantissa part; means for operating an automatic accuracy extension function when the number of bits of the mantissa part of the other computer system is greater than that of the own computer system according to the result of the recognition; means for converting a constant of a program for another computer system into an internal value, and then setting the bits on the right side of the mantissa to 0 until the number of effective bits of the mantissa becomes the same as that of the other computer system; and after executing a floating point arithmetic instruction. The present invention is characterized by comprising means for inserting into the instruction sequence of the target program an instruction that sets the bits on the right side of the mantissa to 0 until the number of effective bits of the operation result becomes the same as that of the other computer system. Mantissa bit number matching method.
JP23795885A 1985-10-23 1985-10-23 Matching system for bit number of mantissa part Pending JPS6297031A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23795885A JPS6297031A (en) 1985-10-23 1985-10-23 Matching system for bit number of mantissa part

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23795885A JPS6297031A (en) 1985-10-23 1985-10-23 Matching system for bit number of mantissa part

Publications (1)

Publication Number Publication Date
JPS6297031A true JPS6297031A (en) 1987-05-06

Family

ID=17022984

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23795885A Pending JPS6297031A (en) 1985-10-23 1985-10-23 Matching system for bit number of mantissa part

Country Status (1)

Country Link
JP (1) JPS6297031A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5875753A (en) * 1996-12-27 1999-03-02 Toyota Jidosha Kabushiki Kaisha Balancer apparatus for engine
JP2011518398A (en) * 2008-04-21 2011-06-23 クゥアルコム・インコーポレイテッド Programmable streaming processor with mixed precision instruction execution

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5776634A (en) * 1980-10-31 1982-05-13 Hitachi Ltd Digital signal processor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5776634A (en) * 1980-10-31 1982-05-13 Hitachi Ltd Digital signal processor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5875753A (en) * 1996-12-27 1999-03-02 Toyota Jidosha Kabushiki Kaisha Balancer apparatus for engine
JP2011518398A (en) * 2008-04-21 2011-06-23 クゥアルコム・インコーポレイテッド Programmable streaming processor with mixed precision instruction execution

Similar Documents

Publication Publication Date Title
US11068463B2 (en) System and method for managing log data
JPS6297031A (en) Matching system for bit number of mantissa part
JPS62217325A (en) Optimization system for assembler code
JP3430635B2 (en) Constant reference optimization processor
JP2748582B2 (en) Compile processing unit
US20230237097A1 (en) Information processing device, information processing method, and recording medium
JPS63155264A (en) Language tuning processing system for vector computer
JP2539070B2 (en) Compiler processor
JP4327533B2 (en) Arithmetic processing program, arithmetic processing method, and arithmetic processing apparatus
JPH0795275B2 (en) Compile processor
CN117130894A (en) Test case generation system and method for RISC-V vector instruction set function verification
JPH0250730A (en) Language converting system based upon common machine word
JPH0795273B2 (en) Partial expansion processing method of sum calculation in compiler
JPH01209542A (en) Logical verification device
JPS62169238A (en) Program execution analysis tool
JPH02253443A (en) Program generating method
JPH04343140A (en) Parallelized processing system
JPS63174130A (en) System for detecting value unsettled variable name
JPH0776926B2 (en) Loop control processing method
JPH0232423A (en) Dividing system for program routine group
JPH0573335A (en) Automatic in-line development system for program
JPH0573607A (en) Vector instruction generation processing method
JPS62166432A (en) Control system for program translation
JPH0659905A (en) Parallel processing system for compiler
JPS62267830A (en) Arithmetic control system for vector processing built-in function in programming language