JP2011039856A - Data processing device, data processing method, program conversion processing device, and program conversion processing method - Google Patents
Data processing device, data processing method, program conversion processing device, and program conversion processing method Download PDFInfo
- Publication number
- JP2011039856A JP2011039856A JP2009187622A JP2009187622A JP2011039856A JP 2011039856 A JP2011039856 A JP 2011039856A JP 2009187622 A JP2009187622 A JP 2009187622A JP 2009187622 A JP2009187622 A JP 2009187622A JP 2011039856 A JP2011039856 A JP 2011039856A
- Authority
- JP
- Japan
- Prior art keywords
- execution
- instruction
- input value
- reuse
- unit
- 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.)
- Abandoned
Links
Images
Abstract
Description
本発明は、データ処理装置に関し、特に複数回実行される命令区間の実行結果を再利用するデータ処理装置およびその処理方法、ならびに、このデータ処理装置に対応するプログラムに変換するデータ変換処理装置およびその処理方法に関する。 The present invention relates to a data processing apparatus, and in particular, a data processing apparatus that reuses an execution result of an instruction section that is executed a plurality of times, a processing method thereof, a data conversion processing apparatus that converts a program corresponding to the data processing apparatus, and It relates to the processing method.
従来からCPU(Central Processing Unit)などのマイクロプロセッサにおいて、演算処理の高速化技術に関する研究開発が盛んに行われている。この演算処理の高速化技術として、値再利用技術という手法が考案されている。例えば、この値再利用技術をループの命令区間に適用したデータ処理装置が提案されている(例えば、特許文献1参照。)。
この値再利用技術では、プログラムの一部分である命令区間のうち、その命令区間における入力値が同じであれば実行結果も同じとなる命令区間における入力値と、その実行結果である出力値とを関連付けて再利用表に登録する。その後、同じ命令区間を再度実行する場合に、同一の入力値が再利用表に登録されていれば、その入力値に対応する出力値を再利用表から出力することによって、過去に実行された命令区間の実行結果を再利用する。このように、複数回実行される命令区間のうち、過去に実行された命令区間の実行結果を再利用することができる命令区間をここでは再利用区間という。
2. Description of the Related Art Conventionally, research and development relating to high-speed computing processing technology has been actively performed in microprocessors such as a CPU (Central Processing Unit). As a technique for speeding up this arithmetic processing, a technique called value reuse technique has been devised. For example, a data processing apparatus in which this value reuse technique is applied to an instruction section of a loop has been proposed (for example, see Patent Document 1).
In this value reuse technique, among the instruction sections that are part of the program, if the input value in the instruction section is the same, the input value in the instruction section that has the same execution result and the output value that is the execution result are Register in the reuse table in association. After that, when the same instruction section is executed again, if the same input value is registered in the reuse table, it was executed in the past by outputting the output value corresponding to the input value from the reuse table. Reuse the execution result of the instruction section. As described above, an instruction interval in which an execution result of an instruction interval executed in the past among the instruction intervals executed a plurality of times can be reused is referred to as a reuse interval.
上述の従来技術では、再利用区間における処理が再度実行されたときに、その命令区間の入力値が再利用表に登録されていれば、その再利用区間の処理を省略することができるため、命令区間の実行に要する時間を短縮することができる。しかしながら、この場合、再利用区間の処理において入力値が使用されるまでは、その再利用区間の入力値が再利用表に登録されているか否かの判断を行うことができない。このため、入力値が使用されるまで再利用表の検索を行うことができないことから、実行結果の再利用によって短縮することができる期間が制限されてしまう。 In the above-described conventional technique, if the input value of the command section is registered in the reuse table when the process in the reuse section is executed again, the process of the reuse section can be omitted. The time required for executing the instruction section can be shortened. However, in this case, it is not possible to determine whether or not the input value of the reuse section is registered in the reuse table until the input value is used in the processing of the reuse section. For this reason, since the reuse table cannot be searched until the input value is used, the period that can be shortened by reusing the execution result is limited.
本発明はこのような状況に鑑みてなされたものであり、実行結果の再利用による再利用区間の処理時間をさらに短縮させることを目的とする。 The present invention has been made in view of such a situation, and an object thereof is to further reduce the processing time of the reuse section by reusing the execution result.
本発明は、上記課題を解決するためになされたものであり、その第1の側面は、複数回実行される命令区間である再利用区間が含まれる命令列に基づく処理を実行する実行部と、上記再利用区間を識別するための識別情報ごとに上記再利用区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリと、上記再利用区間における処理の実行を予告する予告命令に基づいて上記再利用区間の入力値を取得して上記取得された入力値と上記予告命令により特定された上記識別情報とに基づいて上記実行履歴における上記実行結果を検索する実行履歴検索部と、上記予告命令によって識別された上記再利用区間における処理が実行されるときに上記実行履歴検索部により上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力する実行結果出力部とを具備するデータ処理装置およびその処理方法である。これにより、再利用区間の実行前において予告命令に基づいて再利用区間の入力値を取得し、その取得された入力値と予告命令により特定された識別情報とに基づいて履歴メモリにおける実行結果を検索させて、予告命令によって識別された再利用区間における処理が実行されるときに、実行結果が抽出された場合には、その抽出された実行結果を実行部に出力させるという作用をもたらす。 The present invention has been made to solve the above problems, and a first aspect thereof is an execution unit that executes processing based on an instruction sequence including a reuse section that is an instruction section that is executed a plurality of times. A history memory that associates an input value and an execution result in the reuse section for each piece of identification information for identifying the reuse section, and retains it as an execution history, and a notice instruction for notifying execution of processing in the reuse section An execution history search unit that acquires the input value of the reuse section based on the acquired input value and the identification information specified by the notice command, and searches for the execution result in the execution history; When the execution result is extracted by the execution history search unit when the process in the reuse section identified by the notice instruction is executed, the extracted actual result is extracted. The results is a data processing apparatus and a processing method comprising an execution result output section for outputting to the execution unit. Thereby, before executing the reuse section, the input value of the reuse section is acquired based on the notice instruction, and the execution result in the history memory is obtained based on the acquired input value and the identification information specified by the notice instruction. When the execution result is extracted when the search is performed and the process in the reuse section identified by the notice instruction is executed, the extracted execution result is output to the execution unit.
また、この第1の側面において、上記実行履歴検索部は、上記予告命令から上記再利用区間の先頭アドレスが呼び出される呼出し命令の直前の命令までの命令群のうち上記再利用区間の入力値を設定するための入力値設定命令に基づいて入力値を取得するようにしてもよい。これにより、実行履歴検索部により、予告命令の後に続く入力値設定命令によって設定されたデータを再利用区間の入力値として取得させるという作用をもたらす。 Further, in this first aspect, the execution history search unit obtains an input value of the reuse section in an instruction group from the notice instruction to an instruction immediately before a call instruction for calling a head address of the reuse section. An input value may be acquired based on an input value setting command for setting. As a result, the execution history search unit has an effect that the data set by the input value setting command following the notice command is acquired as the input value of the reuse section.
また、この第1の側面において、上記実行履歴検索部は、上記取得された入力値と上記予告命令に含まれる上記識別情報とに基づいて上記実行履歴における上記実行結果を検索するようにしてもよい。これにより、実行履歴検索部により、予告命令に含まれる識別情報と、予告命令に基づいて取得された入力値とを用いて履歴メモリにおける実行結果を検索させるという作用をもたらす。 In the first aspect, the execution history search unit may search the execution result in the execution history based on the acquired input value and the identification information included in the notice command. Good. As a result, the execution history search unit causes the execution result in the history memory to be searched using the identification information included in the notice command and the input value acquired based on the notice command.
また、この第1の側面において、上記履歴メモリは、上記識別情報である上記再利用区間の先頭アドレスごとに上記再利用区間における入力値および実行結果を関連付けて上記実行履歴として保持し、上記実行部は、上記先頭アドレスを参照するための参照情報を含む上記予告命令に基づいて上記先頭アドレスを上記実行履歴検索部に出力し、上記実行履歴検索部は、上記識別情報として上記実行部から出力された上記先頭アドレスと上記再利用区間の入力値とに基づいて上記実行履歴における上記実行結果を検索するようにしてもよい。これにより、予告命令に含まれる参照情報に基づいて再利用区間の先頭アドレスを実行部から出力させ、その実行部から出力させた再利用区間の先頭アドレスと、予告命令に基づいて取得された入力値とを用いて履歴メモリにおける実行結果を検索させるという作用をもたらす。 Further, in the first aspect, the history memory associates an input value and an execution result in the reuse section for each head address of the reuse section that is the identification information, and holds the execution history as the execution history. The section outputs the head address to the execution history search section based on the notice command including reference information for referring to the head address, and the execution history search section outputs the identification information from the execution section as the identification information. The execution result in the execution history may be searched based on the head address and the input value of the reuse section. Thus, the start address of the reuse section is output from the execution unit based on the reference information included in the notice command, and the start address of the reuse section output from the execution unit and the input acquired based on the notice command The value is used to search the execution result in the history memory.
また、この第1の側面において、上記予告命令は、上記識別情報である上記再利用区間の先頭アドレスを設定するための予告設定命令であり、上記履歴メモリは、上記再利用区間の先頭アドレスごとに上記再利用区間における入力値および実行結果を関連付けて上記実行履歴として保持し、上記実行部は、上記先頭アドレスの設定先が示された設定情報を含む上記予告設定命令に基づいて上記先頭アドレスを上記設定先に設定し、上記実行履歴検索部は、上記予告設定命令に基づいて上記再利用区間の入力値を取得して上記取得された入力値と上記実行部により設定された上記先頭アドレスとに基づいて上記実行履歴における上記実行結果を検索するようにしてもよい。これにより、実行履歴検索部により、再利用区間の先頭アドレスを設定する予告設定命令によって設定された先頭アドレスと、予告設定命令に基づいて取得された入力値とに基づいて履歴メモリにおける実行履歴を検索させるという作用をもたらす。 In the first aspect, the notice command is a notice setting command for setting the start address of the reuse section, which is the identification information, and the history memory is provided for each start address of the reuse section. The execution value is stored as the execution history in association with the input value and the execution result in the reuse section, and the execution unit determines the start address based on the notice setting instruction including the setting information indicating the setting destination of the start address. Is set as the setting destination, and the execution history search unit acquires the input value of the reuse section based on the advance notice setting command, and the acquired input value and the start address set by the execution unit Based on the above, the execution result in the execution history may be searched. As a result, the execution history search unit obtains the execution history in the history memory based on the start address set by the notice setting command for setting the start address of the reuse section and the input value acquired based on the notice setting instruction. It brings about the effect of making it search.
また、この第1の側面において、上記履歴メモリは、上記実行履歴を削除する際の優先度と上記優先度に対応する上記再利用区間における入力値および実行結果とを関連付けて上記実行履歴として上記識別情報ごとに保持し、上記実行履歴検索部は、上記予告命令に含まれる上記優先度に基づいて上記履歴メモリにおける上記実行履歴を削除するようにしてもよい。これにより、実行履歴検索部により、実行履歴ごとに付与された優先度に基づいて、履歴メモリにおける実行履歴を削除させるという作用をもたらす。 Further, in the first aspect, the history memory associates the priority when deleting the execution history with the input value and the execution result in the reuse section corresponding to the priority, as the execution history. For each identification information, the execution history search unit may delete the execution history in the history memory based on the priority included in the notice command. As a result, the execution history search unit deletes the execution history in the history memory based on the priority assigned to each execution history.
また、この第1の側面において、上記実行部は、上記実行履歴検索部により上記実行履歴における上記実行結果が上記履歴メモリから抽出されない場合には上記予告命令によって識別された上記再利用区間における処理を実行し、上記実行履歴検索部は、上記予告命令に基づいて取得された上記入力値と上記実行部により実行された実行結果と上記識別情報とを上記履歴メモリに保持させるようにしてもよい。これにより、履歴メモリから実行結果が抽出されない場合には、実行履歴検索部により、予告命令に基づいて取得された入力値と、その入力値に基づいて実行された実行結果と、識別情報とを履歴メモリに保持させるという作用をもたらす。 Further, in the first aspect, the execution unit performs processing in the reuse section identified by the notice instruction when the execution result in the execution history is not extracted from the history memory by the execution history search unit. The execution history search unit may cause the history memory to hold the input value acquired based on the notice command, the execution result executed by the execution unit, and the identification information. . Thereby, when the execution result is not extracted from the history memory, the execution history search unit obtains the input value acquired based on the notice command, the execution result executed based on the input value, and the identification information. This brings about the effect that it is retained in the history memory.
また、この第1の側面において、上記履歴メモリは、上記再利用区間である関数を識別するための上記識別情報ごとに上記関数における入力値および実行結果を関連付けて上記実行履歴として保持し、上記実行履歴検索部は、上記関数の実行を予告する予告命令に基づいて上記関数の入力値を取得して上記取得された入力値と上記予告命令により特定された上記識別情報とに基づいて上記実行履歴における上記実行結果を検索し、実行結果出力部は、上記予告命令によって識別された上記関数が実行されるときに上記実行履歴検索部により上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力するようにしてもよい。これにより、実行履歴検索部により、関数の実行を予告する予告命令に基づいて関数の入力値を取得して、その取得された入力値と予告命令により特定された識別情報とを用いてこれらのパラメータに関連付けられた実行結果を履歴メモリから抽出し、関数が実行されるときに、実行結果部により、その抽出された実行結果を実行部に出力させるという作用をもたらす。 In the first aspect, the history memory associates an input value and an execution result in the function for each identification information for identifying the function that is the reuse section, and holds the execution history as the execution history. The execution history search unit acquires an input value of the function based on a notice command for notifying execution of the function, and executes the execution based on the acquired input value and the identification information specified by the notice command. The execution result in the history is searched, and the execution result output unit extracts the execution result if the execution result is extracted by the execution history search unit when the function identified by the notice instruction is executed. The execution result may be output to the execution unit. As a result, the execution history search unit acquires the input value of the function based on the advance notice for notifying the execution of the function, and uses these obtained input values and the identification information specified by the advance instruction. The execution result associated with the parameter is extracted from the history memory, and when the function is executed, the execution result unit causes the execution unit to output the extracted execution result.
また、本発明の第2の側面は、プログラムのうち複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度を上記命令区間の使用態様に基づいて上記命令区間ごとに生成する再利用度生成部と、上記複数の命令区間のうち上記再利用度に基づいて選択された再利用区間における入力値を設定する入力値設定命令の直前に上記再利用区間における入力値の設定を予告する予告命令を生成する予告命令生成部とを具備するプログラム変換処理装置およびその処理方法である。これにより、再利用度生成部において命令区間の使用態様に基づいて命令区間ごとの再利用度を生成し、その生成された再利用度に基づいて選択された再利用区間における入力値設定命令の直前に、予告命令生成部により再利用区間の実行を予告する予告命令を生成させるという作用をもたらす。 Further, according to a second aspect of the present invention, the reusability indicating the degree to which the execution results of the instruction sections executed a plurality of times in the program coincide with each other is determined for each instruction section based on the usage of the instruction section. And the input value in the reuse section immediately before the input value setting instruction for setting the input value in the reuse section selected based on the reuse degree among the plurality of instruction sections. A program conversion processing apparatus and a processing method thereof including a notice command generating unit for generating a notice command for notifying the setting of the information. Thus, the reuse level generation unit generates a reuse level for each command section based on the usage mode of the instruction section, and the input value setting command in the reuse section selected based on the generated reuse level. Immediately before, the notice command generation unit generates a notice command for notifying the execution of the reuse section.
また、この第2の側面において、上記予告命令生成部は、上記再利用度に基づいて選択された複数の上記再利用区間を識別するための識別情報を含む上記予告命令を生成するようにしてもよい。これにより、上記予告命令生成部により、上記再利用度に基づいて選択された複数の再利用区間を互いに識別するための識別情報を含む予告命令を生成させるという作用をもたらす。 In the second aspect, the notice command generation unit generates the notice command including identification information for identifying the plurality of reuse sections selected based on the degree of reuse. Also good. As a result, the notice command generation unit generates a notice command including identification information for identifying a plurality of reuse sections selected based on the degree of reuse.
また、この第2の側面において、上記予告命令生成部は、上記再利用区間の先頭アドレスを設定するためのアドレス設定命令の後に上記先頭アドレスを参照するための参照情報を含む上記予告命令を生成するようにしてもよい。これにより、アドレス設定命令の後に、予告命令生成部により、そのアドレス設定命令により設定された再利用区間の先頭アドレスを参照するための参照情報を含む予告命令を生成させるという作用をもたらす。 In the second aspect, the notice command generation unit generates the notice command including reference information for referring to the start address after an address setting instruction for setting the start address of the reuse section. You may make it do. Thus, after the address setting command, the notification command generating unit generates a notification command including reference information for referring to the head address of the reuse section set by the address setting command.
また、この第2の側面において、上記予告命令生成部は、上記再利用区間の先頭アドレスを設定するために上記先頭アドレスの設定先が示された設定情報を含むアドレス設定命令として上記予告命令を生成するようにしてもよい。これにより、再利用区間の先頭アドレスを設定するための予告命令を生成させるという作用をもたらす。 Further, in the second aspect, the notice command generation unit outputs the notice command as an address setting instruction including setting information indicating a setting destination of the start address in order to set a start address of the reuse section. You may make it produce | generate. This brings about the effect that a notice command for setting the start address of the reuse section is generated.
また、この第2の側面において、上記予告命令生成部は、上記再利用度生成部により生成された上記再利用度に応じて付与された優先度を含む上記予告命令を生成するようにしてもよい。これにより、予告命令生成部により、履歴メモリの実行履歴を削除するための優先度を含む予告命令を生成させるという作用をもたらす。 In the second aspect, the notice command generation unit may generate the notice command including a priority given in accordance with the reuse degree generated by the reuse degree generation unit. Good. As a result, the notice command generation unit generates a notice command including a priority for deleting the execution history of the history memory.
本発明によれば、実行結果の再利用による再利用区間における処理時間をさらに短縮することができるという優れた効果を奏し得る。 According to the present invention, it is possible to achieve an excellent effect that the processing time in the reuse section due to the reuse of the execution result can be further shortened.
以下、本発明を実施するための形態(以下、実施の形態と称する)について説明する。説明は以下の順序により行う。
1.第1の実施の形態(データ処理制御:識別情報を含む予告命令による実行結果の再利用処理の例)
2.第2の実施の形態(データ処理制御:参照情報を含む予告命令による実行結果の再利用処理の例)
3.第3の実施の形態(データ処理制御:予告設定命令による実行結果の再利用処理の例)
4.第4の実施の形態(プログラム変換制御:予告命令を含むプログラムの生成例)
Hereinafter, modes for carrying out the present invention (hereinafter referred to as embodiments) will be described. The description will be made in the following order.
1. First Embodiment (Data Processing Control: Example of Reuse Processing of Execution Result by Notice Command Including Identification Information)
2. Second Embodiment (Data Processing Control: Example of Execution Result Reuse Processing by Preliminary Instruction including Reference Information)
3. Third Embodiment (Data Processing Control: Example of Execution Result Reuse Processing by Advance Setting Command)
4). Fourth embodiment (program conversion control: generation example of program including notice command)
<1.第1の実施の形態>
[データ処理装置の構成例]
図1は、本発明の第1の実施の形態におけるデータ処理装置の一構成例を示すブロック図である。ここでは、集積回路を構成するデータ処理装置100と、バス120と、主記憶部130とが示されている。この集積回路は、主記憶部130からバス120を介して読み出される命令列に従って、データ処理装置100により処理を実行するものである。
<1. First Embodiment>
[Configuration example of data processing device]
FIG. 1 is a block diagram showing an example of the configuration of the data processing apparatus according to the first embodiment of the present invention. Here, a
データ処理装置100は、一次キャッシュ200と、データ処理部300と、実行結果再利用処理部400とを備える。なお、データ処理装置100は、特許請求の範囲に記載のデータ処理装置の一例である。一次キャッシュ200は、バス120を介して主記憶部130から命令およびデータを読み出す際、または、書き込む際の処理によって生じる遅延時間を軽減するためのメモリである。この一次キャッシュ200は、例えば、DRAM(Dynamic Random Access Memory)により実現される。
The
この一次キャッシュ200は、命令キャッシュ210およびデータキャッシュ220を備える。命令キャッシュ210は、主記憶部130から読み出された過去の命令を一時的に保持するものである。この命令キャッシュ210は、データ処理部300からの要求に従って、その保持された命令を、命令線219を介してデータ処理部300に出力する。
The
また、この命令キャッシュ210は、データ処理部300から要求された命令を保持している場合には、その保持している複数の命令のうち、その要求された命令をデータ処理部300に出力する。一方、データ処理部300から要求された命令を保持していない場合には、命令キャッシュ210は、データ処理部300により主記憶部130から読み出された命令を保持するとともにデータ処理部300に出力する。
In addition, when the
データキャッシュ220は、主記憶部130から読み出された過去のデータを一時的に保持するものである。このデータキャッシュ220は、データ処理部300からの要求に従って、その保持されたデータを、データ線229を介してデータ処理部300に出力する。また、このデータキャッシュ220は、データ処理部300から要求されたデータを保持している場合には、保持している複数のデータのうち、その要求されたデータをデータ処理部300に出力する。
The
一方、データ処理部300から要求されたデータを保持していない場合には、データキャッシュ220は、データ処理部300により主記憶部130から読み出されたデータを保持する。また、データキャッシュ220は、主記憶部130に書き戻すためのデータがデータ処理部300から供給された場合には、そのデータを保持する。
On the other hand, when the data requested by the
データ処理部300は、主記憶部130から読み出された命令に基づく処理を実行するものである。このデータ処理部300は、例えば、命令キャッシュ210を介して主記憶部130から命令を読み出して、その読み出された命令に従って、主記憶部130に記憶されたデータを、データキャッシュ220を介して読み出す。そして、データ処理部300は、例えば、その読み出されたデータを用いて演算命令に基づく演算処理を実行する。
The
また、データ処理部300は、例えば、関数の処理を実行する場合には、データキャッシュ220から読み出された関数における引数の入力値を用いて関数の演算処理を実行して、その演算処理の結果である実行結果をデータキャッシュ220に出力する。このとき、データ処理部300は、関数における入力値および実行結果を実行結果再利用処理部400に出力する。また、このデータ処理部300は、例えば、プロセッサコアにより実現される。
Further, for example, when executing the processing of a function, the
実行結果再利用処理部400は、過去に実行された命令区間の入力値と、再び実行される命令区間の入力値とが一致した場合には、その過去に実行された命令区間の実行結果を再利用するものである。ここでは、複数回実行される命令区間のうち、過去に実行された命令区間の実行結果を再利用することができる命令区間を再利用区間という。すなわち、この再利用区間とは、複数回実行される命令区間のうち、命令区間における入力値が同じであれば実行結果も同じとなる命令区間のことである。
When the input value of the instruction section executed in the past matches the input value of the instruction section executed again, the execution result
この実行結果再利用処理部400は、複数回実行される再利用区間における入力値および実行結果を実行履歴として保持する。また、この実行結果再利用処理部400は、再び実行される再利用区間の入力値と、その保持された実行履歴の入力値とが同一である場合には、その保持された実行履歴における実行結果をデータ処理部300に出力する。これとともに、実行結果再利用処理部400は、その再利用区間における処理をスキップするための指示をデータ処理部300に通知する。
The execution result
実行結果再利用処理部400は、例えば、再利用区間である関数の引数の入力値と、その保持された実行履歴における入力値とが同一である場合には、その保持された実行履歴における実行結果をデータ処理部300に出力する。これとともに、実行結果再利用処理部400は、その関数における処理をスキップするための指示をデータ処理部300に通知する。
For example, when the input value of the argument of the function that is the reuse section is the same as the input value in the retained execution history, the execution result
バス120は、データ処理装置100と主記憶部130との間の通信を行うものである。このバス120は、主記憶部130に記憶されているプログラムをデータ処理装置100に転送する。また、このバス120は、データ処理装置100から出力されたデータを主記憶部130に転送する。
The bus 120 performs communication between the
主記憶部130は、データ処理装置100に処理を実行させるためのプログラムを記憶するものである。ここでは、このプログラムは、ABI(Application Binary Interface)の規定に基づいて生成されたプログラムを想定する。このプログラムは、例えば、SPARC(Scalable Processor Architecture) ABIに基づいて生成されるものである。これにより、データ処理装置100において、関数における入力値および実行結果が格納される場所を特定することができるため、実行結果の再利用を実現することができる。また、この主記憶部130に記憶されているプログラムには、再利用区間である関数が実行される前に、関数における処理の実行を予告する予告命令が挿入されている。
The
[データ処理部300および実行結果再利用処理部400の構成例]
図2は、本発明の第1の実施の形態におけるデータ処理部300および実行結果再利用処理部400の一構成例を示すブロック図である。ここでは、主記憶部130に予告命令が挿入されたプログラムが記憶されていることを想定している。
[Configuration Example of
FIG. 2 is a block diagram illustrating a configuration example of the
データ処理部300は、フェッチ部310と、命令デコーダ320と、実行部330と、レジスタファイル340とを備える。この実行部330は、ロードユニット331と、入力選択部332と、演算回路333と、ストアユニット334とを備える。また、実行結果再利用処理部400は、実行履歴検索部410と、実行結果出力部420と、履歴メモリ430とを備える。
The
フェッチ部310は、命令キャッシュ210に保持された命令、または、主記憶部130に記憶されている命令を、命令線219を介して読み出すものである。このフェッチ部310は、プログラムカウンタからの指示に従って、命令キャッシュ210から命令を読み出す。
The fetch
また、フェッチ部310は、例えば、再利用区間である関数の呼出し命令の実行を予告する予告命令を読み出した後に、その関数における引数の入力値を設定するための入力値設定命令を読み出す。そして、その入力値設定命令の後に、フェッチ部310は、その関数を呼び出す呼出し命令を読み出す。すなわち、フェッチ部310は、再利用区間である関数の呼出し命令を読み出す前に、その関数に対応する予告命令および入力値設定命令を読み出す。
Further, the fetch
また、フェッチ部310は、その読み出された命令を命令デコーダ320に供給する。また、実行履歴検索部410により実行結果が抽出された場合には、フェッチ部310は、例えば、実行結果を設定するための命令を、実行履歴検索部410からの通知に基づいて命令デコーダ320に供給する。
The fetch
命令デコーダ320は、フェッチ部310から供給された命令を解読(デコード)して、その解読内容に基づいて、実行部330、レジスタファイル340および実行履歴検索部410を制御するものである。この命令デコーダ320は、関数の実行を予告する予告命令を受け付けた場合には、その予告命令により特定される識別情報を実行履歴検索部410に供給する。ここにいう識別情報とは、複数の再利用区間である関数を互いに識別するための情報であり、履歴メモリ430に保持された実行履歴を検索するための検索キーとして用いられるものである。すなわち、命令デコーダ320は、予告命令によって、予告命令により特定される再利用区間である関数を実行する前に、その関数を識別するための識別情報を実行履歴検索部410に保持される。
The
命令デコーダ320は、例えば、識別情報を含む予告命令を受け付けたときは、その識別情報を履歴メモリ430に入力させるために、その識別情報を実行履歴検索部410に供給する。また、その識別情報として関数の先頭アドレスを用いる場合において、レジスタファイル340に関数の先頭アドレスが既に格納されているときは、命令デコーダ320は、その関数の先頭アドレスを参照するための参照情報を含む予告命令により識別情報を特定する。
For example, when the
このとき、命令デコーダ320は、その予告命令に含まれる参照情報に基づいて、レジスタファイル340に格納された関数の先頭アドレスを実行履歴検索部410に出力させる。すなわち、命令デコーダ320は、実行部330に対し、参照情報を含む予告命令に基づいて、識別情報である関数の先頭アドレスを実行履歴検索部410に出力させる。
At this time, the
また、識別情報として関数の先頭アドレスを用いる場合において、関数の先頭アドレスをレジスタファイル340に設定するためのアドレス設定命令を予告命令とするときは、命令デコーダ320は、その予告命令に含まれる設定情報に基づいて識別情報を特定する。
In addition, when the function start address is used as the identification information, if the instruction setting instruction for setting the function start address in the
このとき、命令デコーダ320は、入力選択部332を介して、その予告命令に指定された設定情報が示すレジスタファイル340における設定先に、関数の先頭アドレスを設定する。これとともに、命令デコーダ320は、入力選択部332から出力される関数の先頭アドレスを取得するように実行履歴検索部410に指示する。このようなアドレス設定命令である予告命令を、ここでは予告設定命令という。したがって、命令デコーダ320は、実行部330に対し、関数の先頭アドレスの設定先が示された設定情報を含む予告設定命令に基づいて、識別情報である関数の先頭アドレスを設定先に設定させるとともに、実行履歴検索部410に出力させる。
At this time, the
また、命令デコーダ320は、関数の実行を予告する予告命令の後に受け付けた命令が、関数における引数の入力値を設定するための入力値設定命令であるか否かを判断する。この命令デコーダ320は、例えば、ABIの規定に基づいて入力値設定命令であるか否かを判断する。
Further, the
この例において、MIPS(Microprocessor without Interlocked Pipeline Stages)のABIの規定に基づく判断例について簡単に説明する。MIPSの規定では、引数の入力値が全て整数である場合には、4つのレジスタ4乃至7に入力値が格納され、引数が5つ以上のときには、5つ目以上の引数の入力値が主記憶部130のスタック領域にスタックされる。具体的には、5つ目以上の引数の入力値は、レジスタファイル340におけるレジスタ29に格納されたスタックポイント値に16以上の値を加算した値に対応するスタック領域にスタックされる。
In this example, a determination example based on the MBI (Microprocessor without Interlocked Pipeline Stages) ABI will be briefly described. According to the MIPS rules, when all input values of the arguments are integers, the input values are stored in the four registers 4 to 7, and when there are five or more arguments, the input values of the fifth or more arguments are mainly used. Stacked in the stack area of the
したがって、命令デコーダ320は、例えば、ロードワード命令(lw)に示された転送先レジスタがレジスタ4乃至7である場合には、関数における引数の入力値を設定する入力値設定命令と判断する。また、命令デコーダ320は、引数が5以上であり、その引数の全ての入力値が整数である場合において、ストアワード命令(sw)に示された転送先レジスタがレジスタ29であり、かつ、オフセット値が「16」以上を示すときは、入力値設定命令と判断する。
Therefore, for example, when the transfer destination register indicated by the load word instruction (lw) is the registers 4 to 7, the
そして、入力値設定命令と判断された場合には、命令デコーダ320は、入力選択部332から出力されるデータを引数の入力値として取得させるための取得信号を実行履歴検索部410に供給する。すなわち、命令デコーダ320は、予告命令から、関数を呼び出すための呼出し命令の直前の命令までの命令群のうち、関数の入力値を設定するための入力値設定命令に基づいて、引数の入力値を実行履歴検索部410に取得させるように制御する。
If it is determined that the instruction is an input value setting instruction, the
また、この命令デコーダ320は、例えば、主記憶部130から読み出された関数の入力値を設定するための入力値設定命令を受け付けた場合には、ロードユニット331から読み出された入力値をレジスタファイル340に格納するように制御する。これとともに、命令デコーダ320は、実行履歴検索部410に対し取得信号を供給する。
For example, when the
また、命令デコーダ320は、例えば、レジスタファイル340に格納された関数の入力値を設定するための入力値設定命令を受け付けた場合には、レジスタファイル340における1つのレジスタに格納された入力値を他のレジスタに転送するように制御する。これとともに、命令デコーダ320は、実行履歴検索部410に対し取得信号を供給する。
For example, when the
そして、命令デコーダ320は、入力値設定命令の後に、関数の先頭アドレスを呼び出すための呼出し命令を受け付けた場合には、関数に用いられる全ての入力値の設定が終了した旨を示す入力値終了信号を実行履歴検索部410に供給する。すなわち、この命令デコーダ320は、識別情報に対応する関数を呼び出すための呼出し命令を受け付けた場合には、入力値終了信号を実行履歴検索部410に供給する。また、命令デコーダ320は、実行履歴を削除する際の優先度が予告命令に含まれる場合には、その優先度を実行履歴検索部410に供給する。
When the
実行部330は、命令デコーダ320からの制御に従って処理を実行するものである。すなわち、この実行部330は、複数回実行される命令区間である再利用区間が含まれる命令列に基づく処理を実行する。また、実行部330は、例えば、参照情報を含む予告命令が命令デコーダ320に供給された場合には、参照情報に示されたレジスタに格納された関数の先頭アドレスを識別情報として実行履歴検索部410に出力する。
The
また、実行部330は、例えば、予告設定命令が命令デコーダ320に供給された場合には、予告設定命令に含まれる関数の先頭アドレスの設定先を示す設定情報に基づいて、関数の先頭アドレスを設定先に設定する。すなわち、実行部330は、予告設定命令の設定情報に基づいて関数の先頭アドレスをレジスタファイル340に設定するとともに、関数の先頭アドレスを識別情報として実行履歴検索部410に出力する。
For example, when the notice setting instruction is supplied to the
また、この実行部330は、再利用区間である関数の入力値および実行結果をレジスタファイル340または主記憶部130に出力するとともに、実行履歴検索部410に供給する。なお、実行部330は、特許請求の範囲に記載の実行部の一例である。
In addition, the
ロードユニット331は、命令デコーダ320からの制御に従って、主記憶部130またはデータキャッシュ220からデータを読み出して、その読み出されたデータを入力選択部332に供給するものである。このロードユニット331は、例えば、命令デコーダ320からの制御に従って、主記憶部130またはデータキャッシュ220から関数における引数の入力値を読み出して、その読み出された入力値を入力選択部332に供給する。
The
入力選択部332は、命令デコーダ320からの制御に従って、実行結果出力部420、演算回路333、レジスタファイル340および実行結果出力部420から出力されたデータのうち、いずれか1つのデータを選択するものである。この入力選択部332は、その選択されたデータを、レジスタファイル340および実行履歴検索部410に出力する。すなわち、入力選択部332は、命令デコーダ320の制御に従って、実行結果出力部420、演算回路333、レジスタファイル340および実行結果出力部420の出力のうち、いずれかをレジスタファイル340および実行履歴検索部410に出力する。
The
この入力選択部332は、例えば、命令デコーダ320に入力値設定命令としてロード命令が供給された場合には、命令デコーダ320の制御に従って、ロードユニット331からのデータを、レジスタファイル340および実行履歴検索部410に出力する。また、この入力選択部332は、命令デコーダ320に入力値設定命令としてムーブ命令が供給された場合には、命令デコーダ320の制御に従って、レジスタファイル340から出力されたデータを、レジスタファイル340および実行履歴検索部410に出力する。
For example, when a load instruction is supplied as an input value setting instruction to the
また、入力選択部332は、演算処理を実行するための演算命令が命令デコーダ320に供給された場合には、命令デコーダ320の制御に従って、演算回路333から出力された演算結果を実行結果として、レジスタファイル340に出力する。また、この入力選択部332は、実行履歴検索部410により実行結果が抽出された場合には、命令デコーダ320からの制御に従って、実行結果出力部420から出力された実行結果をレジスタファイル340に出力する。
In addition, when an arithmetic instruction for executing arithmetic processing is supplied to the
演算回路333は、命令デコーダ320からの制御に従って、演算処理を実行するものである。この演算回路333は、例えば、乗算、除算または積和などの演算処理を実行するための演算命令が命令デコーダ320に供給された場合には、命令デコーダ320の制御に従って、レジスタファイル340に格納されたデータを用いて演算処理を実行する。また、演算回路333は、その演算処理による演算結果を実行結果として、入力選択部332を介してレジスタファイル340に格納する。
The
ストアユニット334は、命令デコーダ320からの制御に従って、レジスタファイル340に格納されたデータ、または、実行結果出力部420から出力された実行結果を主記憶部130に書き戻すためのものである。このストアユニット334は、主記憶部130にデータを書き戻すためのストア命令が命令デコーダ320に供給された場合には、命令デコーダ320からの制御に従って、書き戻すべきデータを、データ線229を介してデータキャッシュ220に出力する。また、このストアユニット334は、実行履歴検索部410により実行結果が抽出された場合には、実行結果出力部420から出力された実行結果を、データ線229を介して主記憶部130およびデータキャッシュ220に書き戻す。
The
レジスタファイル340は、実行部330から出力されたデータを保持するものである。このレジスタファイル340は、複数のレジスタ、例えば、32個のレジスタ0乃至31により構成される。このレジスタファイル340は、命令デコーダ320からの制御に従って、実行部330から出力されたデータを、複数のレジスタのうち、1つのレジスタに格納する。
The
また、このレジスタファイル340は、例えば、命令デコーダ320からの制御に従って、複数のレジスタのうち1つのレジスタに格納されたデータを実行結果として実行部330または実行部330を介して実行履歴検索部410に出力する。また、このレジスタファイル340は、例えば、命令デコーダ320からの制御に従って、複数のレジスタのうち1つのレジスタに格納された関数の先頭アドレスを識別情報として実行部330を介して実行履歴検索部410に出力する。
Further, the
実行履歴検索部410は、履歴メモリ430において識別情報ごとに保持された再利用区間における入力値および実行結果である実行履歴のうち、予告命令に基づいて取得された識別情報および入力値と同一の実行履歴における実行結果を検索するものである。この実行履歴検索部410は、予告命令に基づいて特定された識別情報および入力値を保持して、その保持された識別情報および入力値を履歴メモリ430に出力することによって、実行履歴の検索を行う。
The execution
この実行履歴検索部410は、命令デコーダ320の指示に従って、予告命令により特定される識別情報を取得する。この実行履歴検索部410は、例えば、識別情報を含む予告命令が命令デコーダ320に供給された場合には、命令デコーダ320から出力された識別情報を保持する。また、この実行履歴検索部410は、例えば、参照情報を含む予告命令が命令デコーダ320に供給された場合には、命令デコーダ320からの制御に従って、レジスタファイル340から出力された関数の先頭アドレスを識別情報として取得する。
The execution
さらに、この実行履歴検索部410は、例えば、予告設定命令が命令デコーダ320に供給された場合には、命令デコーダ320からの制御に従って、入力選択部332を介して、レジスタファイル340に格納される関数の先頭アドレスを識別情報として取得する。その識別情報が取得された後に、実行履歴検索部410は、入力値設定命令が命令デコーダ320に供給されるたびに、命令デコーダ320から出力される取得信号に基づいて関数の入力値を取得する。
Further, the execution
すなわち、実行履歴検索部410は、実行部330から出力された識別情報である関数の先頭アドレスと、その関数の入力値とに基づいて、履歴メモリ430に保持された実行履歴における実行結果を検索する。そして、実行履歴検索部410は、関数を呼び出す呼出し命令が命令デコーダ320に供給された場合には、命令デコーダ320からの入力値終了信号に基づいて、履歴メモリ430に対する検索を終了する。
That is, the execution
実行履歴検索部410は、履歴メモリ430から実行結果が抽出された場合には、その実行結果を実行結果出力部420に出力する。これとともに、実行履歴検索部410は、関数の処理を省略するための省略信号として、その抽出された実行結果における格納場所に関する情報をフェッチ部310に供給する。
When the execution result is extracted from the
一方、履歴メモリ430から実行結果が抽出されない場合には、実行履歴検索部410は、実行部330において予告命令により識別された関数における処理が実行された後に、実行部330から出力された実行結果を取得する。そして、実行履歴検索部410は、その関数の実行結果と、予告命令に基づいて取得された識別情報および入力値とを履歴メモリ430に保持させる。すなわち、履歴メモリ430から実行結果が抽出されない場合には、実行履歴検索部410は、予告命令の後に実行される関数の実行結果と、予告命令により保持された関数の識別情報および入力値を履歴メモリ430に登録する。
On the other hand, when the execution result is not extracted from the
この例において、関数における処理の実行を終了するためのリターン命令が命令デコーダ320に供給された場合には、命令デコーダ320の制御によって、実行履歴検索部410は、レジスタファイル340に格納される実行結果を取得する。これにより、実行履歴検索部410は、予告命令により特定された関数の識別情報に対応する入力値および実行結果を関連付けて履歴メモリ430に保持させることができる。
In this example, when the return instruction for ending the execution of the process in the function is supplied to the
また、実行履歴を削除する際の優先度が予告命令に含まれる場合には、実行履歴検索部410は、命令デコーダ320からの優先度と、優先度に対応する関数の入力値および実行結果とを関連付けて実行履歴として識別情報ごとに履歴メモリ430に保持させる。この場合において、実行履歴検索部410は、履歴メモリ430に保持された優先度に基づいて、履歴メモリ430における実行履歴を削除する。すなわち、実行履歴検索部410は、優先度が最も大きい識別情報に関連付けられた実行履歴から順番に、履歴メモリ430における実行履歴を削除する。なお、実行履歴検索部410は、特許請求の範囲に記載の実行履歴検索部の一例である。
When the priority at the time of deleting the execution history is included in the notice instruction, the execution
実行結果出力部420は、実行履歴検索部410によって履歴メモリ430から実行結果が抽出された場合には、その実行結果を、入力選択部332を介してレジスタファイル340に、または、ストアユニット334に出力するものである。この実行結果出力部420は、実行結果の格納場所によって、ストアユニット334または入力選択部332に実行結果のデータを出力する。なお、実行結果出力部420は、特許請求の範囲に記載の実行結果出力部の一例である。
If the execution result is extracted from the
履歴メモリ430は、識別情報ごとに識別情報に対応する入力値および実行結果を関連付けて実行履歴として保持するものである。この履歴メモリ430は、例えば、連想メモリ(CAM:Content Addressable Memory)により実現される。この例において、履歴メモリ430は、実行結果を検索するための検索キーである識別情報が実行履歴検索部410から入力されることによって、その識別情報に関連付けられた実行履歴の検索を開始する。
The
また、この履歴メモリ430は、実行履歴検索部410から順次供給された入力値と、履歴メモリ430に保持されている入力値とが全て一致する場合には、その保持された入力値に関連付けられた実行結果を実行履歴検索部410に出力する。すなわち、実行履歴検索部410から入力された識別情報および入力値と同一の実行履歴が履歴メモリ430から検出されることによって、実行履歴検索部410により履歴メモリ430から実行結果が抽出される。なお、履歴メモリ430は、特許請求の範囲に記載の履歴メモリの一例である。
Further, the
また、履歴メモリ430は、例えば、実行履歴検索部410から供給された優先度と、優先度に対応する関数の入力値および実行結果とを関連付けて実行履歴として識別情報ごとに保持する。また、この連想メモリにより実現される履歴メモリ430は、例えば、実行履歴における入力値のパターンを木構造により保持する。ここで、履歴メモリ430におけるデータ構造の例について図面を参照して以下に説明する。
Further, the
[履歴メモリ430のデータ構造例]
図3は、本発明の第1の実施の形態における履歴メモリ430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ430により、複数の関数を互いに識別する識別情報ごとに保持された実行履歴のうち、1つの識別情報における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。また、ここでは、関数の先頭アドレスである関数アドレスを識別情報として用いることとする。
[Data structure example of history memory 430]
FIG. 3 is a conceptual diagram showing an example of the data structure of the
この例では、木構造における関数ルート440と、第1の引数ノード451および452と、第nの引数ノード461乃至464と、第1の出力ノード471乃至474と、第mの出力ノード481乃至484とが示されている。
In this example, the
関数ルート440には、識別情報である関数アドレスと、第1の引数ノード451を指し示すポインタとが示されている。
In the
第1および第nの引数ノード451、452および461乃至464には、履歴メモリ430に保持されている実行履歴における引数の入力値として、引数の値を示す入力データと、その引数の型と、その引数の格納場所を示す種類とが示されている。ここにいう格納場所とは、レジスタファイル340のレジスタ番号または主記憶部130のメモリアドレスのことをいう。
The first and
さらに、第1および第nの引数ノード451、452および461乃至464には、比較対象の入力値が互いに一致した場合に次の引数における引数ノードを指し示す右ポインタと、不一致の場合に同一の引数における他の引数ノードを指し示す下ポインタとが示されている。また、第nの引数ノード461乃至464の各々に、第1および第mの出力ノード471乃至474および481乃至484がそれぞれ連結されている。
Further, the first and
第1および第mの出力ノード471乃至474および481乃至484には、履歴メモリ430に保持されている実行履歴における実行結果として、実行結果の値を示す出力データと、その実行結果の格納場所を示す種類と、その実行結果の型とが示されている。さらに、第1の出力ノード471乃至474には、次の出力ノードを指し示す右ポインタが示されている。この第1および第mの出力ノード471乃至474および481乃至484は、連結リストを構成している。また、第mの出力ノード481乃至484の右ポインタには、出力ノードの終端を表わすヌルが示されている。
In the first and m-
このような木構造において、関数ルート440に示された関数アドレスと一致する関数アドレスが実行履歴検索部410から入力されると、関数ルート440のポインタによって指し示された第1の引数ノード451において入力値の比較処理が実行される。ここにいう入力値の比較処理とは、第1の引数ノード451に示された入力データ、種類および型である入力値と、実行履歴検索部410からの入力値とを比較することである。
In such a tree structure, when a function address that matches the function address shown in the
このとき、例えば、第1の引数ノード451に示された入力値と実行履歴検索部410からの入力値とが一致した場合には、第1の引数ノード451の右ポインタにより指し示された次の引数ノードにおいて入力値の比較処理が実行される。一方、第1の引数ノード451に示された入力値と、実行履歴検索部410からの入力値とが一致しない場合には、第1の引数ノード451の下ポインタにより指し示された第1の引数ノード452において入力値の比較処理が実行される。
At this time, for example, when the input value indicated by the first argument node 451 matches the input value from the execution
このようにして、各引数ノードにおける比較処理による結果に基づいて右または下ポインタの指し示す引数ノードが選択され、その選択された引数ノードにおいて入力値の比較処理が順次実行される。例えば、第nの引数ノード461に示された入力値と、実行履歴検索部410からの入力値とが互いに一致した場合には、第nの引数ノード461の右ポインタにより第1の出力ノード471が指し示される。そして、第1の出力ノード471に保持された出力データ、種類および型を示す実行結果から順番に、第m番の出力ノード481に保持された実行結果までが実行履歴検索部410に順次出力される。
In this way, the argument node pointed to by the right or lower pointer is selected based on the result of the comparison process at each argument node, and the input value comparison process is sequentially executed at the selected argument node. For example, when the input value indicated by the nth argument node 461 and the input value from the execution
このように、履歴メモリ430を識別情報ごとに木構造により構成することによって、同じ引数の入力値を重複して保持させる必要が無いため、記憶領域を節約することができる。また、識別情報ごとにデータ構造を分けることによって、検索速度の低下を抑制することができる。
Thus, by configuring the
[識別情報を含む予告命令によるデータ処理装置100の動作例]
図4は、本発明の第1の実施の形態におけるデータ処理装置100において識別情報を含む予告命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。図4(a)は、アセンブリ言語により記述された命令列の一部を例示する図である。図4(a)には、インデックス(index)を指定する予告命令(noticeCall)と、関数(func)を呼び出すコール命令(Call)とが示されている。
[Example of operation of
FIG. 4 is a conceptual diagram showing an operation outline of the
図4(b)は、履歴メモリ430における識別情報ごとの実行履歴検索データの一例を示す概念図である。図4(b)には、インデックス(index)により示される識別情報(インデックス0乃至k)の列431と、実行履歴検索データ(実行履歴検索データ0乃至k)の列432との対応が示されている。ここにいう実行履歴検索データは、図3に示した木構造により構成される検索データのことを示す。
FIG. 4B is a conceptual diagram showing an example of execution history search data for each identification information in the
この場合において、予告命令(noticeCall)が命令デコーダ320に供給されることによって、インデックス(index)により示される識別情報「インデックスk」が、命令デコーダ320から実行履歴検索部410に供給される。そして、実行履歴検索部410により、識別情報「インデックスk」が履歴メモリ430に入力されることによって、この識別情報(インデックスk)によって識別される関数(func)における「実行履歴検索データk」に基づいて、実行履歴の検索が開始される。
In this case, the notice instruction (noticeCall) is supplied to the
その後、関数における引数の入力値を設定する入力値設定命令に基づいて、実行履歴検索部410において、関数(func)の引数の入力値が取得され、その取得された入力値が履歴メモリ430に順次入力される。これにより、識別情報「インデックスk」に対応する実行履歴検索データ(実行履歴検索データk)に保持された入力値と、実行履歴検索部410からの入力値との比較が順次行われる。
Thereafter, based on an input value setting command for setting an input value of an argument in the function, the execution
そして、コール命令(call)が命令デコーダ320に供給されることによって、実行履歴検索部410により取得された識別情報および入力値と一致する実行履歴の有無が履歴メモリ430から実行履歴検索部410に通知される。すなわち、実行履歴検索部410により、実行履歴検索データkによる検索結果として関数(func)の再利用できる実行結果の有無がコール命令(call)に基づいて参照される。
Then, when the call instruction (call) is supplied to the
このとき、履歴メモリ430から実行結果が出力された場合には、関数(func)の実行が省略される。一方、実行結果が出力されない場合には、関数(func)が実行されて、その実行された実行結果と、実行履歴検索部410によって既に取得された識別情報および入力値とが履歴メモリ430に保持される。
At this time, when the execution result is output from the
このように、データ処理装置100は、関数(func)のコール命令(call)を実行する前において、予告命令(noticeCall)に基づいて関数(func)の引数の入力値を取得する。そして、その関数(func)の入力値と、履歴メモリ430に保持された関数(func)の入力値との比較を終了させる。次に、識別情報を含む予告命令によるデータ処理装置100におけるより具体的な動作例について、MIPSによる命令コードを示す図面を参照して説明する。
As described above, the
[識別情報を含む予告命令による動作例]
図5は、本発明の第1の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。図5(a)は、再利用区間として選択された関数のソースプログラムの一部の例を示す図である。図5(b)は、図5(a)に示したソースプログラムがMIPSのアセンブリ言語により変換された命令列の一部を例示する図である。
[Operation example by notice command including identification information]
FIG. 5 is a diagram illustrating a part of a program executed by the
図5(a)の上段には、5つの引数(a乃至e)を持つ関数(func)の呼出しが記述されている。下段には、イント(int)型の関数(func)の定義が記述されている。この関数(func)は、イント(int)型の引数として、第1の引数(a)、第2の引数(b)、第3の引数(c)、第4の引数(d)および第5の引数(e)を持つ。このようなソースプログラムに対し、MIPSのアセンブリ言語により変換するとともに予告命令の挿入処理を施すことによって生成された命令列の一部が図5(b)に示されている。 In the upper part of FIG. 5A, a call to a function (func) having five arguments (a to e) is described. In the lower part, the definition of an int type function (func) is described. This function (func) is a first argument (a), second argument (b), third argument (c), fourth argument (d) and fifth argument as int type arguments. With an argument (e). FIG. 5B shows a part of an instruction sequence generated by converting such a source program by the MIPS assembly language and performing a notice instruction insertion process.
図5(b)には、第1の命令列(noticeCall)、第2の命令列(lw)、第3の命令列(lw)、第4の命令列(move)、第5の命令列(move)、第6の命令列(sw)、第7の命令列(lw)および第8の命令列(jalr)が示されている。ここでは、第1乃至第5引数の入力値A乃至Eが全て整数であることを想定している。 FIG. 5B shows a first instruction sequence (noticeCall), a second instruction sequence (lw), a third instruction sequence (lw), a fourth instruction sequence (move), a fifth instruction sequence ( move), sixth instruction sequence (sw), seventh instruction sequence (lw), and eighth instruction sequence (jalr). Here, it is assumed that the input values A to E of the first to fifth arguments are all integers.
第1の命令列において、インデックス(index)を指定する予告命令(noticeCall)が実行される。これにより、命令デコーダ320により供給されたインデックス(index)により示された識別情報が実行履歴検索部410から履歴メモリ430に入力されることによって、実行履歴の検索が行われる。
In the first instruction sequence, a notice instruction (noticeCall) designating an index (index) is executed. As a result, the identification information indicated by the index supplied by the
第2の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1000」が加算され、その加算された値によって指定される主記憶部130のメモリアドレスに記憶されたデータ(第1の引数の入力値A)がレジスタ4(R4)に転送される。
In the second instruction sequence, the load word instruction (lw) is executed. As a result, the offset value “1000” is added to the reference address stored in the register 28 (R28), and the data stored in the memory address of the
このロードワード命令(lw)は、そのロードワード命令(lw)に示された転送先レジスタ番号が「R4」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ4(R4)に転送される入力値Aが実行履歴検索部410にも供給されて、履歴メモリ430に保持されている第1の引数の入力値と比較される。このとき、履歴メモリ430に保持された第1の引数の入力値のうち、入力値Aが保持されていれば、第2の引数の入力値の比較処理に進む。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
The load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the
第3の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1004」が加算され、その加算された値によって指定される主記憶部130のメモリアドレスに記憶されたデータ(第2の引数の入力値B)がレジスタ5(R5)に転送される。
In the third instruction sequence, the load word instruction (lw) is executed. As a result, the offset value “1004” is added to the reference address stored in the register 28 (R28), and the data stored in the memory address of the
このロードワード命令(lw)は、そのロードワード命令(lw)に示される転送先レジスタ番号が「R5」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ5(R5)に格納される入力値Bが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第2の引数の入力値と比較される。このとき、履歴メモリ430に保持された第2の引数の入力値のうち、入力値Bが保持されていれば、第3の引数の入力値の比較処理に進む。一方、入力値Bが保持されていない場合には、実行履歴の検索を終了する。
The load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the
第4の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ10(R10)に格納されているデータ(第3の引数の入力値C)がレジスタ6(R6)に転送される。このムーブ命令(move)は、その転送先レジスタ番号が「R6」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ6(R6)に格納される入力値Cが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第3の引数の入力値と比較される。
In the fourth instruction sequence, a move instruction (move) is executed. Thereby, the data (the input value C of the third argument) stored in the register 10 (R10) is transferred to the register 6 (R6). Since the move instruction (move) has the transfer destination register number “R6”, the
このとき、履歴メモリ430に保持された第3の引数の入力値のうち入力値Cが保持されていれば、第4の引数の入力値の比較処理に進む。一方、入力値Cが保持されていない場合には、実行履歴の検索を終了する。
At this time, if the input value C is held among the input values of the third argument held in the
第5の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ11(R11)に格納されているデータ(第4の引数の入力値D)がレジスタ7(R7)に転送される。このムーブ命令(move)は、そのムーブ命令(move)に示される転送先レジスタ番号が「R7」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ7(R7)に格納される入力値Dが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第4の引数の入力値と比較される。
In the fifth instruction sequence, a move instruction (move) is executed. Thereby, the data (the input value D of the fourth argument) stored in the register 11 (R11) is transferred to the register 7 (R7). The move instruction (move) is determined to be an input value setting instruction for setting the input value of the argument by the
このとき、履歴メモリ430に保持された第4の引数の入力値のうち入力値Dが保持されていれば、第5の引数の入力値の比較処理に進む。一方、入力値Dが保持されていない場合には、実行履歴の検索を終了する。
At this time, if the input value D is held among the input values of the fourth argument held in the
第6の命令列において、ストアワード命令(sw)が実行される。これにより、レジスタ29(R29)に格納されているスタックポインタの値に「16」が加算され、その加算された値のメモリアドレスにレジスタ12(R12)に格納されているデータ(第5の引数の入力値E)が転送される。このストアワード命令(sw)は、そのストアワード命令(sw)に示される転送先レジスタ番号が「R29」であり、オフセット値が「16」以上であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。
In the sixth instruction sequence, a store word instruction (sw) is executed. As a result, “16” is added to the value of the stack pointer stored in the register 29 (R29), and the data (fifth argument) stored in the register 12 (R12) is added to the memory address of the added value. Input value E) is transferred. Since the transfer destination register number indicated by the store word instruction (sw) is “R29” and the offset value is “16” or more, this store word instruction (sw) is input with an argument by the
これにより、主記憶部130に転送された入力値Eが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第5の引数の入力値と比較される。このとき、履歴メモリ430に保持された第5の引数の入力値のうち、入力値Eが保持されていれば、全ての引数の入力値A乃至Eが一致する実行履歴における実行結果が実行履歴検索部410に出力される。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
Thus, the input value E transferred to the
第7の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスに、オフセット値「2000」が加算され、その加算された値のメモリアドレスに記憶されたデータ(関数funcの先頭アドレス)がレジスタ25(R25)に転送される。 In the seventh instruction sequence, the load word instruction (lw) is executed. As a result, the offset value “2000” is added to the reference address stored in the register 28 (R28), and the data (start address of the function func) stored in the memory address of the added value is stored in the register 25 ( R25).
このロードワード命令(lw)は、そのロードワード命令(lw)に示される転送先レジスタ番号が「R25」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令でないと判断される。このため、実行履歴検索部410により、入力選択部332から出力されたデータは取得されない。
The load word instruction (lw) is not an input value setting instruction for setting the input value of the argument by the
第8の命令列において、ジャンプ命令(jalr)が実行される。これにより、レジスタ25(R25)に格納されている関数(func)の先頭アドレスの命令が読み出される。このとき、命令デコーダ320により、関数(func)における全ての第1乃至第5引数の入力値の設定が終了したことを示す入力値終了信号が実行履歴検索部410に通知される。
In the eighth instruction sequence, a jump instruction (jalr) is executed. As a result, the instruction at the head address of the function (func) stored in the register 25 (R25) is read. At this time, the
このとき、履歴メモリ430から実行結果が出力されていれば、実行履歴検索部410により、その実行結果が実行結果出力部420に出力されるとともに、関数(func)の処理を省略するための省略信号がフェッチ部310に供給される。一方、履歴メモリ430から実行結果が出力されていなければ、実行履歴検索部410により、関数(func)の実行後の実行結果と、予告命令に基づいて取得された識別情報および入力値とが履歴メモリ430に登録される。
At this time, if an execution result is output from the
次に、履歴メモリ430に保持された実行履歴と、実行履歴検索部410により取得された識別情報および入力値とが一致した場合において予告命令により関数の処理時間が短縮される例について以下に図面を参照して説明する。
Next, an example in which the processing time of the function is shortened by the notice command when the execution history held in the
[データ処理装置100による関数処理の時間短縮例]
図6は、予告命令の実行により関数における処理時間が短縮される例を示す概念図である。図6(a)は、予告命令のないプログラムの処理を実行する従来のデータ処理装置における実行結果の再利用による短縮時間を示す概念図である。図6(b)は、本発明の第1の実施の形態におけるデータ処理装置100における実行結果の再利用による短縮時間を示す概念図である。
[Example of time reduction of function processing by data processing apparatus 100]
FIG. 6 is a conceptual diagram showing an example in which the processing time in the function is shortened by executing the notice instruction. FIG. 6A is a conceptual diagram showing a shortened time due to reuse of execution results in a conventional data processing apparatus that executes processing of a program without a notice instruction. FIG. 6B is a conceptual diagram showing a shortened time by reusing the execution result in the
図6(a)および(b)では、上位ルーチンにおいて2つの引数を持つ関数がコール命令(call)によって呼び出され、その関数における処理の終了に伴うリターン命令(return)によって下位ルーチンから復帰する例が示されている。また、ここでは、左から右に時間が経過することとする。 6 (a) and 6 (b), an example in which a function having two arguments is called by a call instruction (call) in the upper routine and returns from the lower routine by a return instruction (return) upon completion of processing in the function. It is shown. Here, time passes from the left to the right.
図6(a)には、上位ルーチンにおける入力値A設定321および入力値B設定322と、下位ルーチンにおける入力値A使用323および入力値B使用324とが示されている。
FIG. 6A shows an input value A setting 321 and an input value B setting 322 in the upper routine, and an input value A use 323 and an input
入力値A設定321および入力値B設定322は、関数における引数の入力値が設定されるタイミングを示す。これは、図1で述べたとおり、ABIの規定に従って記述されたプログラムによる処理手順である。また、入力値A使用323および入力値B使用324は、下位ルーチンである関数の処理において引数である入力値が使用されるタイミングを示す。
The input value A setting 321 and the input value B setting 322 indicate the timing when the input value of the argument in the function is set. As described in FIG. 1, this is a processing procedure by a program described in accordance with the ABI rules. The input value A use 323 and the input
この場合には、下位ルーチンにおいて2つの引数が全て使用(入力値B使用324)されるまで、関数の引数である入力値AおよびBを特定することができない。このため、関数の引数である入力値AおよびBが、履歴メモリ430に保持されている入力値と全て一致したときであっても、入力値B使用324からリターン命令(return)までの短縮期間t1だけしか関数の処理時間を削減することができない。
In this case, the input values A and B that are the arguments of the function cannot be specified until all the two arguments are used in the lower-level routine (use of the input value B 324). Therefore, even when the input values A and B, which are arguments of the function, all match the input values held in the
図6(b)には、図6(a)に示したタイミングに加えて予告命令421が示されている。この予告命令421は、命令デコーダ320によって予告命令がデコードされるタイミングを示す。予告命令421以外は、図6(a)と同様のものを示しているため、図6(a)と同一符号を付してここでの説明を省略する。
FIG. 6B shows a
この場合には、関数を識別するための識別情報が予告命令421により特定されるため、履歴メモリ430の検索キーである識別情報を履歴メモリ430に入力することによって、関数の実行履歴の検索が開始される。そして、実行履歴検索部410により、引数の入力値AおよびBを設定するための2つの入力値設定命令に基づいて取得された入力値AおよびBが、履歴メモリ430に供給される。
In this case, since the identification information for identifying the function is specified by the
その後、コール命令(call)に基づいて、その取得された入力値AおよびBと、履歴メモリ430に保持されている入力値とが全て一致したか否かが判断される。そして、全て一致した場合には、関数である下位ルーチン(callからreturnまで)の処理に要する短縮期間t2が削減される。
Thereafter, based on the call command (call), it is determined whether or not the acquired input values A and B match all the input values held in the
このように、データ処理装置100は、予告命令に含まれる識別情報および引数の入力値を予告命令に基づいて取得することによって、実行履歴検索期間tにおいて履歴メモリ430に対する実行結果の検索を終了させることができる。これにより、履歴メモリ430に保持された実行結果が再利用できる場合には、短縮することができる期間(短縮期間t2)を、従来の短縮期間t1よりも長くすることができる。
As described above, the
[データ処理装置100の動作例]
次に本発明の実施の形態におけるデータ処理装置100の動作について図面を参照して説明する。
[Operation Example of Data Processing Device 100]
Next, the operation of the
図7は、本発明の第1の実施の形態におけるデータ処理装置100の実行結果再利用方法の処理手順の一例を示すフローチャートである。
FIG. 7 is a flowchart illustrating an example of a processing procedure of the execution result reusing method of the
まず、命令デコーダ320により、フェッチ部310から供給された予告命令が解読される(ステップS911)。そして、命令デコーダ320により、予告命令により特定された識別情報である履歴メモリ430の検索キーが実行履歴検索部410に供給されることによって、実行履歴検索部410において識別情報が取得される。すなわち、実行履歴検索部410により、予告命令に含まれる識別情報が取得されて、その取得された識別情報が実行履歴検索部410から履歴メモリ430に入力される(ステップS912)。これにより、履歴メモリ430における識別情報に対応する複数の実行履歴の検索が開始される。なお、ステップS912は、特許請求の範囲に記載の取得手順の一例である。
First, the
続いて、フェッチ部310により、予告命令の次に実行されるべき命令が読み出される(ステップS913)。この後、命令デコーダ320により、フェッチ部310から読み出された命令が、関数の第1の引数の入力値を設定するための入力値設定命令か否かが判断される(ステップS914)。
Subsequently, the fetch
そして、入力値設定命令であると判断された場合には、命令デコーダ320により、入力値設定命令によって設定された引数の入力値が実行履歴検索部410に供給されることによって、実行履歴検索部410において引数の入力値が取得される(ステップS921)。なお、ステップS921は、特許請求の範囲に記載の取得手順の一例である。
If it is determined that the instruction is an input value setting command, the
続いて、実行履歴検索部410により取得された引数の入力値が、履歴メモリ430における識別情報に関連付けられた引数の入力値と一致するか否かが判断される(ステップS922)。そして、両者の入力値が一致しない場合には、ステップS913の処理に戻る。
Subsequently, it is determined whether or not the input value of the argument acquired by the execution
一方、両者の入力値が一致した場合には、履歴メモリ430において、次の引数の入力値を比較するための次の引数ノードにポインタが進められて(ステップS923)、ステップS913の処理に戻る。すなわち、複数の引数ノードのうち、実行履歴検索部410からの入力値と一致する引数ノードがあれば、その引数ノードの右ポインタによって、次の引数ノードが指し示される。
On the other hand, if the two input values match, the pointer is advanced to the next argument node for comparing the input values of the next argument in the history memory 430 (step S923), and the process returns to step S913. . That is, if there is an argument node that matches the input value from the execution
このようにして、全ての引数の入力値が設定されるまで、ステップS913、S914、S921乃至S923における一連の処理が繰り返し実行される。なお、ステップS922およびS923は、特許請求の範囲に記載の実行履歴検索手順の一例である。 In this way, a series of processes in steps S913, S914, and S921 to S923 are repeatedly executed until the input values of all the arguments are set. Steps S922 and S923 are an example of an execution history search procedure described in the claims.
一方、ステップS914の処理において入力値設定命令でないと判断された場合には、命令デコーダ320により、フェッチ部310から読み出された命令が、関数を呼び出す呼出し命令であるか否かが判断される(ステップS915)。そして、呼出し命令でないと判断された場合には、ステップS913の処理に戻る。
On the other hand, if it is determined in step S914 that the instruction is not an input value setting instruction, the
一方、呼出し命令と判断された場合には、入力値設定命令により設定された入力値が、履歴メモリ430における識別情報に関連付けられた入力値と全て一致したか否かが判断される(ステップS916)。そして、全ての入力値が一致した場合には、実行結果再利用処理が実行される(ステップS924)。すなわち、実行履歴検索部410により取得された識別情報および入力値に対応する履歴メモリ430における実行結果が、実行結果出力部420から出力される。そして、主記憶部130またはレジスタファイル340に書き戻されて、呼び出される関数の処理を終了する。なお、S924は、特許請求の範囲に記載の実行結果出力手順の一例である。
On the other hand, if it is determined that the instruction is a call instruction, it is determined whether or not the input values set by the input value setting instruction all match the input values associated with the identification information in the history memory 430 (step S916). ). If all input values match, an execution result reuse process is executed (step S924). That is, the execution result in the
一方、全ての入力値が一致しない場合には、呼び出された関数が実行される(ステップS917)。そして、実行履歴検索部410により、実行された関数の実行結果が取得される(ステップS918)。続いて、実行履歴検索部410により、その取得された実行結果と、ステップS912およびS921により取得された入力値とを履歴メモリ430に登録される(ステップS919)。
On the other hand, if all input values do not match, the called function is executed (step S917). Then, the execution
このように、本発明の第1の実施の形態では、関数の実行を予告する予告命令によって、関数の識別情報と、その予告命令の後に実行される入力値設定命令により設定される入力値とを、関数の実行前に特定することができる。これにより、関数が呼び出されるときに、その特定された識別情報および入力値と一致する履歴メモリ430における実行履歴を抽出することができる。また、履歴メモリ430から実行履歴における実行結果が抽出された場合には、呼出し命令により呼び出される関数の実行を省略することができるため、実行結果の再利用による関数の処理時間を大幅に削減することができる。
As described above, in the first embodiment of the present invention, the function identification information and the input value set by the input value setting command executed after the notice command are notified by the notice command for notifying the execution of the function. Can be specified before the function is executed. Thereby, when a function is called, an execution history in the
なお、本発明の第1の実施の形態では、履歴メモリ430の検索キーである識別情報を予告命令に含める例について説明したが、識別情報を関数の先頭アドレスとし、関数の先頭アドレスを参照するための参照情報を予告命令に含めるようにしてもよい。そこで、参照情報を含む予告命令に基づいて履歴メモリ430における実行履歴を検索する例を第2の実施の形態として以下に図面を参照して説明する。
In the first embodiment of the present invention, the example in which the identification information that is the search key of the
<第2の実施の形態>
[参照情報を含む予告命令によるデータ処理装置100の動作例]
図8は、本発明の第2の実施の形態におけるデータ処理装置100において参照情報を含む予告命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。ここでは、履歴メモリ430の検索キーである識別情報として関数の先頭アドレスである関数アドレスを用いることを想定している。
<Second Embodiment>
[Operation example of
FIG. 8 is a conceptual diagram showing an outline of the operation of the
図8(a)は、アセンブリ言語により記述された命令列の一部を例示する図である。図8(a)には、関数アドレスをレジスタ25(R25)に設定するロードワード命令(lw)と、参照情報(R25)を含む予告命令(noticeCall)とが示されている。また、ここでは、レジスタ25(R25)に格納された関数を呼び出すコール命令(Call)が示されている。 FIG. 8A is a diagram illustrating a part of an instruction sequence described in assembly language. FIG. 8A shows a load word instruction (lw) for setting a function address in the register 25 (R25) and a notice instruction (noticeCall) including reference information (R25). Further, here, a call instruction (Call) for calling a function stored in the register 25 (R25) is shown.
このように、予告命令(noticeCall)の参照情報には、関数アドレスが格納されているレジスタ番号(R25)が示される。また、このような参照情報を含む予告命令を生成する場合には、コンパイル処理において、関数アドレスを設定するロードワード命令(lw)を予告命令の前に生成することを想定している。 As described above, the reference number of the notice instruction (noticeCall) indicates the register number (R25) in which the function address is stored. Further, when generating a warning instruction including such reference information, it is assumed that a load word instruction (lw) for setting a function address is generated before the warning instruction in the compilation process.
図8(b)は、履歴メモリ430における識別情報である関数アドレスごとの実行履歴検索データの一例を示す概念図である。図8(b)には、参照情報(R25)に示されるレジスタ25(R25)に格納されている関数アドレス(関数アドレス0乃至k)の列433と、実行履歴検索データ(実行履歴検索データ0乃至k)の列434との対応表が示されている。ここにいう実行履歴検索データは、図3に示した木構造によって構成される検索データのことを示す。
FIG. 8B is a conceptual diagram showing an example of execution history search data for each function address, which is identification information in the
この場合において、命令デコーダ320は、予告命令(noticeCall)に含まれる参照情報(R25)に基づいて、レジスタ25(R25)に格納されている「関数アドレス1」を実行履歴検索部410に出力させる。すなわち、実行部330は、参照情報を含む予告命令に基づいて関数アドレス「関数アドレス1」を実行履歴検索部410に出力する。そして、実行履歴検索部410により、その「関数アドレス1」が履歴メモリ430に入力されることによって、その関数アドレス1に対応する実行履歴検索データ1に基づいて、実行履歴の検索が開始される。
In this case, the
その後、関数における引数の入力値を設定するための入力値設定命令に基づいて、実行履歴検索部410において、関数における引数の入力値が保持され、その保持された入力値が履歴メモリ430に順次入力される。これにより、関数アドレス(関数アドレス1)に対応する実行履歴検索データ(実行履歴検索データ1)に保持された入力値と、実行履歴検索部410からの入力値との比較が順次行われる。
Thereafter, based on the input value setting command for setting the input value of the argument in the function, the execution
そして、コール命令(call)が命令デコーダ320に供給されることによって、実行履歴検索部410により取得された関数アドレスおよび入力値と一致する実行履歴の有無が、履歴メモリ430から実行履歴検索部410に通知される。すなわち、実行履歴検索部410により、関数アドレス1に対応する実行履歴検索データ1による検索結果として、再利用できる実行結果の有無がコール命令(call)に基づいて参照される。
Then, when the call instruction (call) is supplied to the
このとき、履歴メモリ430から実行結果が出力された場合には、関数の実行が省略される。一方、実行結果が出力されない場合には、関数の処理がそのまま実行されて、その実行された実行結果と、実行履歴検索部410によって既に保持されている識別情報および入力値とが履歴メモリ430に登録される。
At this time, when the execution result is output from the
このように、データ処理装置100は、関数(関数アドレス1)のコール命令(call)の実行前に、予告命令(noticeCall)に含まれる参照情報に基づいて、履歴メモリ430の検索キーである識別情報(関数アドレス1)を取得することができる。次に、参照情報を含む予告命令によるデータ処理装置100におけるより具体的な動作例について、MIPSによる命令コードを示す図面を参照して説明する。
As described above, the
[参照情報を含む予告命令によるデータ処理装置100の具体的な動作例]
図9は、本発明の第2の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。図9(a)は、再利用区間として選択された関数のソースプログラムの一部の例を示す図である。図5(b)は、図5(a)に示したソースプログラムがMIPSのアセンブリ言語により変換された命令列の一部を例示する図である。
[Specific operation example of the
FIG. 9 is a diagram illustrating a part of a program executed by the
図9(a)の上段には、5つの引数(a乃至e)を持つ関数(func)の呼出しが記述されている。下段には、イント(int)型の関数(func)の定義が記述されている。この関数(func)は、イント(int)型の引数として、第1の引数(a)、第2の引数(b)、第3の引数(c)、第4の引数(d)および第5の引数(e)を持つ。このようなソースプログラムに対し、MIPSのアセンブリ言語により変換するとともに予告命令の挿入処理を施すことによって生成された命令列の一部が図9(b)に示されている。 In the upper part of FIG. 9A, a call to a function (func) having five arguments (a to e) is described. In the lower part, the definition of an int type function (func) is described. This function (func) is a first argument (a), second argument (b), third argument (c), fourth argument (d) and fifth argument as int type arguments. With an argument (e). FIG. 9B shows a part of an instruction sequence generated by converting such a source program by the MIPS assembly language and performing a notice instruction insertion process.
図9(b)には、第1の命令列(lw)、第2の命令列(noticeCall)、第3の命令列(lw)、第4の命令列(lw)、第5の命令列(move)、第6の命令列(move)、第7の命令列(sw)、および第8の命令列(jalr)が示されている。ここでは、関数の引数の入力値A乃至Eが全て整数であることを想定している。 In FIG. 9B, the first instruction sequence (lw), the second instruction sequence (noticeCall), the third instruction sequence (lw), the fourth instruction sequence (lw), the fifth instruction sequence ( move), sixth instruction sequence (move), seventh instruction sequence (sw), and eighth instruction sequence (jalr). Here, it is assumed that input values A to E of function arguments are all integers.
第1の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスに、オフセット値「2000」が加算され、その加算された値のメモリアドレスに記憶されたデータ(関数funcの先頭アドレス)がレジスタ25(R25)に転送される。このように、主記憶部130から読み出された関数の先頭アドレスをレジスタファイル340に設定するロードワード命令を、ここではアドレス設定命令という。
In the first instruction sequence, the load word instruction (lw) is executed. As a result, the offset value “2000” is added to the reference address stored in the register 28 (R28), and the data (start address of the function func) stored in the memory address of the added value is stored in the register 25 ( R25). Thus, the load word instruction that sets the start address of the function read from the
第2の命令列において、参照情報(R25)を含む予告命令(noticeCall)が実行される。これにより、命令デコーダ320の制御により、参照情報(R25)に基づいて、レジスタ25に格納された識別情報である関数アドレスが実行履歴検索部410に出力される。すなわち、実行部330により、参照情報を含む予告命令に基づいて関数アドレスが実行履歴検索部410に出力される。そして、実行履歴検索部410により、その関数アドレスが履歴メモリ430に入力されることによって、実行履歴の検索が行われる。
In the second instruction sequence, a notice instruction (noticeCall) including reference information (R25) is executed. Thereby, under the control of the
第3の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1000」が加算され、その加算された値である主記憶部130のメモリアドレスに記憶されたデータ(第1の引数の入力値A)がレジスタ4(R4)に転送される。
In the third instruction sequence, the load word instruction (lw) is executed. As a result, the offset value “1000” is added to the reference address stored in the register 28 (R28), and the data (first argument of the first argument) stored in the memory address of the
このロードワード命令(lw)は、そのロードワード命令(lw)に示される転送先レジスタ番号が「R4」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ4(R4)に転送される入力値Aが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第1の引数の入力値と比較される。このとき、履歴メモリ430に保持された第1の引数の入力値のうち、入力値Aが保持されていれば、第2の引数の入力値の比較処理に進む。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
The load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the
第4の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1004」が加算され、その加算された値である主記憶部130のメモリアドレスに記憶されたデータ(第2の引数の入力値B)がレジスタ5(R5)に転送される。
In the fourth instruction sequence, the load word instruction (lw) is executed. As a result, the offset value “1004” is added to the reference address stored in the register 28 (R28), and the data (the second argument of the second argument) stored in the memory address of the
このロードワード命令(lw)は、そのロードワード命令(lw)に示された転送先レジスタ番号が「R5」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ5(R5)に格納される入力値Bが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第2の引数の入力値と比較される。このとき、履歴メモリ430に保持された第2の引数の入力値のうち、入力値Bが保持されていれば、第3の引数の入力値の比較処理に進む。一方、入力値Bが保持されていない場合には、実行履歴の検索を終了する。
The load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the
第5の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ10(R10)に格納されているデータ(第3の引数の入力値C)が、レジスタ6(R6)に転送される。このムーブ命令(move)は、そのムーブ命令(move)に示された転送先レジスタ番号が「R6」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ6(R6)に格納される入力値Cが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第3の引数の入力値と比較される。
In the fifth instruction sequence, a move instruction (move) is executed. Thereby, the data (the input value C of the third argument) stored in the register 10 (R10) is transferred to the register 6 (R6). The move instruction (move) is an input value setting instruction for setting the input value of the argument by the
このとき、履歴メモリ430に保持された第3の引数の入力値のうち入力値Cが保持されていれば、第4の引数の入力値の比較処理に進む。一方、入力値Cが保持されていない場合には、実行履歴の検索を終了する。
At this time, if the input value C is held among the input values of the third argument held in the
第6の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ11(R11)に格納されているデータ(第4の引数の入力値D)がレジスタ7(R7)に転送される。このムーブ命令(move)は、そのムーブ命令(move)に示された転送先レジスタ番号が「R7」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると特定される。このため、レジスタ7(R7)に格納される入力値Dが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第4の引数の入力値と比較される。
In the sixth instruction sequence, a move instruction (move) is executed. Thereby, the data (the input value D of the fourth argument) stored in the register 11 (R11) is transferred to the register 7 (R7). The move instruction (move) is an input value setting instruction for setting the input value of the argument by the
このとき、履歴メモリ430に保持された第4の引数の入力値のうち入力値Dが保持されていれば、第5の引数の入力値の比較処理に進む。一方、入力値Dが保持されていない場合には、実行履歴の検索を終了する。
At this time, if the input value D is held among the input values of the fourth argument held in the
第7の命令列において、ストアワード命令(sw)が実行される。これにより、レジスタ29(R29)に格納されているスタックポインタの値に「16」が加算され、その加算された値のメモリアドレスにレジスタ12(R12)に格納されているデータ(第5の引数の入力値E)が転送される。このストアワード命令(sw)は、そのストアワード命令(sw)に示された転送先レジスタ番号が「R29」であり、オフセット値が「16」以上であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。 In the seventh instruction sequence, a store word instruction (sw) is executed. As a result, “16” is added to the value of the stack pointer stored in the register 29 (R29), and the data (fifth argument) stored in the register 12 (R12) is added to the memory address of the added value. Input value E) is transferred. This store word instruction (sw) has the transfer destination register number “R29” indicated by the store word instruction (sw) and the offset value is “16” or more. It is determined that this is an input value setting command for setting an input value.
これにより、主記憶部130に転送された入力値Eが実行履歴検索部410にも供給され、その供給された入力値Eと、履歴メモリ430に保持されている第5の引数の入力値とが比較される。このとき、履歴メモリ430に保持された第5の引数の入力値のうち、入力値Eが保持されていれば、全ての引数の入力値A乃至Eが一致する実行履歴における実行結果が実行履歴検索部410に出力される。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
As a result, the input value E transferred to the
第8の命令列において、ジャンプ命令(jalr)が実行される。これにより、レジスタ25(R25)に格納されている関数(func)の先頭アドレスの命令が読み出される。このとき、命令デコーダ320により、関数(func)における全ての第1乃至第5引数の入力値の設定が終了したことを示す入力値終了信号が、実行履歴検索部410に通知される。
In the eighth instruction sequence, a jump instruction (jalr) is executed. As a result, the instruction at the head address of the function (func) stored in the register 25 (R25) is read. At this time, the
このとき、履歴メモリ430から実行結果が出力されていれば、実行履歴検索部410により、その実行結果が実行結果出力部420に出力されるとともに、関数(func)の処理を省略するための省略信号がフェッチ部310に供給される。一方、履歴メモリ430から実行結果が出力されていなければ、実行履歴検索部410により、関数(func)の実行後の実行結果と、予告命令に基づいて取得された識別情報および入力値とが履歴メモリ430に登録される。
At this time, if an execution result is output from the
このように、本発明の第2の実施の形態では、実行履歴検索部410は、予告命令により識別される関数が実行される前において、予告命令に含まれる参照情報に基づいて関数の先頭アドレスを識別情報として取得することができる。これにより、実行履歴検索部410は、識別情報として実行部330から出力された再利用区間である関数の先頭アドレスと、関数の入力値とに基づいて、履歴メモリ430に保持された実行履歴における実行結果を検索することができる。
As described above, in the second embodiment of the present invention, the execution
すなわち、実行結果再利用処理部400は、参照情報を含む予告命令によって、実行履歴検索部410において識別情報および入力値を取得することができるため、関数の実行前に、履歴メモリ430に保持された実行履歴を検索することができる。
That is, the execution result
なお、ここでは、参照情報を含む予告命令により関数アドレスを取得する例について説明したが、関数アドレスを設定するためのアドレス設定命令を予告命令とする予告設定命令を用いるようにしてもよい。次に、予告設定命令を契機に履歴メモリ430に保持された実行履歴を検索する例を第3の実施の形態として以下に図面を参照して説明する。
Here, an example in which a function address is acquired by a notice command including reference information has been described. However, a notice setting command using an address setting command for setting a function address as a notice command may be used. Next, an example in which an execution history held in the
<第3の実施の形態>
[参照情報を含む予告命令によるデータ処理装置100の動作例]
図10は、本発明の第3の実施の形態におけるデータ処理装置100において予告設定命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。ここでは、履歴メモリ430の検索キーである識別情報として関数の先頭アドレスである関数アドレスを用いることを想定している。
<Third Embodiment>
[Operation example of
FIG. 10 is a conceptual diagram showing an outline of the operation of the
図10(a)は、アセンブリ言語により記述された命令列の一部を例示する図である。図10(a)には、関数アドレスをレジスタ25(R25)に設定する予告設定命令(memolw)と、レジスタ25(R25)に格納された関数アドレスに対応する関数を呼び出すコール命令(Call)が示されている。 FIG. 10A is a diagram illustrating a part of an instruction sequence described in assembly language. FIG. 10A shows a notice setting instruction (memolw) for setting a function address in the register 25 (R25) and a call instruction (Call) for calling a function corresponding to the function address stored in the register 25 (R25). It is shown.
このように、予告設定命令(memolw)を用いることによって、第2の実施の形態と比べて、関数アドレスをレジスタ25(R25)に設定するアドレス設定命令(lw)を省略することができる。 In this way, by using the notice setting instruction (memolw), the address setting instruction (lw) for setting the function address in the register 25 (R25) can be omitted as compared with the second embodiment.
図10(b)は、履歴メモリ430における識別情報である関数アドレスごとの実行履歴検索データの一例を示す概念図である。図10(b)には、予告設定命令(memolw)によってレジスタ25(R25)に設定される関数アドレス(関数アドレス0乃至k)の列435と、実行履歴検索データ(実行履歴検索データ0乃至k)の列436との対応表が示されている。ここにいう実行履歴検索データは、図3に示した木構造によって構成される検索データのことを示す。
FIG. 10B is a conceptual diagram showing an example of execution history search data for each function address, which is identification information in the
この場合において、命令デコーダ320は、予告設定命令(memolw)に指定された設定情報に示されたレジスタ25(R25)に「関数アドレス1」を設定するとともに、実行履歴検索部410に「関数アドレス1」を取得させる。すなわち、実行部330は、関数の先頭アドレスの設定先(R25)を示す設定情報を含む予告設定命令(memolw)基づいて、関数の先頭アドレス「関数アドレス1」を設定先(R25)に設定する。
In this case, the
そして、実行履歴検索部410により、その「関数アドレス1」が履歴メモリ430に入力されることによって、その関数アドレス1に対応する「実行履歴検索データ1」に基づいて、実行履歴の検索が開始される。
Then, when the “
その後、関数における引数の入力値を設定するための入力値設定命令に基づいて、実行履歴検索部410において、引数の入力値が取得され、その取得された入力値が履歴メモリ430に順次入力される。これにより、関数アドレス(関数アドレス1)に対応する実行履歴検索データ(実行履歴検索データ1)に保持された入力値と、実行履歴検索部410からの入力値との比較が順次行われる。
Thereafter, based on the input value setting command for setting the input value of the argument in the function, the execution
そして、コール命令(call)が命令デコーダ320に供給されることによって、実行履歴検索部410により取得された関数アドレス(関数アドレス1)および入力値と一致する実行履歴の有無が履歴メモリ430から実行履歴検索部410に通知される。すなわち、実行履歴検索部410により、関数アドレス1に対応する実行履歴検索データ1による検索結果がコール命令(call)に基づいて参照される。
Then, the call instruction (call) is supplied to the
このとき、履歴メモリ430から実行結果が出力された場合には、関数の実行が省略される。一方、実行結果が出力されない場合には、関数の処理が実行されて、その実行された実行結果と、実行履歴検索部410によって既に取得された識別情報である関数アドレスおよび入力値とが履歴メモリ430に保持される。
At this time, when the execution result is output from the
このように、データ処理装置100は、関数(関数アドレス1)のコール命令(call)を実行する前に、予告設定命令(memolw)により設定される関数アドレス(関数アドレス1)を実行履歴検索部410において取得することができる。次に、予告設定命令によるデータ処理装置100におけるより具体的な動作例について、MIPSによる命令コードを示す図面を参照して説明する。
As described above, the
[予告設定命令によるデータ処理装置100の具体的な動作例]
図11は、本発明の第3の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。図11(a)の上段には、5つの引数(a乃至e)を持つ関数(func)の呼出しが記述されている。下段には、イント(int)型の関数(func)の定義が記述されている。この関数(func)は、イント(int)型の引数として、第1の引数(a)、第2の引数(b)、第3の引数(c)、第4の引数(d)および第5の引数(e)を持つ。
[Specific operation example of
FIG. 11 is a diagram illustrating a part of a program executed by the
このようなソースプログラムに対し、MIPSのアセンブリ言語により変換するとともに予告命令の挿入処理を施すことによって生成された命令列の一部が図11(b)に示されている。 FIG. 11B shows a part of an instruction sequence generated by converting such a source program by the MIPS assembly language and performing a notice instruction insertion process.
図11(b)には、第1の命令列(memolw)、第2の命令列(lw)、第3の命令列(lw)、第4の命令列(move)、第5の命令列(move)、第6の命令列(sw)、および第7の命令列(jalr)が示されている。ここでは、関数の引数の入力値A乃至Eが全て整数であることを想定している。 In FIG. 11B, the first instruction sequence (memolw), the second instruction sequence (lw), the third instruction sequence (lw), the fourth instruction sequence (move), the fifth instruction sequence ( move), a sixth instruction string (sw), and a seventh instruction string (jalr). Here, it is assumed that input values A to E of function arguments are all integers.
第1の命令列において、予告設定命令(memolw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスに、オフセット値「2000」が加算され、その加算された値のメモリアドレスに記憶されたデータ(関数funcの先頭アドレス)がレジスタ25(R25)に転送される。すなわち、実行部330は、予告設定命令に含まれる関数の先頭アドレスの設定先を示す設定情報を基づいて、関数の先頭アドレスを設定先に設定する。
In the first instruction sequence, a notice setting instruction (memolw) is executed. As a result, the offset value “2000” is added to the reference address stored in the register 28 (R28), and the data (start address of the function func) stored in the memory address of the added value is stored in the register 25 ( R25). That is, the
これとともに、命令デコーダ320により供給される取得信号に基づいて、入力選択部332から出力される関数アドレスが実行履歴検索部410により取得される。そして、実行履歴検索部410によりその関数アドレスが履歴メモリ430に入力されることによって、実行履歴の検索が行われる。
At the same time, the function history output from the
第2の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1000」が加算され、その加算された値である主記憶部130のメモリアドレスに記憶されたデータ(第1の引数の入力値A)がレジスタ4(R4)に転送される。
In the second instruction sequence, the load word instruction (lw) is executed. As a result, the offset value “1000” is added to the reference address stored in the register 28 (R28), and the data (first argument of the first argument) stored in the memory address of the
このロードワード命令(lw)は、そのロードワード命令(lw)に示された転送先レジスタ番号が「R4」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ4(R4)に転送される入力値Aが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第1の引数の入力値と比較される。
The load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the
このとき、履歴メモリ430に保持された第1の引数の入力値のうち、入力値Aが保持されていれば、第2の引数の入力値の比較処理に進む。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
At this time, if the input value A is held among the input values of the first argument held in the
第3の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1004」が加算され、その加算された値である主記憶部130のメモリアドレスに記憶されたデータ(第2の引数の入力値B)がレジスタ5(R5)に転送される。
In the third instruction sequence, the load word instruction (lw) is executed. As a result, the offset value “1004” is added to the reference address stored in the register 28 (R28), and the data (the second argument of the second argument) stored in the memory address of the
このロードワード命令(lw)は、そのロードワード命令(lw)に示された転送先レジスタ番号が「R5」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ5(R5)に格納される入力値Bが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第2の引数の入力値と比較される。
The load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the
このとき、履歴メモリ430に保持された第2の引数の入力値のうち、入力値Bが保持されていれば、第3の引数の入力値の比較処理に進む。一方、入力値Bが保持されていない場合には、実行履歴の検索を終了する。
At this time, if the input value B is held among the input values of the second argument held in the
第4の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ10(R10)に格納されているデータ(第3の引数の入力値C)がレジスタ6(R6)に転送される。このムーブ命令(move)は、その転送先レジスタ番号が「R6」であることから、命令デコーダ320により引数の入力値を設定する入力値設定命令であると判断される。これにより、レジスタ6(R6)に格納される入力値Cが実行履歴検索部410にも供給されるため、実行履歴検索部410に供給された入力値Cと、履歴メモリ430に保持されている第3の引数の入力値とが比較される。
In the fourth instruction sequence, a move instruction (move) is executed. Thereby, the data (the input value C of the third argument) stored in the register 10 (R10) is transferred to the register 6 (R6). Since the move instruction (move) has a transfer destination register number “R6”, the
このとき、履歴メモリ430に保持された第3の引数の入力値のうち入力値Cが保持されていれば、第4の引数の入力値の比較処理に進む。一方、入力値Cが保持されていない場合には、実行履歴の検索を終了する。
At this time, if the input value C is held among the input values of the third argument held in the
第5の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ11(R11)に格納されているデータ(第4の引数の入力値D)がレジスタ7(R7)に転送される。このムーブ命令(move)は、そのムーブ命令(move)に示された転送先レジスタ番号が「R7」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると特定される。このため、レジスタ7(R7)に格納される入力値Dが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第4の引数の入力値と比較される。
In the fifth instruction sequence, a move instruction (move) is executed. Thereby, the data (the input value D of the fourth argument) stored in the register 11 (R11) is transferred to the register 7 (R7). The move instruction (move) is an input value setting instruction for setting the input value of the argument by the
このとき、履歴メモリ430に保持された第4の引数の入力値のうち入力値Dが保持されていれば、第5の引数の入力値の比較処理に進む。一方、入力値Dが保持されていない場合には、実行履歴の検索を終了する。
At this time, if the input value D is held among the input values of the fourth argument held in the
第6の命令列において、ストアワード命令(sw)が実行される。これにより、レジスタ29(R29)に格納されているスタックポインタの値に「16」が加算され、その加算された値のメモリアドレスにレジスタ12(R12)に格納されているデータ(第5の引数の入力値E)が転送される。このストアワード命令(sw)は、そのストアワード命令(sw)に示された転送先レジスタ番号が「R29」であり、オフセット値が「16」以上であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。 In the sixth instruction sequence, a store word instruction (sw) is executed. As a result, “16” is added to the value of the stack pointer stored in the register 29 (R29), and the data (fifth argument) stored in the register 12 (R12) is added to the memory address of the added value. Input value E) is transferred. This store word instruction (sw) has the transfer destination register number “R29” indicated by the store word instruction (sw) and the offset value is “16” or more. It is determined that this is an input value setting command for setting an input value.
これにより、主記憶部130に転送された入力値Eが実行履歴検索部410にも供給され、その供給された入力値Eと、履歴メモリ430に保持されている第5の引数の入力値とが比較される。このとき、履歴メモリ430に保持された第5の引数の入力値のうち、入力値Eが保持されていれば、全ての引数の入力値A乃至Eが一致する実行履歴における実行結果が実行履歴検索部410に出力される。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
As a result, the input value E transferred to the
第7の命令列において、ジャンプ命令(jalr)が実行される。これにより、レジスタ25(R25)に格納されている関数(func)の先頭アドレスの命令が読み出される。このとき、命令デコーダ320により、関数(func)における全ての第1乃至第5引数の入力値の設定が終了したことを示す入力値終了信号が実行履歴検索部410に通知される。
In the seventh instruction sequence, a jump instruction (jalr) is executed. As a result, the instruction at the head address of the function (func) stored in the register 25 (R25) is read. At this time, the
このとき、履歴メモリ430から実行結果が出力されていれば、実行履歴検索部410により、その実行結果が実行結果出力部420に出力されるとともに、関数(func)の処理を省略するための省略信号がフェッチ部310に供給される。一方、履歴メモリ430から実行結果が出力されていなければ、実行履歴検索部410により、関数(func)の実行後の実行結果と、予告命令に基づいて取得された識別情報および入力値とが履歴メモリ430に登録される。
At this time, if an execution result is output from the
このように、本発明の第3の実施の形態では、実行履歴検索部410は、関数の実行前において、その関数に対応する予告設定命令に基づいて設定される関数アドレスを識別情報として取得することができる。これにより、実行履歴検索部410は、実行部330により設定された関数の先頭アドレスと、予告設定命令により取得された関数の入力値とに基づいて、履歴メモリ430における実行結果を検索することができる。
As described above, in the third embodiment of the present invention, the execution
すなわち、実行結果再利用処理部400は、予告設定命令によって、実行履歴検索部410において識別情報および入力値を取得することができるため、関数の実行前に、履歴メモリ430に保持された実行履歴を検索することができる。
That is, the execution result
このように、本発明の第1乃至3の実施の形態では、主記憶部130に記憶されたプログラムに含まれる予告命令に基づいて、関数の実行結果の再利用による処理時間を大幅に短縮することができる。次に、このような予告命令をプログラムに挿入するプログラム変換装置について図面を参照して説明する。
As described above, in the first to third embodiments of the present invention, the processing time by reusing the execution result of the function is significantly shortened based on the notice instruction included in the program stored in the
<4.第4の実施の形態>
[プログラム変換装置の構成例]
図12は、本発明の第4の実施の形態におけるプログラム変換処理装置の一機能構成例を示すブロック図である。プログラム変換処理装置500は、ソースプログラム記憶部510と、予告命令挿入コード生成部600と、オブジェクトプログラム記憶部520とを備える。なお、プログラム変換処理装置500は、特許請求の範囲に記載のプログラム変換処理装置の一例である。
<4. Fourth Embodiment>
[Configuration example of program conversion device]
FIG. 12 is a block diagram showing a functional configuration example of the program conversion processing device according to the fourth embodiment of the present invention. The program
ソースプログラム記憶部510は、コンパイル処理の対象となるソースプログラムを記憶するものである。このソースプログラムは、実行結果が再び利用される再利用区間が含まれるソースプログラムである。このソースプログラム記憶部510は、その記憶されたソースプログラムを予告命令挿入コード生成部600に供給する。
The source
予告命令挿入コード生成部600は、ソースプログラム記憶部510からのソースプログラムをコンパイルすることによって、予告命令を挿入するための処理を施した後に、機械語プログラムであるオブジェクトプログラムを生成するものである。この予告命令挿入コード生成部600は、その生成されたオブジェクトプログラムをオブジェクトプログラム記憶部520に記憶させる。この予告命令挿入コード生成部600は、プログラム解析部610と、プログラム最適化処理部620と、コード生成部630とを備える。
The notice instruction insertion
プログラム解析部610は、ソースプログラム記憶部510から読み出したソースプログラムに基づいて形態素解析や構文解析などの解析処理を実行するものである。このプログラム解析部610は、解析または最適化に適した形式の中間コードによって表現された中間表現によるプログラムを生成して、その生成されたプログラムに解析処理を実行する。
The
また、このプログラム解析部610は、再利用候補区間抽出部611および再利用候補区間解析部612を備える。再利用候補区間抽出部611は、複数の命令区間のうち、実行結果を再利用する再利用区間の候補となる再利用候補区間をプログラムから抽出するものである。この再利用候補区間抽出部611は、例えば、複数回実行される命令区間である複数の関数のうち、再利用候補区間となる関数を抽出する。
The
また、再利用候補区間抽出部611は、再利用候補区間の入力値が同じでも異なる実行結果になるため、実行結果が再利用できない関数を再利用候補区間から除外する。この再利用候補区間抽出部611は、例えば、命令区間に分岐命令を含むような関数を再利用候補区間から除外する。この再利用候補区間抽出部611は、その抽出された再利用候補区間の識別情報をプログラムとともに再利用候補区間解析部612に供給する。
Further, the reuse candidate
再利用候補区間解析部612は、再利用候補区間抽出部611により抽出された再利用候補区間の使用態様を解析するものである。この再利用候補区間解析部612は、例えば、関数における引数の個数および型と、その1つの関数が実行される回数とを使用態様として関数ごとに解析する。この例において、再利用候補区間解析部612は、例えば、関数の処理内容から引数の採り得る範囲の数を使用態様の解析結果として出力する。この再利用候補区間解析部612は、その解析結果を、再利用候補区間の識別情報およびプログラムとともにプログラム最適化処理部620に供給する。
The reuse candidate
プログラム最適化処理部620は、再利用候補区間解析部612から供給されたプログラムに基づいて、プログラムの実行速度を向上させるための最適化、および、コードサイズを削減するための最適化などを行うプログラム最適化処理を実行するものである。このプログラム最適化処理部620は、再利用度生成部621と、再利用区間選択部622と、予告命令生成処理部623とを備える。
The program
再利用度生成部621は、再利用候補区間解析部612から供給された解析結果に基づいて、再利用候補区間の実行結果が再び利用される度合いを示す再利用度を生成するものである。すなわち、再利用度生成部621は、複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度を、命令区間の使用態様に基づいて命令区間ごとに生成する。
Based on the analysis result supplied from the reuse candidate
この再利用度生成部621は、例えば、再利用候補区間が実行される実行回数に応じて再利用度を生成する。この場合において、再利用度生成部621は、例えば、実行回数が大きいほど再利用度を大きく設定する。また、この再利用度生成部621は、例えば、再利用候補区間の入力値が採り得る範囲の数に応じて再利用度を生成する。この場合には、再利用度は、例えば、組合せの数の逆数に定数を乗算することによって算出される。このため、再利用候補区間の再利用度が大きいほど、再利用される度合いが高い再利用候補区間であることを意味する。
For example, the reuse
この再利用度生成部621は、その生成された再利用度を、プログラムおよび再利用候補区間の識別情報とともに再利用区間選択部622に供給する。なお、再利用度生成部621は、特許請求の範囲に記載の再利用度生成部の一例である。
The reuse
再利用区間選択部622は、再利用度生成部621から供給された再利用候補区間の再利用度に基づいて、複数の再利用候補区間のうち、再利用区間を選択するものである。この再利用区間選択部622は、例えば、再利用度に関する一定の閾値(再利用閾値)以上である再利用候補区間を再利用区間として選択する。
The reuse
また、再利用区間選択部622は、例えば、履歴メモリ430における識別情報ごとの実行履歴を削除する際の優先度を再利用度に基づいて生成する。この例において、再利用区間選択部622は、再利用度が高いほど優先度が低くなるように優先度を生成する。また、再利用区間選択部622は、その選択された再利用区間に関する識別情報および優先度を、プログラムとともに予告命令生成処理部623に供給する。
Further, the reuse
予告命令生成処理部623は、再利用区間選択部622により選択された再利用区間を呼び出すための呼出し命令の前に、その再利用区間を特定するための情報を含む予告命令を生成するものである。この予告命令生成処理部623は、その予告命令から呼出し命令の直前の命令までに、再利用区間の入力値を設定するための入力値設定命令を生成する。
The notice command
すなわち、予告命令生成処理部623は、複数の命令区間のうち、再利用度に基づいて選択された再利用区間における入力値を設定する入力値設定命令の直前に、再利用区間における入力値の設定を予告する予告命令を生成する。この予告命令生成処理部623は、例えば、再利用区間である関数の呼出し命令の前に予告命令を挿入するとともに、その予告命令と呼出し命令との間に入力値設定命令を生成する。
That is, the notice command
また、予告命令生成処理部623は、例えば、呼出し命令の前において、その呼出し命令によって呼び出される関数の識別情報が含まれる予告命令を生成する。すなわち、予告命令生成処理部623は、再利用度に基づいて選択された複数の再利用区間を互いに識別するための識別情報を含む予告命令を生成する。この予告命令生成処理部623は、例えば、図5(b)に表わしたように、インデックス(index)により示される識別情報を含む予告命令(noticeCall)を生成する。
In addition, for example, the notice instruction
また、予告命令生成処理部623は、例えば、呼出し命令の前に、その呼出し命令の実行のためにレジスタファイル340に予め設定された関数の先頭アドレスを参照するための参照情報が含まれる予告命令を挿入する。この場合、予告命令生成処理部623は、参照情報を含む予告命令の前に、関数の先頭アドレスをレジスタファイル340に設定するためのアドレス設定命令を生成する。すなわち、予告命令生成処理部623は、再利用区間の先頭アドレスを設定するためのアドレス設定命令の後に、その先頭アドレスを参照するための参照情報を含む予告命令を生成する。この例において、予告命令生成処理部623は、例えば、図9(b)に示すように参照情報(R25)を含む予告命令(noticeCall)を生成する。
In addition, the notice instruction
その他の例として、予告命令生成処理部623は、呼出し命令の前に、その呼出し命令の飛越し先である関数の先頭アドレスの設定先を示す設定情報が含まれる予告命令を予告設定命令として生成する。すなわち、予告命令生成処理部623は、再利用区間の先頭アドレスを設定するために、関数の先頭アドレスの設定先が示された設定情報を含むアドレス設定命令として予告命令を生成する。この例において、予告命令生成処理部623は、例えば、図11(b)に示すように予告設定命令(memolw)を生成する。
As another example, the warning instruction
また、予告命令生成処理部623は、例えば、識別情報を含む予告命令、または、参照情報を含む予告命令を生成するにあたり、再利用区間選択部622により生成された優先度をさらに含めた予告命令を、呼出し命令の前に生成する。すなわち、予告命令生成処理部623は、再利用度生成部621により生成された再利用度に応じて付与された優先度を含む予告命令を生成する。
In addition, for example, the notice command
また、この予告命令生成処理部623は、その生成された予告命令を含む最適化されたプログラムをコード生成部630に供給する。なお、予告命令生成処理部623は、特許請求の範囲に記載の予告命令生成処理部の一例である。
Further, the notice command
コード生成部630は、予告命令生成処理部623から供給された最適化されたプログラムに基づいて、機械語プログラムのコードであるオブジェクトプログラムを生成するものである。このコード生成部630は、その生成したオブジェクトプログラムをオブジェクトプログラム記憶部520に供給する。
The
オブジェクトプログラム記憶部520は、コード生成部630から供給されたオブジェクトプログラムを記憶するものである。このオブジェクトプログラム記憶部520に記憶されたオブジェクトプログラムが、図1に示した主記憶部130に記憶される。
The object
このように、予告命令生成処理部623を設けることによって、再利用区間の呼出し命令の実行前にその呼出し命令の実行を予告する予告命令が実行されるプログラムを生成することができる。また、再利用度生成部621を設けることによって、複数回実行される命令区間の使用態様に基づいて再利用度が生成されるため、複数の命令区間のうち、実行結果が再利用される確率の高い命令区間を再利用区間として選択することができる。
As described above, by providing the notice instruction
[予告命令のデータフォーマットの例]
図13は、本発明の第4の実施の形態におけるプログラム変換処理装置500により生成される予告命令のデータフォーマットを例示する図である。ここでは、MIPSの規定による32ビット命令のデータフォーマットに基づく予告命令の例について示す。
[Example of data format of notice command]
FIG. 13 is a diagram exemplifying a data format of a notice command generated by the program
図13(a)は、識別情報を含む予告命令のデータフォーマットを示す図である。図13(b)は、参照情報を含む予告命令のデータフォーマットを示す図である。図13(c)は、予告設定命令のデータフォーマットを示す図である。 FIG. 13A is a diagram illustrating a data format of a notice instruction including identification information. FIG. 13B is a diagram illustrating a data format of a notice instruction including reference information. FIG. 13C is a diagram showing a data format of the notice setting instruction.
図13(a)には、オペレーションコード711、インデックス712、優先度713および機能コード714を表わすフィールドがそれぞれ示されている。オペレーションコード711には、特殊命令(SPECIAL)を示す「000000」が26乃至31ビットに格納される。
FIG. 13A shows fields representing
インデックス712には、再利用区間選択部622により選択された複数の関数を互いに識別するための識別情報が10乃至25ビットに格納される。優先度713には、履歴メモリ430における実行履歴を削除する際の優先度が6乃至9ビットに格納される。この優先度713には、再利用区間選択部622により生成された優先度の値が格納される。機能コード714には、予告命令(noticeCall)として「000101」が0乃至5ビットに格納される。
In the
図13(b)には、オペレーションコード721、優先度722、転送先レジスタ723および機能コード724を表わすフィールドがそれぞれ示されている。オペレーションコード711には、特殊命令(SPECIAL)を示す「000000」が26乃至31ビットに格納される。
FIG. 13B shows fields representing
優先度722には、履歴メモリ430の実行履歴を削除する際の優先度が11乃至25ビットに格納される。この優先度722には、再利用区間選択部622により生成された優先度の値が格納される。転送先レジスタ723には、参照情報として、関数の先頭アドレスが格納されているレジスタ番号が6乃至10ビットに格納される。機能コード724には、予告命令(noticeCall)として「000101」が0乃至5ビットに格納される。
In the
図13(c)には、オペレーションコード731、基準レジスタ732、転送先レジスタ733およびオフセット734を表わすフィールドがそれぞれ示されている。オペレーションコード731には、予告設定命令(memolw)を示す「011111」が26乃至31ビットに格納される。
FIG. 13C shows fields representing
基準レジスタ732には、基準アドレスが格納されているレジスタ番号(R25)が21乃至25ビットに格納される。転送先レジスタ733には、設定先を示す設定情報として、関数を呼び出すための関数の先頭アドレスが設定されるレジスタ番号が16乃至20ビットに格納される。オフセット734には、基準アドレスに対するオフセット値が0乃至15ビットに格納される。
In the
このような予告命令または予告設定命令が、関数を呼び出すための呼出し命令の前に、予告命令生成処理部623によって生成される。
Such a notice command or notice setting command is generated by the notice command
[プログラム変換処理装置500の動作例]
次に本発明の第4の実施の形態におけるプログラム変換処理装置500の動作について図面を参照して説明する。
[Operation Example of Program Conversion Processing Device 500]
Next, the operation of the program
図14は、本発明の第4の実施の形態におけるプログラム変換処理装置500の予告命令生成処理方法の処理手順の一例を示すフローチャートである。
FIG. 14 is a flowchart illustrating an example of a processing procedure of a notice instruction generation processing method of the program
まず、再利用候補区間抽出部611により、ソースプログラム記憶部510からソースプログラムが読み出される(ステップS931)。そして、再利用候補区間抽出部611により、複数回実行される命令区間である複数の関数のうち、再利用候補区間となる関数が抽出される(ステップS932)。
First, the reuse candidate
続いて、再利用候補区間解析部612により、再利用候補区間抽出部611において抽出された再利用候補区間の使用態様が解析される(ステップS933)。この後、再利用度生成部621により、再利用候補区間の使用態様に基づいて再利用候補区間ごとに再利用度が生成される(ステップS934)。なお、ステップS934は、特許請求の範囲に記載の再利用度生成手順の一例である。
Subsequently, the usage pattern of the reuse candidate section extracted by the reuse candidate
そして、再利用区間選択部622により、再利用候補区間ごとの再利用度に基づいて再利用区間が選択される(ステップS935)。次に、予告命令生成処理部623により、再利用区間を呼び出す呼出し命令の前に予告命令を生成して、その生成された予告命令から呼出し命令の間に入力値設定命令を生成する予告命令生成処理が実行される(ステップS940)。なお、ステップS940は、特許請求の範囲に記載の予告命令生成手順の一例である。
Then, the reuse
その後、コード生成部630により、予告命令生成処理部623から供給された最適化されたプログラムに基づいて、オブジェクトプログラムが生成される(ステップS936)。次に、図13(a)乃至(c)に示した予告命令ごとの予告命令生成処理の処理手順例について以下に図面を参照して説明する。
Thereafter, the
[識別情報を含む予告命令における予告命令生成処理例]
図15は、本発明の第4の実施の形態における識別情報を含む予告命令についての予告命令処理(ステップS940)の処理手順の一例を示すフローチャートである。
[Example of notice command generation processing in notice command including identification information]
FIG. 15 is a flowchart illustrating an example of a processing procedure of a notice command process (step S940) for a notice command including identification information according to the fourth embodiment of the present invention.
まず、予告命令生成処理部623により、再利用区間の呼出し命令の前に、識別情報を含む予告命令が生成される(ステップS942)。例えば、図5(b)に示した第1の命令列のように、インデックス(index)を指定する予告命令(noticeCall)が生成される。
First, the notice command
次に、予告命令生成処理部623により、識別情報を含む予告命令の後に、再利用区間の入力値を設定するための入力値設定命令が生成される(ステップS943)。例えば、図5(b)に示した第2乃至第6の命令列のように、入力値設定命令(2つのロードワード命令、2つのムーブ命令およびストアワード命令)が生成される。
Next, the advance command
そして、予告命令生成処理部623により、入力値設定命令の後に、再利用区間の先頭アドレスを設定するためのアドレス設定命令が生成される(ステップS944)。例えば、図5(b)に示した第7の命令列のように、アドレス設定命令(ロードワード命令)が生成される。
Then, the notice command
その後、予告命令生成処理部623により、アドレス設定命令の後に、再利用区間の呼出し命令が生成される(ステップS945)。例えば、図5(b)に示した第8の命令列のように、呼出し命令(ジャンプ命令)が生成される。
Thereafter, the notice command
予告命令生成処理部623により、ステップS942乃至S945の一連の処理が全ての再利用区間を対象に施されるまで繰り返し行われ(ステップS946)、全ての再利用区間に対する処理が終了することによって、予告命令生成処理が終了する。
The notice command
[参照情報を含む予告命令における予告命令生成処理例]
図16は、本発明の第4の実施の形態における参照情報を含む予告命令についての予告命令処理(ステップS950)の処理手順の一例を示すフローチャートである。
[Example of notice command generation processing in notice command including reference information]
FIG. 16 is a flowchart showing an example of the processing procedure of the notice command processing (step S950) for the notice command including the reference information according to the fourth embodiment of the present invention.
まず、予告命令生成処理部623により、再利用区間の先頭アドレスを設定するためのアドレス設定命令が生成される(ステップS951)。例えば、図9(b)に示した第1の命令列のように、アドレス設定命令(ロードワード命令)が生成される。
First, the notice command
そして、予告命令生成処理部623により、アドレス設定命令の後に、参照情報を含む予告命令が生成される(ステップS952)。例えば、図9(b)に示した第2の命令列のように、参照情報(R25)を示す予告命令(noticeCall)が生成される。
Then, the notice command
次に、予告命令生成処理部623により、参照情報を含む予告命令の後に、再利用区間の入力値を設定するための入力値設定命令が生成される(ステップS943)。例えば、図9(b)に示した第3乃至第7の命令列のように、入力値設定命令(2つのロードワード命令、2つのムーブ命令およびストアワード命令)が生成される。
Next, the notice command
その後、予告命令生成処理部623により、入力値設定命令の後に、再利用区間の呼出し命令が生成される(ステップS945)。例えば、図9(b)に示した第8の命令列のように、呼出し命令(ジャンプ命令)が生成される。
Thereafter, the notice command
予告命令生成処理部623により、ステップS951、S952、S943およびS945の一連の処理が全ての再利用区間を対象に施されるまで繰り返し行われる(ステップS946)。そして、全ての再利用区間に対する処理が終了することによって、予告命令生成処理が終了する。
The notice command
[予告設定命令における予告命令生成処理例]
図17は、本発明の第4の実施の形態における予告設定命令についての予告命令処理(ステップS960)の処理手順の一例を示すフローチャートである。
[Example of notice instruction generation processing in notice setting instruction]
FIG. 17 is a flowchart showing an example of the processing procedure of the notice command processing (step S960) for the notice setting command according to the fourth embodiment of the present invention.
まず、予告命令生成処理部623により、再利用区間の先頭アドレスを設定するための予告設定命令が生成される(ステップS961)。例えば、図11(b)に示した第1の命令列のように、予告設定命令(memolw)が生成される。
First, the notice command
次に、予告命令生成処理部623により、予告設定命令の後に、再利用区間の入力値を設定するための入力値設定命令が生成される(ステップS943)。例えば、図11(b)に示した第2乃至第6の命令列のように、入力値設定命令(2つのロードワード命令、2つのムーブ命令およびストアワード命令)が生成される。
Next, the advance command
その後、予告命令生成処理部623により、入力値設定命令の後に、再利用区間の呼出し命令が生成される(ステップS946)。例えば、図11(b)に示した第7の命令列のように、呼出し命令(ジャンプ命令)が生成される。
Thereafter, the notice command
予告命令生成処理部623により、ステップS961、S943およびS945の一連の処理が全ての再利用区間を対象に施されるまで繰り返し行われる(ステップS946)。そして、全ての再利用区間に対する処理が終了することによって、予告命令生成処理が終了する。
The notice command
このように、本発明の第4の実施の形態では、再利用区間の呼出し命令の前に予告命令を生成することによって、データ処理装置100による実行結果の再利用による再利用区間の処理時間を削減することができる。また、再利用度に基づいて選択された再利用区間に予告命令生成処理を施すことによって、データ処理装置100における実行結果の再利用率を向上させることができる。
As described above, in the fourth embodiment of the present invention, the processing time of the reuse section due to the reuse of the execution result by the
このように、本発明の実施の形態によれば、再利用区間における処理の実行を予告する予告命令に基づいてその再利用区間の実行結果の再利用処理を行うことによって、再利用区間の処理時間を大幅に削減することができる。 As described above, according to the embodiment of the present invention, the processing of the reuse section is performed by performing the reuse processing of the execution result of the reuse section based on the notice command for notifying the execution of the process in the reuse section. Time can be greatly reduced.
なお、本発明の実施の形態は本発明を具現化するための一例を示したものであり、本発明の実施の形態において明示したように、本発明の実施の形態における事項と、特許請求の範囲における発明特定事項とはそれぞれ対応関係を有する。同様に、特許請求の範囲における発明特定事項と、これと同一名称を付した本発明の実施の形態における事項とはそれぞれ対応関係を有する。ただし、本発明は実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において実施の形態に種々の変形を施すことにより具現化することができる。 The embodiment of the present invention shows an example for embodying the present invention. As clearly shown in the embodiment of the present invention, the matters in the embodiment of the present invention and the claims Each invention-specific matter in the scope has a corresponding relationship. Similarly, the matters specifying the invention in the claims and the matters in the embodiment of the present invention having the same names as the claims have a corresponding relationship. However, the present invention is not limited to the embodiments, and can be embodied by making various modifications to the embodiments without departing from the gist of the present invention.
また、本発明の実施の形態において説明した処理手順は、これら一連の手順を有する方法として捉えてもよく、また、これら一連の手順をコンピュータに実行させるためのプログラム乃至そのプログラムを記憶する記録媒体として捉えてもよい。この記録媒体として、例えば、CD(Compact Disc)、MD(MiniDisc)、DVD(Digital Versatile Disk)、メモリカード、ブルーレイディスク(Blu-ray Disc(登録商標))等を用いることができる。 The processing procedure described in the embodiment of the present invention may be regarded as a method having a series of these procedures, and a program for causing a computer to execute the series of procedures or a recording medium storing the program May be taken as As this recording medium, for example, a CD (Compact Disc), an MD (MiniDisc), a DVD (Digital Versatile Disk), a memory card, a Blu-ray Disc (registered trademark), or the like can be used.
100 データ処理装置
120 バス
130 主記憶部
200 一次キャッシュ
210 命令キャッシュ
220 データキャッシュ
300 データ処理部
310 フェッチ部
320 命令デコーダ
331 ロードユニット
332 入力選択部
333 演算回路
334 ストアユニット
340 レジスタファイル
400 実行結果再利用処理部
410 実行履歴検索部
420 実行結果出力部
430 履歴メモリ
500 プログラム変換処理装置
510 ソースプログラム記憶部
520 オブジェクトプログラム記憶部
600 予告命令挿入コード生成部
610 プログラム解析部
611 再利用候補区間抽出部
612 再利用候補区間解析部
620 プログラム最適化処理部
621 再利用度生成部
622 再利用区間選択部
623 予告命令生成処理部
630 コード生成部
DESCRIPTION OF
Claims (15)
前記再利用区間を識別するための識別情報ごとに前記再利用区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリと、
前記再利用区間における処理の実行を予告する予告命令に基づいて前記再利用区間の入力値を取得して前記取得された入力値と前記予告命令により特定された前記識別情報とに基づいて前記実行履歴における前記実行結果を検索する実行履歴検索部と、
前記予告命令によって識別された前記再利用区間における処理が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力部と
を具備するデータ処理装置。 An execution unit that executes processing based on an instruction sequence including a reuse interval that is an instruction interval that is executed a plurality of times;
A history memory that associates an input value and an execution result in the reuse interval for each piece of identification information for identifying the reuse interval, and holds the history as an execution history;
The input value of the reuse section is acquired based on a notice command for notifying execution of processing in the reuse section, and the execution is performed based on the acquired input value and the identification information specified by the notice command. An execution history search unit for searching the execution result in the history;
An execution result that outputs the extracted execution result to the execution unit when the execution result is extracted by the execution history search unit when processing in the reuse section identified by the notice instruction is executed A data processing apparatus comprising an output unit.
前記実行部は、前記先頭アドレスを参照するための参照情報を含む前記予告命令に基づいて前記先頭アドレスを前記実行履歴検索部に出力し、
前記実行履歴検索部は、前記識別情報として前記実行部から出力された前記先頭アドレスと前記再利用区間の入力値とに基づいて前記実行履歴における前記実行結果を検索する
請求項1記載のデータ処理装置。 The history memory associates an input value and an execution result in the reuse section for each head address of the reuse section that is the identification information, and holds the execution history as the execution history,
The execution unit outputs the start address to the execution history search unit based on the notice command including reference information for referring to the start address;
The data processing according to claim 1, wherein the execution history search unit searches the execution result in the execution history based on the start address output from the execution unit as the identification information and an input value of the reuse section. apparatus.
前記履歴メモリは、前記再利用区間の先頭アドレスごとに前記再利用区間における入力値および実行結果を関連付けて前記実行履歴として保持し、
前記実行部は、前記先頭アドレスの設定先が示された設定情報を含む前記予告設定命令に基づいて前記先頭アドレスを前記設定先に設定し、
前記実行履歴検索部は、前記予告設定命令に基づいて前記再利用区間の入力値を取得して前記取得された入力値と前記実行部により設定された前記先頭アドレスとに基づいて前記実行履歴における前記実行結果を検索する
請求項1記載のデータ処理装置。 The notice command is a notice setting command for setting a head address of the reuse section that is the identification information,
The history memory associates an input value and an execution result in the reuse section for each head address of the reuse section and holds the execution history as the execution history,
The execution unit sets the head address to the setting destination based on the notice setting instruction including setting information indicating the setting destination of the head address,
The execution history search unit acquires an input value of the reuse section based on the notice setting command, and in the execution history based on the acquired input value and the start address set by the execution unit. The data processing apparatus according to claim 1, wherein the execution result is searched.
前記実行履歴検索部は、前記予告命令に含まれる前記優先度に基づいて前記履歴メモリにおける前記実行履歴を削除する
請求項1記載のデータ処理装置。 The history memory associates an input value and an execution result in the reuse section corresponding to the priority at the time of deleting the execution history, and holds the execution history as the execution history for each identification information,
The data processing device according to claim 1, wherein the execution history search unit deletes the execution history in the history memory based on the priority included in the notice command.
前記実行履歴検索部は、前記予告命令に基づいて取得された前記入力値と前記実行部により実行された実行結果と前記識別情報とを前記履歴メモリに保持させる
請求項1記載のデータ処理装置。 The execution unit executes processing in the reuse section identified by the notice command when the execution result in the execution history is not extracted from the history memory by the execution history search unit,
The data processing device according to claim 1, wherein the execution history search unit causes the history memory to hold the input value acquired based on the notice command, an execution result executed by the execution unit, and the identification information.
前記実行履歴検索部は、前記関数の実行を予告する予告命令に基づいて前記関数の入力値を取得して前記取得された入力値と前記予告命令により特定された前記識別情報とに基づいて前記実行履歴における前記実行結果を検索し、
実行結果出力部は、前記予告命令によって識別された前記関数が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する
請求項1記載のデータ処理装置。 The history memory associates an input value and an execution result in the function for each identification information for identifying a function that is the reuse section, and holds the execution history as the execution history,
The execution history search unit acquires an input value of the function based on a notice command for notifying execution of the function, and based on the acquired input value and the identification information specified by the notice command. Search the execution result in the execution history,
The execution result output unit outputs the extracted execution result to the execution unit when the execution result is extracted by the execution history search unit when the function identified by the notice instruction is executed. The data processing apparatus according to claim 1.
前記複数の命令区間のうち前記再利用度に基づいて選択された再利用区間における入力値を設定するための入力値設定命令の直前に前記再利用区間における入力値の設定を予告する予告命令を生成する予告命令生成部と
を具備するプログラム変換処理装置。 A reuse degree generating unit that generates a reuse degree for each instruction section based on a usage mode of the instruction section;
A notice instruction for notifying the setting of the input value in the reuse section immediately before the input value setting instruction for setting the input value in the reuse section selected based on the degree of reuse among the plurality of instruction sections. A program conversion processing device comprising a notice command generation unit for generating.
前記再利用区間における処理の実行を予告する予告命令により特定された前記識別情報と前記予告命令により特定された前記再利用区間の入力値とを取得する取得手順と、
前記取得手順により取得された前記識別情報と前記入力値とに基づいて前記実行履歴における前記実行結果を検索する実行履歴検索手順と、
前記予告命令によって識別された前記再利用区間における処理が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力手順と
を具備するデータ処理方法。 An execution unit that executes processing based on an instruction sequence including a reuse interval that is an instruction interval that is executed a plurality of times, and an input value and an execution result in the reuse interval for each piece of identification information for identifying the reuse interval A data processing method in a data processing device comprising a history memory that stores the execution history in association with each other,
An acquisition procedure for acquiring the identification information specified by the advance notice for notifying execution of processing in the reuse section and the input value of the reuse section specified by the advance notice;
An execution history search procedure for searching for the execution result in the execution history based on the identification information acquired by the acquisition procedure and the input value;
An execution result that outputs the extracted execution result to the execution unit when the execution result is extracted by the execution history search unit when processing in the reuse section identified by the notice instruction is executed A data processing method comprising: an output procedure.
前記複数の命令区間のうち前記再利用度に基づいて選択された再利用区間における入力値を設定するための入力値設定命令の直前に前記再利用区間における入力値の設定を予告する予告命令を生成する予告命令生成手順と、
を具備する予告命令生成処理方法。 A reuse degree generation procedure for generating a reuse degree for each instruction section based on a usage mode of the instruction section;
A notice instruction for notifying the setting of the input value in the reuse section immediately before the input value setting instruction for setting the input value in the reuse section selected based on the degree of reuse among the plurality of instruction sections. The notice instruction generation procedure to generate,
A notice instruction generation processing method comprising:
Priority Applications (7)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009187622A JP2011039856A (en) | 2009-08-13 | 2009-08-13 | Data processing device, data processing method, program conversion processing device, and program conversion processing method |
KR1020127003143A KR20120068824A (en) | 2009-08-13 | 2010-08-05 | Data processing device, data processing method, program conversion processing device, program conversion processing method, program analysis processing device, program analysis processing method, history storing device, program, compile processing device, and compile processing method |
TW099126111A TW201124910A (en) | 2009-08-13 | 2010-08-05 | Data processing device, data processing method, program conversion processing device, and program conversion processing method |
US13/389,134 US20120185859A1 (en) | 2009-08-13 | 2010-08-05 | Methods and systems for program analysis and program conversion |
CN2010800349313A CN102667715A (en) | 2009-08-13 | 2010-08-05 | Data processing device, data processing method, program conversion processing device, and program conversion processing method, program conversion processing device, data processing device, program conversion processing method, and data processing me |
PCT/JP2010/063246 WO2011018974A1 (en) | 2009-08-13 | 2010-08-05 | Data processing device, data processing method, program conversion processing device, and program conversion processing method, program conversion processing device, data processing device, program conversion processing method, and data processing method, data processing device, data processing method, program analysis processing device, and program analysis processing method, data processing device, history storing device, data processing method, and program, and compile processing device, data processing device, compile processing method, and program |
EP10808157A EP2466453A1 (en) | 2009-08-13 | 2010-08-05 | Data processing device, data processing method, program conversion processing device, and program conversion processing method, program conversion processing device, data processing device, program conversion processing method, and data processing method, data processing device, data processing method, program analysis processing device, and program analysis processing method, data processing device, history storing device, data processing method, and program, and compile processing device, data processing device, compile processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009187622A JP2011039856A (en) | 2009-08-13 | 2009-08-13 | Data processing device, data processing method, program conversion processing device, and program conversion processing method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011039856A true JP2011039856A (en) | 2011-02-24 |
Family
ID=43767548
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009187622A Abandoned JP2011039856A (en) | 2009-08-13 | 2009-08-13 | Data processing device, data processing method, program conversion processing device, and program conversion processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011039856A (en) |
-
2009
- 2009-08-13 JP JP2009187622A patent/JP2011039856A/en not_active Abandoned
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2011018974A1 (en) | Data processing device, data processing method, program conversion processing device, and program conversion processing method, program conversion processing device, data processing device, program conversion processing method, and data processing method, data processing device, data processing method, program analysis processing device, and program analysis processing method, data processing device, history storing device, data processing method, and program, and compile processing device, data processing device, compile processing method, and program | |
US7508985B2 (en) | Pattern-matching system | |
JP6549563B2 (en) | System and method for content based medical macro sorting and retrieval system | |
JP2009237762A (en) | Program analyzer, program analytical method, and analytical program | |
CN108846069B (en) | Document execution method and device based on markup language | |
JP5440287B2 (en) | Symbolic execution support program, method and apparatus | |
US9182960B2 (en) | Loop distribution detection program and loop distribution detection method | |
CN111611788B (en) | Data processing method and device, electronic equipment and storage medium | |
US9588747B2 (en) | Method and apparatus for converting programs | |
US10789203B2 (en) | Data processing apparatus, data processing method, and program recording medium | |
JP2007122207A (en) | Program analysis program, program analyzing device and program analyzing method | |
JP2011039856A (en) | Data processing device, data processing method, program conversion processing device, and program conversion processing method | |
JP5273884B1 (en) | Structure analysis apparatus and program | |
US10108405B2 (en) | Compiling apparatus and compiling method | |
JP2011039857A (en) | Program conversion processing device, data processing device, program conversion processing method, and data processing method | |
JP2011039858A (en) | Data processing device, data processing method, program analysis processing device, and program analysis processing method | |
JP2011096153A (en) | Compile processing device, data processing device, compile processing method, and program | |
CN113031952A (en) | Method and device for determining execution code of deep learning model and storage medium | |
JP2007257397A (en) | Contention state detection process additional program, contention state detection process adding apparatus and contention state detection process adding method | |
JP2022002034A (en) | Extraction method, extraction program, and extraction device | |
CN216527140U (en) | Branch prediction device and processor | |
CN113609821B (en) | Regular expression conversion method, device, equipment and storage medium | |
JP5462215B2 (en) | SEARCH DEVICE, SEARCH METHOD, AND PROGRAM | |
JP2011039859A (en) | Data processor, history storing device, and data processing method and program | |
CN108958802B (en) | Thread pre-operation method, device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Effective date: 20120723 Free format text: JAPANESE INTERMEDIATE CODE: A621 |
|
A762 | Written abandonment of application |
Free format text: JAPANESE INTERMEDIATE CODE: A762 Effective date: 20130416 |