JPH03127125A - Automatic change system for multiple branch processing by learning - Google Patents
Automatic change system for multiple branch processing by learningInfo
- Publication number
- JPH03127125A JPH03127125A JP26495289A JP26495289A JPH03127125A JP H03127125 A JPH03127125 A JP H03127125A JP 26495289 A JP26495289 A JP 26495289A JP 26495289 A JP26495289 A JP 26495289A JP H03127125 A JPH03127125 A JP H03127125A
- Authority
- JP
- Japan
- Prior art keywords
- processing
- branch
- comparison
- value
- program
- 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
Links
- 238000012545 processing Methods 0.000 title claims abstract description 79
- 230000009191 jumping Effects 0.000 claims abstract 2
- 238000000034 method Methods 0.000 claims description 71
- 238000010586 diagram Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000003672 processing method Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 1
Landscapes
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、プログラミング言語において定数値の比較を
行う多重分岐処理方法に係り、特に、プログラムが処理
を行う度に処理シーケンスの変更を行い、性能向上を図
る処理方法に関する。[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a multiple branch processing method for comparing constant values in a programming language, and in particular, a method for changing a processing sequence every time a program performs processing, This article relates to a processing method for improving performance.
従来の技術は、特開昭63−221427号公報に記載
のように、定数値の比較を行う多重分岐処理において比
較する定数値の演算を行うときのサイズの値判定を最適
化して無駄なオブジェクトを廃するという方法が考えら
れている。As described in Japanese Unexamined Patent Application Publication No. 63-221427, the conventional technology optimizes the size value judgment when calculating constant values to be compared in multiple branch processing that compares constant values, and eliminates unnecessary objects. A method is being considered to abolish it.
しかし、多重分岐処理の定数値比較のシーケンスをプロ
グラム自身で学習により、変更する方法は従来技術には
なかった。However, the prior art does not have a method for changing the sequence of constant value comparisons in multiple branch processing by learning the program itself.
従来技術では定数値の比較を行う多重分岐処理で処理シ
ーケンスを最適化するという点について考慮がされてい
ない。多重分岐処理は、第1図番:例を示すように、被
判定データによって、定数毎との比較処理が多かったり
、少なかったりする。In the prior art, no consideration is given to optimizing the processing sequence using multiple branch processing that compares constant values. As shown in the example in Figure 1, the multiple branching process involves more or less comparison processing for each constant depending on the data to be determined.
被判定データの値の中で、確率の高い定数値【ある場合
は、比較処理を少なく、確率の低い定費値である場合は
、比較処理を多くした方が処理適度の点から望ましい。Among the values of the data to be determined, it is desirable to perform less comparison processing if there is a constant value with a high probability, and to perform more comparison processing if it is a constant value with low probability, from the viewpoint of processing moderation.
本発明はプログラム自身が、処理を重ねていくごとに少
しずつ、比較処理の処理シーケンスを襠更していくこと
で、多重分岐処理の性能を向上させる。The present invention improves the performance of multiple branch processing by allowing the program itself to modify the processing sequence of comparison processing little by little as the processing is repeated.
本発明の目的は多重分岐処理でトータルの動がステップ
量を縮少化することにある。An object of the present invention is to reduce the total step amount in multiple branch processing.
第1図は本発明の基本処理図であり、学習前C初期状態
、及び、初期処理を示す、多重分岐部1は基本的に三処
理以上に分岐する処理であり、:処理に分岐する単分岐
処理は本発明の適用対象力・ら外す、また、各処理へ分
岐する比較処理の判ボは被判定データXと定数値at
by ct dとを=(等しい)又は、≠(等しくない
)という定数値の比較処理に限定した多重分岐処理に本
発明は適用する。FIG. 1 is a basic processing diagram of the present invention, showing the pre-learning C initial state and initial processing. The branching process is excluded from the application target force of the present invention, and the judgment mark of the comparison process that branches to each process is based on the data to be determined X and the constant value at.
The present invention is applied to multi-branch processing in which by ct d is limited to comparison processing using constant values such as = (equal) or ≠ (not equal).
第1図は例として被判定データのXの値により、五処理
に分岐される多重分岐処理である。FIG. 1 shows, as an example, a multi-branch process in which the process is branched into five processes depending on the value of X of the data to be determined.
この状態で被判定データXはCという値でこの多重分岐
処理に入ってきたとするa X ” Cであるため、x
:aとX:bの比較1.比較2では≠の判定と・なり、
x:cの比較3では=の判定となる。In this state, it is assumed that the data to be determined X enters this multiple branching process with a value of C. Since a
Comparison of :a and X:b1. In comparison 2, the judgment is ≠,
Comparison 3 of x:c results in a determination of =.
この比較3より、処理は処理8に移る。処理8では判定
する定数値すとCの値の交換と、比較3での分岐処理後
dジャンプ先ポインタPcと比較2での分岐処理後のジ
ャンプ先ポインタPaの交換を行う。From this comparison 3, the process moves to process 8. In process 8, the value of the constant value C to be determined is exchanged, and the jump destination pointer d after the branch processing in comparison 3 and the jump destination pointer Pa after the branch processing in comparison 2 are exchanged.
処理9では、処理8で交換したポインタPaへジャンプ
する。ポインタPaは処理8で交換する前のポインタp
cの値になっていることがら、Cに対応するC処理へ移
行することになる。In process 9, a jump is made to the pointer Pa exchanged in process 8. Pointer Pa is the pointer p before being exchanged in process 8
Since the value is c, the process moves to C processing corresponding to C.
この段階で、比較2と比較3の処理は、入れ替わり、処
理シーケンスが変更された。再度、被判定データXはC
という値であったとすると、X:aの比較1で≠の判定
後、入れ替わった比較2の処理(x:cの比較)を行い
、=の判定となる。At this stage, the processes of Comparison 2 and Comparison 3 have been swapped, and the processing sequence has been changed. Again, the data to be determined X is C
If the value is , then after comparing ≠ in comparison 1 of
処理は処理6へ移り、aとC(旧す値)の値の交換と、
比較2での分岐処理後のジャンプポインタPc (旧
Pa値)と比較1での分岐処理後のジャンプポインタP
^の交換を行う、ポインタP^は処理6で交換する前の
ポインタPc (旧PR値)になっていることからC
に対応するC処理へ移行することになる。The process moves to process 6, where the values of a and C (old value) are exchanged,
Jump pointer Pc (old Pa value) after branch processing in comparison 2 and jump pointer P after branch processing in comparison 1
Since the pointer P^ is the pointer Pc (old PR value) before the exchange in process 6, C
The process will then proceed to C processing corresponding to .
この段階で、比較1と比較2の処理は、入れ替わり、処
理シーケンスが変更された。At this stage, the processes of Comparison 1 and Comparison 2 have been swapped, and the processing sequence has been changed.
第2図に多重分岐処理の学習の変化を示す。第2図の状
態1は、第1図の初期状態の処理シーケンスを示す、こ
の状態で、x=cの値で本発明の多重分岐処理に入ると
比較処理の処理シーケンスは変更されて状71!2とな
る。再度、x=cの値で入ると比較処理の処理シーケン
スは、また、変更されて状態3となる。再々度、x=c
の値で入るとx:cの比較処理は先頭に処理であるため
、処理シーケンスは変更されず、状態3.状態4は同じ
状態のままとなる。このように、第2図がらX:Cの比
較処理が処理シーケンスの中で順番が速くなっていくこ
とがわかる1本発明の多重分岐処理では被判定データX
の値の中で確率の高い定数値は処理を行うごとに比較処
理が少なくなる。また、確率の高い定数値は、処理を行
うごとに比較処理が多くなる。FIG. 2 shows changes in learning in multiple branch processing. State 1 in FIG. 2 shows the processing sequence in the initial state shown in FIG. It becomes !2. If the value of x=c is entered again, the processing sequence of the comparison process is changed again and becomes state 3. Once again, x=c
Since the x:c comparison process is the first process, the processing sequence is not changed and state 3. State 4 remains the same. In this way, it can be seen from FIG. 2 that the order of comparison processing of
Among the values of , constant values with high probability require less comparison processing each time they are processed. Further, for a constant value with a high probability, the number of comparison processes increases each time the process is performed.
プログラムの動作環境で多重分岐処理に入る被判定デー
タが高い確率で一定の値である場合、本発明の多重分岐
処理は、その高い確率の値の判定を優先しようとする。If the data to be determined that enters multiple branch processing in the operating environment of the program has a constant value with a high probability, the multiple branch processing of the present invention attempts to give priority to the determination of the value with that high probability.
その値の比較処理の順番は処理シーケンスの中で早くな
っていき、最後は先頭の比較処理となる。The order of comparison processing of the values becomes earlier in the processing sequence, and the comparison processing at the beginning becomes the last one.
また、プログラムの動作環境が途中のある時点で変化し
て高い確立で多重分岐処理に入る被判定データが変わっ
ても、本発明の多重分岐処理はその動作環境の変化に対
応して変化後の値を優先しようとして処理シーケンスを
また変更する。Further, even if the operating environment of the program changes at some point during the program and the data to be determined that enters the multi-branch processing with a high probability changes, the multi-branch processing of the present invention will respond to the change in the operating environment and The processing sequence is changed again in an attempt to prioritize the value.
よって本発明の多重分岐処理は、動作環境の変化に合わ
せて処理シーケンスを自分自身で変えていき、常にトー
タルの動的ステップを縮少化できる。Therefore, the multi-branch processing of the present invention changes the processing sequence by itself in accordance with changes in the operating environment, and can always reduce the total dynamic steps.
本発明の実施方法としては、プログラムの実行するテキ
スト部を、直接、変更する方法とプログラム実行部は変
更せず、判定を行う比較定数、及び、処理ジャンプ先ポ
インタを配列データ化し、この配列データを変更する方
法が考えられる。本文では後者を一実施例として説明す
る。The present invention can be implemented by directly changing the text portion executed by the program, or by converting comparison constants for judgment and process jump destination pointers into array data without changing the program execution portion, and converting the comparison constants and process jump destination pointers into array data. One possible method is to change the . In this text, the latter will be explained as an example.
第3図、第4図に本発明の一実施例を示す、第4図の配
列24に示すO”maxの配列番号に対応する処理ジャ
ンプ先ポインタ26のA、B、C。3 and 4 show an embodiment of the present invention, A, B, and C of the processing jump destination pointer 26 corresponding to the array number O''max shown in the array 24 of FIG. 4.
・・・、E、Zの処理先ポインタに分岐する処理を想定
する。よって(wax + 1 )個の処理へ分岐する
多重分岐処理となる。..., E, Z processing destination pointers are assumed. Therefore, it becomes a multi-branch process that branches into (wax + 1) processes.
今、被判定データXがdという値とする。このとき、第
4図の比較定数25の四番目配列C3(=d)と比較し
て=(等しい)、又は≠(等しくない)を判定して処理
ジャンプ先ポインタ26の四番目配列であるPa(=D
)ポインタヘジャンプして分岐する。この処理を次に第
3図を利用して説明する。Now, assume that the data to be determined X has a value of d. At this time, it is compared with the fourth array C3 (=d) of the comparison constant 25 in FIG. (=D
) Jump to the pointer and branch. This process will now be explained using FIG.
第3図の処理13で被判定データXはdとして実行する
と、XとCoを比較してGoはaのため、≠の判定とな
り、処理14へ行く。処理14ではカウンタnを1に初
期化する。処理15は、Cm a xの空きエリアへX
の値(=d)を代入する。When executing the process 13 in FIG. 3 with the data to be determined as d, X and Co are compared and since Go is a, the determination is ≠, and the process goes to process 14. In process 14, a counter n is initialized to 1. Process 15 is X to the empty area of Cm a x.
Assign the value (=d).
処理16では、又とC1を比較してC1はbのため、キ
の判定となり、処理17へ行く。処理17はカウンタn
を+1する。ここで処理16へ戻るループ処理となる。In process 16, C1 is compared with C1, and since C1 is b, the determination is KI, and the process goes to process 17. Process 17 is counter n
Add +1 to Here, a loop process returns to process 16.
nが3の値にカウントアツプした時、CSの値がdのた
め、処理16でXとC8が一致して=の判定となり、処
理19へ行く。When n counts up to a value of 3, since the value of CS is d, X and C8 match in process 16, and a determination of = is made, and the process goes to process 19.
nは3の値であるため、≠の判定となる。処理20、処
理21では第4図の比較定数25と処理ジャンプ先ポイ
ンタ26の四番目と三番目の配列データを交換する。Since n has a value of 3, the determination is ≠. In processes 20 and 21, the comparison constant 25 and the fourth and third array data of the process jump destination pointer 26 in FIG. 4 are exchanged.
よってCa(=d)とCz (=c)、Pa (=D)
とPg(=C)が交換される。この後、処理22でPg
(=D)のポインタヘジャンプする。Therefore, Ca (=d), Cz (=c), Pa (=D)
and Pg (=C) are exchanged. After this, in process 22, Pg
Jump to pointer (=D).
この状態で被判定データXがdの値で処理することが二
回連続して処理された後は、Coはd。In this state, after the determined data X is processed with the value of d twice in a row, Co becomes d.
PGはDの値に変換している。この状態で、再度。PG is converted to the value of D. In this state, again.
被判定データXがdの値で処理すると処理13で、Co
はdのため、=の判定となり、処理18でPa(=D)
のポインタへジャンプする。When the data to be determined X is processed with the value of d, in process 13, Co
is d, so it is judged as =, and in process 18 Pa(=D)
Jump to the pointer.
以上、被判定データXがdの値のときの処理を説明した
が、その他のat be ct・・・、eの値のときも
同様な処理となる。Above, the processing when the determined data X is the value d has been described, but the processing is similar when the data X is the value of other at be ct . . . e.
被判定データXが、at by C,ci、”・t e
のどの値にも一致しない場合は、処理15で0.28の
空きエリアにXの値が代入されるため、処理16でnの
値がカウントアツプして最大になったとき、又とC11
&Xが一致して=の判定となる。この後、処理19でn
は最大のため、=の判定となり、処理23へ行ってP
waxのポインタへジャンプする。The data to be determined X is at by C, ci,”・t e
If it does not match any value of
&X match, resulting in a determination of =. After this, in process 19
Since is the maximum, it is judged as =, and the process goes to step 23, where P
Jump to wax pointer.
本実施例によると、被判定データが高い確率で一定であ
る場合、その高い確立の値の判定を優先する処理シーケ
ンスとするために、動的ステップ量は次第に減少する。According to this embodiment, when the data to be determined is constant with a high probability, the dynamic step amount is gradually reduced in order to set the processing sequence to prioritize the determination of the value with the high probability.
また、確立の高いデータの値が変化しても、その値の判
定を優先する処理シーケンスに変化する。このように確
立の高い被判定データの値が変わっても、処理シーケン
スを変更することで一定の処理速度に自動的に修正する
ため、性能にばらつきがなく、さらに人手によるプログ
ラムの処理シーケンスの修正も不要となる効果がある。Furthermore, even if the value of data with a high probability changes, the processing sequence changes to give priority to the determination of that value. In this way, even if the value of the target data with high probability changes, the processing sequence is automatically corrected to a constant processing speed by changing the processing sequence, so there is no variation in performance, and furthermore, it is possible to manually correct the program processing sequence. This also has the effect of making it unnecessary.
本発明は、以上説明したような処理シーケンスで構成さ
れているので、以下に記載されるような効果を奏する。Since the present invention is configured with the processing sequence described above, it produces the effects described below.
プログラムの動作環境で多重分岐処理に入る被判定デー
タが高い確率で一定の値である場合、その高い確率の値
の判定を優先する処理シーケンスとするために、プログ
ラムのトータルの動的ステップ量は処理を行うたびに縮
少化する。If the data to be determined that enters multiple branch processing in the program operating environment has a constant value with a high probability, the total dynamic step amount of the program is It shrinks each time it is processed.
また、プログラムの動作環境が変わり、多重分岐処理に
入る確率の高い被判定データの値が変わってもプログラ
ム自身が、その値に合わせて処理シーケンスを変更する
。このように、プログラムの動作環境の変化に対応して
その時点での最適な処理シーケンスに自動変更し、処理
速度を上げようとする。Further, even if the operating environment of the program changes and the value of the determined data that has a high probability of entering multiple branch processing changes, the program itself changes the processing sequence in accordance with the value. In this way, in response to changes in the operating environment of the program, the processing sequence is automatically changed to the optimum one at that time, thereby increasing the processing speed.
第1図は本発明の一実施例のプログラム実行部フローチ
ャート、第2図は多重分岐の学習処理の初期状態と処理
説明図、第3図は多重分岐処理の学習の変化図、第4図
は本発明のデータ配列部を示す。
1.2,3.4・・・被判定データと定数値との比較処
理、6,8.10・・・定数値と分岐処理後のジャンプ
先ポインタの交換処理、5,7,9,11゜第
図FIG. 1 is a flowchart of the program execution unit according to an embodiment of the present invention, FIG. 2 is an initial state and process explanation diagram of multiple branch learning processing, FIG. 3 is a change diagram of learning multiple branch processing, and FIG. 4 is a diagram showing changes in learning of multiple branch processing. 3 shows a data array section of the present invention. 1.2, 3.4... Comparison process between the data to be determined and constant value, 6, 8.10... Exchange process of constant value and jump destination pointer after branch processing, 5, 7, 9, 11゜Figure
Claims (1)
以上であり、分岐する条件は被比較データと判定対象の
定数とを「等しい」、又は、「等しくない」の判定を行
う比較処理で「等しい」が成り立つことに限定し、また
、前記比較処理が二つ以上で構成された多重に分岐する
プログラム処理において、「等しい」か「等しくない」
かの判定を行う全ての比較処理の内、最初に行なう比較
処理が成立した分岐条件と全ての判定対象の定数と分岐
条件が成立しなかつた分岐条件の二つの分岐条件を除い
た全ての分岐条件の各分岐先の処理へジャンプする時点
で該当する前の比較処理と該当する比較処理を交換した
処理と、該当の一つ前の分岐条件成立後の処理ジャンプ
先ポインタと該当の分岐条件成立後の処理ジャンプ先ポ
インタを交換する処理を設けたことを特徴とする学習に
よる多重分岐処理の自動変更方式。1. In the branch processing of the program, there are three or more processing destinations to branch to, and the condition for branching is a comparison process that determines whether the compared data and the constant to be determined are "equal" or "not equal." In addition, in program processing where the comparison process is multi-branched and consists of two or more, the comparison process is limited to cases where "equal" holds true, and "equal" or "not equal"
Of all the comparison processes that perform this judgment, all branches except for two branch conditions: the branch condition for which the first comparison process was satisfied, the constant for all judgment targets, and the branch condition for which the branch condition was not satisfied. At the time of jumping to the process of each branch destination of the condition, the process that replaced the previous comparison process with the corresponding comparison process, the process after the previous branch condition was met, the jump destination pointer, and the corresponding branch condition being met. An automatic change method for multiple branch processing using learning, characterized in that a process for exchanging a pointer to a subsequent processing jump destination is provided.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP26495289A JPH03127125A (en) | 1989-10-13 | 1989-10-13 | Automatic change system for multiple branch processing by learning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP26495289A JPH03127125A (en) | 1989-10-13 | 1989-10-13 | Automatic change system for multiple branch processing by learning |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH03127125A true JPH03127125A (en) | 1991-05-30 |
Family
ID=17410479
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP26495289A Pending JPH03127125A (en) | 1989-10-13 | 1989-10-13 | Automatic change system for multiple branch processing by learning |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH03127125A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07160499A (en) * | 1993-12-09 | 1995-06-23 | Nec Corp | Optimization system for multidirectional branch instruction |
US6343357B1 (en) | 1991-06-24 | 2002-01-29 | Hitachi, Ltd. | Microcomputer and dividing circuit |
JP2008057880A (en) * | 2006-08-31 | 2008-03-13 | Daikin Ind Ltd | Air conditioner |
WO2012093489A1 (en) * | 2011-01-07 | 2012-07-12 | 富士通株式会社 | Computation processing device and branch prediction method |
-
1989
- 1989-10-13 JP JP26495289A patent/JPH03127125A/en active Pending
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6343357B1 (en) | 1991-06-24 | 2002-01-29 | Hitachi, Ltd. | Microcomputer and dividing circuit |
US6996700B2 (en) | 1991-06-24 | 2006-02-07 | Renesas Technology Corp. | Microcomputer and dividing circuit |
JPH07160499A (en) * | 1993-12-09 | 1995-06-23 | Nec Corp | Optimization system for multidirectional branch instruction |
JP2008057880A (en) * | 2006-08-31 | 2008-03-13 | Daikin Ind Ltd | Air conditioner |
WO2012093489A1 (en) * | 2011-01-07 | 2012-07-12 | 富士通株式会社 | Computation processing device and branch prediction method |
JP5494832B2 (en) * | 2011-01-07 | 2014-05-21 | 富士通株式会社 | Arithmetic processing device and branch prediction method |
US8751776B2 (en) | 2011-01-07 | 2014-06-10 | Fujitsu Limited | Method for predicting branch target address based on previous prediction |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2808672B2 (en) | Merid decision method using object-oriented language classes | |
US5535412A (en) | Circular buffer controller | |
JPH03127125A (en) | Automatic change system for multiple branch processing by learning | |
US6917850B2 (en) | Motion data command system and control signal definition system for motion program | |
JPS63142431A (en) | Pipeline control system | |
WO2022057459A1 (en) | Tensorcore-based int4 data type processing method and system, device, and medium | |
EP0600520B1 (en) | Microcomputer internally having fuzzy inference exclusive-instructions | |
JPS5856153A (en) | Subroutine return system | |
JPH086797A (en) | Constant reference optimizing processor | |
CN111401402A (en) | K neighbor decision method and system for boundary tree under condition of uncertain sample labels | |
EP0633525A2 (en) | Language processing method | |
JPH0259884A (en) | Character recognizing device | |
JPH0766369B2 (en) | Command processing method for image processing | |
JP3036900B2 (en) | Assembler processing unit | |
JPS61282932A (en) | Address counter control system | |
CN116009877A (en) | Instruction optimization method and device | |
JPS61193201A (en) | Optimization and extraction processing method for characteristic function | |
JP2585780B2 (en) | DO loop optimization processing method for input / output library | |
JPH0776926B2 (en) | Loop control processing method | |
JPS5998203A (en) | Optimizing control method | |
JPH03263176A (en) | Automatic alteration system for search processing by experience | |
JPH05257703A (en) | Assembler device | |
JPS62175831A (en) | Control system for pipeline with tag | |
JP2637007B2 (en) | Sintering operation management method | |
JPH0267635A (en) | Method retrieving method and method retrieving procedure forming method |