Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0233188B2 - - Google Patents
[go: Go Back, main page]

JPH0233188B2 - - Google Patents

Info

Publication number
JPH0233188B2
JPH0233188B2 JP58055489A JP5548983A JPH0233188B2 JP H0233188 B2 JPH0233188 B2 JP H0233188B2 JP 58055489 A JP58055489 A JP 58055489A JP 5548983 A JP5548983 A JP 5548983A JP H0233188 B2 JPH0233188 B2 JP H0233188B2
Authority
JP
Japan
Prior art keywords
vector
register
invariant
instruction
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP58055489A
Other languages
Japanese (ja)
Other versions
JPS59180669A (en
Inventor
Morie Sagawa
Hideo Takashima
Shinya Miura
Kazuhiko Suzuki
Masaki Aoki
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP58055489A priority Critical patent/JPS59180669A/en
Publication of JPS59180669A publication Critical patent/JPS59180669A/en
Publication of JPH0233188B2 publication Critical patent/JPH0233188B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Computational Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Devices For Executing Special Programs (AREA)
  • Complex Calculations (AREA)

Description

【発明の詳細な説明】 〔発明の技術分野〕 本発明は、プログラムのうち入れ子構造のルー
プを構成する部分、特に内部ループに領域不変ベ
クトルをロードするためのベクトル・ロード命
令、領域不変ベクトル演算するためのベクトル演
算命令および領域不変ベクトルをストアするため
のベクトル・ストア命令を有する入れ子構造のル
ープを構成する部分を最適化する領域不変ベクト
ルの割付方式に関するものである。
Detailed Description of the Invention [Technical Field of the Invention] The present invention relates to a vector load instruction for loading an area-invariant vector into a part of a program that constitutes a nested loop, particularly an inner loop, and an area-invariant vector operation. The present invention relates to an area-invariant vector allocation method for optimizing a portion constituting a nested loop having vector operation instructions for storing area-invariant vectors and vector store instructions for storing area-invariant vectors.

〔従来技術と問題点〕[Prior art and problems]

第1図はベクトル命令を実行する計算機システ
ムの概要を示すものであつて、MSUは主記憶装
置、MCUは記憶制御ユニツト、VPはベクトル・
プロセツサ、CHPはチヤネル・プロセツサ、DA
はDASDをそれぞれ示している。
Figure 1 shows an overview of a computer system that executes vector instructions, where MSU is the main memory, MCU is the memory control unit, and VP is the vector instruction.
Processor, CHP is channel processor, DA
indicate DASD.

ベクトル・プロセツサVPは、メモリ・アクセ
ス・パイプライン、加減算パイプライン、乗算パ
イプライン、除算パイプライン及びマスク・パイ
プラインを有している。ベクトル・プロセツサ
VPがメモリ・アクセス要求を発行すると、記憶
制御ユニツトMCUはこのメモリ・アクセス要求
を実行する。
The vector processor VP has a memory access pipeline, an addition/subtraction pipeline, a multiplication pipeline, a division pipeline, and a mask pipeline. vector processor
When the VP issues a memory access request, the storage control unit MCU executes this memory access request.

第2図はベクトル・プロセツサVPのレジス
タ・アーキテクチヤを示すものであつて、FRO
ないしFRngは汎用レジスタ、VR0ないしVRnv
はベクトル・レジスタ、MR0ないしMRnvはマ
スク・レジスタ、VLはベクトル長をそれぞれ示
している。ベクトル・レジスタVR0ないしVRnv
のそれぞれは、演算ベクトルを格納するものであ
り、マスク・レジスタMR0ないしMRnvのそれ
ぞれはマスク・ベクトルを格納するものである。
ベクトル長レジスタVLには、演算ベクトル長が
セツトされる。1回のベクトル長の設定で動作可
能なベクトル命令範囲をVL制御範囲という。VL
制御範囲で使用する最大のベクトル・レジスタ数
をビジー数というが、ベクトル・レジスタの個数
とベクトル・レジスタの長さ(要素数)は、ビジ
ー数で相違する。例えば、ビジー数が1ないし8
の場合は、全ベクトル・レジスタは長さ1024の8
個のベクトル・レジスタに分割される。なお、全
ベクトル・レジスタは1024×8個のエレメントを
有し、1エレメントは8バイトである。ビジー数
が9ないし16の場合には全ベクトル・レジスタは
長さ512の16個のベクトル・レジスタに分割され、
ビジー数が17ないし32の場合には全ベクトル・レ
ジスタは長さ256の32個のベクトル・レジスタに
分割され、ビジー数が33ないし64の場合には全ベ
クトル・レジスタは長さ128の64個のベクトル・
レジスタに分割され、ビジー数が65ないし128の
場合には全ベクトル・レジスタは長さ64の128個
のベクトル・レジスタに分割され、ビジー数が
129以上の場合には全ベクトル・レジスタは長さ
32の256個のベクトル・レジスタに分割される。
ビジー数は、或る演算を行う場合に幾つのベクト
ル・レジスタを必要とするかを示すものであつ
て、コンパイラによつて決定される。
Figure 2 shows the register architecture of the vector processor VP.
or FRng is a general-purpose register, VR0 or VRnv
is a vector register, MR0 to MRnv are mask registers, and VL is a vector length. Vector register VR0 to VRnv
Each of the mask registers MR0 to MRnv stores a mask vector.
The operation vector length is set in the vector length register VL. The range of vector commands that can be operated by setting the vector length once is called the VL control range. VL
The maximum number of vector registers used in a control range is called the busy number, but the number of vector registers and the length (number of elements) of the vector register are different depending on the busy number. For example, the busy number is 1 to 8.
, the total vector register is 8 of length 1024
vector registers. Note that the total vector register has 1024×8 elements, and one element is 8 bytes. If the busy number is between 9 and 16, the total vector register is divided into 16 vector registers of length 512,
If the busy number is 17 to 32, the total vector register is divided into 32 vector registers of length 256; if the busy number is 33 to 64, the total vector register is divided into 64 vector registers of length 128. The vector of
If the busy number is between 65 and 128, the total vector register is divided into 128 vector registers of length 64 and the busy number is between 65 and 128.
If greater than or equal to 129, all vector registers are of length
Divided into 32 256 vector registers.
The busy number indicates how many vector registers are required to perform a certain operation, and is determined by the compiler.

第3図はVP用FORTRANコンパイラの概要を
示す図であり、CMPはVP用FORTRANコンパ
イラを示すものである。このコンパイラCMPは、
ソース解釈部、記憶域割付け部、ベクトル化部、
中間コード最適化部、レジスタ使用決定部および
目的プログラム出力部を有している。ソース解釈
部はソース・プログラムをDASDより入力し、文
解釈を行つて中間コードに展開するものであり、
記憶域割付部はプログラム中に出現する各種デー
タに記憶域内番地を割当てるものであり、ベクト
ル化部はプログラムのループ構造を検出し、並列
実行可能部分の記憶と中間コード変更を行うもの
であり、中間コード最適化部は中間コードのレベ
ルでVPハードウエアを有効に利用する最適化を
施すものであり、レジスタ使用決定部は中間コー
ドに現われたデータに実際の資源(レジスタ)を
割当てるものであり、目的プログラム出力部は機
械命令語のDASDへの出力と、機械語レベルでの
最適化を行うものである。
FIG. 3 is a diagram showing an overview of the FORTRAN compiler for VP, and CMP indicates the FORTRAN compiler for VP. This compiler CMP is
Source interpretation section, storage allocation section, vectorization section,
It has an intermediate code optimization section, a register use determination section, and a target program output section. The source interpreter inputs the source program from DASD, interprets the sentences, and develops it into intermediate code.
The storage allocation section allocates addresses within the storage area to various data that appear in the program, and the vectorization section detects the loop structure of the program, stores parts that can be executed in parallel, and changes intermediate code. The intermediate code optimization section performs optimization to effectively utilize the VP hardware at the intermediate code level, and the register usage determination section allocates actual resources (registers) to data appearing in the intermediate code. The purpose program output section outputs machine command words to DASD and performs optimization at the machine language level.

第4図は、入れ子構造のループをなし、内部ル
ープに配列Bと配列Cとを加算し、これを配列A
とするためのベクトル命令列を有する中間テキス
トの1例を示すものである。内部ループのベクト
ル命令列は、ベクトルBをベクトル・レジスタvt
1にロードし、ベクトルCをベクトル・レジスタ
vt2にロードし、ベクトル・レジスタvt1のベク
トルとベクトル・レジスタvt2のベクトルを加算
して加算結果をベクトル・レジスタvt3にセツト
し、ベクトル・レジスタvt3のベクトルをベクト
ルAにストアするためのものである。この内部ル
ープをm回実行した後、制御変数Jの値は更新さ
れる。制御変数Jの値が定められた値になると、
入れ子構造のループの処理は終了したことにな
る。ベクトルA、B、Cが制御変数Jに無関係な
場合、これを領域不変ベクトルという。
Figure 4 shows a nested loop, which adds arrays B and C to the inner loop, and adds array A to the inner loop.
This is an example of an intermediate text having a vector instruction sequence for performing the following. The vector instruction sequence of the inner loop is to store vector B in vector register vt
1 and vector C into the vector register.
This is to load the vector into vt2, add the vector in vector register vt1 and the vector in vector register vt2, set the addition result in vector register vt3, and store the vector in vector register vt3 to vector A. . After executing this inner loop m times, the value of the control variable J is updated. When the value of the control variable J reaches a predetermined value,
This means that the nested loop has finished processing. When vectors A, B, and C are unrelated to control variable J, they are called domain-invariant vectors.

第5図は配列Bと配列Cと加算して配列Aを作
る処理を説明するものである。いま、配列A、
B、Cの要素数をn、ベクトル・レジスタの長さ
を512、nを512で割つたときの商をSとし、剰余
をxとする。この場合、ベクトル長レジスタVL
には512がセツトされ、また、回転数mはS+1
となる。先ず、配列Bの第0番地(先頭)ないし
第x−1番地のベクトルを取り出してベクトル・
レジスタvt1にロードし、配列Cの第0番地ない
し第x−1番地のベクトルを取り出してベクト
ル・レジスタvt2にロードし、ベクトル・レジス
タvt1とベクトル・レジスタvt2を加算して加算
結果をベクトル・レジスタvt3に入れ、ベクト
ル・レジスタvt3の中のベクトル配列Aの第0番
地ないし第x−1番地にストアする。次に、配列
Bの第x番地ないし第x+511番地のベクトルを
ベクトル・レジスタvt1にロードし、配列Cの第
x番地ないし第x+511番地のベクトルをベクト
ル・レジスタvt2にロードし、ベクトル・レジス
タvt1とベクトル・レジスタvt2の加算結果をベ
クトル・レジスタvt3にセツトし、ベクトル・レ
ジスタvt3のベクトルを配列Aの第x番地ないし
第x+511番地にストアする。以下、同様な処理
を繰返し数がmになるまで行う。
FIG. 5 explains the process of adding arrays B and C to create array A. Now, array A,
Let the number of elements of B and C be n, the length of the vector register be 512, the quotient when n is divided by 512 be S, and the remainder be x. In this case, the vector length register VL
is set to 512, and the rotation speed m is set to S+1.
becomes. First, extract the vectors from address 0 (start) to x-1 of array B and create the vector
Load it into register vt1, take out the vector from the 0th address to the vt3 and stored at addresses 0 to x-1 of vector array A in vector register vt3. Next, vectors at addresses x to x+511 of array B are loaded into vector register vt1, vectors from address x to x+511 of array C are loaded to vector register vt2, and vector register vt1 and The addition result in vector register vt2 is set in vector register vt3, and the vector in vector register vt3 is stored in addresses x to x+511 of array A. Thereafter, similar processing is performed until the number of repetitions reaches m.

第4図に示されているような入れ子構造ループ
は、制御変数Jの回転数をNとすると、ロードの
回数は、 N×m×2 となり、ストアの回数は N×m となる。ベクトル・プロセツサVPの処理効率を
向上させるためには、主記憶装置をアクセスする
回数は可能な限り少なくすることが望まれる。
In the nested loop shown in FIG. 4, when the number of rotations of the control variable J is N, the number of loads is N×m×2, and the number of stores is N×m. In order to improve the processing efficiency of the vector processor VP, it is desirable to reduce the number of times the main memory is accessed as much as possible.

〔発明の目的〕[Purpose of the invention]

本発明は、上記の考察の基づくものであつて、
入れ子構造をなし且つ内部ループに領域不変ベク
トルをロード/ストアするベクトル命令を有する
プログラムを効率のよいプログラムに変換する領
域不変ベクトルの割付方式を提供することを目的
としている。
The present invention is based on the above considerations, and includes:
It is an object of the present invention to provide an area-invariant vector allocation method that converts a program having a nested structure and vector instructions for loading/storing area-invariant vectors into inner loops into an efficient program.

〔発明の構成〕[Structure of the invention]

そしてそのため、本発明の領域不変ベクトルの
割付方式は入れ子構造のループを構成し、且つ内
側ループに領域不変ベクトルをベクトル・レジス
タにロードするためのベクトル・ロード命令、ベ
クトル・レジスタ内の領域不変ベクトルを演算す
るためのベクトル命令およびベクトル・レジスタ
内の領域不変ベクトルをストアするためのベクト
ル・ストア命令を有するプログラムを最適化する
領域不変ベクトルの割付方式において、演算対象
となる領域不変ベクトルの全要素数をベクトル・
レジスタのベクトル長で割つたときの商をm、剰
余をxとするとき、外側のループのバツク・ター
ゲツトに、ベクトル長レジスタに値xを設定する
ための命令、領域不変ベクトルをループ中で恒久
割付可能なレジスタgvtにロードするための命令
を配置し、内側ループに、ベクトル長レジスタに
値xを設定するための命令、上記の恒久割付可能
なレジスタgvt同志の演算を行わせるための命令、
回転数をmとする命令、ベクトル長レジスタにベ
クトル・レジスタのベクトル長を設定するための
命令、領域不変ベクトルをベクトル・レジスタに
ロードするためのベクトル・ロード命令、ベクト
ル・レジスタ内の領域不変ベクトル演算するベク
トル演算命令およびベクトル・レジスタ内の領域
不変ベクトルをストアするためのベクトル・スト
ア命令を配置し、外側ループのフオワード・ター
ゲツトに、ベクトル長レジスタに値xを設定する
命令、恒久割付可能なレジスタgvt内の領域不変
ベクトルをストアするためのストア命令を配置す
ることを特徴とするものである。
Therefore, the area-invariant vector allocation method of the present invention configures a nested loop, and the inner loop includes a vector load instruction for loading an area-invariant vector into a vector register, and an area-invariant vector in the vector register. In an area-invariant vector allocation method that optimizes a program that has a vector instruction to operate on a vector instruction and a vector store instruction to store an area-invariant vector in a vector register, all elements of the area-invariant vector to be operated on are Vector number
When dividing by the vector length of the register, the quotient is m and the remainder is x.Then, the back target of the outer loop is an instruction to set the value x in the vector length register, and the domain-invariant vector is made permanent in the loop. Place an instruction to load into the allocatable register gvt, and in the inner loop, an instruction to set the value x in the vector length register, an instruction to perform the above-mentioned operation on the permanently allocatable register gvt,
Instruction to set the number of revolutions to m, instruction to set the vector length of the vector register in the vector length register, vector load instruction to load an area-invariant vector into the vector register, area-invariant vector in the vector register Place a vector operation instruction to operate on and a vector store instruction to store an area-invariant vector in the vector register, and set the forward target of the outer loop to the value x in the vector length register, which can be permanently allocated. This is characterized by arranging a store instruction for storing an area-invariant vector in register gvt.

〔発明の実施例〕[Embodiments of the invention]

以下、本発明の図面を参照しつつ説明する。第
6図は本発明の概要を示す図である。本発明にお
いては、先ず、領域不変ベクトルのgvt化が行わ
れる。gvtとは、GLOBAL VECTOR
TEMPORARYの略であり、gvtレジスタとはル
ープ中で恒久割付可能なベクトル・レジスタ(以
下、単にgvtという)を意味している。領域不変
ベクトルのgvt化を行つた後、VL制御範囲をmod
部とLoop部に分割する。modはModulusの略で
あり、剰余のことである。VL制御範囲をmod部
とloop部に分割した後、mod部の領域不変ベクト
ルの移動を行う。なお、本発明は第3図の中間コ
ード最適化部に関するものである。
Hereinafter, the present invention will be explained with reference to the drawings. FIG. 6 is a diagram showing an overview of the present invention. In the present invention, first, a domain-invariant vector is converted into a gvt. gvt means GLOBAL VECTOR
It is an abbreviation for TEMPORARY, and the gvt register means a vector register (hereinafter simply referred to as gvt) that can be permanently allocated in a loop. After converting the domain-invariant vector to GVT, mod the VL control range
Divide into section and loop section. mod is an abbreviation for Modulus, which refers to remainder. After dividing the VL control range into a mod part and a loop part, the region invariant vector of the mod part is moved. Note that the present invention relates to the intermediate code optimization section shown in FIG.

領域不変ベクトルgvt化は、下記のような手順
で行われる。
The region-invariant vector GVT conversion is performed in the following procedure.

(1) SCR(Strongly Connected Region)内で参
照のみの領域不変ベクトルをgvt化の候補とし
て選出する(ロード命令に対応)。なお、SCR
とはDOルーポに対応するものと考えてよい。
(1) Select region-invariant vectors that are reference-only within an SCR (Strongly Connected Region) as candidates for GVT conversion (corresponding to load instructions). In addition, SCR
can be thought of as corresponding to DO Lupo.

(2) SCR内で定義有りの領域不変ベクトルをgvt
化の候補として選出する(ストア命令に対応)。
(2) gvt defined area invariant vector in SCR
(corresponds to a store instruction).

(3) 使用頻度の多い順に、選出されたgvt候補の
順序付を行う。
(3) The selected GVT candidates are ordered in descending order of frequency of use.

(4) gvt候補からgvtを決定する。(4) Determine gvt from gvt candidates.

(5) gvtの割付けを行うと共に、領域不変ベクト
ルに対応するvtの引用をgvtで置き換える。
(5) Allocate gvt and replace vt references corresponding to area-invariant vectors with gvt.

第7図はベクトル加算命令を含む入れ子構造の
DOループと、これに対応する中間テキストを示
すものである。配列A、B、CはJに対して不変
である。B(*)、C(*)、A(*)の*は1ない
しnの全部を意味する。第7図において、B
(*)、C(*)、A(*)が領域不変ベクトルであ
る。
Figure 7 shows a nested structure containing vector addition instructions.
It shows a DO loop and its corresponding intermediate text. Arrays A, B, and C are invariant to J. * in B(*), C(*), and A(*) means all of 1 to n. In Figure 7, B
(*), C(*), and A(*) are domain-invariant vectors.

第8図はgvtの割付けと、領域不変ベクトルに
対するvtのgvtへの置き換えを説明するものであ
る。vt1がgvt1に、vt2がgvt2に、vt3がgvt
3に置き換えられる。
FIG. 8 explains the allocation of gvt and the replacement of vt with gvt for area-invariant vectors. vt1 to gvt1, vt2 to gvt2, vt3 to gvt
Replaced by 3.

次にVL制御範囲をmod部とLoop部に分割す
る。いま、配列A、B、Cの要素数を1500、ベク
トル・レジスタの長さを512とする。剰余xは x=mod(1500、512)=476 商Sは S=(1500/512)=2 となる。なお、回転数mはSと等しく、2とな
る。配列A、B、Cの要素数を1500、ベクトル・
レジスタの長さを512とした場合、第8図のgvt化
された中間テキストは、第9図に示すようにmod
部とloop部に分割される。
Next, divide the VL control range into a mod part and a loop part. Now, assume that the number of elements in arrays A, B, and C is 1500, and the length of the vector register is 512. The remainder x is x = mod (1500, 512) = 476, and the quotient S is S = (1500/512) = 2. Note that the rotation speed m is equal to S, which is 2. The number of elements in arrays A, B, and C is 1500, and the vector
If the length of the register is 512, the intermediate text converted to gvt in Figure 8 is modified as shown in Figure 9.
It is divided into a loop part and a loop part.

最後に、mod部の領域不変ベクトルの移動につ
いて説明する。第10図に示すように、mod部の
領域不変ベクトルのロード命令をSCRのバツ
ク・ターゲツトに移動し、次にmod部の領域不変
ベクトルのストア命令をSCRのフオワード・タ
ーゲツトに移動し、最後にloop部のgvtをvtで置
き換える。第9図の中間テキストに対して上記の
処理を施すと、第11図のような中間テキストが
得られる。
Finally, the movement of the area-invariant vector in the mod section will be explained. As shown in Figure 10, the load instruction of the area-invariant vector in the mod section is moved to the back target of the SCR, then the store instruction of the area-invariant vector in the mod section is moved to the forward target of the SCR, and finally, Replace gvt in the loop section with vt. When the intermediate text in FIG. 9 is subjected to the above processing, intermediate text as shown in FIG. 11 is obtained.

第12図はバツク・ターゲツト及びフオワー
ド・ターゲツトを説明する図である。同図におい
て、→は制御(プログラムの流れ)を意味する。
SCR(J)は1つ以上のブロツク(命令列の集合)
で構成されているが、バツク・ターゲツトとは、
そのSCR(J)に入る前に必ず実行される直前のブ
ロツクを示す。フオワード・ターゲツトとは、
SCR(J)を実行後、最初に実行されるブロツクを
示す。このブロツクは、SCR(J)からの流れのみ
で、他ブロツクからの流れはない。
FIG. 12 is a diagram illustrating back targets and forward targets. In the figure, → means control (program flow).
SCR(J) is one or more blocks (set of instruction sequences)
The back target is
Indicates the immediately preceding block that is always executed before entering that SCR(J). What is a forward target?
The first block executed after executing SCR(J) is shown. This block has only a flow from SCR(J) and no flow from other blocks.

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

以上の説明から明らかなように、本発明によれ
ば、ロード/ストア命令の実行回数を従来方式に
比し減すことが出来る。本発明によつて主記憶ア
クセス回数を減らすことができる理由を、第9図
を例にして説明する。mod部に着目した場合、
mod部内のB(*)のロード、C(*)のロード及
びA(*)のストアが第11図ではSCR(J)の外側
に移動されている。これは、SCR(J)の中を実行
する場合にB(*)のロード、C(*)のロード及
びA(*)のストアが減つたことを意味する。例
えば、SCR(J)の回転数を10とした場合、mod部
のB(*)のロード、C(*)のロード及びA(*)
のストア回数は、 本発明を採用した場合 :0回 本発明を採用しない場合 :10回 となる。すなわち、mod部における命令は B(*)+C(*) だけになり、主記憶アクセス(B(*)のロード、
C(*)のロード及A(*)のストア)回数は削減
されたことになる。SCR(J)の回転数が1回の場
合は、A(*)に対するロードが余分に出るが、
通常のプログラムでは余り存在しない。mod部内
の主記憶アクセス回数をm、SCR(J)の回転数を
nとすると、 m×n−ストア回数+m) だけ主記憶アクセス回数が削減されたことにな
る。
As is clear from the above description, according to the present invention, the number of executions of load/store instructions can be reduced compared to the conventional method. The reason why the number of main memory accesses can be reduced by the present invention will be explained using FIG. 9 as an example. If you focus on the mod part,
In FIG. 11, the load of B(*), load of C(*), and store of A(*) in the mod section have been moved to the outside of SCR(J). This means that when executing in SCR(J), the load of B(*), the load of C(*), and the store of A(*) are reduced. For example, if the rotation speed of SCR (J) is 10, load B (*) of the mod section, load C (*), and load A (*)
The number of stores is: When the present invention is adopted: 0 times When the present invention is not adopted: 10 times. In other words, the only instructions in the mod section are B(*) + C(*), and main memory access (loading B(*),
This means that the number of times C(*) is loaded and A(*) is stored) is reduced. If the number of revolutions of SCR (J) is 1, there will be an extra load on A (*), but
It doesn't exist in many normal programs. If the number of accesses to the main memory in the mod section is m and the number of rotations of SCR (J) is n, then the number of accesses to the main memory is reduced by m×n - number of stores + m).

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

第1図はベクトル命令を実行する計算機システ
ムの1例を示す図、第2図はベクトル・プロセツ
サのレジスタ・アーキテクチヤを示す図、第3図
はVP用FORTRANコンパイラの概要を示す図、
第4図は入れ子構造のループをもつ中間テキスト
の1例を示す図、第5図は配列Bと配列Cと加算
して配列Aを作る処理を説明する図、第6図は本
発明の概要を示す図、第7図はベクトル加算命令
を含む入れ子構造のDOループとこれに対応する
中間テキストを示す図、第8図はgvtの割付とvt
のgvtへの置き換えを説明する図、第9図はmod
部とloopの分割を説明する図、第10図はmod部
の領域不変ベクトル移動するための手順を示す
図、第11図はmod部の領域不変ベクトルの移動
が行われた後の中間テキストの1例を示す図、第
12図はバツク・ターゲツト及びフオワード・タ
ーゲツトを説明する図である。 MSU……主記憶ユニツト、MCU……記憶制御
ユニツト、VP……ベクトル・プロセツサ、DA
……DASD、FROないしFRng……汎用レジス
タ、VL……ベクトル長レジスタ、VROないし
VRnv……ベクトル・レジスタ、MROないし
MRnv……マスク・レジスタ。
Fig. 1 is a diagram showing an example of a computer system that executes vector instructions, Fig. 2 is a diagram showing the register architecture of a vector processor, and Fig. 3 is a diagram showing an overview of a FORTRAN compiler for VP.
Figure 4 is a diagram showing an example of intermediate text with a nested loop; Figure 5 is a diagram explaining the process of adding arrays B and C to create array A; Figure 6 is an overview of the present invention. Figure 7 is a diagram showing a nested DO loop including a vector addition instruction and the corresponding intermediate text. Figure 8 is a diagram showing gvt allocation and vt
Figure 9 explains the replacement of gvt with mod
Figure 10 is a diagram illustrating the procedure for moving the domain-invariant vector of the mod part. Figure 11 is a diagram of the intermediate text after the domain-invariant vector of the mod part has been moved. FIG. 12, which is a diagram showing one example, is a diagram illustrating a back target and a forward target. MSU: Main memory unit, MCU: Memory control unit, VP: Vector processor, DA
...DASD, FRO or FRng...General purpose register, VL...Vector length register, VRO or
VRnv...vector register, MRO or
MRnv...Mask register.

Claims (1)

【特許請求の範囲】[Claims] 1 入れ子構造のループを構成し、且つ内側ルー
プに領域不変ベクトルをベクトル・レジスタにロ
ードするためのベクトル・ロード命令、ベクト
ル・レジスタ内の領域不変ベクトルを演算するた
めのベクトル命令およびベクトル・レジスタ内の
領域不変ベクトルをストアするためのベクトル・
ストア命令を有するプログラムを最適化する領域
不変ベクトルの割付方式において、演算対象とな
る領域不変ベクトルの全要素数をベクトル・レジ
スタのベクトル長で割つたときの商をm、剰余を
xとするとき、外側のループのバツク・ターゲツ
トに、ベクトル長レジスタに値xを設定するため
の命令、領域不変ベクトルをループ中で恒久割付
可能なレジスタgvtにロードするための命令を配
置し、内側ループに、ベクトル長レジスタに値x
を設定するための命令、上記の恒久割付可能なレ
ジスタgvt同士の演算を行わせるための命令、回
転数をmとする命令、ベクトル長レジスタにベク
トル・レジスタのベクトル長を設定するための命
令、領域不変ベクトルをベクトル・レジスタにロ
ードするためのベクトル・ロード命令、ベクト
ル・レジスタ内の領域不変ベクトル演算するベク
トル演算命令およびベクトル・レジスタ内の領域
不変ベクトルをストアするためのベクトル・スト
ア命令を配置し、外側ループのフオワード・ター
ゲツトに、ベクトル長レジスタに値xを設定する
命令、恒久割付可能なレジスタgvt内の領域不変
ベクトルをストアするためのストア命令を配置す
ることを特徴とする領域不変ベクトルの割付方
式。
1 Construct a nested loop, and use a vector load instruction for loading an area-invariant vector into a vector register in the inner loop, a vector instruction for operating an area-invariant vector in the vector register, and a vector instruction for operating an area-invariant vector in the vector register. A vector to store domain-invariant vectors of
In the area-invariant vector allocation method for optimizing programs with store instructions, when the total number of elements of the area-invariant vector to be operated on is divided by the vector length of the vector register, the quotient is m and the remainder is x. , in the back target of the outer loop, place an instruction to set the value x in the vector length register, and an instruction to load the domain-invariant vector into the permanently allocatable register gvt in the loop, and in the inner loop, value x in vector length register
, an instruction to perform an operation between the permanently allocatable registers gvt, an instruction to set the rotation speed to m, an instruction to set the vector length of the vector register in the vector length register, Places a vector load instruction to load an area-invariant vector into a vector register, a vector operation instruction to operate on an area-invariant vector in a vector register, and a vector store instruction to store an area-invariant vector in a vector register. and an area-invariant vector characterized in that an instruction for setting a value x in a vector length register and a store instruction for storing an area-invariant vector in a permanently allocatable register gvt are placed in the forward target of the outer loop. allocation method.
JP58055489A 1983-03-31 1983-03-31 Assigning method of area constant vector Granted JPS59180669A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58055489A JPS59180669A (en) 1983-03-31 1983-03-31 Assigning method of area constant vector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58055489A JPS59180669A (en) 1983-03-31 1983-03-31 Assigning method of area constant vector

Publications (2)

Publication Number Publication Date
JPS59180669A JPS59180669A (en) 1984-10-13
JPH0233188B2 true JPH0233188B2 (en) 1990-07-25

Family

ID=13000038

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58055489A Granted JPS59180669A (en) 1983-03-31 1983-03-31 Assigning method of area constant vector

Country Status (1)

Country Link
JP (1) JPS59180669A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0632278U (en) * 1992-10-06 1994-04-26 ヤンマー農機株式会社 Vehicle height adjustment device for mobile work equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5143542B2 (en) * 2007-12-19 2013-02-13 Kddi株式会社 Source code conversion program and apparatus based on processor device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0632278U (en) * 1992-10-06 1994-04-26 ヤンマー農機株式会社 Vehicle height adjustment device for mobile work equipment

Also Published As

Publication number Publication date
JPS59180669A (en) 1984-10-13

Similar Documents

Publication Publication Date Title
US5958048A (en) Architectural support for software pipelining of nested loops
US6367071B1 (en) Compiler optimization techniques for exploiting a zero overhead loop mechanism
US7926046B2 (en) Compiler method for extracting and accelerator template program
JP3983857B2 (en) Single instruction multiple data processing using multiple banks of vector registers
US6675374B2 (en) Insertion of prefetch instructions into computer program code
US5303357A (en) Loop optimization system
JP3120152B2 (en) Computer system
US6826677B2 (en) Renaming registers to values produced by instructions according to assigned produce sequence number
US7631305B2 (en) Methods and products for processing loop nests
US5983336A (en) Method and apparatus for packing and unpacking wide instruction word using pointers and masks to shift word syllables to designated execution units groups
US6202143B1 (en) System for fetching unit instructions and multi instructions from memories of different bit widths and converting unit instructions to multi instructions by adding NOP instructions
US4677547A (en) Vector processor
CN110073332B (en) Data processing apparatus and method
US6738893B1 (en) Method and apparatus for scheduling to reduce space and increase speed of microprocessor operations
JPS63132338A (en) Code generating method
JPH10293692A (en) Data prefetch method, processor and program generation method for multiple loops
US6687808B2 (en) Data processor using indirect register addressing
JPH11194948A (en) Compiler optimization algorithm
JPH0477347B2 (en)
US5390306A (en) Pipeline processing system and microprocessor using the system
Bi et al. Efficiently running SpMV on multi-core DSPs for block sparse matrix
CN100395709C (en) Data processing method and system for instruction conversion
JPH0233188B2 (en)
KR19980018071A (en) Single instruction multiple data processing in multimedia signal processor
JPH10187460A (en) Binary program conversion apparatus and method