JPH0142019B2 - - Google Patents
Info
- Publication number
- JPH0142019B2 JPH0142019B2 JP5548183A JP5548183A JPH0142019B2 JP H0142019 B2 JPH0142019 B2 JP H0142019B2 JP 5548183 A JP5548183 A JP 5548183A JP 5548183 A JP5548183 A JP 5548183A JP H0142019 B2 JPH0142019 B2 JP H0142019B2
- Authority
- JP
- Japan
- Prior art keywords
- mask
- vector
- instruction
- processing
- statement
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/76—Architectures of general purpose stored program computers
- G06F15/80—Architectures of general purpose stored program computers comprising an array of processing units with common control, e.g. single instruction multiple data processors
- G06F15/8053—Vector processors
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Advance Control (AREA)
- Complex Calculations (AREA)
Description
【発明の詳細な説明】
〔発明の技術分野〕
本発明は、複数の並列演算部を備えてベクトル
命令を処理するベクトル処理プロセツサに係り、
条件付命令の実行に際し、各エレメントに対して
命令を実行するか否かを示す情報として与えられ
たマスク情報のベクトル長単位のオンの数を基
に、マスク付命令で実行するか、データのベクト
ル長短縮処理をして実行するか、或いはスキツプ
するかを選択するようにした条件付命令の実行時
命令選択方式に関するものである。[Detailed Description of the Invention] [Technical Field of the Invention] The present invention relates to a vector processing processor that includes a plurality of parallel operation units and processes vector instructions.
When executing a conditional instruction, based on the number of ons in the vector length unit of the mask information given as information indicating whether to execute the instruction for each element, whether to execute it with a masked instruction or This invention relates to a method for selecting an instruction at the time of execution of a conditional instruction in which it is possible to select whether to perform vector length shortening processing or skip the instruction.
第1図はベクトル処理プロセツサを有する処理
システムの1例を示す図、第2図はベクトル命令
に対応した処理を概念的に説明する図、第3図は
ベクトル処理プロセツサに対して、与えられたソ
ース・プログラムから目的プログラムを生成して
供給するコンパイラの構成例を示す図、第4図は
ソース・プログラムを中間テキストに移してゆく
態様を説明する図、第5図はソース・プログラム
をベクトル化してゆく態様を説明する図、第6図
ないし第8図はIF文を含むソース・プログラム
に対して文マスクやパス・マスクを用意して並列
実行可能な形にしてゆく態様を説明する図であ
る。
FIG. 1 is a diagram showing an example of a processing system having a vector processing processor, FIG. 2 is a diagram conceptually explaining processing corresponding to vector instructions, and FIG. A diagram showing an example of the configuration of a compiler that generates and supplies a target program from a source program, Figure 4 is a diagram explaining how a source program is transferred to intermediate text, and Figure 5 is a diagram showing how a source program is vectorized. Figures 6 to 8 are diagrams explaining how to prepare a statement mask and path mask for a source program containing an IF statement so that it can be executed in parallel. be.
例えば、第1図Aに示す如く、ベクトルAに属
するエレメントa1,a2,……とベクトルBに属す
るエレメントb1,b2,……との各エレメント相互
を加算して、エレメントc1,c2,……をもつベク
トルCを生成するような、ベクトル命令を実行す
るベクトル処理プロセツサが存在している。第1
図A図示の場合、第i番目のエレメント相互の加
算を行なうか否かをマスク・エレメントm1,
m2,……にて指示するようにされており、第1
図Bに一般化して示す如き処理が行なわれる。 For example, as shown in FIG. 1A, elements a 1 , a 2 , . . . belonging to vector A and elements b 1 , b 2 , . . . belonging to vector B are added together to form element c 1 . , c 2 , . . . , c 2 , . . . 1st
In the case shown in Figure A, mask element m 1 ,
m 2 , ..., and the first
Processing as generalized in FIG. B is performed.
上記の如き処理を行なうベクトル処理プロセツ
サを有するデータ処理システムは、一実施例とし
て第2図図示の如きシステム構成をもつている。
図中の符号1は主記憶装置、2はメモリ制御装
置、3はベクトル処理プロセツサ、4はチヤネ
ル・プロセツサ、5は大記憶装置、6はスカラ処
理回路部、7はベクトル処理回路部、8−0、8
−1、…は夫々浮動小数点データ・レジスタ、9
−0、9−1、…は夫々複数個のデータ(エレメ
ント・データ)を格納し得るベクトル・レジス
タ、10−0、10−1、…は夫々複数個のマス
ク・データ(マスク・エレメント・データ)を格
納し得るマスク・レジスタ、11はベクトル長レ
ジスタであつて各ベクトル・レジスタに格納され
るエレメントの個数情報がセツトされるもの、1
2−0、12−1は夫々メモリ・アクセス・パイ
プライン、13は加減算パイプライン、14は乗
算処理パイプライン、15は除算処理パイプライ
ン、16はマスク処理パイプラインを表わしてい
る。 A data processing system having a vector processing processor that performs the above processing has a system configuration as shown in FIG. 2 as an embodiment.
In the figure, reference numeral 1 is a main storage device, 2 is a memory control device, 3 is a vector processing processor, 4 is a channel processor, 5 is a large storage device, 6 is a scalar processing circuit section, 7 is a vector processing circuit section, 8- 0,8
-1, ... are floating point data registers, 9
-0, 9-1, ... are vector registers that can each store a plurality of data (element data), and 10-0, 10-1, ... are vector registers that can each store a plurality of mask data (mask element data). ); 11 is a vector length register in which information on the number of elements to be stored in each vector register is set; 1;
Reference numerals 2-0 and 12-1 represent memory access pipelines, 13 an addition/subtraction pipeline, 14 a multiplication processing pipeline, 15 a division processing pipeline, and 16 a mask processing pipeline.
上記の如きベクトル処理プロセツサが処理を実
行するに当つて、当該プロセツサが実行するに適
した形に、与えられたソース・プログラムをコン
パイルし目的プロセツサを生成することが行なわ
れる。当該コンパイルを行なうコンパイラの構成
を示したのが第3図である。 When a vector processing processor as described above executes a process, a given source program is compiled into a form suitable for execution by the processor to generate a target processor. FIG. 3 shows the configuration of a compiler that performs the compilation.
第3図において、17は大記憶装置に格納され
ているソース・プログラム、18はコンパイラ、
19はコンパイルされて大記憶装置上に格納され
る目的プログラム、20はソース解釈部、21は
記憶域割付け部、22はベクトル化部、23は中
間テキスト最適化部、24はレジスタ使用決定
部、25は目的プログラム出力部を表わしてい
る。 In FIG. 3, 17 is a source program stored in a large storage device, 18 is a compiler,
19 is an object program compiled and stored on a large storage device; 20 is a source interpretation section; 21 is a storage allocation section; 22 is a vectorization section; 23 is an intermediate text optimization section; 24 is a register usage determination section; 25 represents a target program output section.
コンパイラ18は、大記憶装置からソース・プ
ログラム17を取込んで、所望の目的プログラム
19を生成する。このとき図示の各部は次のよう
な処理を行う。 A compiler 18 takes in a source program 17 from a large storage device and generates a desired target program 19. At this time, each of the illustrated units performs the following processing.
即ち、ソース解釈部20はソース・プログラム
17を大記憶装置から取込み、文解釈を行つて中
間テキストに展開する。例えばソース・プログラ
ムが第4図図示左側の如き場合に図示右側に示す
如き中間テキストに展開する。記憶域割付け部2
1はプログラム内に出現する各種データに対応し
て記憶域内番地を割当てる。ベクトル化部22
は、プログラム中のループ構造を検出し、並列実
行可能部分を認識し、第5図図示の如く中間テキ
スト変更を行う。中間テキスト最適化部23は、
中間テキストのレベルで、第2図図示の如きベク
トル処理プロセツサを有効に利用するための最適
化を施す。レジスタ使用決定部24は、中間テキ
ストに現われたデータに対して、ベクトル処理プ
ロセツサ上の資源(レジスタ)を割当てる。そし
て目的プログラム出力部25は機械命令語を大記
憶装置へ出力しかつ命令語レベルでの最適化を行
う。 That is, the source interpreter 20 takes in the source program 17 from the large storage device, performs sentence interpretation, and develops it into intermediate text. For example, if the source program is as shown on the left side of FIG. 4, it is developed into intermediate text as shown on the right side of the figure. Storage area allocation part 2
1 allocates addresses within the storage area corresponding to various data appearing within the program. Vectorization unit 22
detects loop structures in the program, recognizes parallel executable parts, and changes intermediate text as shown in FIG. The intermediate text optimization unit 23
At the intermediate text level, optimization is performed to effectively utilize a vector processing processor as shown in FIG. The register use determining unit 24 allocates resources (registers) on the vector processing processor to data appearing in the intermediate text. Then, the target program output unit 25 outputs the machine instruction words to the large storage device and performs optimization at the instruction word level.
ベクトル処理プロセツサを稼動させるためのコ
ンパイラは第3図図示の如き構成をもつており、
ループ構成内にIF文をもたないプログラムにつ
いては第5図に概念的に示した如く並列実行可能
な形にして処理してゆくことが可能である。しか
し第6図に示す如きソース・プログラムが与えら
れると、当該ループ構成の中に「IF(A(I).GT.
B(I))GO TO 50」などのIF文が存在することか
ら、従来このようなループ構成については一般に
は並列実行可能な状態にないものとして処理され
ていた。しかし、当該プログラムの場合、IF文
の飛び先がループ内に止まつており、プログラム
中の個々の文について個々の処理に当つて当該文
を実行するか否かを文マスクmiにて指示する手
法を採用することによつて並列実行可能となるこ
とが判つた。その文マスクmiを与えるコンパイ
ラ処理方式は、既に本願と同一の出願人により先
行発明(特願昭57−31198号)として提案されて
いる。以下にその概要を第6図ないし第8図を参
照しつつ説明する。 The compiler for operating the vector processing processor has the configuration shown in Figure 3.
A program that does not have an IF statement in its loop structure can be processed in a parallel executable format as conceptually shown in FIG. However, when a source program as shown in FIG. 6 is given, the loop structure contains "IF(A(I).GT.
B(I)) GO TO 50'', such loop configurations have traditionally been treated as not being able to be executed in parallel. However, in the case of this program, the destination of the IF statement is stopped within the loop, and the method uses statement mask mi to instruct whether or not to execute each statement in the program for each individual process. It was found that parallel execution was possible by adopting . A compiler processing method for providing the sentence mask mi has already been proposed as a prior invention (Japanese Patent Application No. 57-31198) by the same applicant as the present application. The outline thereof will be explained below with reference to FIGS. 6 to 8.
第6図図示のプログラムは、概略次の如き処理
を指示している。即ち、Iの値が「1」から
「N」になるまで繰返して文10ないし文70を実行
することを指示し、その間に文20によつて或るI
の値のときA(I)がB(I)よりも大となるならば文50
に飛び、また文40によつて或るIの値のときB(I)
がYよりも大となるならば文60に飛ぶことを指示
している。上記文マスクは、例えば文30に対応し
て「A(I).GT.B(I)」なる条件以外のとき、当該
文30を実行するよう指示すれば、IF文が第8図図
示の如く消減する形となる。 The program shown in FIG. 6 generally instructs the following processing. That is, it instructs to repeatedly execute statements 10 to 70 until the value of I changes from "1" to "N", and during that time, a certain I is executed by statement 20 .
If A(I) is greater than B(I) for the value of , then statement 50
, and according to statement 40 , for a certain value of I, B(I)
If is greater than Y, it instructs to jump to statement 60 . For example, if the above statement mask corresponds to statement 30 and instructs to execute the statement 30 when the condition is other than "A(I).GT.B(I)", the IF statement will be It becomes a form that disappears like this.
第7図は、第6図図示のプログラムを構成する
各文10ないし文70に対して、どのような文マスク
m10ないしm70を与えるかを説明する説明図を示
している。 Figure 7 shows what kind of statement masks are applied to each of the statements 10 to 70 that make up the program shown in Figure 6.
An explanatory diagram explaining how to give m 10 to m 70 is shown.
文10の場合にはIの値の如何に拘らず、すべて
のIについて実行する必要がある。このことから
文マスクm10としてφ(空)となる。文20の場合も
m20としてφとなる。文20から文50へ飛ぶルート
は文20の条件「A(I).GT.B(I)」のときにとられ
るもので、当該パスに対してバス・マスクP20,50
として
P20,50=A(I).GT.B(I)
が与えられ、一方同様にパス・マスクP20,30とし
て
P20,30=20,50
が与えられる。この結果から文30に対応する文マ
スクm30は
m30=20,50
となる。 In the case of statement 10 , it is necessary to execute for all I, regardless of the value of I. From this, the sentence mask m 10 is φ (empty). Also for sentence 20
As m 20 , it becomes φ. The route from statement 20 to statement 50 is taken when the condition "A(I).GT.B(I)" of statement 20 is met, and the bus mask P 20 , 50 is used for the path.
As P 20 , 50 = A(I). GT.B(I) is given, and similarly, P 20 , 30 = 20 , 50 is given as the path mask P 20 , 30 . From this result, the sentence mask m 30 corresponding to sentence 30 is m 30 = 20 , 50 .
文40についての文マスクm40はm30と同じもの
となる。同じようにして、パス・マスクP40,60や
P40,50が図示の如く与えられ、文マスクm50は、
パス・マスクP20,50とP40,50との論理和をとつた
ものとなる。そして文マスクm60,m70はφとな
る。 The sentence mask m 40 for sentence 40 is the same as m 30 . In the same way, pass masks P 40 , 60 and
P 40 and 50 are given as shown, and the sentence mask m 50 is
This is the logical sum of the path masks P 20 , 50 and P 40 , 50 . And the sentence masks m 60 and m 70 become φ.
このような文マスクmiを与えると、第6図図
示のプログラムは、第8図図示プログラムの如
く、IF文が存在しない形となつて、並列実行可
能な形となる。なお、第8図において、「:」を
付して示した所の「:M2」、「:M5」は対応する
文についての文マスクであると考えてよい。 When such a statement mask mi is given, the program shown in FIG. 6 becomes a form that does not include an IF statement and can be executed in parallel, like the program shown in FIG. 8. In FIG. 8, ":M 2 " and ":M 5 " shown with ":" may be considered to be sentence masks for the corresponding sentences.
このように一般には、(i)IF文を含むループ内
の各文に対応して文マスクを例えばi番目の文に
対して文マスクmiとして与え、かつ(ii)当該第i
番目の文がIF文でない場合に第(i+1)番目
の文に向うパスに対しパス・マスクPi,i+1と
し値miを与え、(iii)当該第i番目の文がIF文であ
る場合に当該IF文の条件をCiとするとき条件成
立によつて飛ぶ所の飛び先の第k番目の文へのパ
スに対してパス・マスクPikとして
mi・AND.Ci
を与え、(iv)当該第i番目の文がIF文である場合
に当該IF文の条件Ciの条件不成立によつて飛ぶ
所の飛び先の第k番目の文へのパスに対してパ
ス・マスクRikとして
mi・AND・
を与え、()上記文マスクmiを与えるに当つ
て、上記パス・マスクを調べて第i番目の文へ至
るパスに対応するパス・マスクPliについての論
理和をとる、即ち
mi=
U
l Pli(l≠i)
で与えるようにし、IF文を含んでいる場合でも
並列実行可能な範囲を増大せしめるようにコンパ
イルする。 In this way, in general, (i) a statement mask is given to the i-th statement as the statement mask mi corresponding to each statement in the loop including the IF statement, and (ii) the i-th statement is
If the ith statement is not an IF statement, give the path mask Pi,i+1 and the value mi to the path toward the (i+1)th statement; (iii) If the ith statement is an IF statement, then When the condition of the IF statement is Ci, give mi・AND.Ci as the path mask Pik to the path to the kth sentence that is the destination to jump to when the condition is met, and (iv) When the th sentence is an IF statement, mi・AND・ is given as a path mask Rik for the path to the kth sentence that is the jump destination when the condition Ci of the IF sentence is not met. , () In giving the above sentence mask m i , examine the above path mask and perform a logical OR on the path mask Pli corresponding to the path leading to the i-th sentence, that is, m i = U l Pli (l≠i), and compile in such a way that the range of parallel execution is increased even when an IF statement is included.
このようなマスク情報による条件付命令の実行
は、マスクの状態がどうであれ、ペクトル長分の
時間がかかつてしまう。ところが、マスクのオン
の数が非常に少ない命令、或いは全てのオフのマ
スクを持つ命令がある程度は現われるため、その
分の実行時間に無駄が生じるという問題がある。 Execution of a conditional instruction based on such mask information takes time equal to the length of the spectrum, regardless of the state of the mask. However, there is a problem that some instructions have a very small number of masks turned on, or instructions with all masks turned off, resulting in wasted execution time.
本発明は、上記の考察に基づくものであつて、
マスクのオンの数を認識することによりオンの数
が少ない命令の実行時間を短縮することができる
条件付命令の実行時選択方式を提供することを目
的とするものである。
The present invention is based on the above considerations, and includes:
It is an object of the present invention to provide a conditional instruction execution time selection method that can reduce the execution time of instructions with a small number of ons by recognizing the number of ons in a mask.
条件付命令の実行時選択方式は、複数の並列演
算部を備えてベクトル命令を処理するベクトル処
理プロセツサを有するデータ処理システムにおい
て、上記ベクトル処理プロセツサは、条件付命令
の実行に際し、各エレメントに対して命令を実行
するか否かを示すマスク情報とベクトル長単位で
マスクのオンの数とがセツトされると、上記マス
クのオンの数を調べ、マスクのオンの数が0であ
ることを条件に当該命令の実行をスキツプし、マ
スクのオンの数が所定の閾値より小さいことを条
件にベクトル長短縮処理命令を使つてマスクがオ
ンの部分のみを取出して新しいベクトル・データ
を作つてベクトル演算を行い、しかる後当該ベク
トル演算の結果をマスクがオンの部分に取り込む
ようにし、マスクのオンの数が所定の閾値より大
きいことを条件にマスク付命令を使つてマスクが
オンの要素の演算を行うように構成されたことを
特徴とするものである。
The execution-time selection method for conditional instructions is used in a data processing system that has a vector processing processor that is equipped with multiple parallel processing units and processes vector instructions. Once the mask information indicating whether to execute the command or not and the number of mask ons in vector length units are set, the number of mask ons is checked and the condition is set that the number of mask ons is 0. Then, on the condition that the number of on masks is smaller than a predetermined threshold, the execution of the relevant instruction is skipped, and on the condition that the number of mask ons is smaller than a predetermined threshold, a vector length shortening processing instruction is used to extract only the part where the mask is on, create new vector data, and perform vector operations. Then, the result of the vector operation is taken into the part where the mask is on, and the operation on the element where the mask is on is performed using a masked instruction on the condition that the number of mask ons is greater than a predetermined threshold. It is characterized in that it is configured to perform.
以下、本発明の実施例を図面を参照しつつ説明
する。
Embodiments of the present invention will be described below with reference to the drawings.
第9図は本発明の1実施例構成を示す図、第1
0図は本発明に使用される条件付命令の実行方式
を説明する図、第11図は第10図に示す条件付
命令の実行方式に対応するベクトル・テキストを
示す図、第12図は本発明が適用されるマスク・
レジスタの設定例を示す図、第13図は本発明に
よる命令実行時の処理の流れを説明する図であ
る。図において、26は命令バツフア・レジス
タ、27はデコーダ、28はマスク・レジスタ
(MR;Mask Register)、29は一致回路、30
は比較回路、31は閾値設定部
(THRESHOLD)、32と33はインバータ、3
4はブランチ処理部、35はマスク処理への分岐
処理部、36は圧縮/拡散処理への分岐処理部を
示す。 FIG. 9 is a diagram showing the configuration of one embodiment of the present invention.
0 is a diagram explaining the conditional instruction execution method used in the present invention, FIG. 11 is a diagram showing vector text corresponding to the conditional instruction execution method shown in FIG. 10, and FIG. Masks to which the invention is applied
FIG. 13, which is a diagram showing an example of register settings, is a diagram illustrating the flow of processing when executing an instruction according to the present invention. In the figure, 26 is an instruction buffer register, 27 is a decoder, 28 is a mask register (MR), 29 is a matching circuit, and 30
3 is a comparison circuit, 31 is a threshold setting unit (THRESHOLD), 32 and 33 are inverters, 3
4 is a branch processing section, 35 is a branch processing section for mask processing, and 36 is a branch processing section for compression/diffusion processing.
第9図において、マスク・レジスタ28は、ベ
クトル長毎のマスク情報と共にマスクのオンの数
を示す情報(MSR;Mask Status Register)が
書き込まれるものであり、命令バツフア・レジス
タ26に格納された命令をデコーダ27によりデ
コードされたマスク定義命令に基づいてセツトさ
れる。一致回路29は、デコーダ27からの実行
命令に従つて、マスク・レジスタ28のMSRの
内容が0か否かを調べるものであり、0(Yes)
の場合にはブランチ処理部34を作動させ、0で
ない場合にはインバータ32を通して比較回路3
0を動作させる。ブランチ処理部34は、命令の
実行は行わないスキツプ処理を行うものである。
即ち、ここでは、条件付命令の実行時に、MSR
の内容が0(全てオフのマスクを持つ命令)の場
合には命令の実行は行わないようにするものであ
る。比較回路30は、マスク・レジスタ28の
MSRの内容が閾値以上であるかを調べるもので
あり、MSRの内容が閾値以上である場合にはマ
スク処理への分岐処理部35を動作させ、そうで
ない場合には圧縮/拡散処理への分岐処理部36
を動作させる。マスク処理への分岐処理部35
は、マスク付演算方式を採用した処理を行うよう
にするものであり、圧縮/拡散処理への分岐処理
部36は、圧縮/拡散方式を採用した処理を行う
ようにするものである。次にこれらの方式につい
て説明する。 In FIG. 9, the mask register 28 is written with mask information for each vector length as well as information indicating the number of mask ONs (MSR; Mask Status Register), and the mask register 28 is used to store the instructions stored in the instruction buffer register 26. is set based on the mask definition command decoded by the decoder 27. The matching circuit 29 checks whether the contents of the MSR in the mask register 28 are 0 or not in accordance with the execution command from the decoder 27, and returns 0 (Yes).
In the case of 0, the branch processing section 34 is operated, and when it is not 0, the comparator circuit 3 is operated through the inverter 32.
Operate 0. The branch processing unit 34 performs skip processing without executing instructions.
That is, here, when the conditional instruction is executed, the MSR
If the content of is 0 (an instruction with a mask that is all off), the instruction is not executed. Comparison circuit 30 compares mask register 28 with
This is to check whether the content of the MSR is greater than or equal to the threshold value, and if the content of the MSR is greater than or equal to the threshold value, the branch processing unit 35 to mask processing is operated, and if not, it is branched to compression/diffusion processing. Processing section 36
make it work. Branch processing unit 35 to mask processing
is configured to perform processing that employs a masked calculation method, and branch processing unit 36 to compression/diffusion processing is configured to perform processing that employs a compression/diffusion method. Next, these methods will be explained.
ベクトル処理プロセツサには、マスク付ベクト
ル演算の他に、IF文のような条件文を処理する
のに適した命令として、ベクトル長短縮処理命令
がある。本発明はこのベクトル長短縮処理命令を
使つて実現するものであるが、以下では代表して
その1つ圧縮/拡散命令を使つた例で説明する。
マスク付命令(条件付命令)では、例えば、
VT1←VT2 OP VT3;mt
(mtは条件を示すマスク情報)
とある場合に、mtの内容(オン又はオフ)によ
つて、その要素の演算を実行するかしないかを決
定する。しかし実行しない要素に対しても実行し
た時と同じ時間がかかる。一方、圧縮/拡散命令
では、例えば、
VT2′comp
←――――
VT2:mt
VT3′comp
←――――
VT3:mt
VT1′←――――VT2′ OP VT3′
VT1exp
←―――
VT1′:mt
comp
←――――
はベクトル・データの圧縮
exp
←―――
はベクトル・データの拡散
を示す。 In addition to masked vector operations, vector processing processors have vector length shortening instructions that are suitable for processing conditional statements such as IF statements. The present invention is implemented using this vector length shortening processing instruction, and below, an example using one of them, a compression/spreading instruction, will be explained as a representative example.
In a masked instruction (conditional instruction), for example, in the case of VT1←VT2 OP VT3; mt (mt is mask information indicating a condition), the operation on that element is performed depending on the contents of mt (on or off). Decide whether to proceed or not. However, it takes the same amount of time to execute elements that are not executed. On the other hand, for compression/spreading instructions, for example, VT2'comp ←---- VT2:mt VT3'comp ←---- VT3:mt VT1'←----VT2' OP VT3' VT1exp ←---- VT1 ′:mt comp ←―――― indicates the compression of vector data, and exp ←―――― indicates the spread of vector data.
とある場合に、圧縮は、mtの内容がオンの部分
のみを取り出して新しいベクトル・データ(VT
2′,VT3′)をつくり、拡散は、mtの内容がオ
ンの部分にVT1′の内容を取り込むものである。
このときの演算は、mtのオンの数をベクトル長
として実行できる。条件付の演算、例えば、
Ai+Bi:mi:i=1,2、……8
についての操作の様子を示したのが第10図であ
る。第10図において、Aがマスク付命令を使つ
たマスク付演算方式について示したものであり、
Bが圧縮/拡散命令を使つた圧縮/拡散方式につ
いて示したものである。これらの2方式を比較す
ると、圧縮/拡散方式は、前後の圧縮及び拡散処
理が補助操作として必要になり、その分の時間が
かかるものの、演算そのものの実行はオンの数
(true率又は真率)に応じた時間でよいため、
true率が小さい時には効果がある。他方マスク付
演算方式は、演算時間はベクトル長分かかるが、
補助操作がないのでtrue率が高い場合に有効であ
る。これらの方式を採用するベクトル・テキスト
の例を示したのが第11図である。第11図にお
いて、Aがマスク付演算方式の場合の例を示した
ものであり、Bが圧縮/拡散方式の場合の例を示
したものである。In some cases, compression extracts only the part where the contents of mt are on and creates new vector data (VT
2', VT3'), and the diffusion involves taking in the contents of VT1' into the part where the contents of mt are on.
The calculation at this time can be performed using the number of turns on mt as the vector length. FIG. 10 shows the conditional operation, for example, Ai+Bi:mi:i=1, 2, . . . 8. In FIG. 10, A shows a masked operation method using masked instructions,
B shows a compression/spreading method using compression/spreading instructions. Comparing these two methods, the compression/diffusion method requires pre- and post-compression and diffusion processing as auxiliary operations, which takes time; however, the execution of the calculation itself is ).
It is effective when the true rate is small. On the other hand, the masked calculation method takes the calculation time equal to the vector length, but
Since there is no auxiliary operation, it is effective when the true rate is high. FIG. 11 shows an example of vector text that employs these methods. In FIG. 11, A shows an example where the masked calculation method is used, and B shows an example where the compression/spreading method is used.
本発明が適用されるマスク・レジスタの設定例
を示したのが第12図である。第12図におい
て、マスク・レジスタMR0ないしMR3は、ベ
クトル長6の場合の例を示し、マスクのオンの数
を示す情報MSR0ないしMSR3を持つている。
例えば、マスク・レジスタMR1の場合にはマス
ク付命令を使つて実行され、マスク・レジスタ
MR2の場合にはMSR2内容が0であるからス
キツプされ、マスク・レジスタMR3の場合に
は、MSR3の内容がベクトル長6に比べて非常
に小さいので圧縮/拡散命令を使つて実行され
る。 FIG. 12 shows an example of mask register settings to which the present invention is applied. In FIG. 12, mask registers MR0 to MR3 have information MSR0 to MSR3 indicating the number of mask ONs, showing an example of a vector length of 6.
For example, in the case of mask register MR1, it is executed using a masked instruction, and the mask register MR1 is executed using a masked instruction.
In the case of MR2, the content of MSR2 is 0, so it is skipped, and in the case of mask register MR3, the content of MSR3 is very small compared to the vector length of 6, so it is executed using a compression/spreading instruction.
次に条件付命令の実行時の処理の流れを第13
図を参照しつつ説明する。 Next, the flow of processing when executing a conditional instruction is shown in Section 13.
This will be explained with reference to the figures.
マスク・レジスタ(MR、MSR)への情報
をセツトする。次にの処理を行う。 Set information to mask registers (MR, MSR). Perform the following processing.
MSR=0かどうかを調べる。 Check whether MSR=0.
Yesの場合には実行をスキツプして処理終了
としNoの場合にはの処理を行う。 If Yes, the process is skipped and the process ends; if No, the process is performed.
閾値をベクトル長*γ(γ<1)とすると、
MSRの内容が閾値より大きいか否かを調べる。 If the threshold is vector length * γ (γ < 1),
Check whether the content of MSR is greater than the threshold.
Yes(真率が高い)の場合にはの処理を行
い、No(真率が低い)場合にはの処理を行
う。 If Yes (true rate is high), process is performed, and if No (true rate is low), process is performed.
マスク付命令を使つて実行する。 Execute using masked instructions.
圧縮/拡散命令を使つてデータの圧縮、拡散
をして実行する。 Compress and spread data using compression/spreading instructions.
なお、先に述べたように、によればベクトル
長に比例する実行時間を要するが、によれば真
率に比例した実行時間にα(圧縮、拡散の補助操
作に必要な時間)を加えた時間を要する。 As mentioned earlier, according to , the execution time is proportional to the vector length, but according to , the execution time is proportional to the true rate plus α (the time required for auxiliary operations of compression and diffusion). It takes time.
また、では、MSRへマスク・レジスタMR
中のオンのビツト数が入るが、これをマスク・レ
ジスタMRへの設定と同時に設定できないハード
ウエアの場合には、その後にマスク・レジスタ
MRのオンのビツト数を数える命令を出して、ソ
フトウエアによる代行処理を行つてもよい。 Also, mask register MR to MSR
If the hardware does not allow this to be set at the same time as the mask register MR, then the mask register MR is set.
It is also possible to issue an instruction to count the number of ON bits of MR and perform processing on behalf of the software.
以上の説明から明らかなように、本発明によれ
ば、真率の低い命令及び全てのマスクがオフの命
令について実行時間を短縮することができ、デー
タ処理システムの処理効率の向上を計ることがで
きる。
As is clear from the above description, according to the present invention, the execution time of instructions with a low true rate and instructions with all masks off can be shortened, and the processing efficiency of a data processing system can be improved. can.
第1図はベクトル処理プロセツサを有する処理
システムの1例を示す図、第2図はペクトル命令
に対応した処理を概念的に説明する図、第3図は
ベクトル処理プロセツサに対して、与えられたソ
ース・プログラムから目的プログラムを生成して
供給するコンパイラの構成例を示す図、第4図は
ソース・プログラムを中間テキストに移してゆく
態様を説明する図、第5図はソース・プログラム
をベクトル化してゆく態様を説明する図、第6図
ないし第8図はIF文を含むソース・プログラム
に対して文マスクやパス・マスクを用意して並列
実行可能な形にしてゆく態様を説明する図、第9
図は本発明の1実施例構成を示す図、第10図は
本発明に使用される条件付命令の実行方式を説明
する図、第11図は第10図に示す条件付命令の
実行方式に対応するベクトル・テキストを示す
図、第12図は本発明が適用されるマスク・レジ
スタの設定例を示す図、第13図は本発明による
命令実行時の処理の流れを説明する図である。
1……主記憶装置、2……メモリ制御装置、3
……ベクトル処理プロセツサ、4……チヤネル・
プロセツサ、5……大記憶装置、6……スカラ処
理回路部、7……ベクトル処理回路部、8−0な
いし8−n……浮動小数点データ・レジスタ、9
−0ないし9−n……ベクトル・レジスタ、10
−0ないし10−n……マスク・レジスタ、11
……ベクトル長レジスタ、12−0と12−1…
…メモリ・アクセス・パイプライン、13……加
減算パイプライン、14……乗算処理パイプライ
ン、15……除算処理パイプライン、16……マ
スク処理パイプライン、17……ソース・プログ
ラム、18……コンパイラ、19……目的プログ
ラム、20……ソース解釈部、21……記憶域割
付け部、22……ベクトル化部、23……中間テ
キスト最適化部、24……レジスタ使用決定部、
25……目的プログラム出力部、26……命令バ
ツフア・レジスタ、27……デコーダ、28……
マスク・レジスタ(MR:Mask Register)、2
9……一致回路、30……比較回路、31……閾
値設定部(THRESHOLD)、32と33……イ
ンバータ、34……ブランチ処理部、35……マ
スク処理への分岐処理部、36……圧縮/拡散処
理への分岐処理部。
Fig. 1 is a diagram showing an example of a processing system having a vector processing processor, Fig. 2 is a diagram conceptually explaining processing corresponding to vector instructions, and Fig. 3 is a diagram showing an example of a processing system having a vector processing processor. A diagram showing an example of the configuration of a compiler that generates and supplies a target program from a source program, Figure 4 is a diagram explaining how a source program is transferred to intermediate text, and Figure 5 is a diagram showing how a source program is vectorized. Figures 6 to 8 are diagrams explaining how to prepare a statement mask and path mask for a source program containing an IF statement so that it can be executed in parallel. 9th
The figure shows the configuration of one embodiment of the present invention, Figure 10 is a diagram explaining the conditional instruction execution method used in the present invention, and Figure 11 shows the conditional instruction execution method shown in Figure 10. FIG. 12 is a diagram showing an example of mask register settings to which the present invention is applied, and FIG. 13 is a diagram illustrating the flow of processing when executing an instruction according to the present invention. 1...Main storage device, 2...Memory control device, 3
...Vector processing processor, 4...Channel
Processor, 5...Large storage device, 6...Scalar processing circuit section, 7...Vector processing circuit section, 8-0 to 8-n...Floating point data register, 9
-0 to 9-n...vector register, 10
-0 to 10-n...mask register, 11
...Vector length registers, 12-0 and 12-1...
...Memory access pipeline, 13...Addition/subtraction pipeline, 14...Multiplication processing pipeline, 15...Division processing pipeline, 16...Mask processing pipeline, 17...Source program, 18...Compiler , 19...Objective program, 20...Source interpretation unit, 21...Storage area allocation unit, 22...Vectorization unit, 23...Intermediate text optimization unit, 24...Register usage determination unit,
25...Object program output unit, 26...Instruction buffer register, 27...Decoder, 28...
Mask register (MR: Mask Register), 2
9... Matching circuit, 30... Comparison circuit, 31... Threshold value setting section (THRESHOLD), 32 and 33... Inverter, 34... Branch processing section, 35... Branch processing section to mask processing, 36... Branch processing unit for compression/spreading processing.
Claims (1)
理するベクトル処理プロセツサを有するデータ処
理プロセツサにおいて、上記ベクトル処理プロセ
ツサは、条件付命令の実行に際し、各エレメトに
対して命令を実行するか否かを示すマスク情報と
ベクトル長単位でマスクのオンの数とがセツトさ
れると、上記マスクのオンの数を調べ、マスクの
オンの数が0であることを条件に当該命令の実行
をスキツプし、マスクのオンの数が所定の閾値よ
り小さいことを条件にベクトル長短縮処理命令を
使つてマスクがオンの部分のみを取出して新しい
ベクトル・データを作つてベクトル演算を行い、
しかる後当該ベクトル演算の結果をマスクがオン
の部分に取り込むようにし、マスクのオンの数が
所定の閾値より大きいことを条件にマスク付命令
を使つてマスクがオンの要素の演算を行うように
構成されたことを特徴とする条件付命令の実行時
命令選択方式。1. In a data processing processor having a vector processing processor that is equipped with a plurality of parallel calculation units and processes vector instructions, the vector processing processor determines whether or not to execute the instruction for each element when executing a conditional instruction. When the mask information indicated and the number of mask ons in vector length units are set, the number of mask ons is checked, and on condition that the number of mask ons is 0, execution of the instruction is skipped; Under the condition that the number of on masks is smaller than a predetermined threshold, a vector length shortening processing instruction is used to extract only the part where the mask is on, create new vector data, and perform vector operations.
After that, the result of the vector operation is imported into the part where the mask is on, and on condition that the number of mask ons is greater than a predetermined threshold, the masked instruction is used to perform the operation on the element where the mask is on. An execution-time instruction selection method for conditional instructions, characterized in that:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5548183A JPS59180668A (en) | 1983-03-31 | 1983-03-31 | Instruction selecting method at execution of conditional instruction |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5548183A JPS59180668A (en) | 1983-03-31 | 1983-03-31 | Instruction selecting method at execution of conditional instruction |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS59180668A JPS59180668A (en) | 1984-10-13 |
| JPH0142019B2 true JPH0142019B2 (en) | 1989-09-08 |
Family
ID=12999807
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP5548183A Granted JPS59180668A (en) | 1983-03-31 | 1983-03-31 | Instruction selecting method at execution of conditional instruction |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS59180668A (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9652284B2 (en) * | 2013-10-01 | 2017-05-16 | Qualcomm Incorporated | GPU divergence barrier |
-
1983
- 1983-03-31 JP JP5548183A patent/JPS59180668A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS59180668A (en) | 1984-10-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0515016B1 (en) | Instruction scheduler for a computer | |
| US5051896A (en) | Apparatus and method for nullifying delayed slot instructions in a pipelined computer system | |
| CA1256216A (en) | Program switching with vector registers | |
| US5761514A (en) | Register allocation method and apparatus for truncating runaway lifetimes of program variables in a computer system | |
| KR100616722B1 (en) | Pipe1ined instruction dispatch unit in a supersca1ar processor | |
| US6851045B2 (en) | Microprocessor having delayed instructions with variable delay times for executing branch instructions | |
| US7181730B2 (en) | Methods and apparatus for indirect VLIW memory allocation | |
| US5790826A (en) | Reduced register-dependency checking for paired-instruction dispatch in a superscalar processor with partial register writes | |
| US6061367A (en) | Processor with pipelining structure and method for high-speed calculation with pipelining processors | |
| EP0742517B1 (en) | A program translating apparatus and a processor which achieve high-speed execution of subroutine branch instructions | |
| US6871343B1 (en) | Central processing apparatus and a compile method | |
| US11416261B2 (en) | Group load register of a graph streaming processor | |
| US11481223B2 (en) | Reducing operations of sum-of-multiply-accumulate (SOMAC) instructions | |
| EP0140299A2 (en) | Vector mask control system | |
| JPH0142019B2 (en) | ||
| US6079011A (en) | Apparatus for executing a load instruction or exchange instruction in parallel with other instructions in a dual pipelined processor | |
| JPS623336A (en) | Conditional branch system | |
| JPH0346863B2 (en) | ||
| JPS6319906B2 (en) | ||
| Hill | A hardware mechanism for supporting range checks | |
| JP2556148B2 (en) | Vector register allocation method | |
| JPS6321946B2 (en) | ||
| JPH046020B2 (en) | ||
| JPS6319908B2 (en) | ||
| JPH037989B2 (en) |