JP2011096153A - Compile processing device, data processing device, compile processing method, and program - Google Patents

Compile processing device, data processing device, compile processing method, and program Download PDF

Info

Publication number
JP2011096153A
JP2011096153A JP2009251586A JP2009251586A JP2011096153A JP 2011096153 A JP2011096153 A JP 2011096153A JP 2009251586 A JP2009251586 A JP 2009251586A JP 2009251586 A JP2009251586 A JP 2009251586A JP 2011096153 A JP2011096153 A JP 2011096153A
Authority
JP
Japan
Prior art keywords
value
candidate
hash
function
section
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009251586A
Other languages
Japanese (ja)
Inventor
Mutsuhiro Omori
睦弘 大森
Kurniawan Warih
クルニアワン ワリー
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2009251586A priority Critical patent/JP2011096153A/en
Priority to KR1020127003143A priority patent/KR20120068824A/en
Priority to TW099126111A priority patent/TW201124910A/en
Priority to US13/389,134 priority patent/US20120185859A1/en
Priority to CN2010800349313A priority patent/CN102667715A/en
Priority to PCT/JP2010/063246 priority patent/WO2011018974A1/en
Priority to EP10808157A priority patent/EP2466453A1/en
Publication of JP2011096153A publication Critical patent/JP2011096153A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To improve the efficiency of reuse of values by shortening the bit length of data to be kept in a memory storing an execution result when reusing the values (Memoization). <P>SOLUTION: A reuse-instruction determination unit 120 analyzes the use modes of a plurality of instruction sections in a program, and determines reuse sections in which the execution result is used again from among the instruction sections. A hash function determination unit 200 determines a section identification value generating function from candidate functions that are candidates of section identification value generating function, the generating function generating a section-identification value identifying a reuse section by a value of a bit width narrower than the bit width of the starting address of the reuse section. A machine-word program generation unit 140 generates a machine-word program embedding the section identification value generating function determined by the hash function determination unit 200. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、コンパイル処理装置に関し、特にハッシュ関数によって生成されたハッシュ値を用いて、実行結果が再利用される命令区間を識別するコンパイル処理装置、データ処理装置、および、これらにおけるコンパイル処理方法およびプログラムに関する。   The present invention relates to a compile processing apparatus, and in particular, a compile processing apparatus, a data processing apparatus, and a compile processing method for identifying an instruction section in which an execution result is reused using a hash value generated by a hash function, and Regarding the program.

プログラムの処理速度を高速化するために種々の技術が開発されている。近年、その技術を用いた装置の一つとして、値再利用(メモ化:Memoization)と呼ばれる命令区間の実行結果を再利用する技法を用いた区間再利用装置が提案されている(例えば、特許文献1参照。)。この区間再利用装置は、プログラムの所定の命令区間における入力値および実行結果をキャッシュに保存しておくことによって、同じ命令区間を再び実行する際に入力値が一致する場合には、保存していた実行結果である出力値を出力する装置である。   Various techniques have been developed to increase the processing speed of programs. In recent years, as one of devices using the technology, an interval reuse device using a technique for reusing the execution result of an instruction interval called value reuse (memoization) has been proposed (for example, a patent) Reference 1). This section reuse device saves input values and execution results in a predetermined instruction section of a program in a cache so that the input values match when the same instruction section is executed again when it is executed again. This is a device that outputs an output value that is the execution result.

この区間再利用装置において実行結果の検索を高速化するための装置の一つとして、検索時の索引として用いられるキャッシュインデックスを、ハッシュ関数を用いて生成する装置が提案されている(例えば、非特許文献1参照。)。このハッシュ関数を用いてキャッシュインデックスを生成する区間再利用装置は、アッカーマン関数の2つの入力の値をハッシュ関数の入力とすることによって、キャッシュインデックスであるハッシュ値を算出する。そして、この区間再利用装置は、その生成したキャッシュインデックスに基づいてアッカーマン関数の実行結果を保存し、実行結果を検索する場合にはその生成したキャッシュインデックスを索引として用いて実行結果を検索する。   As one of devices for speeding up retrieval of execution results in this section reuse device, a device for generating a cache index used as an index at the time of retrieval using a hash function has been proposed (for example, non-reuse) (See Patent Document 1). The interval reuse device that generates a cache index using this hash function calculates a hash value that is a cache index by using two input values of the Ackerman function as inputs of the hash function. Then, the section reuse device stores the execution result of the Ackermann function based on the generated cache index, and searches the execution result using the generated cache index as an index when searching the execution result.

特開2004−258905号公報(図1)JP 2004-258905 A (FIG. 1)

Stephen E.Richardson著、「Caching Function Results: Faster Arithmetic by Avoiding Unnecessary Computation」、Sun Microsystems Laboratories, Inc.、1992年Stephen E. Richardson, "Caching Function Results: Faster Arithmetic by Avoiding Unnecessary Computation", Sun Microsystems Laboratories, Inc., 1992

上記の従来技術では、アッカーマン関数の2つの入力の値から生成したキャッシュインデックスを用いて実行結果を検索することによって、実行結果の検索に要する時間を削減することができる。しかしながら、このような区間再利用装置では、実行結果を保存しておくメモリのサイズに合わせた単一のハッシュ関数を用いているため、必要なキャッシュインデックスの数に応じてハッシュ関数を選択することはできないという問題が生じる。   In the above prior art, it is possible to reduce the time required to search for an execution result by searching for an execution result using a cache index generated from two input values of the Ackermann function. However, since such a section reuse device uses a single hash function that matches the size of the memory that stores the execution results, the hash function should be selected according to the number of cache indexes required. The problem of not being able to occur.

このような区間再利用装置では、例えば、保持させる実行結果の数に対してハッシュ値(キャッシュインデックス)のビット長が不要に長いために検索に時間が掛かる場合がある。この検索に時間が掛かることにより、このような区間再利用装置では、値再利用の効率の低下が生じてしまう。   In such a section reuse device, for example, the search may take a long time because the bit length of the hash value (cache index) is unnecessarily long with respect to the number of execution results to be held. If this search takes time, in such a section reuse device, the efficiency of value reuse is reduced.

そこで、本発明はこのような状況に鑑みてなされたものであり、値再利用(メモ化)を行う際、実行結果を保存しておくメモリに保持させるデータのビット長を短縮させることにより、値再利用の効率を改善することを目的とする。   Therefore, the present invention has been made in view of such a situation, and when performing value reuse (memoization), by shortening the bit length of data to be held in a memory for storing execution results, The purpose is to improve the efficiency of value reuse.

本発明は、上記課題を解決するためになされたものであり、その第1の側面は、プログラムにおける複数の命令区間の使用態様を解析して上記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、上記再利用区間の開始アドレスのビット幅より狭いビット幅の値により上記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、上記区間識別値の候補である候補値を上記候補関数に関連付けて上記開始アドレスから生成する候補値生成部と、上記候補値生成部により生成された上記候補値を上記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、上記候補値が全て互いに異なる上記候補値リストを抽出し、この抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記関連付けられた候補関数を上記区間識別値生成関数として出力する区間識別値生成関数出力部と、上記区間識別値生成関数が埋め込まれた機械語プログラムを上記解析されたプログラムおよび上記区間識別値生成関数に基づいて生成する機械語プログラム生成部とを具備するコンパイル処理装置およびその処理方法ならびに当該方法をコンピュータに実行させるプログラムである。これにより、候補関数から選択した区間識別値生成関数をプログラムに埋め込ませるという作用をもたらす。   The present invention has been made in order to solve the above-mentioned problems, and a first aspect of the present invention is to re-use the execution result again among the instruction sections by analyzing the usage of a plurality of instruction sections in the program. A candidate for a section identification value generation function for generating a section identification value for identifying the reuse section by a value of a bit width narrower than the bit width of the start address of the reuse section By using a candidate function, a candidate value generation unit that associates a candidate value that is a candidate for the section identification value with the candidate function and generates the candidate value from the start address, and the candidate value generated by the candidate value generation unit A candidate value table held as a candidate value list for each associated candidate function, and the candidate value list in which the candidate values are all different from each other are extracted, and the extracted candidate values A section identification value generation function output unit that outputs the associated candidate function of the candidate value list selected based on the bit width of the candidate value in the list as the section identification value generation function, and the section identification value generation function Compile processing apparatus, machine method thereof, and program for causing a computer to execute the method, and a machine language program generation unit that generates a machine language program embedded with a machine language program based on the analyzed program and the section identification value generation function It is. As a result, the section identification value generation function selected from the candidate functions is embedded in the program.

また、この第1の側面において、上記候補関数は、ハッシュ関数であり、上記区間識別値生成関数出力部は、上記抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記関連付けられたハッシュ関数を上記区間識別値生成関数として出力するようにしてもよい。これにより、ハッシュ関数をプログラムに埋め込ませるという作用をもたらす。この場合において、上記ハッシュ関数は、上記開始アドレスの最下位ビットから所定の数のビットにおける値を上記候補値とするハッシュ関数であり、上記区間識別値生成関数出力部は、上記抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記関連付けられたハッシュ関数を上記区間識別値生成関数として出力するようにしてもよい。これにより、最下位ビットから所定の数のビットにおける値をハッシュ値として算出するハッシュ関数をプログラムに埋め込ませるという作用をもたらす。   In the first aspect, the candidate function is a hash function, and the section identification value generation function output unit is selected based on the bit width of the candidate value in the extracted candidate value list. The hash function associated with the candidate value list may be output as the section identification value generation function. This brings about the effect that the hash function is embedded in the program. In this case, the hash function is a hash function in which a value in a predetermined number of bits from the least significant bit of the start address is used as the candidate value, and the section identification value generation function output unit outputs the extracted candidate The hash function associated with the candidate value list selected based on the bit width of the candidate value in the value list may be output as the section identification value generation function. As a result, the program is embedded with a hash function for calculating a value in a predetermined number of bits from the least significant bit as a hash value.

また、この第1の側面において、上記区間識別値生成関数出力部は、上記抽出された候補値リストのうちビット幅が最も狭い上記候補値の候補値リストの上記関連付けられた候補関数を上記区間識別値生成関数として出力するようにしてもよい。これにより、全て互いに異なる候補値を生成する候補関数のうちビット幅が最も狭い候補値を生成する候補関数を区間識別値生成関数として出力させるという作用をもたらす。   Further, in the first aspect, the section identification value generation function output unit outputs the associated candidate function of the candidate value list having the narrowest bit width in the extracted candidate value list as the section. You may make it output as an identification value generation function. As a result, the candidate function that generates the candidate value having the narrowest bit width among the candidate functions that generate candidate values that are all different from each other is output as the section identification value generation function.

また、この第1の側面において、上記区間識別値生成関数出力部は、上記区間識別値生成関数として上記区間識別値生成関数を識別するための識別子を出力し、上記機械語プログラム生成部は、上記識別子が埋め込まれた機械語プログラムを生成するようにしてもよい。これにより、区間識別値生成関数を識別するための識別子が埋め込まれたプログラムを生成させるという作用をもたらす。   In the first aspect, the section identification value generation function output unit outputs an identifier for identifying the section identification value generation function as the section identification value generation function, and the machine language program generation unit includes: A machine language program in which the identifier is embedded may be generated. As a result, the program in which the identifier for identifying the section identification value generation function is embedded is generated.

また、本発明の第2の側面は、複数の命令区間を実行して実行結果を出力する実行部と、上記命令区間のうち実行結果が再び利用される再利用区間の開始アドレスのビット幅より狭いビット幅の値により上記再利用区間を識別する区間識別値とその上記再利用区間の入力値とその上記再利用区間の実行結果とを実行履歴として保持する履歴メモリと、上記区間識別値および上記入力値に基づいて上記履歴メモリから上記実行履歴を検索し、上記実行履歴が検索された場合には上記実行結果を出力する履歴検索部とを具備するデータ処理装置である。これにより、区間識別値と入力値と実行結果とを実行履歴として履歴メモリに保持させるという作用をもたらす。   The second aspect of the present invention includes an execution unit that executes a plurality of instruction sections and outputs execution results, and a bit width of a start address of a reuse section in which execution results are reused among the instruction sections. A history memory for holding a section identification value for identifying the reuse section with a narrow bit width value, an input value of the reuse section, and an execution result of the reuse section as an execution history, the section identification value, and The data processing apparatus includes a history search unit that searches the history memory for the execution history based on the input value, and outputs the execution result when the execution history is searched. As a result, the section identification value, the input value, and the execution result are stored in the history memory as an execution history.

また、この第2の側面において、上記実行部が上記再利用区間を実行したときに上記開始アドレスを出力した場合には、上記区間識別値を生成するための区間識別値生成関数を用いて上記開始アドレスから上記区間識別値を生成する区間識別値生成部をさらに具備し、上記実行部は、上記区間識別値生成部に上記区間識別値生成関数を供給し、上記履歴メモリは、上記区間識別値生成部により生成された上記区間識別値と上記入力値と上記実行結果とを上記実行履歴として保持し、上記履歴探索部は、上記区間識別値と上記入力値とに基づいて上記履歴メモリから上記実行履歴を検索し、上記実行履歴が検索された場合には上記実行結果を出力するようにしてもよい。これにより、区間識別値生成部により開始アドレスから生成された区間識別値と、実行部から供給された入力値および実行結果とを実行履歴として履歴メモリに保持させるという作用をもたらす。この場合において、上記実行部は、上記区間識別値生成関数を上記区間識別値生成部に供給し、上記区間識別値生成部は、上記実行部が上記再利用区間を実行したときに上記開始アドレスを出力した場合には、上記実行部から供給された上記区間識別値生成関数を用いて上記開始アドレスから上記区間識別値を生成するようにしてもよい。これにより、実行部から供給された区間識別値生成関数を用いて開始アドレスから区間識別値を生成させるという作用をもたらす。この場合において、上記実行部は、上記区間識別値生成関数を識別する識別子を上記区間識別値生成部に供給し、上記区間識別値生成部は、上記区間識別値生成関数の候補である候補関数から上記区間識別値生成関数を上記識別子に基づいて選択し、上記実行部が上記再利用区間を実行したときに上記開始アドレスを出力した場合には上記選択した区間識別値生成関数を用いて上記開始アドレスから上記区間識別値を生成するようにしてもよい。これにより、実行部から供給された識別値に基づいて候補関数から区間識別値生成関数を選択し、その選択した区間識別値を用いて開始アドレスから区間識別値を生成させるという作用をもたらす。   Further, in the second aspect, when the execution unit outputs the start address when the reuse section is executed, the section identification value generation function for generating the section identification value is used to generate the section identification value. A section identification value generation unit configured to generate the section identification value from a start address; the execution unit supplies the section identification value generation function to the section identification value generation unit; and the history memory includes the section identification value The section identification value, the input value, and the execution result generated by the value generation section are stored as the execution history, and the history search section is configured to store the section identification value and the input value from the history memory based on the section identification value and the input value. The execution history may be searched, and when the execution history is searched, the execution result may be output. As a result, the section identification value generated from the start address by the section identification value generation unit, the input value supplied from the execution unit, and the execution result are retained in the history memory as an execution history. In this case, the execution unit supplies the section identification value generation function to the section identification value generation unit, and the section identification value generation unit performs the start address when the execution unit executes the reuse section. Is output, the section identification value may be generated from the start address using the section identification value generation function supplied from the execution unit. Thus, the section identification value is generated from the start address using the section identification value generation function supplied from the execution unit. In this case, the execution unit supplies an identifier for identifying the section identification value generation function to the section identification value generation unit, and the section identification value generation unit is a candidate function that is a candidate for the section identification value generation function. The section identification value generation function is selected based on the identifier, and when the execution unit outputs the start address when the reuse section is executed, the section identification value generation function is used to select the section identification value generation function. The section identification value may be generated from the start address. Thus, the section identification value generation function is selected from the candidate functions based on the identification value supplied from the execution unit, and the section identification value is generated from the start address using the selected section identification value.

また、この第2の側面において、上記実行部は、上記区間識別値が含まれる命令により上記再利用区間を実行した場合には上記区間識別値を上記履歴メモリに供給し、上記履歴メモリは、上記区間識別値と上記入力値と上記実行結果とを上記実行履歴として保持し、上記履歴探索部は、上記区間識別値と上記入力値とに基づいて上記履歴メモリから上記実行履歴を検索し、上記実行履歴が検索された場合には上記実行結果を出力するようにしてもよい。これにより、実行部から供給された区間識別値と入力値と実行結果とを実行履歴として履歴メモリに保持させるという作用をもたらす。   In the second aspect, the execution unit supplies the section identification value to the history memory when the reuse section is executed by an instruction including the section identification value. The section identification value, the input value, and the execution result are held as the execution history, and the history search unit searches the execution history from the history memory based on the section identification value and the input value, When the execution history is searched, the execution result may be output. As a result, the section identification value, the input value, and the execution result supplied from the execution unit are stored in the history memory as an execution history.

また、本発明の第3の側面は、プログラムにおける複数の命令区間の使用態様を解析して上記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、上記再利用区間の開始アドレスのビット幅より狭いビット幅の値により上記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、上記区間識別値の候補である候補値を上記候補関数に関連付けて生成する候補値生成部と、上記候補値生成部により生成された上記候補値を上記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、上記候補値が全て互いに異なる上記候補値リストを抽出し、この抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記候補値を上記区間識別値として出力する区間識別値出力部と、上記再利用区間を呼び出す命令を上記区間識別値が含まれる区間識別値付命令に変換する命令変換部と、上記再利用区間が上記区間識別値付命令により呼び出される機械語プログラムを上記区間識別値付命令が含まれるソースプログラムに基づいて生成する機械語プログラム生成部とを具備するコンパイル処理装置である。これにより、区間識別値付命令が含まれるプログラムを生成させるという作用をもたらす。   According to a third aspect of the present invention, there is provided an analysis unit for analyzing a usage state of a plurality of instruction sections in a program and determining a reuse section in which an execution result is reused among the instruction sections, and the reuse section. By using a candidate function that is a candidate of a section identification value generation function for generating a section identification value for identifying the reuse section by a value having a bit width narrower than the bit width of the start address of A candidate value generation unit that generates a candidate value associated with the candidate function, a candidate value table that holds the candidate value generated by the candidate value generation unit as a candidate value list for each of the associated candidate functions, and The candidate value list in which the candidate values are all different from each other is extracted, and the candidate value list selected based on the bit width of the candidate value from the extracted candidate value list A section identification value output section for outputting the candidate value as the section identification value, a command conversion section for converting a command for calling the reuse section into a section identification value-added instruction including the section identification value, and the reuse section Is a compile processing device including a machine language program generation unit that generates a machine language program called by the section identification value-added instruction based on a source program including the section identification value-added instruction. This brings about the effect | action of producing | generating the program in which the instruction with a section identification value is included.

また、この第3の側面において、上記候補値生成部は、上記開始アドレスの所定の順序に従って付与された番号を入力の値とする上記候補関数を用いることによって上記候補値を生成するようにしてもよい。これにより、開始アドレスの所定の順序に従って付与された番号から候補値を生成させるという作用をもたらす。   In the third aspect, the candidate value generation unit generates the candidate value by using the candidate function having an input value that is a number assigned according to a predetermined order of the start address. Also good. This brings about the effect that the candidate value is generated from the number assigned according to the predetermined order of the start address.

また、この第3の側面において、上記候補値生成部は、上記開始アドレスを入力の値とする上記候補関数を用いることによって上記候補値を生成するようにしてもよい。これにより、開始アドレスから候補値を生成させるという作用をもたらす。   In the third aspect, the candidate value generation unit may generate the candidate value by using the candidate function having the start address as an input value. This brings about the effect | action that a candidate value is produced | generated from a start address.

また、本発明の第4の側面は、複数の命令区間を実行して実行結果を出力する実行部と、上記再利用区間の開始アドレスのビット幅より狭いビット幅の値により上記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、上記区間識別値の候補である候補値を上記候補関数に関連付けて上記開始アドレスから生成する候補値生成部と、上記候補値生成部により生成された上記候補値を上記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、上記候補値が全て互いに異なる上記候補値リストを抽出し、この抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記関連付けられた候補関数を区間識別値生成関数として出力する区間識別値生成関数出力部と、上記実行部が上記再利用区間を実行したときに上記開始アドレスが出力された場合には上記区間識別値生成関数を用いて上記開始アドレスから上記区間識別値を生成する区間識別値生成部と、上記再利用区間の上記区間識別値と入力値と実行結果とを実行履歴として保持する履歴メモリと、上記区間識別値および上記入力値に基づいて上記履歴メモリから上記実行履歴を検索し、上記実行履歴が検索された場合には上記実行結果を出力する履歴検索部とを具備するデータ処理装置である。これにより、区間識別値生成関数出力部が出力した区間識別値生成関数を用いて開始アドレスから区間識別値を生成させて、この生成された区間識別値と実行部から供給された入力値および実行結果とを実行履歴として履歴メモリに保持させるという作用をもたらす。   According to a fourth aspect of the present invention, there is provided an execution unit that executes a plurality of instruction sections and outputs an execution result, and the reuse section is defined by a bit width value smaller than a bit width of a start address of the reuse section. A candidate that is generated from the start address by associating a candidate value that is a candidate for the section identification value with the candidate function by using a candidate function that is a candidate for the section identification value generation function for generating the section identification value to be identified A candidate value table that holds the candidate value generated by the value generation unit, the candidate value generation unit as a candidate value list for each of the associated candidate functions, and the candidate value list in which the candidate values are all different from each other In the extracted candidate value list, the associated candidate function of the candidate value list selected based on the bit width of the candidate value is defined as the section identification value generation function. When the start address is output when the section identification value generation function output unit and the execution unit execute the reuse section, the section identification value generation function is used to identify the section from the start address. A section identification value generation unit that generates a value, a history memory that holds the section identification value, the input value, and the execution result of the reuse section as an execution history, and the history based on the section identification value and the input value The data processing apparatus includes a history search unit that searches the execution history from a memory and outputs the execution result when the execution history is searched. Accordingly, the section identification value is generated from the start address using the section identification value generation function output from the section identification value generation function output unit, and the generated section identification value, the input value supplied from the execution unit, and the execution The result is stored in the history memory as an execution history.

そこで、本発明はこのような状況に鑑みてなされたものであり、値再利用(メモ化)を行う際、実行結果を保存しておくメモリに保持させるデータのビット長を短縮させることにより、値再利用の効率を改善することを目的とする。   Therefore, the present invention has been made in view of such a situation, and when performing value reuse (memoization), by shortening the bit length of data to be held in a memory for storing execution results, The purpose is to improve the efficiency of value reuse.

本発明の第1の実施の形態におけるコンパイル処理装置100の構成例を示すブロック図である。It is a block diagram which shows the structural example of the compile processing apparatus 100 in the 1st Embodiment of this invention. 本発明の第1の実施の形態における再利用命令判別部120が解析するプログラムの一例を示す概念図である。It is a conceptual diagram which shows an example of the program which the reuse command discrimination | determination part 120 in the 1st Embodiment of this invention analyzes. 本発明の第1の実施の形態におけるハッシュ関数決定部200の構成例を示すブロック図である。It is a block diagram which shows the structural example of the hash function determination part 200 in the 1st Embodiment of this invention. 本発明の第1の実施の形態における候補ハッシュ値生成部230が生成するハッシュ値の一例を示す概念図である。It is a conceptual diagram which shows an example of the hash value which the candidate hash value generation part 230 in the 1st Embodiment of this invention produces | generates. 本発明の第1の実施の形態におけるハッシュ値テーブル240に保持されるハッシュ値の一例を示す概念図である。It is a conceptual diagram which shows an example of the hash value hold | maintained at the hash value table 240 in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるハッシュ関数指定命令の一例を示す概念図である。It is a conceptual diagram which shows an example of the hash function designation | designated instruction in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるコンパイル処理装置100によるコンパイル処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the compile process by the compile processing apparatus 100 in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるハッシュ関数決定部200によるハッシュ関数決定処理(ステップS920)の処理手順例の前半を示すフローチャートである。It is a flowchart which shows the first half of the example of a process sequence of the hash function determination process (step S920) by the hash function determination part 200 in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるハッシュ関数決定部200によるハッシュ関数決定処理(ステップS920)の処理手順例の後半を示すフローチャートである。It is a flowchart which shows the second half of the process sequence example of the hash function determination process (step S920) by the hash function determination part 200 in the 1st Embodiment of this invention. 本発明の第2の実施の形態におけるデータ処理装置300の構成例を示すブロック図である。It is a block diagram which shows the structural example of the data processor 300 in the 2nd Embodiment of this invention. 本発明の第2の実施の形態におけるプロセッサコア400とハッシュ変換部500と履歴管理部600との構成例を示すブロック図である。It is a block diagram which shows the structural example of the processor core 400, the hash conversion part 500, and the log | history management part 600 in the 2nd Embodiment of this invention. 本発明の第2の実施の形態における履歴メモリ630のデータ構造の一例を示す概念図である。It is a conceptual diagram which shows an example of the data structure of the history memory 630 in the 2nd Embodiment of this invention. 本発明の第2の実施の形態におけるデータ処理装置300による命令処理方法の処理手順例を示すフローチャートである。It is a flowchart which shows the example of a process sequence of the command processing method by the data processor 300 in the 2nd Embodiment of this invention. 本発明の第3の実施の形態におけるコンパイル処理装置100の構成例を示すブロック図である。It is a block diagram which shows the structural example of the compile processing apparatus 100 in the 3rd Embodiment of this invention. 本発明の第3の実施の形態におけるハッシュ値決定部700の構成例を示すブロック図である。It is a block diagram which shows the structural example of the hash value determination part 700 in the 3rd Embodiment of this invention. 本発明の第3の実施の形態におけるハッシュ値テーブル740に保持されるハッシュ値の一例を示す概念図である。It is a conceptual diagram which shows an example of the hash value hold | maintained at the hash value table 740 in the 3rd Embodiment of this invention. 本発明の第3の実施の形態における関数の呼出し命令および関数の再利用命令の一例を示す概念図である。FIG. 20 is a conceptual diagram illustrating an example of a function call instruction and a function reuse instruction according to the third embodiment of the present invention. 本発明の第3の実施の形態におけるコンパイル処理装置100によるコンパイル処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the compilation process by the compilation processing apparatus 100 in the 3rd Embodiment of this invention. 本発明の第3の実施の形態におけるハッシュ値決定部700によるハッシュ値決定処理(ステップS960)の処理手順例の前半を示すフローチャートである。It is a flowchart which shows the first half of the process sequence example of the hash value determination process (step S960) by the hash value determination part 700 in the 3rd Embodiment of this invention. 本発明の第3の実施の形態におけるハッシュ値決定部700によるハッシュ値決定処理(ステップS960)の処理手順例の後半を示すフローチャートである。It is a flowchart which shows the second half of the process sequence example of the hash value determination process (step S960) by the hash value determination part 700 in the 3rd Embodiment of this invention. 本発明の第4の実施の形態におけるデータ処理装置300の構成例を示すブロック図である。It is a block diagram which shows the structural example of the data processor 300 in the 4th Embodiment of this invention. 本発明の第4の実施の形態におけるプロセッサコア400および履歴管理部600の構成例を示すブロック図である。It is a block diagram which shows the structural example of the processor core 400 and the log | history management part 600 in the 4th Embodiment of this invention. 本発明の第4の実施の形態におけるデータ処理装置300による命令処理方法の処理手順例を示すフローチャートである。It is a flowchart which shows the example of a process sequence of the command processing method by the data processor 300 in the 4th Embodiment of this invention. 本発明の第5の実施の形態におけるデータ処理装置300の構成例を示すブロック図である。It is a block diagram which shows the structural example of the data processor 300 in the 5th Embodiment of this invention. 本発明の第5の実施の形態におけるプロセッサコア400とハッシュ変換部500と履歴管理部600との構成例を示すブロック図である。It is a block diagram which shows the structural example of the processor core 400, the hash transformation part 500, and the log | history management part 600 in the 5th Embodiment of this invention. 本発明の第5の実施の形態におけるデータ処理装置300による命令処理方法の処理手順例を示すフローチャートである。It is a flowchart which shows the example of a process sequence of the command processing method by the data processor 300 in the 5th Embodiment of this invention. 本発明の第5の実施の形態におけるプログラム実行処理(ステップS990)の処理手順例を示すフローチャートである。It is a flowchart which shows the example of a process sequence of the program execution process (step S990) in the 5th Embodiment of this invention.

以下、本発明を実施するための形態(以下、実施の形態と称する)について説明する。説明は以下の順序により行う。
1.第1の実施の形態(コンパイル処理制御:ハッシュ関数を選択してプログラムに埋め込む例)
2.第2の実施の形態(データ処理制御:ハッシュ関数が埋め込まれたプログラムを処理する例)
3.第3の実施の形態(コンパイル処理制御:ハッシュ値を選択してハッシュ値付再利用命令を生成する例)
4.第4の実施の形態(データ処理制御:ハッシュ値付再利用命令を処理する例)
5.第5の実施の形態(データ処理制御:既に生成されたオブジェクトプログラムの再利用区間の開始アドレスからハッシュ値を生成する例)
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 (compilation control: example of selecting a hash function and embedding it in a program)
2. Second embodiment (data processing control: an example of processing a program in which a hash function is embedded)
3. Third embodiment (compilation control: example of selecting a hash value and generating a reuse instruction with a hash value)
4). Fourth embodiment (data processing control: example of processing a reuse instruction with hash value)
5. Fifth embodiment (data processing control: an example in which a hash value is generated from the start address of a reuse section of an already generated object program)

<1.第1の実施の形態>
[本発明の第1の実施の形態におけるコンパイル処理装置100の構成例]
図1は、本発明の第1の実施の形態におけるコンパイル処理装置100の構成例を示すブロック図である。このコンパイル処理装置100は、ソースプログラム記憶部110と、再利用命令判別部120と、ハッシュ関数決定部200と、機械語プログラム生成部140と、オブジェクトプログラム記憶部150とを備える。
<1. First Embodiment>
[Configuration example of the compile processing apparatus 100 according to the first embodiment of the present invention]
FIG. 1 is a block diagram showing a configuration example of a compile processing apparatus 100 according to the first embodiment of the present invention. The compile processing apparatus 100 includes a source program storage unit 110, a reuse instruction determination unit 120, a hash function determination unit 200, a machine language program generation unit 140, and an object program storage unit 150.

ソースプログラム記憶部110は、コンパイルを行うソースプログラムを記憶するものである。このソースプログラムは、例えば、実行結果が再び利用される再利用区間が含まれるソースプログラムである。このソースプログラム記憶部110は、記憶したソースプログラムを再利用命令判別部120に供給する。   The source program storage unit 110 stores a source program to be compiled. This source program is, for example, a source program including a reuse section in which the execution result is reused. The source program storage unit 110 supplies the stored source program to the reuse instruction determination unit 120.

再利用命令判別部120は、ソースプログラム記憶部110から読み出したソースプログラムを解析して、再利用命令が含まれるプログラムを生成するものである。ここで、再利用命令とは、再利用区間と再利用しない区間とを、再利用される度合いに基づいて区別することによって、再利用区間が呼出された際に実行結果を再利用するための処理をデータ処理装置に行わせる命令である。   The reuse instruction determination unit 120 analyzes the source program read from the source program storage unit 110 and generates a program including the reuse instruction. Here, the reuse instruction is for reusing the execution result when the reuse section is called by distinguishing the reuse section and the non-reuse section based on the degree of reuse. This is an instruction for causing the data processing apparatus to perform processing.

この再利用命令判別部120は、再利用候補区間抽出部121と、再利用候補区間解析部122と、再利用度生成部123と、再利用命令変換部124とを備える。この再利用命令判別部120は、その生成した再利用命令が含まれるプログラムをハッシュ関数決定部200に供給する。なお、再利用命令判別部120は、特許請求の範囲に記載の解析部の一例である。   The reuse command determination unit 120 includes a reuse candidate section extraction unit 121, a reuse candidate section analysis unit 122, a reuse degree generation unit 123, and a reuse command conversion unit 124. The reuse instruction determination unit 120 supplies a program including the generated reuse instruction to the hash function determination unit 200. The reuse command determination unit 120 is an example of an analysis unit described in the claims.

再利用候補区間抽出部121は、複数の命令区間のうち、実行結果を再利用する再利用区間の候補となる再利用候補区間をプログラムから抽出するものである。ここでは、コンパイル処理装置100が処理する命令区間は関数またはループを想定するものとする。この再利用候補区間抽出部121は、関数およびループなどの複数回呼び出される可能性がある命令区間を再利用候補区間として抽出する。   The reuse candidate section extraction unit 121 extracts, from the program, a reuse candidate section that is a candidate for a reuse section that reuses an execution result among a plurality of command sections. Here, it is assumed that the instruction section processed by the compile processing apparatus 100 is a function or a loop. The reuse candidate section extraction unit 121 extracts command sections that may be called a plurality of times, such as functions and loops, as reuse candidate sections.

また、この再利用候補区間抽出部121は、入力値が同じでも異なる実行結果になる関数などの実行結果が再利用できる可能性が無い関数を、再利用候補区間から除外する。なお、ここで、入力値とは、関数またはループの実行に必要な値であって、引数で構成される値であり、例えば、3つの変数を引数とする関数の場合には、この3つの変数の値である。この再利用候補区間抽出部121は、例えば、システムコールを含む関数または乱数発生関数を再利用候補区間の対象から除外する。この再利用候補区間抽出部121は、抽出した再利用候補区間の識別情報をプログラムとともに再利用候補区間解析部122に供給する。   In addition, the reuse candidate section extraction unit 121 excludes from the reuse candidate section functions that have no possibility of reusing execution results, such as functions that have different input results even if the input values are the same. Here, the input value is a value required for execution of the function or loop, and is a value composed of arguments. For example, in the case of a function having three variables as arguments, The value of the variable. For example, the reuse candidate section extraction unit 121 excludes a function including a system call or a random number generation function from the reuse candidate section. This reuse candidate section extraction unit 121 supplies the extracted reuse candidate section identification information to the reuse candidate section analysis unit 122 together with the program.

再利用候補区間解析部122は、再利用候補区間抽出部121により抽出された再利用候補区間に関する使用態様を解析するものである。この再利用候補区間解析部122は、例えば、関数およびループの入力値である引数に関する内容と、関数およびループの呼出し回数に関する内容とを使用態様として解析する。また、再利用候補区間は、特許請求の範囲に記載の命令区間の一例である。   The reuse candidate section analysis unit 122 analyzes the usage mode related to the reuse candidate section extracted by the reuse candidate section extraction unit 121. The reuse candidate section analysis unit 122 analyzes, for example, the contents relating to the arguments that are the input values of the function and the loop and the contents relating to the number of calls of the function and the loop as usage modes. The reuse candidate section is an example of an instruction section described in the claims.

再利用度生成部123は、再利用候補区間解析部122から供給された解析結果に基づいて、再利用候補区間の実行結果が再び利用される度合いを示す再利用度を生成するものである。この再利用度生成部123は、例えば、再利用候補区間の入力値の組合せに応じて再利用度を生成する。この場合には、再利用候補区間の入力値の組合せが少ないほど再利用される度合いは高くなるため、入力値の組合せの数を分母とする再利用度を生成する。この再利用度生成部123は、その生成した再利用度を再利用候補区間の識別情報およびプログラムとともに再利用命令変換部124に供給する。   Based on the analysis result supplied from the reuse candidate section analysis unit 122, the reuse degree generation unit 123 generates a reuse degree indicating the degree to which the execution result of the reuse candidate section is reused. For example, the reuse degree generation unit 123 generates a reuse degree according to a combination of input values of reuse candidate sections. In this case, since the degree of reuse increases as the number of combinations of input values in the reuse candidate section decreases, the degree of reuse with the number of combinations of input values as the denominator is generated. The reuse level generation unit 123 supplies the generated reuse level together with the identification information of the reuse candidate section and the program to the reuse command conversion unit 124.

再利用命令変換部124は、再利用度生成部123から供給された再利用度に基づいて、実行結果を再利用させる再利用候補区間の呼出し命令を再利用命令に変換するものである。例えば、実行結果を再利用させる再利用候補区間が関数である場合には、関数を呼出す命令であるアセンブリ言語の「call」命令を、再利用命令として新たに規定した「memocall」命令に変換する。この再利用命令変換部124は、その変換した命令を含むプログラムをハッシュ関数決定部200に供給する。   The reuse instruction conversion unit 124 converts a call instruction of a reuse candidate section for reusing an execution result into a reuse instruction based on the degree of reuse supplied from the reuse degree generation unit 123. For example, when a reuse candidate section for reusing an execution result is a function, an assembly language “call” instruction that is an instruction for calling a function is converted into a “memocall” instruction newly defined as a reuse instruction. . The reuse instruction conversion unit 124 supplies a program including the converted instruction to the hash function determination unit 200.

ハッシュ関数決定部200は、再利用区間を識別するための開始アドレスからハッシュ値を生成するハッシュ関数を決定するものである。このハッシュ関数決定部200は、例えば、再利用区間の開始アドレスを関数入力値として複数のハッシュ関数を用いて、再利用区間の開始アドレスに基づくハッシュ値をハッシュ関数ごとに生成する。ここで、関数入力値とは、ハッシュ関数の入力となる値である。そして、このハッシュ関数決定部200は、複数のハッシュ関数のうち、値が全て互いに異なるハッシュ値であってビット幅が最も狭いハッシュ値を生成したハッシュ関数を決定して出力する。すなわち、このハッシュ関数決定部200は、再利用区間の開始アドレスのビット幅より狭いビット幅の値により再利用区間を識別するハッシュ値を生成するハッシュ関数を決定して出力する。このハッシュ関数決定部200は、その決定したハッシュ関数をプログラムとともに機械語プログラム生成部140に供給する。   The hash function determination unit 200 determines a hash function that generates a hash value from a start address for identifying a reuse section. For example, the hash function determination unit 200 generates a hash value based on the start address of the reuse section for each hash function using a plurality of hash functions using the start address of the reuse section as a function input value. Here, the function input value is a value that becomes an input of the hash function. Then, the hash function determination unit 200 determines and outputs a hash function that generates a hash value having the narrowest bit width among the plurality of hash functions. That is, the hash function determination unit 200 determines and outputs a hash function that generates a hash value for identifying a reuse section based on a bit width value narrower than the bit width of the start address of the reuse section. The hash function determination unit 200 supplies the determined hash function together with the program to the machine language program generation unit 140.

機械語プログラム生成部140は、ハッシュ関数決定部200から供給されたプログラムに基づいて、機械語のプログラムであるオブジェクトプログラムを生成するものである。この機械語プログラム生成部140は、例えば、ハッシュ関数決定部200が決定したハッシュ関数が埋め込まれたオブジェクトプログラムを生成する。また、この機械語プログラム生成部140は、そのオブジェクトプログラムに埋め込まれたハッシュ関数をそのオブジェクトプログラムを実行するデータ処理装置に認識させるためのハッシュ関数指定命令をオブジェクトプログラムに追加する。この機械語プログラム生成部140は、その生成したオブジェクトプログラムをオブジェクトプログラム記憶部150に供給する。   The machine language program generation unit 140 generates an object program that is a machine language program based on the program supplied from the hash function determination unit 200. For example, the machine language program generation unit 140 generates an object program in which the hash function determined by the hash function determination unit 200 is embedded. In addition, the machine language program generation unit 140 adds a hash function designation command for causing the data processing apparatus that executes the object program to recognize the hash function embedded in the object program. The machine language program generation unit 140 supplies the generated object program to the object program storage unit 150.

オブジェクトプログラム記憶部150は、機械語プログラム生成部140から供給されたオブジェクトプログラムを記憶するものである。   The object program storage unit 150 stores the object program supplied from the machine language program generation unit 140.

このように、コンパイル処理装置100は、まず、関数の実行結果が再利用される度合いに応じて関数の呼出し命令を再利用命令に変換することによって、再利用区間と再利用されない区間とが区別できるようにする。そして、コンパイル処理装置100は、再利用区間を識別するためのハッシュ値を生成するためのハッシュ関数を決定することによって、その決定したハッシュ関数を埋め込んだプログラムを生成することができる。   In this way, the compile processing apparatus 100 first distinguishes a reuse section from a non-reuse section by converting a function call instruction into a reuse instruction according to the degree to which the function execution result is reused. It can be so. Then, the compile processing apparatus 100 can generate a program in which the determined hash function is embedded by determining a hash function for generating a hash value for identifying a reuse section.

なお、ここでは、コンパイル処理装置100は、関数を再利用対象とする例について説明したが、ループに関しても同様に再利用対象とすることができる。   Here, the compile processing apparatus 100 has been described with respect to an example in which a function is a reuse target. However, a loop can also be a reuse target.

なお、ここでは、便宜上、再利用候補区間解析部122が再利用候補区間の使用態様を関数毎に解析する例について説明したが、より詳細に使用態様を解析するために関数の呼出し命令毎に解析するものとしてもよい。また、再利用度生成部123についても再利用度を関数毎に生成する例について説明したが、より詳細に解析するために関数の呼出し命令毎に生成するものとしてもよい。この場合において、再利用命令変換部124は、関数は同じであっても関数の呼出し命令毎に異なる再利用度に基づいて、関数の呼出し命令毎に呼出し命令を再利用命令に変換する。   Here, for the sake of convenience, the example in which the reuse candidate section analysis unit 122 analyzes the usage mode of the reuse candidate section for each function has been described, but for each function call instruction to analyze the usage mode in more detail. It may be analyzed. Also, the example of generating the reuse level for each function has been described for the reuse level generation unit 123, but it may be generated for each function call instruction in order to analyze in more detail. In this case, the reuse instruction conversion unit 124 converts the call instruction into a reuse instruction for each function call instruction based on a different reuse degree for each function call instruction even if the function is the same.

また、ここでは、再利用度を生成することによって再利用命令に変換する例について説明したが、本発明はこれに限定されるものではない。例えば、関数を呼び出す命令を全て再利用対象としてもよい。   In addition, here, an example in which the degree of reuse is converted into a reuse instruction has been described, but the present invention is not limited to this. For example, all instructions that call functions may be reused.

[本発明の第1の実施の形態における再利用命令判別部120が解析するプログラム例]
図2は、本発明の第1の実施の形態における再利用命令判別部120が解析するプログラムの一例を示す概念図である。
[Program Example Analyzed by Reuse Instruction Discriminating Unit 120 in the First Embodiment of the Present Invention]
FIG. 2 is a conceptual diagram showing an example of a program analyzed by the reuse instruction determination unit 120 according to the first embodiment of the present invention.

ここでは、再利用候補区間の入力値の組合せと、その入力値の組合せに基づいて再利用度生成部123が生成する再利用度とについて一例を説明する。ここでは、再利用候補区間解析部122において以下のC言語のプログラムが解析されたことを想定する。   Here, an example of a combination of input values in a reuse candidate section and a reuse degree generated by the reuse degree generation unit 123 based on the combination of input values will be described. Here, it is assumed that the following C language program is analyzed in the reuse candidate section analysis unit 122.

まず、再利用候補区間解析部122は、図2のプログラムにおける4つの関数(funcA乃至D)の入力値の組合せについて解析する。char型の1個の変数を引数とする関数(funcA)については、char型は16ビットのバイナリ文字データであるため、入力値の組合せは最大216個と解析する。char型の1個の変数とbool(Boolean)型の1個の変数を引数とする関数(funcB)については、bool型は1ビットのバイナリ数値データであるため、「216×2=217」により入力値の組合せは最大217個と解析する。 First, the reuse candidate section analysis unit 122 analyzes combinations of input values of four functions (funcA to D) in the program of FIG. The function (funcA) to char type arguments one variable, for char type is 16-bit binary character data, a combination of input values are up to 2 to 16 and analysis. For a function (funcB) having one variable of char type and one variable of bool (Boolean) type as an argument, the bool type is binary numeric data of 1 bit, and therefore “2 16 × 2 = 2 17 the combination of input values by "the maximum 2 17 and analysis.

さらに、bool型の1個の変数を引数とする関数(funcC)については、入力値の組合せは最大2個と解析する。int(integer)型の1個の変数を引数とする関数(funcD)については、int型は32ビットのバイナリ数値データであるため、入力値の組合せは最大232個と解析する。 Further, with respect to a function (funcC) having one variable of a Boolean type as an argument, the maximum number of combinations of input values is analyzed. For int (integer The) type one variable function with arguments (funcD), int type for a 32-bit binary numerical data, a combination of input values are up to 2 to 32 and analysis.

そして、再利用度生成部123は、4つの関数(funcA乃至D)の解析した結果に基づいて、入力値の組合せの数を分母とする再利用度を生成することにより以下の関係の再利用度を生成する。

Figure 2011096153
Then, the reuse level generation unit 123 generates the reuse level with the number of combinations of input values as the denominator based on the analysis result of the four functions (funcA to D), thereby reusing the following relationships: Generate degrees.
Figure 2011096153

このように、bool型の1個の変数を引数とする関数(funcC)の再利用度が1番高く、char型の1個の変数を引数とする関数(funcA)の再利用度が2番目に高くなる。char型の1個の変数とbool型の1個の変数を引数とする関数(funcB)の再利用度が3番目に高く、int型の1個の変数を引数とする関数(funcD)の再利用度が1番低くなる。   As described above, the function (funcC) having a single variable of the bool type has the highest degree of reuse, and the function having the single variable of the char type (funcA) has the second highest degree of reuse. To be high. A function (funcB) that has one variable of char type and one variable of bool type as an argument (funcB) has the third highest degree of reuse, and a function (funcD) that uses one variable of int type as an argument Usage is the lowest.

すなわち、再利用候補区間解析部122は再利用候補区間を解析し、再利用度生成部123は、その解析結果に基づいて生成した再利用度により、再利用区間とする際の順位付けを再利用候補区間に対して行う。そして、再利用命令変換部124は、この再利用度の高い再利用候補区間から順に再利用区間として決定する。
これにより、コンパイル処理装置100は、再利用される度合いの高い再利用候補区間を再利用区間とするオブジェクトプログラムを生成することができる。
In other words, the reuse candidate section analysis unit 122 analyzes the reuse candidate section, and the reuse degree generation unit 123 re-ranks the ranking when the reuse section is generated based on the reuse degree generated based on the analysis result. This is done for the use candidate section. Then, the reuse instruction conversion unit 124 determines the reuse sections in order from the reuse candidate section having the highest degree of reuse.
Thereby, the compile processing apparatus 100 can generate an object program in which a reuse candidate section having a high degree of reuse is used as a reuse section.

[本発明の第1の実施の形態におけるハッシュ関数決定部200の構成例]
図3は、本発明の第1の実施の形態におけるハッシュ関数決定部200の構成例を示すブロック図である。このハッシュ関数決定部200は、開始アドレス取得部210と、候補ハッシュ関数保持部220と、候補ハッシュ値生成部230と、ハッシュ値テーブル240と、ハッシュ関数出力部250とを備える。
[Configuration Example of Hash Function Determination Unit 200 in the First Embodiment of the Present Invention]
FIG. 3 is a block diagram illustrating a configuration example of the hash function determination unit 200 according to the first embodiment of the present invention. The hash function determination unit 200 includes a start address acquisition unit 210, a candidate hash function holding unit 220, a candidate hash value generation unit 230, a hash value table 240, and a hash function output unit 250.

開始アドレス取得部210は、再利用命令変換部124からの再利用命令を含むプログラムから再利用区間の開始アドレスを取得するものである。この開始アドレス取得部210は、その取得した開始アドレスを開始アドレスリストとして保持する。この開始アドレス取得部210は、その取得した開始アドレスを候補ハッシュ値生成部230に供給する。   The start address acquisition unit 210 acquires the start address of the reuse section from the program including the reuse command from the reuse command conversion unit 124. The start address acquisition unit 210 holds the acquired start address as a start address list. The start address acquisition unit 210 supplies the acquired start address to the candidate hash value generation unit 230.

候補ハッシュ関数保持部220は、開始アドレスをハッシュ値に変換するための複数のハッシュ関数を保持するものである。すなわち、この候補ハッシュ関数保持部220は、ハッシュ関数決定部200が決定するハッシュ関数の候補となるハッシュ関数を保持する。この候補ハッシュ関数保持部220は、ハッシュ関数決定部200が決定するハッシュ関数の候補として予め定められたハッシュ関数を保持する。   The candidate hash function holding unit 220 holds a plurality of hash functions for converting the start address into a hash value. That is, the candidate hash function holding unit 220 holds a hash function that is a hash function candidate determined by the hash function determining unit 200. The candidate hash function holding unit 220 holds a hash function predetermined as a hash function candidate determined by the hash function determining unit 200.

この候補ハッシュ関数保持部220は、例えば、10個のハッシュ関数を保持している場合には、その10個のハッシュ関数を候補ハッシュ値生成部230に供給する。また、この候補ハッシュ関数保持部220は、例えば、ハッシュ関数出力部250において1個のハッシュ関数が決定された場合には、そのハッシュ関数をハッシュ関数出力部250に供給する。なお、候補ハッシュ関数保持部220から供給されるハッシュ関数は、特許請求の範囲に記載の候補関数の一例である。   For example, when the ten hash functions are held, the candidate hash function holding unit 220 supplies the ten hash functions to the candidate hash value generation unit 230. For example, when one hash function is determined in the hash function output unit 250, the candidate hash function holding unit 220 supplies the hash function to the hash function output unit 250. Note that the hash function supplied from the candidate hash function holding unit 220 is an example of a candidate function described in the claims.

候補ハッシュ値生成部230は、開始アドレス取得部210から供給された開始アドレスを関数入力値とし、その関数入力値を候補ハッシュ関数保持部220から供給されたハッシュ関数の入力としてハッシュ値を生成するものである。すなわち、この候補ハッシュ値生成部230は、ハッシュ関数決定部200が決定するハッシュ関数の候補となるハッシュ関数を用いて、再利用区間を識別するためのハッシュ値の候補となるハッシュ値を開始アドレスから生成する。また、この候補ハッシュ値生成部230は、ハッシュ値を生成する際に、そのハッシュ値を生成したハッシュ関数をそのハッシュ値に関連付けて、どのハッシュ関数から生成されたか識別できるようにする。   The candidate hash value generation unit 230 uses the start address supplied from the start address acquisition unit 210 as a function input value, and generates the hash value using the function input value as an input of the hash function supplied from the candidate hash function holding unit 220. Is. That is, the candidate hash value generation unit 230 uses a hash function that is a hash function candidate determined by the hash function determination unit 200 to generate a hash value that is a hash value candidate for identifying a reuse section as a start address. Generate from. In addition, when generating the hash value, the candidate hash value generation unit 230 associates the hash function that generated the hash value with the hash value so that it can be identified from which hash function.

この候補ハッシュ値生成部230は、例えば、開始アドレス取得部210に10個の開始アドレスが保持され、かつ、候補ハッシュ関数保持部220に10個のハッシュ関数が保持されている場合には、全組合せの「10×10=100」個のハッシュ値を生成する。   For example, when 10 start addresses are held in the start address acquisition unit 210 and 10 hash functions are held in the candidate hash function holding unit 220, the candidate hash value generation unit 230 The combination “10 × 10 = 100” hash values are generated.

この候補ハッシュ値生成部230は、その生成したハッシュ値をハッシュ値テーブル240に供給する。なお、候補ハッシュ値生成部230は、特許請求の範囲に記載の候補値生成部の一例である。また、候補ハッシュ値生成部230が生成するハッシュ値は、特許請求の範囲に記載の候補値の一例である。   The candidate hash value generation unit 230 supplies the generated hash value to the hash value table 240. The candidate hash value generation unit 230 is an example of a candidate value generation unit described in the claims. Further, the hash value generated by the candidate hash value generation unit 230 is an example of the candidate value described in the claims.

ハッシュ値テーブル240は、候補ハッシュ値生成部230から供給されたハッシュ値を保持するものである。このハッシュ値テーブル240は、ハッシュ値をそのハッシュ値を生成したハッシュ関数ごとにハッシュ値リストとして保持する。また、このハッシュ値テーブル240は、保持したハッシュ値リストをハッシュ関数出力部250に供給する。なお、ハッシュ値テーブル240は、特許請求の範囲に記載の候補値テーブルの一例である。また、ハッシュ値リストは、特許請求の範囲に記載の候補値リストの一例である。   The hash value table 240 holds the hash value supplied from the candidate hash value generation unit 230. The hash value table 240 holds a hash value as a hash value list for each hash function that generates the hash value. Further, the hash value table 240 supplies the held hash value list to the hash function output unit 250. The hash value table 240 is an example of a candidate value table described in the claims. The hash value list is an example of a candidate value list described in the claims.

ハッシュ関数出力部250は、ハッシュ値が全て互いに異なるハッシュ値リストを抽出し、この抽出されたハッシュ値リストのうちハッシュ値のビット幅が最も狭くなるハッシュ値リストに関連付けられたハッシュ関数を出力するものである。このハッシュ関数出力部250は、ユニークハッシュ値リスト判別部251および確定ハッシュ関数選択部252を備える。なお、ハッシュ関数出力部250は、特許請求の範囲に記載の区間識別値生成関数出力部の一例である。なお、ハッシュ関数出力部250が出力するハッシュ関数は、特許請求の範囲に記載の区間識別値生成関数の一例である。   The hash function output unit 250 extracts hash value lists whose hash values are all different from each other, and outputs a hash function associated with the hash value list in which the bit width of the hash value is the narrowest among the extracted hash value lists. Is. The hash function output unit 250 includes a unique hash value list determination unit 251 and a definite hash function selection unit 252. The hash function output unit 250 is an example of the section identification value generation function output unit described in the claims. The hash function output by the hash function output unit 250 is an example of a section identification value generation function described in the claims.

ユニークハッシュ値リスト判別部251は、ハッシュ値テーブル240に保持されているハッシュ値リストのうちハッシュ値が全て互いに異なるハッシュ値リストを判別するものである。このユニークハッシュ値リスト判別部251は、例えば、ハッシュ値テーブル240に保持された10個のハッシュ値リストのうちハッシュ値が全て互いに異なるものが3個の場合にはその3個のハッシュ値リストを判別する。このユニークハッシュ値リスト判別部251は、その判別したハッシュ値リストを確定ハッシュ関数選択部252に供給する。   The unique hash value list discriminating unit 251 discriminates hash value lists whose hash values are all different from each other among the hash value lists held in the hash value table 240. The unique hash value list discriminating unit 251 selects, for example, three hash value lists when there are three hash values that are all different from each other among the ten hash value lists held in the hash value table 240. Determine. The unique hash value list determination unit 251 supplies the determined hash value list to the determined hash function selection unit 252.

確定ハッシュ関数選択部252は、ユニークハッシュ値リスト判別部251から供給されたハッシュ値リストのうちハッシュ値のビット幅が最も狭くなるハッシュ値リストに関連付けられたハッシュ関数を出力するものである。すなわち、この確定ハッシュ関数選択部252は、候補ハッシュ関数保持部220が保持している複数のハッシュ関数のうちから1つのハッシュ関数を確定して、その確定したハッシュ関数を出力する。この確定ハッシュ関数選択部252は、ユニークハッシュ値リスト判別部251から供給されたハッシュ値が全て互いに異なるハッシュ値リストのうちハッシュ値のビット幅が最も狭いハッシュ値リストを一つ検出する。そして、この確定ハッシュ関数選択部252は、その検出したハッシュ値リストに関連付けられたハッシュ関数を候補ハッシュ関数保持部220から取得し、その取得したハッシュ関数を機械語プログラム生成部140に供給する。   The confirmed hash function selection unit 252 outputs a hash function associated with a hash value list in which the bit width of the hash value is the narrowest among the hash value lists supplied from the unique hash value list determination unit 251. That is, the determined hash function selection unit 252 determines one hash function from among the plurality of hash functions held by the candidate hash function holding unit 220, and outputs the decided hash function. The deterministic hash function selection unit 252 detects one hash value list having the narrowest bit width of hash values among hash value lists whose hash values supplied from the unique hash value list determination unit 251 are all different from each other. Then, the determined hash function selection unit 252 acquires a hash function associated with the detected hash value list from the candidate hash function holding unit 220 and supplies the acquired hash function to the machine language program generation unit 140.

このように、本発明の第1の実施の形態では、ハッシュ関数決定部200を設けることにより、複数のハッシュ関数のうち全て互いに異なるハッシュ値であってビット幅が最も狭いハッシュ値を生成するハッシュ関数をプログラムに埋め込むことができる。   As described above, in the first embodiment of the present invention, by providing the hash function determination unit 200, a hash that generates hash values having the narrowest bit width, which are all different hash values among a plurality of hash functions, is provided. Functions can be embedded in programs.

なお、ここでは、候補ハッシュ関数保持部220は、保持するハッシュ関数を全て候補ハッシュ値生成部230に供給する一例について説明したが、本発明はこれに限定されるものではない。例えば、候補ハッシュ関数保持部220は外部から制御できるようにすることによって、候補ハッシュ値生成部230に供給するハッシュ関数を、プログラムに応じて外部から指定できるようにしてもよい。   Here, although the example in which the candidate hash function holding unit 220 supplies all the stored hash functions to the candidate hash value generating unit 230 has been described, the present invention is not limited to this. For example, by allowing the candidate hash function holding unit 220 to be controlled from the outside, the hash function supplied to the candidate hash value generating unit 230 may be designated from the outside according to the program.

また、ここでは、確定ハッシュ関数選択部252は、ハッシュ関数を機械語プログラム生成部140に供給する一例について説明したが、本発明はこれに限定されるものではない。例えば、確定ハッシュ関数選択部252は、ハッシュ関数を指し示す識別子をハッシュ関数の代わりに供給するようにしてもよい。この例において、機械語プログラム生成部140は、確定ハッシュ関数選択部252から供給された識別子が埋め込まれたオブジェクトプログラムを生成する。これにより、ハッシュ関数をオブジェクトプログラムに埋め込む方法と比較してオブジェクトプログラムを短くすることができるため、ハッシュ関数を頻繁に交換するプログラムを実行する場合にはプログラムの実行処理を早くすることができる。なお、このハッシュ関数の代わりにオブジェクトプログラムに埋め込まれる識別子は、特許請求の範囲に記載の識別子の一例である。   Although the example in which the deterministic hash function selection unit 252 supplies the hash function to the machine language program generation unit 140 has been described here, the present invention is not limited to this. For example, the deterministic hash function selection unit 252 may supply an identifier indicating the hash function instead of the hash function. In this example, the machine language program generation unit 140 generates an object program in which the identifier supplied from the fixed hash function selection unit 252 is embedded. As a result, the object program can be shortened as compared with the method of embedding the hash function in the object program. Therefore, when executing a program that frequently exchanges the hash function, the execution process of the program can be accelerated. The identifier embedded in the object program instead of the hash function is an example of the identifier described in the claims.

[本発明の第1の実施の形態における候補ハッシュ値生成部230が生成するハッシュ値の一例]
図4は、本発明の第1の実施の形態における候補ハッシュ値生成部230が生成するハッシュ値の一例を示す概念図である。ここでは、開始アドレスのビット幅は64ビットとする。また、ここでは、左端は最上位ビット(MSB:Most Significant Bit)を示し、右端は最下位ビット(LSB:Least Significant Bit)を示すものとする。
[One Example of Hash Value Generated by Candidate Hash Value Generation Unit 230 in the First Embodiment of the Present Invention]
FIG. 4 is a conceptual diagram illustrating an example of a hash value generated by the candidate hash value generation unit 230 according to the first embodiment of this invention. Here, the bit width of the start address is 64 bits. Further, here, the left end indicates the most significant bit (MSB) and the right end indicates the least significant bit (LSB: Least Significant Bit).

また、ここでは、一例として、候補ハッシュ関数保持部220が保持している複数のハッシュ関数は、再利用区間の開始アドレスの最下位ビットから所定の数のビットにおける値を算出する関数を想定する。以下の式1にこのハッシュ関数の一例を示す。

Figure 2011096153
Here, as an example, a plurality of hash functions held by the candidate hash function holding unit 220 is assumed to be a function that calculates a value in a predetermined number of bits from the least significant bit of the start address of the reuse interval. . An example of this hash function is shown in Equation 1 below.
Figure 2011096153

ここで、hは、候補ハッシュ値生成部230が生成するハッシュ値である。また、aは、ハッシュ関数の関数入力値であり、ここではハッシュ値テーブル240から候補ハッシュ値生成部230に供給される開始アドレスである。また、&は、ビット単位のAND演算である。mは、数値(m)を2進数(b)で表現したマスクビットである。また、式1の下に示されている式2は、式1のmを算出する式の一例である。式2のiは、式1の算出するh(ハッシュ値)のビット幅を指定するための値である。 Here, h is a hash value generated by the candidate hash value generation unit 230. Further, a is a function input value of the hash function, and here is a start address supplied from the hash value table 240 to the candidate hash value generation unit 230. & Is an AND operation in bit units. m b is a mask bit in which the numerical value (m) is expressed by a binary number (b). Further, Expression 2 shown below Expression 1 is an example of an expression for calculating m of Expression 1. I in Expression 2 is a value for designating the bit width of h (hash value) calculated in Expression 1.

図4(a)には、ハッシュ値テーブル240から供給される開始アドレスの一例である開始アドレス261が示されている。この開始アドレス261は、LSB側から第0乃至63ビットの64ビットで構成されるビット列である。この開始アドレス261は、候補ハッシュ値生成部230においてハッシュ関数の関数入力値として用いられる。   FIG. 4A shows a start address 261 that is an example of the start address supplied from the hash value table 240. The start address 261 is a bit string composed of 64 bits from the 0th to the 63rd bits from the LSB side. This start address 261 is used as a function input value of the hash function in the candidate hash value generation unit 230.

図4(b)には、図4(a)において示した開始アドレスを関数入力値として生成されるハッシュ値の一例であるハッシュ値262乃至266が示されている。   FIG. 4B shows hash values 262 to 266 which are examples of hash values generated using the start address shown in FIG. 4A as a function input value.

ハッシュ値262は、式2のi(ビット幅)が「1」と指定された式1を用いて、開始アドレス261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「1」とすると、mは「1」となる。すなわち、式1は、次式3に示すハッシュ関数となる。

Figure 2011096153
The hash value 262 is h (hash value) calculated from the start address 261 using Expression 1 in which i (bit width) of Expression 2 is specified as “1”. When i (bit width) in Expression 2 is “1”, m is “1”. That is, Equation 1 is a hash function shown in Equation 3 below.
Figure 2011096153

この式3に示すハッシュ関数により、0番の値が「0」である1ビットのハッシュ値262が開始アドレス261の0番の値(0)に基づいて算出される。   With the hash function shown in Equation 3, a 1-bit hash value 262 whose 0th value is “0” is calculated based on the 0th value (0) of the start address 261.

ハッシュ値263は、式2のi(ビット幅)が「2」と指定された式1を用いて、開始アドレス261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「2」とすると、mは「3」となる。すなわち、式1は、次式4に示すハッシュ関数となる。

Figure 2011096153
The hash value 263 is h (hash value) calculated from the start address 261 using Expression 1 in which i (bit width) of Expression 2 is designated as “2”. If i (bit width) in Expression 2 is “2”, m is “3”. That is, Equation 1 is a hash function shown in Equation 4 below.
Figure 2011096153

この式4に示すハッシュ関数により、0番および1番の値が「0および1」である2ビットのビット列のハッシュ値263が開始アドレス261の0番および1番の値(0および1)に基づいて算出される。   By the hash function shown in Expression 4, the hash value 263 of the 2-bit bit string in which the values of the 0th and 1st are “0 and 1” are changed to the 0th and 1st values (0 and 1) of the start address 261. Calculated based on

ハッシュ値264は、式2のi(ビット幅)が「3」と指定された式1を用いて、開始アドレス261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「3」とすると、mは「7」となる。すなわち、式1は、次式5に示すハッシュ関数となる。

Figure 2011096153
The hash value 264 is h (hash value) calculated from the start address 261 using Expression 1 in which i (bit width) of Expression 2 is specified as “3”. If i (bit width) in Expression 2 is “3”, m is “7”. That is, Equation 1 is a hash function shown in Equation 5 below.
Figure 2011096153

この式5に示すハッシュ関数により、0番乃至2番の値が「0、1および0」である3ビットのビット列のハッシュ値264が開始アドレス261の0番乃至2番の値(0、1および0)に基づいて算出される。   By using the hash function shown in Equation 5, the hash value 264 of the 3-bit bit string in which the values from 0 to 2 are “0, 1 and 0” is the values from 0 to 2 of the start address 261 (0, 1 And 0).

ハッシュ値265は、式2のi(ビット幅)が「4」と指定された式1を用いて、開始アドレス261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「4」とすると、mは「15」となる。すなわち、式1は、次式6に示すハッシュ関数となる。

Figure 2011096153
The hash value 265 is h (hash value) calculated from the start address 261 using Expression 1 in which i (bit width) of Expression 2 is specified as “4”. When i (bit width) in Expression 2 is “4”, m is “15”. That is, Equation 1 is a hash function shown in Equation 6 below.
Figure 2011096153

この式6に示すハッシュ関数により、0番乃至3番の値が「0、1、0および1」である4ビットのビット列のハッシュ値265が開始アドレス261の0番乃至3番の値(0、1、0および1)に基づいて算出される。   According to the hash function shown in Expression 6, the hash value 265 of the 4-bit bit string whose values from 0 to 3 are “0, 1, 0, and 1” is the values from 0 to 3 of the start address 261 (0 1, 0 and 1).

ハッシュ値266は、式2のi(ビット幅)が「5」と指定された式1を用いて、開始アドレス261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「5」とすると、mは「31」となる。すなわち、式1は、次式7に示すハッシュ関数となる。

Figure 2011096153
The hash value 266 is h (hash value) calculated from the start address 261 using Expression 1 in which i (bit width) of Expression 2 is designated as “5”. If i (bit width) in Equation 2 is “5”, m is “31”. That is, Equation 1 is a hash function shown in Equation 7 below.
Figure 2011096153

この式7に示すハッシュ関数により、0番乃至4番の値が「0、1、0、1および1」である5ビットのビット列のハッシュ値266が開始アドレス261の0番乃至4番の値(0、1、0、1および1)に基づいて算出される。   According to the hash function shown in Expression 7, the hash value 266 of the 5-bit bit string in which the values of 0 to 4 are “0, 1, 0, 1 and 1” is the values of 0 to 4 of the start address 261 Calculated based on (0, 1, 0, 1 and 1).

このように、本発明の第1の実施の形態では、候補ハッシュ値生成部230を設けることによって、複数のハッシュ関数を用いて複数のハッシュ値を生成することができる。   Thus, in the first embodiment of the present invention, by providing the candidate hash value generation unit 230, a plurality of hash values can be generated using a plurality of hash functions.

なお、ここでは、式1乃至式7において示したハッシュ関数を一例として説明したが、本発明はこれに限定されるものではない。例えば、開始アドレスの最上位から所定の数のビットと最下位から所定の数のビットとの排他的論理和(EOR:Exclusive OR)を算出するハッシュ関数なども考えられる。   Here, the hash functions shown in Equations 1 to 7 have been described as an example, but the present invention is not limited to this. For example, a hash function for calculating an exclusive OR (EOR) of a predetermined number of bits from the most significant start address and a predetermined number of bits from the least significant address may be considered.

[本発明の第1の実施の形態におけるハッシュ値テーブル240に保持されるハッシュ値の一例]
図5は、本発明の第1の実施の形態におけるハッシュ値テーブル240に保持されるハッシュ値の一例を示す概念図である。ここでは、図4において説明した式3乃至式7のハッシュ関数を用いてハッシュ値を生成することを想定する。また、ここでは、プログラムにおける再利用区間は8個の関数(funcA乃至funcH)とする。
[An example of the hash value held in the hash value table 240 in the first embodiment of the present invention]
FIG. 5 is a conceptual diagram illustrating an example of hash values held in the hash value table 240 according to the first embodiment of this invention. Here, it is assumed that a hash value is generated using the hash functions of Expressions 3 to 7 described in FIG. Here, the reuse interval in the program is assumed to be eight functions (funcA to funcH).

開始アドレスリスト271には、ハッシュ値テーブル240に登録されたハッシュ値の基となった開始アドレスのリスト名が示されている。この開始アドレスリスト271において、行282にはfuncAに関する値が示され、行283にはfuncBに関する値が示され、行284にはfuncCに関する値が示されている。さらに、行285にはfuncDに関する値が示され、行286にはfuncEに関する値が示され、行287にはfuncFに関する値が示され、行288にはfuncGが示され、行289にはfuncHに関する値が示されていることを表している。   The start address list 271 shows the list name of the start address that is the basis of the hash value registered in the hash value table 240. In the start address list 271, a value related to funcA is shown in a row 282, a value related to funcB is shown in a row 283, and a value related to funcC is shown in a row 284. In addition, row 285 shows a value for funcD, row 286 shows a value for funcE, row 287 shows a value for funcF, row 288 shows funcG, and row 289 shows funcH. Indicates that the value is shown.

ハッシュ値リスト272には、式1のi(ビット幅)を「5」としたハッシュ関数である式7を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト272の行281には、式1のi(ビット幅)を「5」としたハッシュ関数である式7を用いたことを示す「i=5」が示されている。ハッシュ値リスト272の行282乃至289には、8個の関数(funcA乃至funcH)の開始アドレスを式7の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト272の行282乃至289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットから5ビットの値がそれぞれ示されている。このハッシュ値リスト272の行282乃至289に示したハッシュ値は、式7と関連付けられてハッシュ値テーブル240にリストとして保持される。   The hash value list 272 shows a list of hash values calculated using Expression 7, which is a hash function in which i (bit width) of Expression 1 is “5”. In the row 281 of the hash value list 272, “i = 5” is used, which indicates that Expression 7 which is a hash function in which i (bit width) of Expression 1 is “5” is used. In the rows 282 to 289 of the hash value list 272, hash values calculated using the start addresses of eight functions (funcA to funcH) as the function input values of Expression 7 are shown. That is, in the rows 282 to 289 of the hash value list 272, values of 5 bits from the least significant bit of the start addresses of the eight functions (funcA to funcH) are shown, respectively. The hash values shown in the rows 282 to 289 of the hash value list 272 are associated with Expression 7 and stored as a list in the hash value table 240.

ハッシュ値リスト273には、式1のi(ビット幅)を「4」としたハッシュ関数である式6を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト273の行281には、式1のi(ビット幅)を「4」としたハッシュ関数である式6を用いたことを示す「i=4」が示されている。ハッシュ値リスト273の行282乃至289には、8個の関数(funcA乃至funcH)の開始アドレスを式6の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト273の行282乃至289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットから4ビットの値がそれぞれ示されている。このハッシュ値リスト273の行282乃至289に示したハッシュ値は、式6と関連付けられてハッシュ値テーブル240にリストとして保持される。   The hash value list 273 shows a list of hash values calculated using Expression 6, which is a hash function with i (bit width) of Expression 1 set to “4”. In the row 281 of the hash value list 273, “i = 4” is used, which indicates that the hash function “Expression 6” in which “i” (bit width) of Expression 1 is “4” is used. Rows 282 to 289 of the hash value list 273 show hash values calculated using the start addresses of eight functions (funcA to funcH) as the function input values of Equation 6. That is, the values of 4 bits from the least significant bit of the start address of the eight functions (funcA to funcH) are shown in rows 282 to 289 of the hash value list 273, respectively. The hash values shown in the rows 282 to 289 of the hash value list 273 are associated with Equation 6 and stored as a list in the hash value table 240.

ハッシュ値リスト274には、式1のi(ビット幅)を「3」としたハッシュ関数である式5を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト274の行281には、式1のi(ビット幅)を「3」としたハッシュ関数である式5を用いたことを示す「i=3」が示されている。ハッシュ値リスト274の行282乃至289には、8個の関数(funcA乃至funcH)の開始アドレスを式5の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト274の行282乃至289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットから3ビットの値がそれぞれ示されている。このハッシュ値リスト274の行282乃至289に示したハッシュ値は、式5と関連付けられてハッシュ値テーブル240にリストとして保持される。   The hash value list 274 shows a list of hash values calculated using Expression 5, which is a hash function where i (bit width) of Expression 1 is “3”. In the row 281 of the hash value list 274, “i = 3” is shown, which indicates that Expression 5 which is a hash function where i (bit width) of Expression 1 is “3” is used. Rows 282 to 289 of the hash value list 274 show hash values calculated using the start addresses of the eight functions (funcA to funcH) as the function input values of Equation 5. That is, in the rows 282 to 289 of the hash value list 274, values of 3 bits from the least significant bit of the start address of the eight functions (funcA to funcH) are shown, respectively. The hash values shown in rows 282 to 289 of the hash value list 274 are stored in the hash value table 240 as a list in association with Expression 5.

ハッシュ値リスト275には、式1のi(ビット幅)を「2」としたハッシュ関数である式4を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト275の行281には、式1のi(ビット幅)を「2」としたハッシュ関数である式4を用いたことを示す「i=2」が示されている。ハッシュ値リスト275の行282乃至289には、8個の関数(funcA乃至funcH)の開始アドレスを式4の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト275の行282乃至289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットから2ビットの値がそれぞれ示されている。このハッシュ値リスト275の行282乃至289に示したハッシュ値は、式4と関連付けられてハッシュ値テーブル240にリストとして保持される。   The hash value list 275 shows a list of hash values calculated using Expression 4, which is a hash function with i (bit width) of Expression 1 set to “2”. In the row 281 of the hash value list 275, “i = 2” indicating that Expression 4 which is a hash function in which i (bit width) of Expression 1 is “2” is used is shown. Rows 282 to 289 of the hash value list 275 show hash values calculated using the start addresses of the eight functions (funcA to funcH) as the function input values of Expression 4. That is, in the rows 282 to 289 of the hash value list 275, 2-bit values from the least significant bit of the start address of the eight functions (funcA to funcH) are shown, respectively. The hash values shown in rows 282 to 289 of the hash value list 275 are associated with Equation 4 and stored as a list in the hash value table 240.

ハッシュ値リスト276には、式1のi(ビット幅)を「1」としたハッシュ関数である式3を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト276の行281には、式1のi(ビット幅)を「1」としたハッシュ関数である式3を用いたことを示す「i=1」が示されている。ハッシュ値リスト276の行282乃至289には、8個の関数(funcA乃至funcH)の開始アドレスを式3の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト276の行282乃至289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットの値がそれぞれ示されている。このハッシュ値リスト276の行282乃至289に示したハッシュ値は、式3と関連付けられてハッシュ値テーブル240にリストとして保持される。   The hash value list 276 shows a list of hash values calculated using Expression 3, which is a hash function with i (bit width) of Expression 1 set to “1”. In the row 281 of the hash value list 276, “i = 1” is shown, which indicates that Expression 3 which is a hash function in which i (bit width) of Expression 1 is “1” is used. Rows 282 to 289 of the hash value list 276 show hash values calculated using the start addresses of the eight functions (funcA to funcH) as the function input values of Equation 3. That is, the values of the least significant bits of the start addresses of the eight functions (funcA to funcH) are shown in rows 282 to 289 of the hash value list 276, respectively. The hash values shown in rows 282 to 289 of this hash value list 276 are associated with Equation 3 and held as a list in the hash value table 240.

このように、本発明の第1の実施の形態では、ハッシュ値テーブル240を用いることによって、ハッシュ値を生成したハッシュ関数に関連付けてリストとして保持することができる。   Thus, in the first embodiment of the present invention, by using the hash value table 240, hash values can be stored as a list in association with the generated hash function.

続いて、図5を用いて、ユニークハッシュ値リスト判別部251により判別されるハッシュ値リストと、確定ハッシュ関数選択部252が選択するハッシュ関数とについて説明する。   Next, the hash value list determined by the unique hash value list determination unit 251 and the hash function selected by the deterministic hash function selection unit 252 will be described with reference to FIG.

まず、ユニークハッシュ値リスト判別部251により、ハッシュ値が全て互いに異なるハッシュ値リストが判別され、その判別されたハッシュ値が全て互いに異なるハッシュ値リストが確定ハッシュ関数選択部252に供給される。この時、ハッシュ値リスト276は、funcA、funcC、funcEおよびfuncGのハッシュ値が「0」で重複し、さらに、その他の4つの関数のハッシュ値が「1」で重複しているため、確定ハッシュ関数選択部252に供給されない。   First, the unique hash value list discriminating unit 251 discriminates hash value lists whose hash values are all different from each other, and a hash value list whose discriminated hash values are all different from each other is supplied to the deterministic hash function selecting unit 252. At this time, since the hash values of funcA, funcC, funcE, and funcG overlap with “0” and the hash values of the other four functions overlap with “1”, the hash value list 276 has a fixed hash. It is not supplied to the function selection unit 252.

また、ハッシュ値リスト275は、funcA、funcCおよびfuncEのハッシュ値が「10」で重複し、さらに、funcB、funcFおよびfuncHのハッシュ値が「11」で重複しているため、確定ハッシュ関数選択部252に供給されない。さらに、ハッシュ値リスト274は、funcAおよびfuncEのハッシュ値が「110」で重複し、さらに、funcFおよびfuncHのハッシュ値が「011」で重複しているため、確定ハッシュ関数選択部252に供給されない。   In addition, since the hash values of funcA, funcC, and funcE are duplicated by “10” and the hash values of funcB, funcF, and funcH are duplicated by “11”, the hash value list 275 has a definite hash function selection unit. 252 is not supplied. Furthermore, since the hash values of funcA and funcE overlap with “110” and the hash values of funcF and funcH overlap with “011”, the hash value list 274 is not supplied to the confirmed hash function selection unit 252. .

その結果、ハッシュ値が全て互い異なるハッシュ値リストであると判別されたハッシュ値リスト272および273が、ユニークハッシュ値リスト判別部251により確定ハッシュ関数選択部252に供給される。   As a result, hash value lists 272 and 273 whose hash values are all determined to be different from each other are supplied to the determined hash function selection unit 252 by the unique hash value list determination unit 251.

ユニークハッシュ値リスト判別部251からハッシュ値リストが供給されると、確定ハッシュ関数選択部252は、ユニークハッシュ値リスト判別部251から供給されたハッシュ値リストのうちビット幅が最も狭いハッシュ値のハッシュ値リストを検出する。   When the hash value list is supplied from the unique hash value list determination unit 251, the deterministic hash function selection unit 252 hashes the hash values having the narrowest bit width among the hash value lists supplied from the unique hash value list determination unit 251. Detect a list of values.

その結果、4ビットのハッシュ値のハッシュ値リスト273と、5ビットのハッシュ値のハッシュ値リスト272とのうちハッシュ値リスト273がビット幅が最も狭いハッシュ値のハッシュ値リストとして検出される。そして、確定ハッシュ関数選択部252は、ハッシュ値リスト273に関連付けられたハッシュ関数の式6を候補ハッシュ関数保持部220から取得し、ハッシュ関数決定部200が決定したハッシュ関数としてその取得した式6を出力する。   As a result, the hash value list 273 is detected as the hash value list having the narrowest bit width among the hash value list 273 of the 4-bit hash value and the hash value list 272 of the 5-bit hash value. Then, the deterministic hash function selection unit 252 acquires the hash function expression 6 associated with the hash value list 273 from the candidate hash function holding unit 220, and the acquired expression 6 as the hash function determined by the hash function determination unit 200 Is output.

このように、本発明の第1の実施の形態では、ユニークハッシュ値リスト判別部251を設けることによって、ハッシュ値が全て互いに異なるハッシュ値リストを、ハッシュ値テーブル240が保持するハッシュ値リストから判別することができる。また、確定ハッシュ関数選択部252を設けることによって、ユニークハッシュ値リスト判別部251が判別したハッシュ値リストのうち、ビット幅が最も狭いハッシュ値のハッシュ値リストに関連付けられたハッシュ関数を決定することができる。
なお、ここでは、開始アドレスの最下位ビットから所定の数のビットの値をハッシュ値とするハッシュ関数のみを用いてハッシュ値を生成する場合について説明したが、多様なハッシュ関数を用いることによりビット幅がより狭いハッシュ値を生成することができる。
As described above, in the first embodiment of the present invention, by providing the unique hash value list determination unit 251, the hash value list having all different hash values is determined from the hash value list held in the hash value table 240. can do. In addition, by providing the deterministic hash function selection unit 252, the hash function associated with the hash value list having the narrowest bit value among the hash value lists determined by the unique hash value list determination unit 251 is determined. Can do.
Here, the case where the hash value is generated using only the hash function using the value of the predetermined number of bits from the least significant bit of the start address as the hash value has been described. A narrower hash value can be generated.

また、ここでは、ハッシュ値が全て互いに異なるハッシュ値リストが存在する場合について説明した。しかしながら、ハッシュ値が全て互いに異なるハッシュ値リストがハッシュ値テーブル240に存在しない場合も考えられる。このような場合には、確定ハッシュ関数選択部252は、開始アドレスの値をそのまま出力する関数を出力する。あるいは、確定ハッシュ関数選択部252は、ハッシュ関数が無いことを示す情報を出力する。   Further, here, a case has been described in which there is a hash value list in which all hash values are different from each other. However, there may be a case where there are no hash value lists in the hash value table 240 that have different hash values. In such a case, the deterministic hash function selection unit 252 outputs a function that outputs the value of the start address as it is. Alternatively, the fixed hash function selection unit 252 outputs information indicating that there is no hash function.

[本発明の第1の実施の形態におけるハッシュ関数指定命令の一例]
次に、本発明の第1の実施の形態におけるコンパイル処理装置100が生成するハッシュ関数指定命令について図面を参照して説明する。
[Example of Hash Function Specification Instruction in First Embodiment of the Present Invention]
Next, a hash function specifying instruction generated by the compile processing apparatus 100 according to the first embodiment of the present invention will be described with reference to the drawings.

図6は、本発明の第1の実施の形態におけるハッシュ関数指定命令の一例を示す概念図である。ここでは、データ処理装置のプロセッサコアは、MIPSにより構成されることを想定する。また、ここでは、左端は最上位ビット(MSB)を示し、右端は最下位ビット(LSB)を示している。   FIG. 6 is a conceptual diagram showing an example of a hash function designation instruction in the first embodiment of the present invention. Here, it is assumed that the processor core of the data processing apparatus is configured by MIPS. Here, the left end indicates the most significant bit (MSB), and the right end indicates the least significant bit (LSB).

図6(a)には、オブジェクトプログラムに埋め込まれたハッシュ関数をそのオブジェクトプログラムを実行するデータ処理装置に認識させるためのハッシュ関数指定命令の一例が示されている。このハッシュ関数指定命令は、32個のビット(0乃至31番)のビット列により表現されるものである。このハッシュ関数指定命令は、オペコードフィールド291、ハッシュ関数番地フィールド292、未使用フィールド293、および、ユーザ定義命令フィールド(UDI:User Definable Instruction)295とから構成される。   FIG. 6A shows an example of a hash function specifying instruction for causing a data processing apparatus that executes an object program to recognize a hash function embedded in the object program. This hash function designation command is expressed by a bit string of 32 bits (0 to 31). This hash function designation instruction is composed of an operation code field 291, a hash function address field 292, an unused field 293, and a user-defined instruction field (UDI: User Definable Instruction) 295.

オペコードフィールド291は、命令の種別を指定するフィールドである。このオペコードフィールド291は、第26乃至第31番目のビットから構成されるビット列である。このハッシュ関数指定命令のオペコードフィールド291には、SPECIAL2命令として「011100」のビット列が格納される。ここで、SPECIAL2命令とは、ユーザが独自に定義した命令であることを指し示す命令である。   The opcode field 291 is a field for designating the type of instruction. The opcode field 291 is a bit string composed of the 26th to 31st bits. In the operation code field 291 of the hash function designation instruction, a bit string “011100” is stored as the SPECIAL2 instruction. Here, the SPECIAL2 instruction is an instruction indicating that the instruction is uniquely defined by the user.

ハッシュ関数番地フィールド292は、ハッシュ関数の番地を格納するレジスタを指定するフィールドである。このハッシュ関数番地フィールド292は、第21乃至第25番目のビットから構成されるビット列である。   The hash function address field 292 is a field for designating a register for storing the address of the hash function. The hash function address field 292 is a bit string composed of the 21st to 25th bits.

未使用フィールド293は、ハッシュ関数指定命令では使用されないフィールドである。未使用フィールド293は、第6乃至第20番目のビットから構成される15ビットのビット列である。この未使用フィールド293は、例えば、ビット列(000000000000000)が格納される。   The unused field 293 is a field that is not used in the hash function designation instruction. The unused field 293 is a 15-bit bit string composed of the sixth to twentieth bits. In this unused field 293, for example, a bit string (000000000000000000) is stored.

ユーザ定義命令フィールド(UDI)295は、SPECIAL2命令において、ユーザが定義した複数の命令のうちの1つの命令を指定するフィールドである。このユーザ定義命令フィールド(UDI)295は、第0乃至第5番目のビットから構成されるビット列である。このユーザ定義命令フィールド(UDI)295は、例えば、ビット列(010001)によってハッシュ関数指定命令を指定する。   The user-defined instruction field (UDI) 295 is a field for designating one instruction among a plurality of instructions defined by the user in the SPECIAL2 instruction. The user-defined instruction field (UDI) 295 is a bit string composed of 0th to 5th bits. This user-defined instruction field (UDI) 295 specifies a hash function specifying instruction by a bit string (010001), for example.

このように、本発明の第1の実施の形態では、ハッシュ関数指定命令を用いることによって、オブジェクトプログラムに埋め込まれたハッシュ関数をデータ処理装置に利用させることができる。   As described above, in the first embodiment of the present invention, the hash function embedded in the object program can be used by the data processing apparatus by using the hash function designation instruction.

続いて、図3において確定ハッシュ関数選択部252に関する別の機能として説明した、確定ハッシュ関数選択部252が識別子を出力する場合に用いられる識別子供給命令について説明する。ここで、識別子供給命令とは、オブジェクトプログラムを実行するデータ処理装置に識別子を供給し、その識別子をデータ処理装置に利用させるための命令である。   Next, an identifier supply instruction used when the confirmed hash function selection unit 252 outputs an identifier, which has been described as another function related to the confirmed hash function selection unit 252 in FIG. 3, will be described. Here, the identifier supply instruction is an instruction for supplying an identifier to a data processing apparatus that executes an object program and causing the data processing apparatus to use the identifier.

図6(b)には、ハッシュ関数を指し示す識別子を供給する識別子供給命令の一例が示されている。この識別子供給命令は、32個のビット(0乃至31番)のビット列により表現されるものである。   FIG. 6B shows an example of an identifier supply instruction for supplying an identifier indicating a hash function. This identifier supply command is expressed by a bit string of 32 bits (0 to 31).

この識別子供給命令は、オペコードフィールド291、識別子フィールド294、および、ユーザ定義命令フィールド(UDI)295とから構成される。なお、ここでは、識別子フィールド294以外の各フィールドの機能は、図6(a)で示したハッシュ関数指定命令の各フィールドの機能と同様のものであるため、図6(a)と同符号を付してここでの詳細な説明を省略する。   This identifier supply command is composed of an operation code field 291, an identifier field 294, and a user-defined command field (UDI) 295. Here, since the functions of the fields other than the identifier field 294 are the same as the functions of the fields of the hash function designation instruction shown in FIG. 6A, the same reference numerals as those in FIG. A detailed description thereof is omitted here.

識別子フィールド294は、ハッシュ関数決定部200が決定したハッシュ関数を識別するための識別子を格納するフィールドである。この識別子フィールド294は、例えば、第6乃至第25番目の20ビットから構成されるビット列である。   The identifier field 294 is a field for storing an identifier for identifying the hash function determined by the hash function determination unit 200. This identifier field 294 is, for example, a bit string composed of the 6th to 25th 20 bits.

このように、本発明の第1の実施の形態によれば、ハッシュ関数決定部200が決定したハッシュ関数あるいはそのハッシュ関数を指定する識別子をオブジェクトプログラムに埋め込むことができる。
なお、オペコードフィールド291がSPECIAL2命令である場合には、第6乃至第25番目の20ビットはユーザが定義可能なエンコード空間である。このため、図6(a)および(b)において示したハッシュ関数指定命令および識別子供給命令に限定されるものではなく、種々のパターンが考えられる。
As described above, according to the first embodiment of the present invention, the hash function determined by the hash function determination unit 200 or an identifier designating the hash function can be embedded in the object program.
When the opcode field 291 is a SPECIAL2 instruction, the sixth to 25th 20 bits are an encoding space definable by the user. Therefore, the present invention is not limited to the hash function designation instruction and the identifier supply instruction shown in FIGS. 6A and 6B, and various patterns are conceivable.

[本発明の第1の実施の形態におけるコンパイル処理装置100の動作例]
次に、本発明の第1の実施の形態におけるコンパイル処理装置100の処理について図面を参照して説明する。図7は、本発明の第1の実施の形態におけるコンパイル処理装置100によるコンパイル処理の処理手順を示すフローチャートである。
[Operation example of the compile processing apparatus 100 according to the first embodiment of the present invention]
Next, processing of the compile processing apparatus 100 according to the first embodiment of the present invention will be described with reference to the drawings. FIG. 7 is a flowchart showing a processing procedure of compile processing by the compile processing apparatus 100 according to the first embodiment of the present invention.

まず、ソースプログラム記憶部110からソースプログラムが読み出される(ステップS911)。次に、再利用候補区間抽出部121により、再利用候補区間が抽出される(ステップS912)。   First, a source program is read from the source program storage unit 110 (step S911). Next, a reuse candidate section is extracted by the reuse candidate section extraction unit 121 (step S912).

そして、再利用候補区間解析部122により、再利用候補区間の使用態様が解析される(ステップS913)。続いて、再利用度生成部123により、再利用候補区間の解析結果に基づいて再利用度が生成される(ステップS914)。   Then, the reuse candidate section analysis unit 122 analyzes the usage mode of the reuse candidate section (step S913). Subsequently, the reuse degree generation unit 123 generates a reuse degree based on the analysis result of the reuse candidate section (step S914).

次に、再利用命令変換部124により、再利用度に基づいて再利用候補区間の呼出し命令が再利用命令に変換される(ステップS915)。これは、例えば、関数が再利用候補区間である場合には、関数の呼出し命令(call)が再利用命令(memoCall)に変換されることを意味する。このステップS911乃至S915の一連の処理により、再利用区間が判別される。なお、ステップS911乃至S915は、特許請求の範囲に記載の解析手順の一例である。   Next, the reuse command conversion unit 124 converts the call command for the reuse candidate section into a reuse command based on the degree of reuse (step S915). This means, for example, that a function call instruction (call) is converted into a reuse instruction (memoCall) when the function is a reuse candidate section. The reuse section is determined by a series of processes in steps S911 to S915. Note that steps S911 to S915 are an example of an analysis procedure described in the claims.

そして、ハッシュ関数決定部200により、開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を生成するためのハッシュ関数を決定するハッシュ関数決定処理が行われる(ステップS920)。   Then, the hash function determination unit 200 performs a hash function determination process for determining a hash function for generating a hash value for identifying a reuse section with a bit width narrower than the bit width of the start address (step S920).

最後に、機械語プログラム生成部140により、ハッシュ関数を埋め込んだ機械語プログラムが解析されたプログラムおよびハッシュ関数に基づいて生成される(ステップS918)。そして、コンパイル処理は終了する。なお、ステップS918は、特許請求の範囲に記載の機械語プログラム生成手順の一例である。   Finally, the machine language program generation unit 140 generates a machine language program in which the hash function is embedded based on the analyzed program and the hash function (step S918). Then, the compilation process ends. Note that step S918 is an example of a machine language program generation procedure described in the claims.

図8は、本発明の第1の実施の形態におけるハッシュ関数決定部200によるハッシュ関数決定処理(ステップS920)の処理手順例の前半を示すフローチャートである。なお、ここでは、ハッシュ関数の総数とは、開始アドレスをそのまま出力するハッシュ関数と、図4において示した式3乃至式7のハッシュ関数とを合わせた数の「6」であることを想定する。
まず、開始アドレス取得部210により、再利用区間の開始アドレスがプログラムから取得され、開始アドレス取得部210に開始アドレスリストとして保持される(ステップS921)。
FIG. 8 is a flowchart illustrating the first half of a processing procedure example of the hash function determination processing (step S920) by the hash function determination unit 200 according to the first embodiment of the present invention. Here, it is assumed that the total number of hash functions is “6”, which is the total number of hash functions that output the start address as it is and the hash functions of Expressions 3 to 7 shown in FIG. .
First, the start address acquisition unit 210 acquires the start address of the reuse section from the program and holds it as a start address list in the start address acquisition unit 210 (step S921).

次に、ハッシュ関数カウンタ(hn)が「1」に初期化される(ステップS922)。なお、ここで示すハッシュ関数カウンタ(hn)とは、候補ハッシュ値生成部230によりハッシュ値が生成されたハッシュ関数を識別する値である。例えば、このハッシュ関数カウンタ(hn)は、図5において示したハッシュ値リスト272乃至276に関連付けられた式7乃至式3を識別するために付加される「1乃至5」の値である。   Next, the hash function counter (hn) is initialized to “1” (step S922). The hash function counter (hn) shown here is a value for identifying the hash function for which the hash value is generated by the candidate hash value generation unit 230. For example, the hash function counter (hn) is a value of “1 to 5” added to identify the expressions 7 to 3 associated with the hash value lists 272 to 276 shown in FIG.

なお、ハッシュ関数カウンタ(hn)の値の「0」には、開始アドレスをそのまま出力するハッシュ関数が割り当てられるものとする。例えば、その開始アドレスをそのまま出力するハッシュ関数として、「h(ハッシュ値)=a(開始アドレス)」などが考えられる。   It is assumed that the hash function that outputs the start address as it is is assigned to the value “0” of the hash function counter (hn). For example, “h (hash value) = a (start address)” can be considered as a hash function that outputs the start address as it is.

続いて、開始アドレスカウンタ(an)が「0」に初期化される(ステップS923)。なお、ここで示す開始アドレスカウンタ(an)とは、ハッシュ関数カウンタ(hn)とともに用いることによって、ハッシュ値テーブル240に保持されたハッシュ値を識別する値である。   Subsequently, the start address counter (an) is initialized to “0” (step S923). Note that the start address counter (an) shown here is a value for identifying a hash value held in the hash value table 240 when used together with the hash function counter (hn).

例えば、この開始アドレスカウンタ(an)は、ハッシュ関数カウンタ(hn)が「1」の場合には、式7が関連付けられたハッシュ値リスト272の8つのハッシュ値を識別するための「0乃至7」の値である。また、この開始アドレスカウンタ(an)は、例えば、ハッシュ関数カウンタ(hn)が「5」の場合には、式3が関連付けられたハッシュ値リスト276の8つのハッシュ値を識別するための「0乃至7」の値である。   For example, when the hash function counter (hn) is “1”, the start address counter (an) is “0 to 7 for identifying eight hash values in the hash value list 272 associated with the expression 7. ". For example, when the hash function counter (hn) is “5”, the start address counter (an) is “0” for identifying the eight hash values in the hash value list 276 associated with Expression 3. To 7 ".

そして、候補ハッシュ値生成部230により、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数を用いて、開始アドレスカウンタ(an)が指し示す開始アドレスを関数入力値としてハッシュ値が算出される(ステップS924)。次に、開始アドレスカウンタ(an)に「1」が加算される(ステップS925)。   Then, the hash value is calculated by the candidate hash value generation unit 230 using the hash function indicated by the hash function counter (hn), using the start address indicated by the start address counter (an) as a function input value (step S924). Next, “1” is added to the start address counter (an) (step S925).

続いて、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数であるか否かが判断される(ステップS926)。そして、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数でないと判断された場合には、ステップS924に戻る。これにより、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数を用いてまだ算出されていないハッシュ値が算出される。   Subsequently, it is determined whether or not the start address counter (an) is the total number of start addresses in the start address list (step S926). When it is determined that the start address counter (an) is not the total number of start addresses in the start address list, the process returns to step S924. Thereby, a hash value that has not been calculated yet is calculated using the hash function indicated by the hash function counter (hn).

一方、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数であると判断された場合には、ハッシュ関数カウンタ(hn)に「1」が加算される(ステップS927)。   On the other hand, when it is determined that the start address counter (an) is the total number of start addresses in the start address list, “1” is added to the hash function counter (hn) (step S927).

続いて、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であるか否かが判断される(ステップS928)。そして、ハッシュ関数カウンタ(hn)がハッシュ関数の総数でないと判断された場合には、ステップS923に戻る。これにより、まだハッシュ値が算出されていないハッシュ関数を用いてハッシュ関数が算出される。なお、ステップS922乃至S928は、特許請求の範囲に記載の候補値生成手順の一例である。   Subsequently, it is determined whether or not the hash function counter (hn) is the total number of hash functions (step S928). When it is determined that the hash function counter (hn) is not the total number of hash functions, the process returns to step S923. Thereby, a hash function is calculated using a hash function for which a hash value has not yet been calculated. Note that steps S922 to S928 are an example of a candidate value generation procedure described in the claims.

一方、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、ステップS929に進む。   On the other hand, if it is determined that the hash function counter (hn) is the total number of hash functions, the process proceeds to step S929.

図9は、本発明の第1の実施の形態におけるハッシュ関数決定部200によるハッシュ関数決定処理(ステップS920)の処理手順例の後半を示すフローチャートである。   FIG. 9 is a flowchart illustrating the second half of the processing procedure example of the hash function determination processing (step S920) by the hash function determination unit 200 according to the first embodiment of the present invention.

まず、図8のステップS928においてハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、選択ハッシュ関数カウンタ(h)が「0」に初期化される(ステップS929)。   First, when it is determined in step S928 in FIG. 8 that the hash function counter (hn) is the total number of hash functions, the selected hash function counter (h) is initialized to “0” (step S929).

続いて、ハッシュ値ビット幅サイズ(ws)がハッシュ関数カウンタ(0)のハッシュ関数により生成されるハッシュ値のビット幅に変更される(ステップS931)。すなわち、ハッシュ値ビット幅サイズ(ws)には開始アドレスのビット幅の64ビットが設定される。   Subsequently, the hash value bit width size (ws) is changed to the bit width of the hash value generated by the hash function of the hash function counter (0) (step S931). That is, 64 bits of the bit width of the start address are set as the hash value bit width size (ws).

そして、ハッシュ関数カウンタ(hn)が「1」に変更される(ステップS932)。続いて、ユニークハッシュ値リスト判別部251により、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数に対応するハッシュ値リストのハッシュ値が全て互いに異なるか否かが判別される(ステップS933)。そして、ハッシュ関数(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値が全て互いに異なっていないと判別された場合には、ステップS937に進む。   Then, the hash function counter (hn) is changed to “1” (step S932). Subsequently, the unique hash value list determination unit 251 determines whether or not all hash values in the hash value list corresponding to the hash function indicated by the hash function counter (hn) are different from each other (step S933). If it is determined that all hash values in the hash value list associated with the hash function indicated by the hash function (hn) are not different from each other, the process proceeds to step S937.

一方、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値が全て互いに異なっていると判別された場合には、ステップS934に進む。ステップS934では、確定ハッシュ関数選択部252により、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅が、ハッシュ値ビット幅サイズ(ws)より小さい値であるか否かが判断される。そして、ハッシュ関数(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅がwsより小さい値ではないと判断された場合には、ステップS937に進む。   On the other hand, if it is determined that all hash values in the hash value list associated with the hash function indicated by the hash function counter (hn) are different from each other, the process proceeds to step S934. In step S <b> 934, the bit width of the hash value in the hash value list associated with the hash function indicated by the hash function counter (hn) is smaller than the hash value bit width size (ws) by the confirmed hash function selection unit 252. It is determined whether or not. When it is determined that the bit width of the hash value in the hash value list associated with the hash function indicated by the hash function (hn) is not a value smaller than ws, the process proceeds to step S937.

一方、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅がハッシュ値ビット幅サイズ(ws)より小さい値であると判断された場合には、ステップS935に進む。ステップS935では、選択ハッシュ関数番号(h)がハッシュ関数カウンタ(hn)の値に変更される。   On the other hand, if it is determined that the bit width of the hash value in the hash value list associated with the hash function indicated by the hash function counter (hn) is smaller than the hash value bit width size (ws), the process proceeds to step S935. move on. In step S935, the selected hash function number (h) is changed to the value of the hash function counter (hn).

続いて、ハッシュ値ビット幅サイズ(ws)が、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅に変更される(ステップS936)。   Subsequently, the hash value bit width size (ws) is changed to the bit width of the hash value in the hash value list associated with the hash function indicated by the hash function counter (hn) (step S936).

そして、ハッシュ関数カウンタ(hn)に「1」が加算される(ステップS937)。次に、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であるか否かが判断される(ステップS938)。そして、ハッシュ関数カウンタ(hn)がハッシュ関数の総数でないと判断された場合には、ステップS933に戻る。   Then, “1” is added to the hash function counter (hn) (step S937). Next, it is determined whether or not the hash function counter (hn) is the total number of hash functions (step S938). When it is determined that the hash function counter (hn) is not the total number of hash functions, the process returns to step S933.

一方、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、選択ハッシュ関数(h)が指し示すハッシュ関数がハッシュ関数決定部200の決定したハッシュ関数として出力される(ステップS939)。なお、ステップS929乃至S939は、特許請求の範囲に記載の区間識別値生成関数出力手順の一例である。   On the other hand, when it is determined that the hash function counter (hn) is the total number of hash functions, the hash function indicated by the selected hash function (h) is output as the hash function determined by the hash function determination unit 200 (step S939). Note that steps S929 to S939 are an example of the section identification value generation function output procedure described in the claims.

このように、本発明の第1の実施の形態では、全て互いに異なるハッシュ値であってビット幅が最も狭くなるハッシュ値を生成するハッシュ関数を複数のハッシュ関数から選択して、プログラムに埋め込むことができる。   As described above, in the first embodiment of the present invention, a hash function that generates hash values that are all different hash values and have the smallest bit width is selected from a plurality of hash functions and embedded in a program. Can do.

なお、ここでは、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数に関連付けられたハッシュ値リストのハッシュ値のビット幅に基づいてハッシュ関数を選択したが、本発明はこれに限定されるものではない。例えば、ハッシュ値リストのハッシュ値のビット幅を総和した値に基づいてハッシュ関数を選択する場合なども考えられる。   Here, the hash function is selected based on the bit width of the hash value in the hash value list associated with the hash function indicated by the hash function counter (hn), but the present invention is not limited to this. For example, a case where a hash function is selected based on a value obtained by summing up the bit widths of the hash values in the hash value list may be considered.

<2.第2の実施の形態>
[本発明の第2の実施の形態におけるデータ処理装置300の構成例]
図10は、本発明の第2の実施の形態におけるデータ処理装置300の構成例を示すブロック図である。このデータ処理装置300は、バス350を介して主記憶部360と相互に接続されている。また、ここでは、データ処理装置300が処理を実行する命令区間は関数またはループであることを想定する。さらに、ここでは、データ処理装置300は、本発明の第1の実施の形態におけるコンパイル処理装置100により生成されたオブジェクトプログラムを実行することとする。
<2. Second Embodiment>
[Configuration Example of Data Processing Device 300 in Second Embodiment of the Present Invention]
FIG. 10 is a block diagram illustrating a configuration example of the data processing device 300 according to the second embodiment of the present invention. The data processing device 300 is connected to the main storage unit 360 via the bus 350. Here, it is assumed that the instruction section in which the data processing device 300 executes processing is a function or a loop. Furthermore, here, it is assumed that the data processing device 300 executes the object program generated by the compile processing device 100 according to the first embodiment of the present invention.

データ処理装置300は、プログラムにおける各処理を実行するものである。このデータ処理装置300は、例えば、一般的なコンピュータにおいてはCPU(Central Processing Unit)により実現される。このデータ処理装置300は、一次キャッシュ310と、プロセッサコア400と、ハッシュ変換部500と、履歴管理部600とを備える。   The data processing device 300 executes each process in the program. The data processing device 300 is realized by a CPU (Central Processing Unit) in a general computer, for example. The data processing device 300 includes a primary cache 310, a processor core 400, a hash conversion unit 500, and a history management unit 600.

一次キャッシュ310は、プロセッサコア400がバス350を介して扱う情報を一時的に保持するものである。この一次キャッシュ310は、命令キャッシュ311およびデータキャッシュ312を備える。   The primary cache 310 temporarily holds information handled by the processor core 400 via the bus 350. The primary cache 310 includes an instruction cache 311 and a data cache 312.

命令キャッシュ311は、プロセッサコア400において実行される命令を一時的に保持するものである。この命令キャッシュ311は、プロセッサコア400が頻繁に実行する命令を一時的に保持することによって、プロセッサコア400から主記憶部360へのアクセスを軽減させ、プロセッサコア400におけるデータの入力待ち時間を短縮させることができる。この命令キャッシュ311は、例えば、主記憶部360から供給された再利用命令およびハッシュ関数を指定する命令をプロセッサコア400に供給する。   The instruction cache 311 temporarily holds instructions executed in the processor core 400. This instruction cache 311 temporarily holds instructions frequently executed by the processor core 400, thereby reducing access from the processor core 400 to the main storage unit 360 and shortening data input waiting time in the processor core 400. Can be made. The instruction cache 311 supplies the processor core 400 with, for example, a reuse instruction supplied from the main storage unit 360 and an instruction specifying a hash function.

データキャッシュ312は、プロセッサコア400の入力データおよび出力データを一時的に保持するものである。このデータキャッシュ312は、使用頻度の高いプロセッサコア400の入力データを一時的に保持することによりプロセッサコア400から主記憶部360へのアクセスを軽減させて、プロセッサコア400におけるデータの入力待ち時間を軽減させる。このデータキャッシュ312は、例えば、主記憶部360から供給された関数またはループの入力値および開始アドレスをプロセッサコア400に出力する。また、このデータキャッシュ312は、例えば、主記憶部360から供給されたハッシュ関数に関する情報をプロセッサコア400に出力する。   The data cache 312 temporarily holds input data and output data of the processor core 400. The data cache 312 temporarily reduces the access from the processor core 400 to the main storage unit 360 by temporarily holding input data of the processor core 400 that is frequently used, thereby reducing the data input waiting time in the processor core 400. Reduce. For example, the data cache 312 outputs the input value and start address of the function or loop supplied from the main storage unit 360 to the processor core 400. In addition, the data cache 312 outputs, for example, information related to the hash function supplied from the main storage unit 360 to the processor core 400.

プロセッサコア400は、プログラムの命令に従って演算を実行するものである。このプロセッサコア400は、例えば、MIPS(Microprocessor without Interlocked Pipeline Stages)プロセッサにより実現される。プロセッサコア400は、例えば、データキャッシュ312から供給される関数またはループの入力値および開始アドレスに基づいて、命令キャッシュ311から入力される関数またはループの区間における命令を実行し、その実行の結果を実行結果として出力する。   The processor core 400 executes operations according to program instructions. The processor core 400 is realized by, for example, a MIPS (Microprocessor without Interlocked Pipeline Stages) processor. For example, the processor core 400 executes an instruction in the function or loop section input from the instruction cache 311 based on the input value and start address of the function or loop supplied from the data cache 312, and the result of the execution is executed. Output as the execution result.

このプロセッサコア400は、入力される命令が再利用区間を指定する再利用命令である場合において履歴管理部600から実行結果が供給されないときには、この命令を実行した結果である実行結果をデータキャッシュ312および履歴管理部600に出力する。また、このプロセッサコア400は、再利用命令を実行した際には、再利用命令が指定する再利用区間の開始アドレスをハッシュ変換部500に供給する。   When the input instruction is a reuse instruction that designates a reuse section and the execution result is not supplied from the history management unit 600, the processor core 400 displays the execution result that is the result of executing this instruction in the data cache 312. And output to the history management unit 600. Further, when executing the reuse instruction, the processor core 400 supplies the hash conversion unit 500 with the start address of the reuse section specified by the reuse instruction.

さらに、プロセッサコア400は、入力される命令が再利用区間を指定する再利用命令である場合において履歴管理部600から実行結果が供給されたときには、再利用区間における処理を中止して、この再利用区間を呼び出したルーチンに戻って実行を継続する。   Further, when the execution result is supplied from the history management unit 600 when the input instruction is a reuse instruction designating a reuse section, the processor core 400 stops the process in the reuse section and performs this re-use. Return to the routine that called the usage interval and continue execution.

ハッシュ変換部500は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値に開始アドレスを変換するものである。このハッシュ変換部500は、プログラムの命令のうちハッシュ関数を指定する命令に基づいてハッシュ関数を保持する。このハッシュ変換部500は、その保持しているハッシュ関数を用いて、プロセッサコア400から供給された関数またはループの開始アドレスからハッシュ値を生成する。このハッシュ変換部500は、その生成したハッシュ値を履歴管理部600に供給する。   The hash conversion unit 500 converts the start address into a hash value that identifies the reuse section with a bit width narrower than the bit width of the start address of the reuse section. The hash conversion unit 500 holds a hash function based on an instruction that designates a hash function among the instructions of the program. The hash conversion unit 500 generates a hash value from the function or loop start address supplied from the processor core 400 using the stored hash function. The hash conversion unit 500 supplies the generated hash value to the history management unit 600.

履歴管理部600は、再利用区間の実行結果を保持して管理するものである。この履歴管理部600は、プロセッサコア400から供給された再利用区間の入力値および実行結果と、ハッシュ変換部500から供給されたハッシュ値とを実行履歴として保持する。また、この履歴管理部600は、ハッシュ値と関数またはループの入力値とが供給された場合には、このハッシュ値と入力値とが含まれる実行履歴を検索する。   The history management unit 600 holds and manages the execution result of the reuse section. The history management unit 600 holds the input value and execution result of the reuse section supplied from the processor core 400 and the hash value supplied from the hash conversion unit 500 as an execution history. Further, when the hash value and the input value of the function or loop are supplied, the history management unit 600 searches for an execution history including the hash value and the input value.

バス350は、データ処理装置300の各部と主記憶部360との間を相互に接続するバスである。   The bus 350 is a bus that interconnects each unit of the data processing device 300 and the main storage unit 360.

主記憶部360は、データ処理装置300が動作するために必要なデータを保持するものである。この主記憶部360は、データ処理装置300に処理を実行させるためのプログラムを記憶する。この主記憶部360は、例えば、RAM(Random Access Memory)などが考えられる。この主記憶部360は、記憶しているデータを、バス350を介してデータ処理装置300に出力する。   The main storage unit 360 holds data necessary for the data processing apparatus 300 to operate. The main storage unit 360 stores a program for causing the data processing device 300 to execute processing. For example, a RAM (Random Access Memory) may be used as the main storage unit 360. The main storage unit 360 outputs the stored data to the data processing device 300 via the bus 350.

[本発明の第2の実施の形態におけるプロセッサコア400とハッシュ変換部500と履歴管理部600との構成例]
図11は、本発明の第2の実施の形態におけるプロセッサコア400とハッシュ変換部500と履歴管理部600との構成例を示すブロック図である。ここでは、プロセッサコア400とハッシュ変換部500と履歴管理部600とが示されている。また、ここでは、プロセッサコア400とハッシュ変換部500と履歴管理部600との機能は、図10と同様のものであるため、同一の符号を付してここでの詳細な説明を省略する。
[Configuration example of the processor core 400, the hash conversion unit 500, and the history management unit 600 in the second embodiment of the present invention]
FIG. 11 is a block diagram illustrating a configuration example of the processor core 400, the hash conversion unit 500, and the history management unit 600 according to the second embodiment of the present invention. Here, a processor core 400, a hash conversion unit 500, and a history management unit 600 are shown. Here, since the functions of the processor core 400, the hash conversion unit 500, and the history management unit 600 are the same as those in FIG. 10, the same reference numerals are given and detailed description thereof is omitted here.

プロセッサコア400は、フェッチ部410と、命令デコーダ420と、実行部430と、レジスタファイル440とを備える。   The processor core 400 includes a fetch unit 410, an instruction decoder 420, an execution unit 430, and a register file 440.

フェッチ部410は、命令キャッシュ311または主記憶部360からの命令を読み出すものである。このフェッチ部410は、その読み出した命令を一時的に保持して、その保持されている命令のうち、実行部430に実行させるための命令を命令デコーダ420に供給する。このフェッチ部410は、例えば、一時的に保持している命令のうち、実行部430において実行される再利用命令を命令デコーダ420に供給する。このフェッチ部410は、例えば、主記憶部360に記憶された再利用命令を命令デコーダ420に供給する。   The fetch unit 410 reads an instruction from the instruction cache 311 or the main storage unit 360. The fetch unit 410 temporarily holds the read instruction, and supplies an instruction to the instruction decoder 420 to be executed by the execution unit 430 among the held instructions. For example, the fetch unit 410 supplies a reuse instruction to be executed by the execution unit 430 among the temporarily held instructions to the instruction decoder 420. For example, the fetch unit 410 supplies a reuse instruction stored in the main storage unit 360 to the instruction decoder 420.

命令デコーダ420は、フェッチ部410から供給された命令を解読(デコード)することによって、プロセッサコア400における構成部位を制御する制御信号を生成するものである。この命令デコーダ420は、例えば、命令を解読することによって実行部430およびレジスタファイル440を制御する制御信号を生成して、その生成された制御信号を実行部430およびレジスタファイル440に供給する。   The instruction decoder 420 generates a control signal for controlling the components in the processor core 400 by decoding (decoding) the instruction supplied from the fetch unit 410. For example, the instruction decoder 420 generates a control signal for controlling the execution unit 430 and the register file 440 by decoding the instruction, and supplies the generated control signal to the execution unit 430 and the register file 440.

この命令デコーダ420は、フェッチ部410から再利用命令が供給された場合には、その再利用命令を解読することによって、実行部430およびレジスタファイル440の各々を制御する制御信号を実行部430およびレジスタファイル440に供給する。   When a reuse instruction is supplied from the fetch unit 410, the instruction decoder 420 decodes the reuse instruction to generate control signals for controlling the execution unit 430 and the register file 440. This is supplied to the register file 440.

実行部430は、命令デコーダ420から供給された制御信号に基づいて、命令デコーダ420において解読した命令を実行するものである。この実行部430は、命令デコーダ420においてハッシュ関数を指定する命令をデコードした場合には、レジスタファイル440から取得したハッシュ関数を、信号線407を介してハッシュ変換部500に出力する。   The execution unit 430 executes the instruction decoded by the instruction decoder 420 based on the control signal supplied from the instruction decoder 420. When the instruction decoder 420 decodes an instruction specifying a hash function, the execution unit 430 outputs the hash function acquired from the register file 440 to the hash conversion unit 500 via the signal line 407.

また、この実行部430は、命令デコーダ420が再利用命令をデコードした場合には、再利用命令が指定する再利用区間の処理を開始する。そして、この再利用区間の処理の開始とともに、実行部430は、レジスタファイル440から取得した再利用区間の開始アドレスを、信号線408を介してハッシュ変換部500に出力する。そして、実行部430は、レジスタファイル440から供給される再利用区間の入力値に基づいて再利用区間における処理を実行するとともに、再利用区間の入力値を、信号線409を介して履歴管理部600に出力する。   Further, when the instruction decoder 420 decodes the reuse instruction, the execution unit 430 starts processing of the reuse section specified by the reuse instruction. Then, along with the start of processing of the reuse section, the execution unit 430 outputs the reuse section start address acquired from the register file 440 to the hash conversion unit 500 via the signal line 408. The execution unit 430 executes processing in the reuse section based on the input value of the reuse section supplied from the register file 440, and the history management section receives the input value of the reuse section via the signal line 409. Output to 600.

なお、実行部430は、履歴管理部600から再利用区間の実行結果が供給された場合には、再利用区間の処理を中止するとともに、その実行結果を履歴管理部600から供給された旨を通知する信号をフェッチ部410に供給する。この時、実行部430は、実行結果をレジスタファイル440に出力する。   In addition, when the execution result of the reuse section is supplied from the history management unit 600, the execution unit 430 cancels the processing of the reuse section and indicates that the execution result is supplied from the history management unit 600. A signal to be notified is supplied to the fetch unit 410. At this time, the execution unit 430 outputs the execution result to the register file 440.

一方、実行部430は、履歴管理部600から再利用区間の実行結果が供給されない場合には、再利用区間の処理を最後まで実行して、その実行結果をレジスタファイル440に出力するとともに信号線409を介して履歴管理部600に出力する。   On the other hand, when the execution result of the reuse section is not supplied from the history management unit 600, the execution unit 430 executes the process of the reuse section to the end, and outputs the execution result to the register file 440 and the signal line. The information is output to the history management unit 600 via 409.

レジスタファイル440は、データキャッシュ312から供給されたデータおよび実行部430から供給された実行結果を一時的に保持するものである。このレジスタファイル440は、例えば、命令デコーダ420から再利用命令に基づく制御信号が供給された場合には、再利用区間の入力値を実行部430に供給する。   The register file 440 temporarily holds the data supplied from the data cache 312 and the execution result supplied from the execution unit 430. For example, when a control signal based on a reuse instruction is supplied from the instruction decoder 420, the register file 440 supplies the input value of the reuse section to the execution unit 430.

ハッシュ変換部500は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値に開始アドレスを変換させるものである。このハッシュ変換部500は、確定ハッシュ関数保持部510および確定ハッシュ値生成部520を備える。   The hash conversion unit 500 converts the start address into a hash value that identifies the reuse section with a bit width narrower than the bit width of the start address of the reuse section. The hash conversion unit 500 includes a fixed hash function holding unit 510 and a fixed hash value generation unit 520.

確定ハッシュ関数保持部510は、実行部430から供給されたハッシュ関数を保持するものである。すなわち、この確定ハッシュ関数保持部510は、図3において示した確定ハッシュ関数選択部252が確定したハッシュ関数を保持する。この確定ハッシュ関数保持部510は、実行部430から信号線407を介して供給されたハッシュ関数を保持し、その保持したハッシュ関数を確定ハッシュ値生成部520に供給する。   The fixed hash function holding unit 510 holds the hash function supplied from the execution unit 430. That is, the fixed hash function holding unit 510 holds the hash function fixed by the fixed hash function selecting unit 252 shown in FIG. The fixed hash function holding unit 510 holds the hash function supplied from the execution unit 430 via the signal line 407, and supplies the held hash function to the fixed hash value generation unit 520.

確定ハッシュ値生成部520は、確定ハッシュ関数保持部510から供給されたハッシュ関数を用いて、実行部430から供給された開始アドレスからハッシュ値を生成するものである。すなわち、この確定ハッシュ値生成部520は、図3において示した確定ハッシュ関数選択部252が確定したハッシュ関数を用いて、実行部430から供給された開始アドレスからハッシュ値を生成する。この確定ハッシュ値生成部520は、信号線408を介して関数あるいはループの開始アドレスが供給された場合には、確定ハッシュ関数保持部510が保持しているハッシュ関数を用いてハッシュ値を生成する。この確定ハッシュ値生成部520は、その生成されたハッシュ値を信号線509を介して履歴対象データ保持部610に供給する。なお、確定ハッシュ値生成部520は、特許請求の範囲に記載の区間識別値生成部の一例である。なお、確定ハッシュ値生成部520が生成するハッシュ値は、特許請求の範囲に記載の区間識別値の一例である。また、確定ハッシュ値生成部520が用いるハッシュ関数は、特許請求の範囲に記載の区間識別値生成関数の一例である。   The fixed hash value generation unit 520 generates a hash value from the start address supplied from the execution unit 430 using the hash function supplied from the fixed hash function holding unit 510. That is, the confirmed hash value generation unit 520 generates a hash value from the start address supplied from the execution unit 430, using the hash function confirmed by the confirmed hash function selection unit 252 shown in FIG. When the function or loop start address is supplied via the signal line 408, the fixed hash value generation unit 520 generates a hash value using the hash function held by the fixed hash function holding unit 510. . The confirmed hash value generation unit 520 supplies the generated hash value to the history target data holding unit 610 via the signal line 509. The confirmed hash value generation unit 520 is an example of a section identification value generation unit described in the claims. The hash value generated by the confirmed hash value generation unit 520 is an example of the section identification value described in the claims. Further, the hash function used by the fixed hash value generation unit 520 is an example of the section identification value generation function described in the claims.

履歴管理部600は、再利用区間の実行結果を保持して管理するものであり、履歴対象データ保持部610と、履歴検索部620と、履歴メモリ630と、履歴登録部640とを備える。   The history management unit 600 holds and manages the execution result of the reuse section, and includes a history target data holding unit 610, a history search unit 620, a history memory 630, and a history registration unit 640.

履歴対象データ保持部610は、実行部430および確定ハッシュ値生成部520から供給されたデータを一時的に保持するものである。この履歴対象データ保持部610は、実行部430から入力値が供給され、かつ、確定ハッシュ値生成部520からハッシュ値が供給された際には、これらを検索要求として履歴検索部620に供給する。この履歴対象データ保持部610は、例えば、実行部430において関数の再利用区間が実行された場合には、実行部430から供給された関数の入力値と、確定ハッシュ値生成部520から供給されたハッシュ値とを検索要求として履歴検索部620に供給する。また、履歴対象データ保持部610は、実行部430においてループの再利用区間が実行された場合には、実行部430からの入力値およびループカウンタ値と、確定ハッシュ値生成部520からのハッシュ値とを検索要求として履歴検索部620に供給する。ここで、ループカウンタ値とは、そのループ区間の何回目の実行による実行結果であるのかを示す値である。   The history target data holding unit 610 temporarily holds data supplied from the execution unit 430 and the confirmed hash value generation unit 520. When the input value is supplied from the execution unit 430 and the hash value is supplied from the confirmed hash value generation unit 520, the history target data holding unit 610 supplies these to the history search unit 620 as a search request. . The history target data holding unit 610 is supplied from the input value of the function supplied from the execution unit 430 and the fixed hash value generation unit 520, for example, when a function reuse section is executed in the execution unit 430. The hash value is supplied to the history search unit 620 as a search request. In addition, when the execution unit 430 executes a loop reuse section, the history target data holding unit 610 and the hash value from the confirmed hash value generation unit 520 and the input value and loop counter value from the execution unit 430 Are supplied to the history search unit 620 as a search request. Here, the loop counter value is a value indicating the number of times of execution in the loop section.

また、この履歴対象データ保持部610は、実行部430からは入力値および実行結果が供給され、確定ハッシュ値生成部520からはハッシュ値が供給された場合には、実行履歴を登録する条件を満たすため、これらを実行履歴として履歴登録部640に供給する。例えば、履歴対象データ保持部610は、実行部430において関数の再利用区間が実行された場合には、実行部430からの入力値および実行結果と、確定ハッシュ値生成部520からのハッシュ値とを実行履歴として履歴登録部640に供給する。また、履歴対象データ保持部610は、実行部430においてループの再利用区間が実行された場合には、実行部430からの入力値、実行結果、ループカウンタ値と、確定ハッシュ値生成部520からのハッシュ値とを実行履歴として履歴登録部640に供給する。   Further, the history target data holding unit 610 is provided with a condition for registering an execution history when an input value and an execution result are supplied from the execution unit 430 and a hash value is supplied from the confirmed hash value generation unit 520. In order to satisfy them, these are supplied to the history registration unit 640 as an execution history. For example, when the execution unit 430 executes a function reuse section, the history target data holding unit 610 receives the input value and execution result from the execution unit 430, the hash value from the confirmed hash value generation unit 520, and the like. Is supplied to the history registration unit 640 as an execution history. Further, the history target data holding unit 610 receives the input value from the execution unit 430, the execution result, the loop counter value, and the confirmed hash value generation unit 520 when the execution unit 430 executes the loop reuse section. Are supplied to the history registration unit 640 as an execution history.

履歴検索部620は、履歴対象データ保持部610から供給された検索要求に基づいて実行履歴を検索するものである。この履歴検索部620は、検索要求入力部621および実行結果出力部622を備える。   The history search unit 620 searches the execution history based on the search request supplied from the history target data holding unit 610. The history search unit 620 includes a search request input unit 621 and an execution result output unit 622.

検索要求入力部621は、履歴対象データ保持部610から供給された検索要求に基づいて履歴メモリ630から実行履歴を検索するものである。この検索要求入力部621は、例えば、関数の再利用区間を指定する命令が命令デコーダ420において解読された場合には、この命令により指定された関数の開始アドレスから生成されたハッシュ値と、この関数の入力値とを履歴メモリ630に供給する。また、この検索要求入力部621は、ループの再利用区間を指定する命令が命令デコーダ420において解読された場合には、この指定されたループの開始アドレスから生成されたハッシュ値と、入力値と、ループカウンタ値とを履歴メモリ630に供給する。   The search request input unit 621 searches for an execution history from the history memory 630 based on the search request supplied from the history target data holding unit 610. For example, when an instruction designating a reuse section of a function is decoded by the instruction decoder 420, the search request input unit 621 includes a hash value generated from the start address of the function designated by the instruction, The function input value is supplied to the history memory 630. Further, when an instruction designating a loop reuse section is decoded by the instruction decoder 420, the search request input unit 621 reads the hash value generated from the designated loop start address, the input value, The loop counter value is supplied to the history memory 630.

実行結果出力部622は、履歴メモリ630において実行履歴が検索された場合に実行結果を履歴メモリ630から抽出して、その抽出した実行結果を実行部430に出力するものである。この実行結果出力部622は、その抽出した実行結果を、信号線609を介して実行部430に供給する。   The execution result output unit 622 extracts an execution result from the history memory 630 when the execution history is searched in the history memory 630 and outputs the extracted execution result to the execution unit 430. The execution result output unit 622 supplies the extracted execution result to the execution unit 430 via the signal line 609.

履歴メモリ630は、履歴登録部640から供給された実行履歴を保持するものである。この履歴メモリ630は、例えば、履歴検索部620から検索要求が供給された場合において、この検索要求と一致する実行履歴を保持しているときは、この実行履歴の実行結果を実行結果出力部622に供給する。さらに、この履歴メモリ630は、履歴登録部640から実行履歴が供給された場合には、この実行履歴を保持する。この履歴メモリ630は、例えば、連想メモリ(CAM:Content Addressable Memory)により実現される。   The history memory 630 holds the execution history supplied from the history registration unit 640. For example, when a search request is supplied from the history search unit 620, the history memory 630 holds an execution history that matches the search request, and displays the execution result of the execution history as an execution result output unit 622. To supply. Further, when an execution history is supplied from the history registration unit 640, the history memory 630 holds the execution history. The history memory 630 is realized by, for example, a content addressable memory (CAM).

履歴登録部640は、履歴対象データ保持部610から供給された実行履歴を履歴メモリ630に保持させるためのデータ構造に変換して、その変換された実行履歴を履歴メモリ630に登録するものである。この履歴登録部640は、例えば、履歴検索部620により関数の実行履歴が検索されない場合には、その関数の開始アドレスから生成されたハッシュ値と、入力値と、実行結果とを実行履歴として履歴メモリ630に登録する。また、この履歴登録部640は、例えば、履歴検索部620によりループの実行履歴が検索されない場合には、ループの開始アドレスから生成されたハッシュ値と、入力値と、実行結果と、ループカウンタ値とを実行履歴として履歴メモリ630に登録する。   The history registration unit 640 converts the execution history supplied from the history target data holding unit 610 into a data structure for holding the history memory 630, and registers the converted execution history in the history memory 630. . For example, when the history search unit 620 does not search for the execution history of the function, the history registration unit 640 uses the hash value generated from the start address of the function, the input value, and the execution result as a history of execution. Register in the memory 630. In addition, for example, when the loop search history is not searched by the history search unit 620, the history registration unit 640 generates a hash value, an input value, an execution result, and a loop counter value generated from the loop start address. Are registered in the history memory 630 as an execution history.

このように、本発明の第2の実施の形態では、データ処理装置300にハッシュ変換部500を設けることによって、本発明の第1の実施の形態の装置によりハッシュ関数が埋め込まれたプログラムを実行して開始アドレスをハッシュ値に変換することができる。これにより、開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を開始アドレスの代わりに履歴メモリ630に保持させることができる。   As described above, in the second embodiment of the present invention, the hash conversion unit 500 is provided in the data processing device 300 so that the program in which the hash function is embedded is executed by the device of the first embodiment of the present invention. Thus, the start address can be converted into a hash value. As a result, a hash value for identifying a reuse section with a bit width narrower than the bit width of the start address can be held in the history memory 630 instead of the start address.

すなわち、従来の技術では関数の実行履歴として開始アドレス、入力値および実行結果を履歴メモリに保持させるが、本発明の第2の実施の形態では開始アドレスのビット幅より狭いビット幅のハッシュ値、入力値および実行結果を履歴メモリ630に保持させる。このように、開始アドレスのビット幅より狭いビット幅のハッシュ値を開始アドレスの代わりに履歴メモリ630に保持させることによって、履歴メモリ630に保持される実行履歴の量を増加させることができる。   That is, in the conventional technique, the start address, the input value, and the execution result are held in the history memory as the function execution history, but in the second embodiment of the present invention, a hash value having a bit width narrower than the bit width of the start address, The input value and the execution result are stored in the history memory 630. As described above, by holding the hash value having a bit width narrower than the bit width of the start address in the history memory 630 instead of the start address, the amount of execution history held in the history memory 630 can be increased.

なお、ここでは、実行部430から供給されたハッシュ関数を確定ハッシュ関数保持部510に保持させる例について説明したが、本発明はこれに限定されるものではない。例えば、図3において示した本発明の第1の実施の形態における候補ハッシュ関数保持部220と同一の複数のハッシュ関数を事前に確定ハッシュ関数保持部510に保持させるようにしてもよい。この例において、本発明の第1の実施の形態におけるコンパイル処理装置100により、図3において説明したハッシュ関数を指し示す識別子をハッシュ関数の代わりにプログラムに埋め込む。そして、本発明の第2の実施の形態におけるデータ処理装置300によりその識別子に基づいてハッシュ関数を特定する。   Here, an example in which the hash function supplied from the execution unit 430 is held in the deterministic hash function holding unit 510 has been described, but the present invention is not limited to this. For example, a plurality of hash functions that are the same as the candidate hash function holding unit 220 in the first embodiment of the present invention shown in FIG. 3 may be held in the deterministic hash function holding unit 510 in advance. In this example, the compile processing apparatus 100 according to the first embodiment of the present invention embeds an identifier indicating the hash function described in FIG. 3 in the program instead of the hash function. Then, the data processing device 300 according to the second embodiment of the present invention specifies a hash function based on the identifier.

この場合において、実行部430は、命令デコーダ420が識別子を指定する命令をデコードした際に、識別子をハッシュ変換部500に出力する。そして、確定ハッシュ関数保持部510は、実行部430から供給された識別子に対応するハッシュ関数を保持している複数のハッシュ関数から選択して、その選択したハッシュ関数を確定ハッシュ値生成部520に供給する。   In this case, the execution unit 430 outputs the identifier to the hash conversion unit 500 when the instruction decoder 420 decodes the instruction specifying the identifier. Then, the deterministic hash function holding unit 510 selects from a plurality of hash functions holding the hash function corresponding to the identifier supplied from the execution unit 430, and sends the selected hash function to the deterministic hash value generation unit 520. Supply.

これにより、ハッシュ関数を識別する識別子が埋め込まれたプログラムに基づいて、開始アドレスをハッシュ値に変換することができる。   Thereby, the start address can be converted into a hash value based on a program in which an identifier for identifying a hash function is embedded.

[履歴メモリ630のデータ構造例]
図12は、本発明の第2の実施の形態における履歴メモリ630のデータ構造の一例を示す概念図である。ここでは、履歴メモリ630により、ハッシュ値ごとに保持された実行履歴のうち、1つのハッシュ値における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。
[Data structure example of history memory 630]
FIG. 12 is a conceptual diagram showing an example of the data structure of the history memory 630 according to the second embodiment of the present invention. Here, a configuration is shown in which the history memory 630 holds the execution history for one hash value in a tree structure among the execution histories held for each hash value. In this example, a function is assumed that has n arguments and returns an output as an execution result to m storage destinations.

この例では、木構造における関数ルート650と、第1の引数ノード661および662と、第nの引数ノード671乃至674と、第1の出力ノード681乃至684と、第mの出力ノード691乃至694とが示されている。   In this example, the function root 650 in the tree structure, the first argument nodes 661 and 662, the nth argument nodes 671 to 674, the first output nodes 681 to 684, and the mth output nodes 691 to 694 are shown. Is shown.

関数ルート650には、ハッシュ値と、第1の引数ノード661を指し示すポインタとが示されている。   In the function route 650, a hash value and a pointer pointing to the first argument node 661 are shown.

第1および第nの引数ノード661、662および671乃至674には、履歴メモリ630に保持されている実行履歴における引数の入力値として、引数の値を示す入力値と、その引数の型と、その引数の格納場所を示す種類とが示されている。ここにいう格納場所とは、レジスタ番号または主記憶部360のメモリアドレスのことをいう。   The first and nth argument nodes 661, 662, and 671 to 674 include an input value indicating an argument value as an argument input value in the execution history held in the history memory 630, the type of the argument, The type indicating the storage location of the argument is shown. The storage location here refers to a register number or a memory address of the main storage unit 360.

さらに、第1および第nの引数ノード661、662および671乃至674には、比較対象の入力値が互いに一致した場合に次の引数の引数ノードを指し示す右ポインタと、不一致の場合に同一の引数における他の引数ノードを指し示す下ポインタとが示されている。また、第nの引数ノード671乃至674の各々は、第1および第mの出力ノード681乃至684および691乃至694にそれぞれ連結されている。   Further, the first and nth argument nodes 661, 662, and 671 to 674 include a right pointer that points to the argument node of the next argument when the input values to be compared match each other, and the same argument when they do not match And a lower pointer pointing to another argument node. Each of the nth argument nodes 671 to 674 is connected to the first and mth output nodes 681 to 684 and 691 to 694, respectively.

第1および第mの出力ノード681乃至684および691乃至694には、履歴メモリ630に保持されている実行履歴における実行結果として、実行結果の値を示す出力値と、その実行結果の格納場所を示す種類と、その実行結果の型とが示されている。さらに、第1の出力ノード681乃至684には、次の出力ノードを指し示す右ポインタが示されている。すなわち、第1および第mの出力ノード681乃至684および691乃至694は、連結リストを構成している。また、第mの出力ノード691乃至694には、出力ノードの終端を表わすヌルが示されている。   The first and m-th output nodes 681 to 684 and 691 to 694 have an output value indicating an execution result value as an execution result in the execution history held in the history memory 630 and a storage location of the execution result. The type to be shown and the type of the execution result are shown. Further, the first output nodes 681 to 684 show a right pointer that points to the next output node. That is, the first and mth output nodes 681 to 684 and 691 to 694 constitute a linked list. Further, the mth output nodes 691 to 694 show a null indicating the end of the output node.

このような木構造において、関数ルート650に示されたハッシュ値と一致するハッシュ値が履歴検索部620から入力されると、関数ルート650のポインタによって指し示された第1の引数ノード661において入力値の比較処理が実行される。ここにいう入力値の比較処理とは、第1の引数ノード661に示された入力値、種類および型である入力値と、履歴検索部620からの入力値とを比較することである。   In such a tree structure, when a hash value that matches the hash value indicated in the function route 650 is input from the history search unit 620, the input is made in the first argument node 661 indicated by the pointer of the function route 650. A value comparison process is executed. The input value comparison processing here is to compare the input value, type, and type indicated in the first argument node 661 with the input value from the history search unit 620.

このとき、例えば、第1の引数ノード661に示された入力値と履歴検索部620から+の入力値とが一致した場合には、第1の引数ノード661の右ポインタにより指し示された次の引数ノードにおいて入力値の比較処理が実行される。一方、第1の引数ノード661に示された入力値と、履歴検索部620からの入力値とが一致しない場合には、第1の引数ノード661の下ポインタにより指し示された第1の引数ノード662において入力値の比較処理が実行される。   At this time, for example, if the input value indicated by the first argument node 661 matches the input value + from the history search unit 620, the next value indicated by the right pointer of the first argument node 661 is displayed. The input value comparison process is executed at the argument node. On the other hand, if the input value indicated by the first argument node 661 does not match the input value from the history search unit 620, the first argument indicated by the lower pointer of the first argument node 661 is displayed. The node 662 executes input value comparison processing.

このようにして、各引数ノードにおける比較処理による結果に基づいて右または下ポインタの指し示す引数ノードが選択され、その選択された引数ノードにおいて入力値の比較処理が順次実行される。そして、例えば、第nの引数ノード671に示された入力値と履歴検索部620からの入力値とが互いに一致した場合には、第nの引数ノード671の右ポインタの指し示す第1の出力ノード681の実行結果が履歴検索部620に出力される。そして、最後に、第m番の出力ノード691の実行結果が履歴検索部620に出力される。   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 in the nth argument node 671 and the input value from the history search unit 620 match each other, the first output node pointed to by the right pointer of the nth argument node 671 The execution result of 681 is output to the history search unit 620. Finally, the execution result of the m-th output node 691 is output to the history search unit 620.

このように、履歴メモリ630をハッシュ値ごとに木構造により構成することによって、同じ引数の入力値を重複して保持させる必要が無いため、記憶領域を節約することができる。また、ハッシュ値ごとにデータ構造を分けることによって、検索速度の低下を抑制することができる。   In this way, by configuring the history memory 630 with a tree structure for each hash value, it is not necessary to hold the input values of the same argument redundantly, so that a storage area can be saved. Further, by dividing the data structure for each hash value, it is possible to suppress a decrease in search speed.

[本発明の第2の実施の形態におけるデータ処理装置300の動作例]
次に、本発明の第2の実施の形態におけるデータ処理装置300の処理について図面を参照して説明する。
[Operation Example of Data Processing Device 300 in Second Embodiment of the Present Invention]
Next, processing of the data processing device 300 according to the second embodiment of the present invention will be described with reference to the drawings.

図13は、本発明の第2の実施の形態におけるデータ処理装置300による命令処理方法の処理手順例を示すフローチャートである。このフローチャートは、命令デコーダ420によりデコードされる命令毎の処理例を説明するものであり、命令デコーダ420によりデコードされる命令の実行の終了をフローチャートの終了とする。   FIG. 13 is a flowchart illustrating an example of a processing procedure of an instruction processing method performed by the data processing device 300 according to the second embodiment of the present invention. This flowchart describes an example of processing for each instruction decoded by the instruction decoder 420. The end of execution of the instruction decoded by the instruction decoder 420 is defined as the end of the flowchart.

まず、フェッチ部410およびレジスタファイル440に、命令デコーダ420によって解読(デコード)される命令およびその命令に従って実行部430により実行される値が読み出される(ステップS941)。次に、命令デコーダ420により、フェッチ部410から供給された命令がデコードされる(ステップS942)。   First, the instruction decoded by the instruction decoder 420 and the value executed by the execution unit 430 according to the instruction are read into the fetch unit 410 and the register file 440 (step S941). Next, the instruction decoder 420 decodes the instruction supplied from the fetch unit 410 (step S942).

続いて、実行部430により、デコードした命令がハッシュ関数指定命令か否かが判断される(ステップS943)。そして、デコードした命令がハッシュ関数指定命令であると判断された場合には、レジスタファイル440から供給されるハッシュ関数が信号線407を介して確定ハッシュ関数保持部510に登録される(ステップS944)。これにより、ハッシュ関数指定命令の実行は終了する。   Subsequently, the execution unit 430 determines whether or not the decoded instruction is a hash function designation instruction (step S943). If it is determined that the decoded instruction is a hash function designation instruction, the hash function supplied from the register file 440 is registered in the confirmed hash function holding unit 510 via the signal line 407 (step S944). . As a result, the execution of the hash function designation instruction is completed.

一方、デコードした命令がハッシュ関数指定命令でないと判断された場合には、デコードした命令が再利用命令か否かが判断される(ステップS945)。そして、デコードした命令が再利用命令でないと判断された場合には、実行部430により、レジスタファイル440から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力されて(ステップS946)、ステップS954に進む。   On the other hand, when it is determined that the decoded instruction is not a hash function designation instruction, it is determined whether or not the decoded instruction is a reuse instruction (step S945). If it is determined that the decoded instruction is not a reuse instruction, the execution section 430 executes the reuse section based on the input value supplied from the register file 440, thereby outputting an execution result. Then (step S946), the process proceeds to step S954.

一方、ステップS945の処理において、命令が再利用命令であると判断された場合には、確定ハッシュ値生成部520により、再利用区間の開始アドレスからハッシュ値が算出される(ステップS947)。続いて、検索要求入力部621により、ハッシュ値および入力値を用いて履歴メモリ630に実行履歴があるか否かが判断される(ステップS948)。このとき、ループが再利用区間である場合には、ハッシュ値および入力値に加えてループカウンタ値も用いて履歴メモリ630に実行履歴があるか否か探索される。   On the other hand, if it is determined in step S945 that the instruction is a reuse instruction, the determined hash value generation unit 520 calculates a hash value from the start address of the reuse section (step S947). Subsequently, the search request input unit 621 determines whether or not there is an execution history in the history memory 630 using the hash value and the input value (step S948). At this time, if the loop is a reuse section, whether or not there is an execution history in the history memory 630 is searched using the loop counter value in addition to the hash value and the input value.

そして、実行履歴が履歴メモリ630にないと判断された場合には、実行部430により、レジスタファイル440から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力される(ステップS949)。そして、履歴登録部640により、実行履歴が履歴メモリ630に登録される(ステップS951)。これにより、履歴メモリ630に実行履歴が登録される。そして、ステップS954に進む。   If it is determined that the execution history is not in the history memory 630, the execution section 430 executes the reuse section based on the input value supplied from the register file 440, thereby outputting the execution result. (Step S949). Then, the history registration unit 640 registers the execution history in the history memory 630 (step S951). As a result, the execution history is registered in the history memory 630. Then, the process proceeds to step S954.

一方、実行履歴が履歴メモリ630にあると判断された場合には、実行結果出力部622により、実行結果が出力される(ステップS952)。これにより、実行している再利用区間の実行結果が履歴メモリ630から出力される。続いて、実行部430は、実行結果が出力された再利用区間の実行を中止させる(ステップS953)。そして、ステップS954に進む。   On the other hand, when it is determined that the execution history is in the history memory 630, the execution result output unit 622 outputs the execution result (step S952). As a result, the execution result of the reuse section being executed is output from the history memory 630. Subsequently, the execution unit 430 stops execution of the reuse section in which the execution result is output (step S953). Then, the process proceeds to step S954.

そして、ステップS946、S951およびS953の処理の後に、実行結果がレジスタファイル440に書き戻される(ステップS954)。これにより、デコードされた命令の実行は終了する。   Then, after the processing of steps S946, S951, and S953, the execution result is written back to the register file 440 (step S954). As a result, execution of the decoded instruction is completed.

このように、本発明の第2の実施の形態では、ハッシュ変換部500を設けることによって、ハッシュ値と入力値と実行結果とを実行履歴として履歴メモリ630に保持させることができる。   As described above, in the second embodiment of the present invention, by providing the hash conversion unit 500, the hash value, the input value, and the execution result can be held in the history memory 630 as an execution history.

<3.第3の実施の形態>
[本発明の第3の実施の形態におけるコンパイル処理装置100の構成例]
図14は、本発明の第3の実施の形態におけるコンパイル処理装置100の構成例を示すブロック図である。このコンパイル処理装置100は、図1において示したコンパイル処理装置100のハッシュ関数決定部200の代わりにハッシュ値付再利用命令生成部170を備えている。ここでは、ハッシュ値付再利用命令生成部170以外の構成は、図1と同様のものであるため、図1と同符号を付してここでの各部の構成の詳細な説明を省略する。
<3. Third Embodiment>
[Configuration example of the compile processing apparatus 100 according to the third embodiment of the present invention]
FIG. 14 is a block diagram illustrating a configuration example of the compile processing apparatus 100 according to the third embodiment of the present invention. The compile processing apparatus 100 includes a hash value-added reuse instruction generation unit 170 instead of the hash function determination unit 200 of the compile processing apparatus 100 shown in FIG. Here, since the configuration other than the hash value-added reuse instruction generation unit 170 is the same as that in FIG. 1, the same reference numerals as those in FIG. 1 are given, and detailed description of the configuration of each unit is omitted here.

ハッシュ値付再利用命令生成部170は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を含む再利用命令であるハッシュ値付再利用命令を生成するものである。このハッシュ値付再利用命令生成部170は、ハッシュ値決定部700およびハッシュ値付加部172を備える。なお、ハッシュ値付再利用命令は、特許請求の範囲に記載の区間識別値付命令の一例である。   The hash value reuse instruction generation unit 170 generates a hash value reuse instruction that is a reuse instruction including a hash value for identifying a reuse section with a bit width narrower than the bit width of the start address of the reuse section. It is. The hash value-added reuse instruction generation unit 170 includes a hash value determination unit 700 and a hash value addition unit 172. The hash value-added reuse instruction is an example of the section identification value-added instruction described in the claims.

ハッシュ値決定部700は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を決定するものである。このハッシュ値決定部700は、例えば、再利用区間の開始アドレスの所定の順序に従って付与された番号を関数入力値として、複数のハッシュ関数を用いてハッシュ関数ごとにハッシュ値を生成する。そして、このハッシュ値決定部700は、複数のハッシュ関数のうち、値が全て互いに異なるハッシュ値であってビット幅が最も狭いハッシュ値を決定して出力する。このハッシュ値決定部700は、その決定したハッシュ値をプログラムとともにハッシュ値付加部172に供給する。   The hash value determination unit 700 determines a hash value for identifying a reuse section with a bit width narrower than the bit width of the start address of the reuse section. For example, the hash value determination unit 700 generates a hash value for each hash function using a plurality of hash functions, using a number assigned according to a predetermined order of the start address of the reuse interval as a function input value. Then, the hash value determination unit 700 determines and outputs a hash value having the smallest bit width among the plurality of hash functions, all having different values. The hash value determination unit 700 supplies the determined hash value to the hash value addition unit 172 together with the program.

ハッシュ値付加部172は、ハッシュ値決定部700により決定されたハッシュ値をそのハッシュ値が指し示す再利用区間を呼び出す再利用命令に付加してハッシュ値付再利用命令を生成するものである。このハッシュ値付加部172は、その生成したハッシュ値付再利用命令が含まれるプログラムを機械語プログラム生成部140に供給する。なお、ハッシュ値付加部172は、特許請求の範囲に記載の命令変換部の一例である。   The hash value adding unit 172 generates a reuse instruction with a hash value by adding the hash value determined by the hash value determination unit 700 to a reuse instruction for calling a reuse section indicated by the hash value. The hash value adding unit 172 supplies a program including the generated reuse instruction with hash value to the machine language program generating unit 140. The hash value adding unit 172 is an example of an instruction conversion unit described in the claims.

機械語プログラム生成部140は、ハッシュ値付加部172から供給されたハッシュ値付再利用命令が含まれるプログラムに基づいて、機械語のプログラムであるオブジェクトプログラムを生成するものである。また、この機械語プログラム生成部140は、オブジェクトプログラムを生成する際に、ハッシュ値のビット幅を指定する値を指定する命令をオブジェクトプログラムに埋め込む。   The machine language program generation unit 140 generates an object program that is a machine language program based on the program including the reuse instruction with hash value supplied from the hash value addition unit 172. In addition, when generating the object program, the machine language program generation unit 140 embeds an instruction for specifying a value for specifying the bit width of the hash value in the object program.

このように、本発明の第3の実施の形態におけるコンパイル処理装置100では、まず、関数の実行結果が再利用される度合いに応じて関数の呼出し命令を再利用命令に変換することによって、再利用される関数と再利用されない関数とが区別できるようにする。そして、本発明の第3の実施の形態におけるコンパイル処理装置100では、再利用区間を識別するためのハッシュ値を決定してハッシュ値付再利用命令を生成することによって、そのハッシュ値付再利用命令が含まれるプログラムを生成することができる。   As described above, in the compile processing device 100 according to the third embodiment of the present invention, first, a function call instruction is converted into a reuse instruction according to the degree to which the execution result of the function is reused. Make it possible to distinguish between functions that are used and functions that are not reused. Then, in the compilation processing device 100 according to the third embodiment of the present invention, the hash value for identifying the reuse section is determined and the hash value reuse instruction is generated, thereby reusing the hash value reuse. A program including instructions can be generated.

[本発明の第3の実施の形態におけるハッシュ値決定部700の構成例]
図15は、本発明の第3の実施の形態におけるハッシュ値決定部700の構成例を示すブロック図である。このハッシュ値決定部700は、開始アドレス取得部710と、候補ハッシュ関数保持部720と、候補ハッシュ値生成部730と、ハッシュ値テーブル740と、ハッシュ値出力部750とを備える。
[Configuration Example of Hash Value Determining Unit 700 in the Third Embodiment of the Present Invention]
FIG. 15 is a block diagram illustrating a configuration example of the hash value determination unit 700 according to the third embodiment of this invention. The hash value determination unit 700 includes a start address acquisition unit 710, a candidate hash function storage unit 720, a candidate hash value generation unit 730, a hash value table 740, and a hash value output unit 750.

開始アドレス取得部710は、図3において示した開始アドレス取得部210と同様に、再利用命令変換部124からの再利用命令を含むプログラムから再利用区間の開始アドレスを取得するものである。この開始アドレス取得部710は、その取得した開始アドレスを開始アドレスリストとして保持する。また、この開始アドレス取得部710は、その取得した開始アドレスの取得した順序に従って付与された番号を番号リストとして保持する。この開始アドレス取得部710は、取得した開始アドレスあるいは付与した番号を候補ハッシュ値生成部730に供給する。   Similar to the start address acquisition unit 210 shown in FIG. 3, the start address acquisition unit 710 acquires the start address of the reuse section from the program including the reuse command from the reuse command conversion unit 124. The start address acquisition unit 710 holds the acquired start address as a start address list. In addition, the start address acquisition unit 710 holds numbers assigned according to the acquisition order of the acquired start addresses as a number list. The start address acquisition unit 710 supplies the acquired start address or the assigned number to the candidate hash value generation unit 730.

候補ハッシュ関数保持部720は、開始アドレスあるいは番号をハッシュ値に変換するための複数のハッシュ関数を保持するものである。すなわち、この候補ハッシュ関数保持部720は、ハッシュ値決定部700が決定するハッシュ値の候補となるハッシュ値を生成するためのハッシュ関数の候補となるハッシュ関数を保持する。この候補ハッシュ関数保持部720は、予め定められたハッシュ関数を保持する。   The candidate hash function holding unit 720 holds a plurality of hash functions for converting a start address or number into a hash value. That is, the candidate hash function holding unit 720 holds a hash function that is a hash function candidate for generating a hash value that is a hash value candidate determined by the hash value determining unit 700. The candidate hash function holding unit 720 holds a predetermined hash function.

この候補ハッシュ関数保持部720は、保持している複数のハッシュ関数を候補ハッシュ値生成部730に供給する。なお、候補ハッシュ関数保持部720から供給されるハッシュ関数は、特許請求の範囲に記載の候補関数の一例である。   The candidate hash function storage unit 720 supplies the plurality of stored hash functions to the candidate hash value generation unit 730. Note that the hash function supplied from the candidate hash function holding unit 720 is an example of the candidate function described in the claims.

候補ハッシュ値生成部730は、開始アドレス取得部710から供給された開始アドレスあるいは番号を関数入力値とし、その関数入力値を候補ハッシュ関数保持部720から供給されたハッシュ関数の入力としてハッシュ値を生成するものである。すなわち、この候補ハッシュ値生成部730は、ハッシュ値決定部700が決定するハッシュ値の候補となるハッシュ値を生成する。   The candidate hash value generation unit 730 uses the start address or number supplied from the start address acquisition unit 710 as a function input value, and uses the function input value as an input of the hash function supplied from the candidate hash function holding unit 720, to obtain a hash value. Is to be generated. That is, the candidate hash value generation unit 730 generates a hash value that is a hash value candidate determined by the hash value determination unit 700.

この候補ハッシュ値生成部730は、例えば、開始アドレス取得部710から番号が供給された場合には、候補ハッシュ関数保持部720から供給されたハッシュ関数を用いてその番号からハッシュ値を生成する。また、この候補ハッシュ値生成部730は、例えば、開始アドレス取得部710から開始アドレスが供給された場合には、候補ハッシュ関数保持部720から供給されたハッシュ関数を用いてその開始アドレスからハッシュ値を生成する。   For example, when a number is supplied from the start address acquisition unit 710, the candidate hash value generation unit 730 generates a hash value from the number using the hash function supplied from the candidate hash function holding unit 720. For example, when the start address is supplied from the start address acquisition unit 710, the candidate hash value generation unit 730 uses the hash function supplied from the candidate hash function holding unit 720 to calculate the hash value from the start address. Is generated.

この候補ハッシュ値生成部730は、その生成したハッシュ値をハッシュ値テーブル740に供給する。なお、候補ハッシュ値生成部730は、特許請求の範囲に記載の候補値生成部の一例である。なお、候補ハッシュ値生成部730から供給されるハッシュ値は、特許請求の範囲に記載の候補値の一例である。   The candidate hash value generation unit 730 supplies the generated hash value to the hash value table 740. The candidate hash value generation unit 730 is an example of a candidate value generation unit described in the claims. The hash value supplied from the candidate hash value generation unit 730 is an example of the candidate value described in the claims.

ハッシュ値テーブル740は、候補ハッシュ値生成部730から供給されたハッシュ値を保持するものである。このハッシュ値テーブル740は、ハッシュ値をそのハッシュ値を生成したハッシュ関数ごとにハッシュ値リストとして保持する。また、このハッシュ値テーブル740は、保持したハッシュ値リストをハッシュ値出力部750に供給する。なお、ハッシュ値テーブル740は、特許請求の範囲に記載の候補値テーブルの一例である。なお、ハッシュ値リストは、特許請求の範囲に記載の候補値リストの一例である。   The hash value table 740 holds the hash value supplied from the candidate hash value generation unit 730. The hash value table 740 holds a hash value as a hash value list for each hash function that generates the hash value. Also, the hash value table 740 supplies the stored hash value list to the hash value output unit 750. The hash value table 740 is an example of a candidate value table described in the claims. The hash value list is an example of a candidate value list described in the claims.

ハッシュ値出力部750は、ハッシュ値が全て互いに異なるハッシュ値リストを抽出し、この抽出されたハッシュ値リストのうちハッシュ値のビット幅が最も狭くなるハッシュ値リストのハッシュ値を出力するものである。このハッシュ値出力部750は、ユニークハッシュ値リスト判別部751および確定ハッシュ値選択部752を備える。なお、ハッシュ値出力部750は、特許請求の範囲に記載の区間識別値出力部の一例である。なお、ハッシュ値出力部750が出力するハッシュ値は、特許請求の範囲に記載の区間識別値の一例である。   The hash value output unit 750 extracts hash value lists whose hash values are all different from each other, and outputs the hash value of the hash value list in which the bit width of the hash value is the narrowest among the extracted hash value lists. . The hash value output unit 750 includes a unique hash value list determination unit 751 and a confirmed hash value selection unit 752. The hash value output unit 750 is an example of the section identification value output unit described in the claims. The hash value output by the hash value output unit 750 is an example of a section identification value described in the claims.

ユニークハッシュ値リスト判別部751は、図3において示したユニークハッシュ値リスト判別部251と同様に、ハッシュ値テーブル740に保持されているハッシュ値リストのうちハッシュ値が全て互いに異なるハッシュ値リストを判別するものである。このユニークハッシュ値リスト判別部751は、その判別したハッシュ値リストを確定ハッシュ値選択部752に供給する。   Similar to the unique hash value list determination unit 251 illustrated in FIG. 3, the unique hash value list determination unit 751 determines hash value lists whose hash values are all different from each other among the hash value lists held in the hash value table 740. To do. The unique hash value list determination unit 751 supplies the determined hash value list to the confirmed hash value selection unit 752.

確定ハッシュ値選択部752は、ユニークハッシュ値リスト判別部751から供給されたハッシュ値リストのうちハッシュ値のビット幅が最も狭くなるハッシュ値リストを選択して、その選択したハッシュ値リストのハッシュ値を出力するものである。すなわち、この確定ハッシュ値選択部752は、ハッシュ値決定部700が決定するハッシュ値の候補のハッシュ値からハッシュ値を確定し、その確定したハッシュ値をハッシュ値決定部700が決定したハッシュ値として出力する。   The confirmed hash value selection unit 752 selects a hash value list in which the bit width of the hash value is the narrowest from the hash value list supplied from the unique hash value list determination unit 751, and the hash value of the selected hash value list Is output. That is, the determined hash value selection unit 752 determines the hash value from the hash values of the hash value candidates determined by the hash value determination unit 700, and uses the determined hash value as the hash value determined by the hash value determination unit 700. Output.

この確定ハッシュ値選択部752は、ユニークハッシュ値リスト判別部751から供給されたハッシュ値が全て互いに異なるハッシュ値リストのうちハッシュ値のビット幅が最も狭いハッシュ値リストを一つ検出する。そして、この確定ハッシュ値選択部752は、その検出したハッシュ値リストのハッシュ値をハッシュ値付加部172に供給する。   The confirmed hash value selection unit 752 detects one hash value list having the narrowest bit width of hash values among hash value lists whose hash values supplied from the unique hash value list determination unit 751 are all different from each other. Then, the determined hash value selection unit 752 supplies the hash value of the detected hash value list to the hash value addition unit 172.

このように、本発明の第3の実施の形態では、ハッシュ値決定部700を設けることにより、全て互いに異なるハッシュ値であってビット幅が最も狭いハッシュ値を有するハッシュ値付再利用命令を含むプログラムを生成することができる。   As described above, in the third embodiment of the present invention, by providing the hash value determination unit 700, all of the hash values with different hash values and the hash value with the narrowest bit width are included. A program can be generated.

なお、ここでは、候補ハッシュ関数保持部720は、保持するハッシュ関数を全て候補ハッシュ値生成部730に供給する一例について説明したが、本発明はこれに限定されるものではない。例えば、候補ハッシュ関数保持部720は外部から制御できるようにすることによって、候補ハッシュ値生成部730に供給するハッシュ関数を制御できるようにしてもよい。また、例えば、ハッシュ値テーブル740から供給される番号のうち最も大きい番号に基づいて、候補ハッシュ値生成部730が使用するハッシュ関数を判断できるようにしてもよい。   Here, an example has been described in which the candidate hash function holding unit 720 supplies all the stored hash functions to the candidate hash value generation unit 730, but the present invention is not limited to this. For example, the hash function supplied to the candidate hash value generation unit 730 may be controlled by enabling the candidate hash function holding unit 720 to be controlled from the outside. For example, the hash function used by the candidate hash value generation unit 730 may be determined based on the largest number among the numbers supplied from the hash value table 740.

[本発明の第3の実施の形態におけるハッシュ値テーブル740に保持されるハッシュ値の一例]
図16は、本発明の第3の実施の形態におけるハッシュ値テーブル740に保持されるハッシュ値の一例を示す概念図である。ここでは、便宜上、開始アドレス取得部710には、開始アドレスが取得された順序に従って付与された番号が番号リストとして保持されることを想定する。また、この番号は、ハッシュ値テーブル740に登録された開始アドレスに対して「1」から順に付与される値であることとする。さらに、ここでは、候補ハッシュ関数保持部720は、図4において説明した式3乃至式6のハッシュ関数を保持しているものとする。
[An example of hash values held in the hash value table 740 according to the third embodiment of the present invention]
FIG. 16 is a conceptual diagram illustrating an example of hash values held in the hash value table 740 according to the third embodiment of this invention. Here, for the sake of convenience, it is assumed that the start address acquisition unit 710 holds numbers assigned according to the order in which start addresses are acquired as a number list. Further, this number is assumed to be a value assigned in order from “1” to the start address registered in the hash value table 740. Further, here, it is assumed that the candidate hash function holding unit 720 holds the hash functions of Expressions 3 to 6 described in FIG.

また、ここでは、プログラムにおける再利用区間は7個の関数(funcA乃至funcG)とする。なお、ここでは、開始アドレス取得部710は、7個の関数(funcA乃至funcG)をfuncAから順に取得してハッシュ値テーブルに供給したことを想定する。   Here, the reuse interval in the program is assumed to be seven functions (funcA to funcG). Here, it is assumed that the start address acquisition unit 710 sequentially acquires seven functions (funcA to funcG) from funcA and supplies them to the hash value table.

また、候補ハッシュ値生成部730は、ビット幅を短くするハッシュ関数のみでハッシュ値を算出する場合には、ハッシュ値テーブル740におけるデータ量を軽減させるために、関数入力値をそのままハッシュ値テーブル740に供給できることとする。すなわち、候補ハッシュ値生成部730は、開始アドレス取得部710から番号が関数入力値として供給される際には、開始アドレス取得部710における番号リストと同様の番号リストをハッシュ値テーブル740に保持させることができることとする。
さらに、この候補ハッシュ値生成部730は、関数入力値をそのままハッシュ値テーブル740に供給する場合において、ハッシュ関数の生成するハッシュ値のビット幅に関するデータをハッシュ値テーブル740にハッシュ値リストの代わりとして保持させることを想定する。
In addition, when the hash value is calculated using only the hash function that shortens the bit width, the candidate hash value generation unit 730 uses the function input value as it is to reduce the data amount in the hash value table 740 as it is. It can be supplied to. That is, the candidate hash value generation unit 730 causes the hash value table 740 to hold a number list similar to the number list in the start address acquisition unit 710 when a number is supplied as a function input value from the start address acquisition unit 710. Be able to.
Further, when the candidate hash value generation unit 730 supplies the function input value to the hash value table 740 as it is, the data related to the bit width of the hash value generated by the hash function is stored in the hash value table 740 instead of the hash value list. Assume that they are retained.

図16(a)には、ハッシュ値テーブル740に保持された番号リスト772の一例が示されている。   FIG. 16A shows an example of the number list 772 held in the hash value table 740.

開始アドレスリスト771は、ハッシュ値テーブル740に登録されたハッシュ値の基となった開始アドレスのリスト名が示されている。この開始アドレスリスト771において、行782にはfuncAに関する値が示され、行783にはfuncBに関する値が示され、行784にはfuncCに関する値が示されている。さらに、行785にはfuncDに関する値が示され、行786にはfuncEに関する値が示され、行787にはfuncFに関する値が示され、行788にはfuncGが示されていることを表している。   The start address list 771 indicates the list name of the start address that is the basis of the hash value registered in the hash value table 740. In this start address list 771, a value related to funcA is shown in line 782, a value related to funcB is shown in line 783, and a value related to funcC is shown in line 784. Furthermore, row 785 shows a value for funcD, row 786 shows a value for funcE, row 787 shows a value for funcF, and row 788 shows funcG. .

番号リスト772は、候補ハッシュ値生成部730が関数入力値をそのままハッシュ値テーブル740に供給した場合において、ハッシュ値テーブル740に登録された番号のリストである。この番号リスト772は、開始アドレス(funcA乃至funcG)に対して付与された番号(1乃至7)が10進数で示された値を括弧の外に表し、かつ、その番号が64ビットの2進数で表された値を括弧の中に表している。   The number list 772 is a list of numbers registered in the hash value table 740 when the candidate hash value generation unit 730 supplies the function input value as it is to the hash value table 740. This number list 772 represents the value (1 to 7) assigned to the start address (funcA to funcG) in decimal notation, and the number is a 64-bit binary number. The value represented by is shown in parentheses.

このような番号リスト772をハッシュ値テーブル740に保持させる場合において、候補ハッシュ値生成部730は、ハッシュ関数の生成するハッシュ値のビット幅に関するデータをハッシュ値リストの代わりとしてハッシュ値テーブル740に保持させる。   In a case where such a number list 772 is held in the hash value table 740, the candidate hash value generation unit 730 holds data relating to the bit width of the hash value generated by the hash function in the hash value table 740 instead of the hash value list. Let

図16(b)には、図16(a)において示した番号リスト772と、番号リストのビット幅を指定するデータとから想定されるハッシュ値リスト773乃至776が示されている。   FIG. 16B shows hash value lists 773 to 776 assumed from the number list 772 shown in FIG. 16A and data specifying the bit width of the number list.

ハッシュ値リスト773には、式1のi(ビット幅)を「4」としたハッシュ関数である式6を用いた場合に算出されるハッシュ値のリストが示されている。このハッシュ値リスト773の行782乃至788には、7個の関数(funcA乃至funcG)の開始アドレスの取得された順序に従って付与された番号(番号リスト772の行782乃至788)を式6の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト773の行782乃至788には、7つの関数の開始アドレスの取得された順序に従って付与された番号(番号リスト772の行782乃至788)を2進数で表現したビット列の最下位ビットから4ビットの値がそれぞれ示されている。   The hash value list 773 shows a list of hash values calculated when using Expression 6 which is a hash function with i (bit width) of Expression 1 being “4”. In the rows 782 to 788 of the hash value list 773, numbers (rows 782 to 788 of the number list 772) assigned according to the acquisition order of the start addresses of the seven functions (funcA to funcG) A hash value calculated as an input value is shown. That is, in the rows 782 to 788 of the hash value list 773, the lowest number of the bit string expressing the numbers (rows 782 to 788 of the number list 772) given in the binary number in accordance with the acquisition order of the start addresses of the seven functions. Bit to 4-bit values are shown respectively.

ハッシュ値リスト774には、式1のi(ビット幅)を「3」としたハッシュ関数である式5を用いた場合に算出されるハッシュ値のリストが示されている。このハッシュ値リスト774の行782乃至788には、7個の関数(funcA乃至funcG)の開始アドレスの取得された順序に従って付与された番号(番号リスト772の行782乃至788)を式5の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト774の行782乃至788には、7つの関数の開始アドレスの取得された順序に従って付与された番号(番号リスト772の行782乃至788)を2進数で表現したビット列の最下位ビットから3ビットの値がそれぞれ示されている。   The hash value list 774 shows a list of hash values calculated when Expression 5 which is a hash function in which i (bit width) of Expression 1 is “3” is used. In rows 782 to 788 of the hash value list 774, numbers (rows 782 to 788 of the number list 772) assigned according to the acquisition order of the start addresses of the seven functions (funcA to funcG) are the functions of the formula 5. A hash value calculated as an input value is shown. That is, in the rows 782 to 788 of the hash value list 774, the lowest number of the bit string expressing the numbers (rows 782 to 788 of the number list 772) given in the binary number in accordance with the acquisition order of the start addresses of the seven functions. Bit to 3-bit values are shown respectively.

ハッシュ値リスト775には、式1のi(ビット幅)を「2」としたハッシュ関数である式4を用いた場合に算出されるハッシュ値のリストが示されている。このハッシュ値リスト775の行782乃至788には、7個の関数(funcA乃至funcG)の開始アドレスの取得された順序に従って付与された番号(番号リスト772の行782乃至788)を式4の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト775の行782乃至788には、7つの関数の開始アドレスの取得された順序に従って付与された番号(番号リスト772の行782乃至788)を2進数で表現したビット列の最下位ビットから2ビットの値がそれぞれ示されている。   The hash value list 775 shows a list of hash values calculated when using Expression 4 which is a hash function with i (bit width) of Expression 1 being “2”. In rows 782 to 788 of the hash value list 775, numbers (rows 782 to 788 of the number list 772) assigned in accordance with the acquisition order of the start addresses of the seven functions (funcA to funcG) A hash value calculated as an input value is shown. That is, in the rows 782 to 788 of the hash value list 775, the lowest number of the bit string expressing the numbers (rows 782 to 788 of the number list 772) given in the binary number in accordance with the acquisition order of the start addresses of the seven functions. Bit to 2-bit values are shown respectively.

ハッシュ値リスト776には、式1のi(ビット幅)を「1」としたハッシュ関数である式3を用いた場合に算出されるハッシュ値のリストが示されている。このハッシュ値リスト776の行782乃至788には、7個の関数(funcA乃至funcG)の開始アドレスの取得された順序に従って付与された番号(番号リスト772の行782乃至788)を式3の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト776の行782乃至788には、7つの関数の開始アドレスの取得された順序に従って付与された番号(番号リスト772の行782乃至788)を2進数で表現したビット列の最下位ビットの値がそれぞれ示されている。   The hash value list 776 shows a list of hash values calculated when Expression 3 which is a hash function in which i (bit width) of Expression 1 is “1” is used. In rows 782 to 788 of the hash value list 776, numbers (rows 782 to 788 of the number list 772) assigned according to the acquisition order of the start addresses of the seven functions (funcA to funcG) A hash value calculated as an input value is shown. That is, in the rows 782 to 788 of the hash value list 776, the lowest number of the bit string expressing the numbers (rows 782 to 788 of the number list 772) given in the binary number according to the acquisition order of the start addresses of the seven functions. Each bit value is shown.

続いて、図16を用いて、ユニークハッシュ値リスト判別部751により判別されるハッシュ値リストと、確定ハッシュ値選択部752が選択するハッシュ値とについて説明する。   Next, the hash value list determined by the unique hash value list determination unit 751 and the hash value selected by the confirmed hash value selection unit 752 will be described with reference to FIG.

まず、ユニークハッシュ値リスト判別部751は、この図16(b)において示したハッシュ値リスト773乃至776を、図16(a)の番号リスト772と、ハッシュ関数の生成するハッシュ値のビット幅に関するデータとから想定する。そして、このハッシュ値リスト773乃至776からハッシュ値が全て互いに異なるハッシュ値リストを検出し、その検出したハッシュ値リストを確定ハッシュ値選択部752に供給する。
この時、ハッシュ値リスト776は、funcA、funcC、funcEおよびfuncGのハッシュ値が「1」で重複し、さらに、その他の3つの関数のハッシュ値が「0」で重複しているため、確定ハッシュ値選択部752に供給されない。また、ハッシュ値リスト775は、funcAおよびfuncEのハッシュ値が「01」で重複、funcBおよびfuncFのハッシュ値が「10」で重複、funcCおよびfuncGのハッシュ値が「11」で重複しているため供給されない。その結果、ハッシュ値が全て互い異なるハッシュ値リストと判別されたハッシュ値リスト773および774が確定ハッシュ値選択部752に供給される。
First, the unique hash value list discriminating unit 751 relates the hash value lists 773 to 776 shown in FIG. 16B to the number list 772 in FIG. 16A and the bit width of the hash value generated by the hash function. Assuming from data. Then, a hash value list having all different hash values is detected from the hash value lists 773 to 776, and the detected hash value list is supplied to the determined hash value selection unit 752.
At this time, since the hash values of funcA, funcC, funcE, and funcG overlap with “1” and the hash values of the other three functions overlap with “0”, the hash value list 776 has a fixed hash. It is not supplied to the value selector 752. Further, in the hash value list 775, the hash values of funcA and funcE are “01” and duplicated, the hash values of funcB and funcF are duplicated as “10”, and the hash values of funcC and funcG are duplicated as “11”. Not supplied. As a result, hash value lists 773 and 774 in which all hash values are determined to be different from each other are supplied to the determined hash value selection unit 752.

続いて、確定ハッシュ値選択部752は、供給されたハッシュ値リストからハッシュ値のビット幅が最も狭いハッシュ値リストを検出し、その検出されたハッシュ値リストのハッシュ値をハッシュ値付加部172に供給する。その結果、4ビットのハッシュ値のハッシュ値リスト773と、3ビットのハッシュ値のハッシュ値リスト774とのうちハッシュ値リスト774がビット幅が最も狭いハッシュ値のハッシュ値リストとして検出される。そして、確定ハッシュ値選択部752は、その検出したハッシュ値リスト774のハッシュ値を出力する。   Subsequently, the confirmed hash value selection unit 752 detects a hash value list having the narrowest bit width of the hash value from the supplied hash value list, and sends the hash value of the detected hash value list to the hash value addition unit 172. Supply. As a result, the hash value list 774 is detected as the hash value list with the narrowest bit width among the hash value list 773 of the 4-bit hash value and the hash value list 774 of the 3-bit hash value. Then, the determined hash value selection unit 752 outputs the hash value of the detected hash value list 774.

このように、本発明の第3の実施の形態では、候補ハッシュ値生成部730によりビット幅が異なるハッシュ値のみが生成される場合には、ハッシュ値テーブル740に関数入力値を保持させておいてもハッシュ値を決定することができる。これにより、ハッシュ値テーブル740におけるハッシュ値リストのデータ量を軽減させることができるため、全て互いに異なるハッシュ値のハッシュ値リストの検索などの処理を軽減させることができる。また、番号を関数入力値とする場合について説明したが、開始アドレスの場合においても同様に処理することができる。すなわち、この図16において示した方法は、第1の実施の形態におけるハッシュ関数決定部200でも同様に行うことができる。   As described above, in the third embodiment of the present invention, when only the hash values having different bit widths are generated by the candidate hash value generation unit 730, the function input values are held in the hash value table 740. The hash value can be determined. Thereby, since the data amount of the hash value list in the hash value table 740 can be reduced, it is possible to reduce processing such as searching for hash value lists having different hash values. Further, although the case where the number is a function input value has been described, the same processing can be performed in the case of a start address. That is, the method shown in FIG. 16 can be similarly performed by the hash function determination unit 200 in the first embodiment.

なお、ここでは、開始アドレスの取得された順序に従って付与された番号をハッシュ関数の関数入力値としてハッシュ値を算出したが、本発明はこれに限定されるものではない。例えば、図5において示した第1の実施の形態と同様に、開始アドレスを関数入力値とする場合も考えられる。また、開始アドレスの取得された順序を関数入力値とするではなく、再利用度生成部123が生成した再利用度の値に対する順序を関数入力値とする場合なども考えられる。   Here, the hash value is calculated using the number assigned according to the order in which the start address is acquired as the function input value of the hash function, but the present invention is not limited to this. For example, as in the first embodiment shown in FIG. 5, the start address may be a function input value. In addition, the order in which the start address is acquired is not set as the function input value, but the order for the reuse level generated by the reuse level generation unit 123 may be set as the function input value.

また、ここでは、ユニークハッシュ値リスト判別部751は、番号リスト772と、ハッシュ関数の生成するハッシュ値のビット幅に関するデータとから、ハッシュ値リスト773乃至776を想定する場合について説明したが、本発明はこれに限定されるものではない。例えば、ハッシュ値出力部750は、値が全て互いに異なるとともに最も狭いビット幅の値を、開始アドレス取得部710が保持する番号リストから直接選択できるようにしてもよい。これにより、候補ハッシュ関数保持部720、候補ハッシュ値生成部730およびハッシュ値テーブル740を備えないハッシュ値決定部700により、値が全て互いに異なるとともに最も狭いビット幅のハッシュ値を決定することができる。   Also, here, the unique hash value list determination unit 751 has been described with respect to the case where the hash value lists 773 to 776 are assumed from the number list 772 and the data related to the bit width of the hash value generated by the hash function. The invention is not limited to this. For example, the hash value output unit 750 may be able to directly select a value having the smallest bit width from all different values from the number list held by the start address acquisition unit 710. Accordingly, the hash value determination unit 700 that does not include the candidate hash function holding unit 720, the candidate hash value generation unit 730, and the hash value table 740 can determine the hash value having the narrowest bit width and different values. .

[本発明の第3の実施の形態における再利用命令の一例]
次に、本発明の第3の実施の形態におけるコンパイル処理装置100が生成する再利用命令について図面を参照して説明する。
[An example of a reuse instruction in the third embodiment of the present invention]
Next, a reuse instruction generated by the compile processing apparatus 100 according to the third embodiment of the present invention will be described with reference to the drawings.

図17は、本発明の第3の実施の形態における関数の呼出し命令および関数の再利用命令の一例を示す概念図である。ここでは、データ処理装置のプロセッサコアはMIPSにより構成されることを想定する。また、ここでは、左端は最上位ビット(MSB)を示し、右端は最下位ビット(LSB)を示している。   FIG. 17 is a conceptual diagram showing an example of a function call instruction and a function reuse instruction according to the third embodiment of the present invention. Here, it is assumed that the processor core of the data processing apparatus is configured by MIPS. Here, the left end indicates the most significant bit (MSB), and the right end indicates the least significant bit (LSB).

図17(a)には、MIPS命令セットにおける関数の呼出し命令(call)であるJALR(Jump And Link Register)命令が示されている。MIPS命令セットは32ビットの固定長の命令セットであり、このJALR命令は、32個のビット(0乃至31番)のビット列により表現されるものである。   FIG. 17A shows a JALR (Jump And Link Register) instruction which is a function call instruction (call) in the MIPS instruction set. The MIPS instruction set is a 32-bit fixed-length instruction set, and the JALR instruction is represented by a bit string of 32 bits (0 to 31).

このJALR命令は、オペコードフィールド810と、関数番地フィールド(rs)820と、第1未使用フィールド830と、戻り番地フィールド(rd)840と、第2未使用フィールド850と、機能指定フィールド860とから構成される。   The JALR instruction includes an operation code field 810, a function address field (rs) 820, a first unused field 830, a return address field (rd) 840, a second unused field 850, and a function designation field 860. Composed.

オペコードフィールド810は、命令の種別を指定するフィールドである。このオペコードフィールド810は、第26乃至第31番目のビットから構成されるビット列である。このオペコードフィールド810には、SPECIAL命令としてビット列(000000)が格納される。   The opcode field 810 is a field for designating the type of instruction. The opcode field 810 is a bit string composed of the 26th to 31st bits. In this opcode field 810, a bit string (000000) is stored as a SPECIAL instruction.

関数番地フィールド(rs)820は、関数の番地を格納するレジスタを指定するフィールドである。この関数番地フィールド(rs)820は、第21乃至第25番目のビットから構成されるビット列である。   A function address field (rs) 820 is a field for designating a register for storing a function address. The function address field (rs) 820 is a bit string composed of the 21st to 25th bits.

第1未使用フィールド830は、JALR命令では使用されないフィールドである。この第1未使用フィールド830は、第16乃至第20番目のビット列である。この第1未使用フィールド830は、JALR命令ではビット列(00000)が格納される。   The first unused field 830 is a field that is not used in the JALR instruction. The first unused field 830 is the 16th to 20th bit strings. This first unused field 830 stores a bit string (00000) in the JALR instruction.

戻り番地フィールド(rd)840は、関数からの戻り番地を指定するフィールドである。この戻り番地フィールド(rd)840は、第11乃至第15番目のビットから構成されるビット列である。この戻り番地フィールド(rd)840は、JALR命令では31番レジスタを指すビット列(11111)が格納される。   A return address field (rd) 840 is a field for designating a return address from the function. The return address field (rd) 840 is a bit string composed of the 11th to 15th bits. This return address field (rd) 840 stores a bit string (11111) indicating the 31st register in the JALR instruction.

第2未使用フィールド850は、JALR命令では使用されないフィールドである。この第2未使用フィールド850は、第6乃至第10番目のビットから構成されるビット列である。この第2未使用フィールド850は、JALR命令ではビット列(00000)が格納される。   The second unused field 850 is a field that is not used in the JALR instruction. The second unused field 850 is a bit string composed of sixth to tenth bits. This second unused field 850 stores a bit string (00000) in the JALR instruction.

機能指定フィールド860は、オペコードフィールド810により指定された命令が複数の機能を含む場合には、その複数の機能のうち1つの機能を指定するフィールドである。この機能指定フィールド860は、第0乃至第5番目のビットから構成されるビット列である。この機能指定フィールド860は、JALR命令ではビット列(001001」)が格納される。   The function designation field 860 is a field for designating one function among the plurality of functions when the instruction designated by the operation code field 810 includes a plurality of functions. This function designation field 860 is a bit string composed of the 0th to 5th bits. This function designation field 860 stores a bit string (001001) in the JALR instruction.

図17(b)には、本発明の第3の実施の形態における関数のハッシュ値付再利用命令の一例が示されている。このハッシュ値付再利用命令は、32個のビット(0乃至31番)のビット列により表現されるものである。このハッシュ値付再利用命令は、オペコードフィールド810と、関数番地フィールド(rs)820と、第1ハッシュ値フィールド832および833と、戻り番地フィールド(rd)840と、第2ハッシュ値フィールド852および853と、機能指定フィールド860とから構成される。なお、ここでは、第1ハッシュ値フィールド832および833と、第2ハッシュ値フィールド852および853と以外の構成は、図17(a)と同様のものであるため、図17(a)と同符号を付してここでの説明を省略する。   FIG. 17B shows an example of a reuse instruction with a hash value of a function according to the third embodiment of the present invention. This reusable instruction with hash value is represented by a bit string of 32 bits (0 to 31). This reusable instruction with hash value includes an operation code field 810, a function address field (rs) 820, first hash value fields 832 and 833, a return address field (rd) 840, and second hash value fields 852 and 853. And a function designation field 860. Here, since the configuration other than the first hash value fields 832 and 833 and the second hash value fields 852 and 853 is the same as that in FIG. 17A, the same reference numerals as in FIG. The description here is omitted.

第1ハッシュ値フィールド832および833は、第2ハッシュ値フィールド852および853とともにハッシュ値が付加された再利用命令であることを示すフィールドである。この第1ハッシュ値フィールド832および833は、第2ハッシュ値フィールド852および853のビット列と連結させることによって、ハッシュ値を示す10ビットの数値を示すフィールドになる。この第1ハッシュ値フィールド832および833と、第2ハッシュ値フィールド852および853とは、JALR命令における第1未使用フィールド830および第2未使用フィールド850のビット列を「00000」以外のビット列に変更したものである。ただし、この第1ハッシュ値フィールド832および833と、第2ハッシュ値フィールド852および853とは、一方のビット列が「00000」以外ならばハッシュ値付再利用命令を指し示し、他方のビット列が「00000」であってもよい。   The first hash value fields 832 and 833 are fields indicating a reuse instruction to which a hash value is added together with the second hash value fields 852 and 853. The first hash value fields 832 and 833 become a field indicating a 10-bit numerical value indicating the hash value by being concatenated with the bit string of the second hash value fields 852 and 853. In the first hash value fields 832 and 833 and the second hash value fields 852 and 853, the bit strings of the first unused field 830 and the second unused field 850 in the JALR instruction are changed to bit strings other than “00000”. Is. However, the first hash value fields 832 and 833 and the second hash value fields 852 and 853 indicate a reuse instruction with a hash value if one bit string is other than “00000”, and the other bit string is “00000”. It may be.

例えば、第1ハッシュ値フィールド832には、第2ハッシュ値フィールド852とともに、ハッシュ値の値が最も低いハッシュ値付再利用命令におけるビット列の値が格納されている。この第1ハッシュ値フィールド832は、第2ハッシュ値フィールド852と連結させることによって、10ビットのビット列(0000000001)となる。すなわち、この命令を処理するデータ処理装置において、このビット列(0000000001)は、「1」の値のハッシュ値を指し示すと判断される。   For example, the first hash value field 832 stores the value of the bit string in the reuse instruction with hash value having the lowest hash value value together with the second hash value field 852. The first hash value field 832 is concatenated with the second hash value field 852 to become a 10-bit bit string (0000000001). That is, in the data processing apparatus that processes this instruction, it is determined that this bit string (0000000001) indicates a hash value of “1”.

さらに、第1ハッシュ値フィールド833には、第2ハッシュ値フィールド853とともに、ハッシュ値の値が最も高いハッシュ値付再利用命令におけるビット列の値が格納されている。この第1ハッシュ値フィールド833は、第2ハッシュ値フィールド853と連結させることによって、10ビットのビット列(1111111111)となる。すなわち、この命令を処理するデータ処理装置において、このビット列(1111111111)は、「1024」の値のハッシュ値を指し示すと判断される。   Further, the first hash value field 833 stores the value of the bit string in the reuse instruction with hash value having the highest hash value value, together with the second hash value field 853. The first hash value field 833 is concatenated with the second hash value field 853 to become a 10-bit bit string (1111111111). That is, in the data processing apparatus that processes this command, it is determined that this bit string (11111111111) indicates the hash value of “1024”.

なお、図17(b)では、ハッシュ値付加部172が生成するハッシュ値付再利用命令について説明した。再利用命令変換部124が生成するハッシュ値が付加される前の再利用命令については、第1未使用フィールド830および第2未使用フィールド850のいずれか一方のビット列が「00000」以外のビット列に変更されたものであれば何でもよい。   In FIG. 17B, the hash value-added reuse instruction generated by the hash value adding unit 172 has been described. For the reuse instruction before the hash value generated by the reuse instruction conversion unit 124 is added, one of the first unused field 830 and the second unused field 850 is changed to a bit string other than “00000”. Anything changed may be used.

このように、第3の実施の形態では、ハッシュ値付加部172を設けることによって、ハッシュ値が付加された再利用命令を生成することができる。   As described above, in the third embodiment, by providing the hash value adding unit 172, it is possible to generate a reuse instruction to which a hash value is added.

なお、ここでは、JALRの第1未使用フィールド830および第2未使用フィールド850にハッシュ値を埋め込んだハッシュ値付再利用命令について説明したが、本発明はこれに限定されるものではない。例えば、図6において示したハッシュ関数指定命令および識別子供給命令と同様に、ユーザが独自に新たにハッシュ値付再利用命令を定義してもよい。   Here, although the hash value reuse instruction in which the hash value is embedded in the first unused field 830 and the second unused field 850 of JALR has been described, the present invention is not limited to this. For example, similarly to the hash function designation instruction and the identifier supply instruction shown in FIG. 6, the user may newly define a new reuse instruction with a hash value.

例えば、オペコードフィールド810にはSPECIAL2命令を格納し、機能指定フィールド860には図6のユーザ定義命令フィールド(UDI)295と同様に、ユーザが定義した複数の命令のうちの1つの命令を指定する値を格納する。そして、第6乃至第25番目のユーザが定義可能なエンコード空間に、関数の番地を格納するレジスタを指定する値、関数からの戻り番地を指定する値、ハッシュ値が格納されている番地を格納する値を格納する。このハッシュ値が格納されている番地には10ビット以上のビット幅のハッシュ値が格納できるため、これにより、10ビットより大きいビット幅のハッシュ値が付加されたハッシュ値付再利用命令を生成することができる。   For example, the SPECIAL2 instruction is stored in the operation code field 810, and one instruction among a plurality of instructions defined by the user is designated in the function designation field 860, like the user-defined instruction field (UDI) 295 in FIG. Stores a value. Then, in the 6th to 25th user definable encoding spaces, a value for specifying a register for storing the address of the function, a value for specifying a return address from the function, and an address for storing the hash value are stored. Store the value to be stored. Since a hash value having a bit width of 10 bits or more can be stored at the address where the hash value is stored, a reuse instruction with a hash value to which a hash value having a bit width larger than 10 bits is added is generated. be able to.

このハッシュ値が格納されている番地を格納するレジスタを指定するフィールドを格納させることにより、10ビットより大きいビット幅のハッシュ値が付加されたハッシュ値付再利用命令を生成することができる。   By storing a field for designating a register for storing the address where the hash value is stored, it is possible to generate a reuse instruction with a hash value to which a hash value having a bit width larger than 10 bits is added.

[本発明の第3の実施の形態におけるコンパイル処理装置100の動作例]
次に、本発明の第3の実施の形態におけるコンパイル処理装置100の処理について図面を参照して説明する。
[Operation Example of Compilation Processing Apparatus 100 in Third Embodiment of the Present Invention]
Next, processing of the compile processing apparatus 100 according to the third embodiment of the present invention will be described with reference to the drawings.

図18は、本発明の第3の実施の形態におけるコンパイル処理装置100によるコンパイル処理の処理手順を示すフローチャートである。   FIG. 18 is a flowchart showing a processing procedure of compile processing by the compile processing device 100 according to the third embodiment of the present invention.

まず、ソースプログラム記憶部110からソースプログラムが読み出される(ステップS911)。次に、再利用候補区間抽出部121により、再利用候補区間が抽出される(ステップS912)。   First, a source program is read from the source program storage unit 110 (step S911). Next, a reuse candidate section is extracted by the reuse candidate section extraction unit 121 (step S912).

そして、再利用候補区間解析部122により、再利用候補区間の使用態様が解析される(ステップS913)。続いて、再利用度生成部123により、再利用候補区間の解析結果に基づいて再利用度が生成される(ステップS914)。   Then, the reuse candidate section analysis unit 122 analyzes the usage mode of the reuse candidate section (step S913). Subsequently, the reuse degree generation unit 123 generates a reuse degree based on the analysis result of the reuse candidate section (step S914).

次に、再利用命令変換部124により、再利用度に基づいて再利用候補区間の呼出し命令が再利用命令に変換される(ステップS915)。これは、例えば、関数が再利用候補区間である場合には、関数の呼出し命令(call)が再利用命令(memoCall)に変換されることを意味する。このステップS911乃至S915の一連の処理により、再利用区間が判別される。   Next, the reuse command conversion unit 124 converts the call command for the reuse candidate section into a reuse command based on the degree of reuse (step S915). This means, for example, that a function call instruction (call) is converted into a reuse instruction (memoCall) when the function is a reuse candidate section. The reuse section is determined by a series of processes in steps S911 to S915.

そして、ハッシュ値決定部700により、開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を決定するハッシュ値決定処理が行われる(ステップS960)。   Then, the hash value determination unit 700 performs a hash value determination process for determining a hash value for identifying a reuse section with a bit width narrower than the bit width of the start address (step S960).

続いて、ハッシュ値付加部172により、ハッシュ値付再利用命令が生成される(ステップS917)。   Subsequently, the hash value adding unit 172 generates a hash value-added reuse command (step S917).

最後に、機械語プログラム生成部140により、ハッシュ値のビット幅を指定する命令およびハッシュ値付再利用命令が含まれる機械語プログラムが生成される(ステップS918)。そして、コンパイル処理は終了する。   Finally, the machine language program generation unit 140 generates a machine language program including an instruction for specifying the bit width of the hash value and a reuse instruction with a hash value (step S918). Then, the compilation process ends.

図19は、本発明の第3の実施の形態におけるハッシュ値決定部700によるハッシュ値決定処理(ステップS960)の処理手順例の前半を示すフローチャートである。なお、ここでは、便宜上、ハッシュ値テーブル740には、図16(b)において示したハッシュ値リストが保持されることを想定する。なお、ここでは、ハッシュ関数の総数とは、開始アドレスをそのまま出力するハッシュ関数と、図4において示した式3乃至式7のハッシュ関数とを合わせた数の「6」であることを想定する。   FIG. 19 is a flowchart illustrating the first half of a processing procedure example of the hash value determination process (step S960) by the hash value determination unit 700 according to the third embodiment of the present invention. Here, for convenience, it is assumed that the hash value table 740 holds the hash value list shown in FIG. Here, it is assumed that the total number of hash functions is “6”, which is the total number of hash functions that output the start address as it is and the hash functions of Expressions 3 to 7 shown in FIG. .

まず、開始アドレス取得部710により、再利用区間の開始アドレスがプログラムから取得され、開始アドレス取得部710に開始アドレスリストとして保持される(ステップS961)。続いて、開始アドレス取得部710に保持された開始アドレスの保持された順序に従って番号が付与され、その番号が番号リストとして保持される(ステップS962)。   First, the start address acquisition unit 710 acquires the start address of the reuse section from the program, and holds it as a start address list in the start address acquisition unit 710 (step S961). Subsequently, numbers are assigned according to the order in which the start addresses held in the start address acquisition unit 710 are held, and the numbers are held as a number list (step S962).

次に、ハッシュ関数カウンタ(hn)が「1」に初期化される(ステップS963)。なお、ここで示すハッシュ関数カウンタ(hn)とは、図8において示したハッシュ関数カウンタ(hn)と同様のものであるので、ここでの詳細な説明を省略する。なお、ハッシュ関数カウンタ(hn)の値の「0」には、図8において示したハッシュ関数カウンタ(hn)と同様に、開始アドレスをそのまま出力するハッシュ関数が割り当てられるものとする。   Next, the hash function counter (hn) is initialized to “1” (step S963). Note that the hash function counter (hn) shown here is the same as the hash function counter (hn) shown in FIG. 8, and therefore detailed description thereof is omitted here. It is assumed that a hash function that outputs the start address as it is is assigned to the value “0” of the hash function counter (hn) as in the hash function counter (hn) shown in FIG.

続いて、開始アドレスカウンタ(an)が「0」に初期化される(ステップS964)。なお、ここで示す開始アドレスカウンタ(an)とは、図8において示した開始アドレスカウンタ(an)と同様のものであるので、ここでの詳細な説明を省略する。   Subsequently, the start address counter (an) is initialized to “0” (step S964). Note that the start address counter (an) shown here is the same as the start address counter (an) shown in FIG. 8, and thus detailed description thereof will be omitted.

そして、候補ハッシュ値生成部730により、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数を用いて、開始アドレスカウンタ(an)が指し示す開始アドレスに対して付与された番号を関数入力値としてハッシュ値が算出される(ステップS965)。次に、開始アドレスカウンタ(an)に「1」が加算される(ステップS966)。   Then, the hash value is calculated by the candidate hash value generation unit 730 using the hash function indicated by the hash function counter (hn) as the function input value using the number assigned to the start address indicated by the start address counter (an). (Step S965). Next, “1” is added to the start address counter (an) (step S966).

続いて、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数であるか否かが判断される(ステップS967)。そして、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数でないと判断された場合には、ステップS965に戻る。これにより、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数の付与された番号を関数入力値としてまだ算出されていないハッシュ値が算出される。   Subsequently, it is determined whether or not the start address counter (an) is the total number of start addresses in the start address list (step S967). When it is determined that the start address counter (an) is not the total number of start addresses in the start address list, the process returns to step S965. As a result, a hash value that has not been calculated yet is calculated using the number assigned to the hash function indicated by the hash function counter (hn) as the function input value.

一方、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数であると判断された場合には、ハッシュ関数カウンタ(hn)に「1」が加算される(ステップS968)。   On the other hand, when it is determined that the start address counter (an) is the total number of start addresses in the start address list, “1” is added to the hash function counter (hn) (step S968).

続いて、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であるか否かが判断される(ステップS969)。そして、ハッシュ関数カウンタ(hn)がハッシュ関数の総数でないと判断された場合には、ステップS964に戻る。これにより、まだハッシュ値が算出されていないハッシュ関数を用いてハッシュ関数が算出される。   Subsequently, it is determined whether or not the hash function counter (hn) is the total number of hash functions (step S969). When it is determined that the hash function counter (hn) is not the total number of hash functions, the process returns to step S964. Thereby, a hash function is calculated using a hash function for which a hash value has not yet been calculated.

一方、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、ステップS970に進む。   On the other hand, if it is determined that the hash function counter (hn) is the total number of hash functions, the process proceeds to step S970.

図20は、本発明の第3の実施の形態におけるハッシュ値決定部700によるハッシュ値決定処理(ステップS960)の処理手順例の後半を示すフローチャートである。   FIG. 20 is a flowchart illustrating the second half of the processing procedure example of the hash value determination process (step S960) by the hash value determination unit 700 according to the third embodiment of the present invention.

まず、図19のステップS969においてハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、選択ハッシュ関数カウンタ(h)が「0」に初期化される(ステップS970)。   First, when it is determined in step S969 in FIG. 19 that the hash function counter (hn) is the total number of hash functions, the selected hash function counter (h) is initialized to “0” (step S970).

続いて、ハッシュ値ビット幅サイズ(ws)がハッシュ関数カウンタ(0)のハッシュ関数により生成されたハッシュ値のビット幅に変更される(ステップS971)。これにより、ハッシュ値ビット幅サイズ(ws)には開始アドレスのビット幅の64ビットが設定される。   Subsequently, the hash value bit width size (ws) is changed to the bit width of the hash value generated by the hash function of the hash function counter (0) (step S971). Thereby, the hash value bit width size (ws) is set to 64 bits of the bit width of the start address.

そして、ハッシュ関数カウンタ(hn)が「1」に変更される(ステップS972)。続いて、ユニークハッシュ値リスト判別部751により、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数に対応するハッシュ値リストのハッシュ値が全て互いに異なるか否かが判別される(ステップS973)。そして、ハッシュ関数(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値が全て互いに異なっていないと判別された場合には、ステップS977に進む。   Then, the hash function counter (hn) is changed to “1” (step S972). Subsequently, the unique hash value list discriminating unit 751 discriminates whether or not all hash values in the hash value list corresponding to the hash function indicated by the hash function counter (hn) are different from each other (step S973). If it is determined that all hash values in the hash value list associated with the hash function indicated by the hash function (hn) are not different from each other, the process proceeds to step S977.

一方、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値が全て互いに異なっていると判別された場合には、ステップS974に進む。ステップS974では、確定ハッシュ値選択部752により、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅が、ハッシュ値ビット幅サイズ(ws)より小さい値であるか否かが判断される。そして、ハッシュ関数(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅がwsより小さい値ではないと判断された場合には、ステップS977に進む。   On the other hand, if it is determined that the hash values in the hash value list associated with the hash function indicated by the hash function counter (hn) are all different from each other, the process proceeds to step S974. In step S974, the confirmed hash value selection unit 752 has a bit width of the hash value of the hash value list associated with the hash function indicated by the hash function counter (hn) smaller than the hash value bit width size (ws). It is determined whether or not. If it is determined that the bit width of the hash value in the hash value list associated with the hash function indicated by the hash function (hn) is not a value smaller than ws, the process proceeds to step S977.

一方、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅がハッシュ値ビット幅サイズ(ws)より小さい値であると判断された場合には、ステップS975に進む。ステップS975では、選択ハッシュ関数番号(h)がハッシュ関数カウンタ(hn)の値に変更される。   On the other hand, if it is determined that the bit width of the hash value in the hash value list associated with the hash function indicated by the hash function counter (hn) is smaller than the hash value bit width size (ws), the process proceeds to step S975. move on. In step S975, the selected hash function number (h) is changed to the value of the hash function counter (hn).

続いて、ハッシュ値ビット幅サイズ(ws)が、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅に変更される(ステップS976)。   Subsequently, the hash value bit width size (ws) is changed to the bit width of the hash value in the hash value list associated with the hash function indicated by the hash function counter (hn) (step S976).

そして、ハッシュ関数カウンタ(hn)に「1」が加算される(ステップS977)。次に、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であるか否かが判断される(ステップS978)。そして、ハッシュ関数カウンタ(hn)がハッシュ関数の総数でないと判断された場合には、ステップS973に戻る。   Then, “1” is added to the hash function counter (hn) (step S977). Next, it is determined whether or not the hash function counter (hn) is the total number of hash functions (step S978). When it is determined that the hash function counter (hn) is not the total number of hash functions, the process returns to step S973.

一方、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、ステップS979に進む。ステップS979では、選択ハッシュ関数(h)が指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値がハッシュ値決定部700の決定したハッシュ値として出力される(ステップS979)。   On the other hand, if it is determined that the hash function counter (hn) is the total number of hash functions, the process proceeds to step S979. In step S979, the hash value of the hash value list associated with the hash function indicated by the selected hash function (h) is output as the hash value determined by the hash value determination unit 700 (step S979).

このように、本発明の第3の実施の形態では、ハッシュ値決定部700を設けることによって、複数のハッシュ関数のうち全て互いに異なるハッシュ値であってビット幅が最も狭くなるハッシュ値を生成するハッシュ関数のハッシュ値を出力することができる。   As described above, in the third embodiment of the present invention, by providing the hash value determination unit 700, hash values that are all different from each other among a plurality of hash functions and have the smallest bit width are generated. A hash value of a hash function can be output.

このように、本発明の第3の実施の形態によれば、ハッシュ値付再利用命令が含まれるプログラムを生成することができる。   As described above, according to the third embodiment of the present invention, it is possible to generate a program including a hash value reuse instruction.

<4.第4の実施の形態>
[本発明の第4の実施の形態におけるデータ処理装置300の構成例]
図21は、本発明の第4の実施の形態におけるデータ処理装置300の構成例を示すブロック図である。このデータ処理装置300は、図10において示したデータ処理装置300のハッシュ変換部500を除いたものである。このデータ処理装置300における命令キャッシュ311およびデータキャッシュ312は、図10において示した各構成と同様の機能であるため、図10と同一の符号を付してここでの説明を省略する。また、このデータ処理装置300が接続されている主記憶部360およびその接続を介しているバス350は、図10において示したものと同様の機能であるため、図10と同一の符号を付してここでの説明を省略する。
<4. Fourth Embodiment>
[Configuration Example of Data Processing Device 300 in the Fourth Embodiment of the Present Invention]
FIG. 21 is a block diagram illustrating a configuration example of the data processing device 300 according to the fourth embodiment of the present invention. This data processing device 300 is obtained by removing the hash conversion unit 500 of the data processing device 300 shown in FIG. Since the instruction cache 311 and the data cache 312 in this data processing device 300 have the same functions as the components shown in FIG. 10, the same reference numerals as those in FIG. The main storage unit 360 to which the data processing device 300 is connected and the bus 350 via the connection have the same functions as those shown in FIG. The description here is omitted.

プロセッサコア400は、図10におけるプロセッサコア400と同様に、プログラムの命令に従って演算を実行するものである。このプロセッサコア400は、図17において示したハッシュ値付再利用命令が入力された場合には、ハッシュ値付再利用命令に含まれるハッシュ値と、再利用区間の入力値とを履歴管理部600に供給する。また、このプロセッサコア400は、ハッシュ値付再利用命令を実行した際において履歴管理部600から実行結果が供給されないときには、この命令を実行した結果である実行結果をデータキャッシュ312および履歴管理部600に出力する。   Similar to the processor core 400 in FIG. 10, the processor core 400 executes operations in accordance with program instructions. When the reuse instruction with hash value shown in FIG. 17 is input, the processor core 400 stores the hash value included in the reuse instruction with hash value and the input value of the reuse section in the history management unit 600. To supply. Further, when the execution result is not supplied from the history management unit 600 when the hash value reuse instruction is executed, the processor core 400 displays the execution result as the result of executing this instruction in the data cache 312 and the history management unit 600. Output to.

さらに、プロセッサコア400は、入力される命令がハッシュ値付再利用命令である場合において履歴管理部600から実行結果が供給されたときには、再利用区間における処理を中止して、この再利用区間を呼び出したルーチンに戻って実行を継続する。   Further, when the execution result is supplied from the history management unit 600 when the input instruction is a reuse instruction with a hash value, the processor core 400 stops the process in the reuse section, and uses the reuse section. Return to the calling routine and continue execution.

履歴管理部600は、再利用区間の実行結果を保持して管理するものである。この履歴管理部600は、プロセッサコア400から供給されたハッシュ値と入力値と実行結果とを実行履歴として保持する。また、この履歴管理部600は、ハッシュ値と入力値とがプロセッサコア400から供給された場合には、このハッシュ値と入力値とが含まれる実行履歴を検索する。   The history management unit 600 holds and manages the execution result of the reuse section. The history management unit 600 holds a hash value, an input value, and an execution result supplied from the processor core 400 as an execution history. In addition, when the hash value and the input value are supplied from the processor core 400, the history management unit 600 searches for an execution history including the hash value and the input value.

[本発明の第4の実施の形態におけるプロセッサコア400および履歴管理部600の構成例]
図22は、本発明の第4の実施の形態におけるプロセッサコア400および履歴管理部600の構成例を示すブロック図である。ここでは、プロセッサコア400と履歴管理部600とが示されている。また、ここでは、プロセッサコア400および履歴管理部600の機能は、図10および図21と同様のものであるため、同一の符号を付してここでの詳細な説明を省略する。
[Configuration Example of Processor Core 400 and History Management Unit 600 in the Fourth Embodiment of the Present Invention]
FIG. 22 is a block diagram illustrating a configuration example of the processor core 400 and the history management unit 600 according to the fourth embodiment of the present invention. Here, the processor core 400 and the history management unit 600 are shown. Here, since the functions of the processor core 400 and the history management unit 600 are the same as those in FIGS. 10 and 21, the same reference numerals are given and detailed description thereof is omitted here.

プロセッサコア400は、フェッチ部410と、命令デコーダ420と、実行部430と、レジスタファイル440とを備える。なお、本発明の第4の実施の形態におけるフェッチ部410と、命令デコーダ420と、レジスタファイル440との機能は、図11において示した各構成と同様の機能であるため、図11と同一の符号を付してここでの詳細な説明を省略する。   The processor core 400 includes a fetch unit 410, an instruction decoder 420, an execution unit 430, and a register file 440. Note that the functions of the fetch unit 410, the instruction decoder 420, and the register file 440 in the fourth embodiment of the present invention are the same as those shown in FIG. Reference numerals are assigned and detailed description is omitted here.

実行部430は、命令デコーダ420から供給された制御信号に基づいて、命令デコーダ420において解析した命令を実行するものである。この実行部430は、命令デコーダ420においてハッシュ値のビット幅を指定する命令をデコードした場合には、その命令が指定するビット幅をハッシュ値のビット幅として設定する。   The execution unit 430 executes the instruction analyzed in the instruction decoder 420 based on the control signal supplied from the instruction decoder 420. When the instruction decoder 420 decodes an instruction specifying the bit width of the hash value, the execution unit 430 sets the bit width specified by the instruction as the bit width of the hash value.

また、この実行部430は、命令デコーダ420がハッシュ値付再利用命令をデコードした場合、ハッシュ値付再利用命令が指定する再利用区間の処理を開始する。そして、この再利用区間の処理の開始とともに、実行部430は、ハッシュ値付再利用命令から取得したハッシュ値を、信号線409を介して履歴管理部600に出力する。例えば、この実行部430は、ハッシュ値のビット幅が「5」と設定された場合には、図17において示した第2ハッシュ値フィールド852および853の最下位ビットから5ビットの値をハッシュ値として信号線409を介して履歴管理部600に出力する。   Further, when the instruction decoder 420 decodes the reuse instruction with hash value, the execution unit 430 starts processing of the reuse section designated by the reuse instruction with hash value. Then, along with the start of the processing of the reuse section, the execution unit 430 outputs the hash value acquired from the hash value-added reuse command to the history management unit 600 via the signal line 409. For example, when the bit width of the hash value is set to “5”, the execution unit 430 converts the 5-bit value from the least significant bits of the second hash value fields 852 and 853 shown in FIG. To the history management unit 600 via the signal line 409.

そして、実行部430は、レジスタファイル440から供給される再利用区間の入力値に基づいて再利用区間における処理を実行するとともに、再利用区間の入力値を、信号線409を介して履歴管理部600に出力する。   The execution unit 430 executes processing in the reuse section based on the input value of the reuse section supplied from the register file 440, and the history management section receives the input value of the reuse section via the signal line 409. Output to 600.

なお、実行部430は、履歴管理部600から再利用区間の実行結果が供給された場合には、再利用区間の処理を中止するとともに、その実行結果を履歴管理部600から供給された旨を通知する信号をフェッチ部410に供給する。この時、実行部430は、実行結果をレジスタファイル440に出力する。   In addition, when the execution result of the reuse section is supplied from the history management unit 600, the execution unit 430 cancels the processing of the reuse section and indicates that the execution result is supplied from the history management unit 600. A signal to be notified is supplied to the fetch unit 410. At this time, the execution unit 430 outputs the execution result to the register file 440.

一方、実行部430は、履歴管理部600から再利用区間の実行結果が供給されない場合には、再利用区間の処理を最後まで実行して、その実行結果をレジスタファイル440に出力するとともに信号線409を介して履歴管理部600に出力する。   On the other hand, when the execution result of the reuse section is not supplied from the history management unit 600, the execution unit 430 executes the process of the reuse section to the end, and outputs the execution result to the register file 440 and the signal line. The information is output to the history management unit 600 via 409.

履歴管理部600は、再利用区間の実行結果を保持して管理するものであり、履歴対象データ保持部610と、履歴検索部620と、履歴メモリ630と、履歴登録部640とを備える。なお、本発明の第4の実施の形態における履歴管理部600の各構成は、ハッシュ値が実行部430から供給されること以外は図11において示した各構成と同様の機能であるため、図11と同一の符号を付してここでの詳細な説明を省略する。すなわち、図11において示した履歴管理部600はハッシュ変換部500から供給されたハッシュ値を用いていたが、この本発明の第4の実施の形態における履歴管理部600は実行部430から供給されるハッシュ値を用いる点が異なる。   The history management unit 600 holds and manages the execution result of the reuse section, and includes a history target data holding unit 610, a history search unit 620, a history memory 630, and a history registration unit 640. Note that each configuration of the history management unit 600 according to the fourth exemplary embodiment of the present invention has the same function as each configuration illustrated in FIG. 11 except that the hash value is supplied from the execution unit 430. 11 will be assigned the same reference numerals and detailed description thereof will be omitted. That is, the history management unit 600 shown in FIG. 11 uses the hash value supplied from the hash conversion unit 500. However, the history management unit 600 in the fourth embodiment of the present invention is supplied from the execution unit 430. The difference is that a hash value is used.

このように、本発明の第4の実施の形態では、本発明の第3の実施の形態の装置により生成されたハッシュ値付再利用命令が含まれるプログラムに基づいて、ハッシュ値と入力値と実行結果とを実行履歴として履歴メモリ630に保持させることができる。   As described above, in the fourth embodiment of the present invention, the hash value and the input value are calculated based on the program including the reuse instruction with the hash value generated by the apparatus of the third embodiment of the present invention. The execution result can be held in the history memory 630 as an execution history.

[本発明の第4の実施の形態におけるデータ処理装置300の動作例]
次に、本発明の第4の実施の形態におけるデータ処理装置300の処理について図面を参照して説明する。
[Operation Example of Data Processing Device 300 in the Fourth Embodiment of the Present Invention]
Next, processing of the data processing device 300 according to the fourth embodiment of the present invention will be described with reference to the drawings.

図23は、本発明の第4の実施の形態におけるデータ処理装置300による命令処理方法の処理手順例を示すフローチャートである。このフローチャートは、ハッシュ値のビット幅を指し示す命令が実行された以降の命令デコーダ420によりデコードされる命令毎の処理例を説明するものであり、命令デコーダ420によりデコードされる命令の実行の終了をフローチャートの終了とする。   FIG. 23 is a flowchart illustrating an example of a processing procedure of an instruction processing method performed by the data processing device 300 according to the fourth embodiment of the present invention. This flowchart describes an example of processing for each instruction decoded by the instruction decoder 420 after the instruction indicating the bit width of the hash value is executed. The end of execution of the instruction decoded by the instruction decoder 420 is described. The flowchart ends.

まず、フェッチ部410およびレジスタファイル440に、命令デコーダ420によって解読(デコード)される命令およびその命令に従って実行部430により実行される値が読み出される(ステップS941)。次に、命令デコーダ420により、フェッチ部410から供給された命令がデコードされる(ステップS942)。   First, the instruction decoded by the instruction decoder 420 and the value executed by the execution unit 430 according to the instruction are read into the fetch unit 410 and the register file 440 (step S941). Next, the instruction decoder 420 decodes the instruction supplied from the fetch unit 410 (step S942).

続いて、実行部430により、デコードした命令が再利用区間を指定するハッシュ値付再利用命令か否かが判断される(ステップS945)。そして、デコードした命令がハッシュ値付再利用命令でないと判断された場合には、レジスタファイル440から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力される(ステップS946)。そして、ステップS954に進む。   Subsequently, the execution unit 430 determines whether or not the decoded instruction is a reuse instruction with a hash value designating a reuse section (step S945). If it is determined that the decoded instruction is not a reuse instruction with a hash value, the execution result is output by executing the reuse section based on the input value supplied from the register file 440. (Step S946). Then, the process proceeds to step S954.

一方、ステップS945の処理において、命令がハッシュ値付再利用命令であると判断された場合には、検索要求入力部621により、ハッシュ値および入力値を用いて履歴メモリ630に実行履歴があるか否かが判断される(ステップS948)。そして、実行履歴が履歴メモリ630にないと判断された場合には、実行部430により、レジスタファイル440から供給される入力値に基づいてその再利用区間が実行され、実行結果が出力される(ステップS949)。続いて、履歴登録部640により、実行履歴が履歴メモリ630に登録される(ステップS951)。これにより、履歴メモリ630に実行履歴が登録される。そして、ステップS954に進む。   On the other hand, if it is determined in step S945 that the instruction is a reuse instruction with hash value, the search request input unit 621 uses the hash value and the input value to determine whether there is an execution history in the history memory 630. It is determined whether or not (step S948). When it is determined that the execution history is not in the history memory 630, the execution section 430 executes the reuse section based on the input value supplied from the register file 440 and outputs the execution result ( Step S949). Subsequently, the execution history is registered in the history memory 630 by the history registration unit 640 (step S951). As a result, the execution history is registered in the history memory 630. Then, the process proceeds to step S954.

一方、実行履歴が履歴メモリ630にあると判断された場合には、実行結果出力部622により、実行結果が出力される(ステップS952)。これにより、実行している再利用区間の実行結果が履歴メモリ630から出力される。続いて、実行部430は、実行結果が出力された再利用区間の実行を中止させる(ステップS953)。そして、ステップS954に進む。   On the other hand, when it is determined that the execution history is in the history memory 630, the execution result output unit 622 outputs the execution result (step S952). As a result, the execution result of the reuse section being executed is output from the history memory 630. Subsequently, the execution unit 430 stops execution of the reuse section in which the execution result is output (step S953). Then, the process proceeds to step S954.

そして、ステップS946、S951およびS953の処理の後に、実行結果がレジスタファイル440に書き戻される(ステップS954)。これにより、デコードされた命令の実行は終了する。   Then, after the processing of steps S946, S951, and S953, the execution result is written back to the register file 440 (step S954). As a result, execution of the decoded instruction is completed.

このように、本発明の第4の実施の形態では、ハッシュ値と入力値と実行結果とを実行履歴として履歴メモリ630に保持させることができる。   Thus, in the fourth embodiment of the present invention, the hash value, the input value, and the execution result can be held in the history memory 630 as an execution history.

<5.第5の実施の形態>
[本発明の第5の実施の形態におけるデータ処理装置300の構成例]
図24は、本発明の第5の実施の形態におけるデータ処理装置300の構成例を示すブロック図である。このデータ処理装置300は、図10において示したデータ処理装置300の各構成に加えて、ハッシュ関数決定部370を備えている。ここでは、このハッシュ関数決定部370およびハッシュ変換部500以外の各構成の機能は、図10と同様の機能であるため、ここでの説明を省略する。
<5. Fifth embodiment>
[Configuration Example of Data Processing Device 300 in the Fifth Embodiment of the Present Invention]
FIG. 24 is a block diagram illustrating a configuration example of the data processing device 300 according to the fifth embodiment of the present invention. The data processing device 300 includes a hash function determination unit 370 in addition to the components of the data processing device 300 shown in FIG. Here, the functions of the components other than the hash function determination unit 370 and the hash conversion unit 500 are the same as those in FIG. 10, and thus description thereof is omitted here.

ハッシュ関数決定部370は、プロセッサコア400がプログラムを実行する前にハッシュ関数を決定するものである。このハッシュ関数決定部370は、主記憶部360から供給されたオブジェクトプログラムから再利用区間の開始アドレスを取得し、その開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を生成するためのハッシュ関数を決定する。   The hash function determination unit 370 determines the hash function before the processor core 400 executes the program. The hash function determination unit 370 acquires the start address of the reuse interval from the object program supplied from the main storage unit 360, and generates a hash value that identifies the reuse interval with a bit width narrower than the bit width of the start address. Determine the hash function to do.

なお、このハッシュ関数決定部370は、図3において示した本発明の第1の実施の形態のハッシュ関数決定部200をデータ処理装置300に備えたものである。すなわち、この本発明の第5の実施の形態のハッシュ関数決定部370では、開始アドレス取得部210はオブジェクトプログラムを解析して再利用区間の開始アドレスを取得する。また、この本発明の第5の実施の形態では、確定ハッシュ関数選択部252は選択したハッシュ関数をハッシュ変換部500に供給する。このハッシュ関数決定部370における開始アドレス取得部210および確定ハッシュ関数選択部252以外の各構成の機能は、図3と同様のものであるため、この本発明の第5の実施の形態での詳細な説明を省略する。   The hash function determining unit 370 includes the hash function determining unit 200 according to the first embodiment of the present invention shown in FIG. That is, in the hash function determination unit 370 according to the fifth embodiment of the present invention, the start address acquisition unit 210 analyzes the object program and acquires the start address of the reuse section. In the fifth embodiment of the present invention, the deterministic hash function selection unit 252 supplies the selected hash function to the hash conversion unit 500. The functions of the components other than the start address acquisition unit 210 and the deterministic hash function selection unit 252 in the hash function determination unit 370 are the same as those in FIG. 3, so the details in the fifth embodiment of the present invention The detailed explanation is omitted.

このハッシュ関数決定部370は、その決定したハッシュ関数をハッシュ変換部500に供給する。   The hash function determination unit 370 supplies the determined hash function to the hash conversion unit 500.

ハッシュ変換部500は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するためのハッシュ値に開始アドレスを変換するものである。このハッシュ変換部500は、ハッシュ関数決定部370から供給されたハッシュ関数を保持する。このハッシュ変換部500は、その保持しているハッシュ関数を用いて、プロセッサコア400から供給された関数またはループの開始アドレスからハッシュ値を生成する。このハッシュ変換部500は、その生成したハッシュ値を履歴管理部600に供給する。   The hash conversion unit 500 converts the start address into a hash value for identifying the reuse section with a bit width narrower than the bit width of the start address of the reuse section. The hash conversion unit 500 holds the hash function supplied from the hash function determination unit 370. The hash conversion unit 500 generates a hash value from the function or loop start address supplied from the processor core 400 using the stored hash function. The hash conversion unit 500 supplies the generated hash value to the history management unit 600.

このように、本発明の第5の実施の形態では、データ処理装置300にハッシュ関数決定部370を設けることによって、既に生成されたオブジェクトプログラムを用いてハッシュ関数を決定することができる。   As described above, in the fifth embodiment of the present invention, the hash function determination unit 370 is provided in the data processing device 300, so that the hash function can be determined using the already generated object program.

[本発明の第5の実施の形態におけるプロセッサコア400とハッシュ変換部500と履歴管理部600との構成例]
図25は、本発明の第5の実施の形態におけるプロセッサコア400とハッシュ変換部500と履歴管理部600との構成例を示すブロック図である。ここでは、プロセッサコア400とハッシュ変換部500と履歴管理部600とが示されている。また、ここでは、プロセッサコア400、ハッシュ変換部500、履歴管理部600の他に、ハッシュ変換部500にハッシュ関数を供給するハッシュ関数決定部370が示されている。
[Configuration example of the processor core 400, the hash conversion unit 500, and the history management unit 600 in the fifth embodiment of the present invention]
FIG. 25 is a block diagram illustrating a configuration example of the processor core 400, the hash conversion unit 500, and the history management unit 600 according to the fifth embodiment of the present invention. Here, a processor core 400, a hash conversion unit 500, and a history management unit 600 are shown. In addition to the processor core 400, the hash conversion unit 500, and the history management unit 600, a hash function determination unit 370 that supplies a hash function to the hash conversion unit 500 is shown here.

プロセッサコア400は、フェッチ部410と、命令デコーダ420と、実行部430と、レジスタファイル440とを備える。なお、本発明の第5の実施の形態におけるフェッチ部410と命令デコーダ420とレジスタファイル440との機能は、図11において示した各構成と同様の機能であるため、ここでの詳細な説明を省略する。   The processor core 400 includes a fetch unit 410, an instruction decoder 420, an execution unit 430, and a register file 440. Note that the functions of the fetch unit 410, the instruction decoder 420, and the register file 440 in the fifth embodiment of the present invention are the same functions as the respective components shown in FIG. Omitted.

実行部430は、命令デコーダ420から供給された制御信号に基づいて、命令デコーダ420において解析した命令を実行するものである。この本発明の第5の実施の形態における実行部430は、図11において示した実行部430におけるハッシュ関数指定す命令を実行する機能を省いたものである。このハッシュ関数指定命令を実行する機能以外の実行部430の機能は、図11において示した本発明の第1の実施の形態における実行部430の機能と同一であるためここでの説明を省略する。   The execution unit 430 executes the instruction analyzed in the instruction decoder 420 based on the control signal supplied from the instruction decoder 420. The execution unit 430 in the fifth embodiment of the present invention omits the function of executing the instruction specifying the hash function in the execution unit 430 shown in FIG. The functions of the execution unit 430 other than the function of executing the hash function designation instruction are the same as the functions of the execution unit 430 in the first embodiment of the present invention shown in FIG. .

ハッシュ変換部500は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するためのハッシュ値に開始アドレスを変換させるものであり、確定ハッシュ関数保持部510および確定ハッシュ値生成部520を備える。なお、本発明の第5の実施の形態における確定ハッシュ値生成部520の機能は、図11において示したものと同様の機能であるため、ここでの詳細な説明を省略する。   The hash conversion unit 500 converts the start address into a hash value for identifying the reuse section with a bit width narrower than the bit width of the start address of the reuse section. The hash conversion unit 500 and the confirmed hash value A generation unit 520 is provided. Note that the function of the deterministic hash value generation unit 520 in the fifth embodiment of the present invention is the same as that shown in FIG. 11, and thus detailed description thereof is omitted here.

確定ハッシュ関数保持部510は、ハッシュ関数決定部370から供給されたハッシュ関数を保持するものである。この確定ハッシュ関数保持部510は、ハッシュ関数決定部370から信号線501を介してハッシュ関数が供給された場合にはこのハッシュ関数を保持し、その保持したハッシュ関数を確定ハッシュ値生成部520に供給する。   The deterministic hash function holding unit 510 holds the hash function supplied from the hash function determining unit 370. When the hash function is supplied from the hash function determination unit 370 via the signal line 501, the fixed hash function storage unit 510 stores the hash function, and stores the stored hash function in the fixed hash value generation unit 520. Supply.

履歴管理部600は、再利用区間の実行結果を保持して管理するものであり、履歴対象データ保持部610と、履歴検索部620と、履歴メモリ630と、履歴登録部640とを備える。なお、この本発明の第5の実施の形態における履歴管理部600の各構成の機能は、図11において示した各構成の機能と同様のものであるため、ここでの詳細な説明を省略する。   The history management unit 600 holds and manages the execution result of the reuse section, and includes a history target data holding unit 610, a history search unit 620, a history memory 630, and a history registration unit 640. The functions of the components of the history management unit 600 according to the fifth embodiment of the present invention are the same as the functions of the components shown in FIG. 11, and thus detailed description thereof is omitted here. .

[本発明の第5の実施の形態におけるデータ処理装置300の動作例]
次に、本発明の第5の実施の形態におけるデータ処理装置300の処理について図面を参照して説明する。
[Operation Example of Data Processing Device 300 in the Fifth Embodiment of the Present Invention]
Next, processing of the data processing device 300 according to the fifth embodiment of the present invention will be described with reference to the drawings.

図26は、本発明の第5の実施の形態におけるデータ処理装置300による命令処理方法の処理手順例を示すフローチャートである。   FIG. 26 is a flowchart illustrating an example of a processing procedure of an instruction processing method performed by the data processing device 300 according to the fifth embodiment of the present invention.

まず、ハッシュ関数決定部370によって、ハッシュ関数が決定される(ステップS981)。なお、このハッシュ関数決定部370のハッシュ関数を決定する処理手順例は、図8および9において示したハッシュ関数決定部200の処理手順例と同様であるので、ここでの説明を省略する。   First, the hash function is determined by the hash function determination unit 370 (step S981). Note that the processing procedure example for determining the hash function of the hash function determination unit 370 is the same as the processing procedure example of the hash function determination unit 200 shown in FIGS. 8 and 9, and a description thereof will be omitted here.

続いて、ハッシュ変換部500における確定ハッシュ関数保持部510において、ハッシュ関数決定部200により決定されたハッシュ関数が保持される(ステップS982)。そして、プログラムの命令を実行するプログラム実行処理が行われる(ステップS990)。   Subsequently, the hash function determined by the hash function determination unit 200 is stored in the fixed hash function storage unit 510 in the hash conversion unit 500 (step S982). Then, program execution processing for executing program instructions is performed (step S990).

図27は、本発明の第5の実施の形態におけるプログラム実行処理(ステップS990)の処理手順例を示すフローチャートである。このフローチャートは、プログラムの実行の開始をフローチャートの開始とし、プログラムの実行の終了をフローチャートの終了とする。   FIG. 27 is a flowchart illustrating a processing procedure example of the program execution processing (step S990) according to the fifth embodiment of the present invention. In this flowchart, the start of program execution is the start of the flowchart, and the end of program execution is the end of the flowchart.

まず、フェッチ部410およびレジスタファイル440に、命令デコーダ420によって解読(デコード)される命令およびその命令に従って実行部430により実行される値が読み出される(ステップS941)。次に、命令デコーダ420により、そのフェッチ部410から供給された命令がデコードされる(ステップS942)。   First, the instruction decoded by the instruction decoder 420 and the value executed by the execution unit 430 according to the instruction are read into the fetch unit 410 and the register file 440 (step S941). Next, the instruction decoder 420 decodes the instruction supplied from the fetch unit 410 (step S942).

続いて、実行部430により、解読(デコード)した命令が再利用命令か否かが判断される(ステップS945)。そして、デコードした命令が再利用命令でないと判断された場合には、レジスタファイル440から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力される(ステップS946)。そして、ステップS954に進む。   Subsequently, the execution unit 430 determines whether or not the decoded (decoded) instruction is a reuse instruction (step S945). If it is determined that the decoded instruction is not a reuse instruction, the reuse section is executed based on the input value supplied from the register file 440, and the execution result is output (step S946). ). Then, the process proceeds to step S954.

一方、ステップS945の処理において、命令が再利用命令であると判断された場合には、確定ハッシュ値生成部520により、再利用区間の開始アドレスからハッシュ値が算出される(ステップS947)。続いて、検索要求入力部621により、ハッシュ値および入力値を用いて履歴メモリ630に実行情報があるか否かが判断される(ステップS948)。   On the other hand, if it is determined in step S945 that the instruction is a reuse instruction, the determined hash value generation unit 520 calculates a hash value from the start address of the reuse section (step S947). Subsequently, the search request input unit 621 determines whether there is execution information in the history memory 630 using the hash value and the input value (step S948).

そして、実行履歴が履歴メモリ630にないと判断された場合には、実行部430により、レジスタファイル440から供給される入力値に基づいてその再利用区間が実行され、実行結果が出力される(ステップS949)。そして、履歴登録部640により、実行履歴が履歴メモリ630に登録される(ステップS951)。これにより、履歴メモリ630に実行履歴が登録される。そして、ステップS954に進む。   When it is determined that the execution history is not in the history memory 630, the execution section 430 executes the reuse section based on the input value supplied from the register file 440 and outputs the execution result ( Step S949). Then, the history registration unit 640 registers the execution history in the history memory 630 (step S951). As a result, the execution history is registered in the history memory 630. Then, the process proceeds to step S954.

一方、実行履歴が履歴メモリ630にあると判断された場合には、実行結果出力部622により、実行結果が出力される(ステップS952)。これにより、実行している再利用区間の実行結果が履歴メモリ630から出力される。続いて、実行部430は、実行結果が出力された再利用区間の実行を中止させる(ステップS953)。そして、ステップS954に進む。   On the other hand, when it is determined that the execution history is in the history memory 630, the execution result output unit 622 outputs the execution result (step S952). As a result, the execution result of the reuse section being executed is output from the history memory 630. Subsequently, the execution unit 430 stops execution of the reuse section in which the execution result is output (step S953). Then, the process proceeds to step S954.

そして、ステップS946、S951およびS953の処理の後に、実行結果がレジスタファイル440に書き戻される(ステップS954)。これにより、デコードされた命令の実行は終了する。   Then, after the processing of steps S946, S951, and S953, the execution result is written back to the register file 440 (step S954). As a result, execution of the decoded instruction is completed.

続いて、プログラムの実行が終了したか否かが判断される(ステップS995)。そして、プログラムの実行が終了していないと判断された場合には、ステップS941に戻り処理が繰り返される。   Subsequently, it is determined whether or not the execution of the program has ended (step S995). If it is determined that the execution of the program has not ended, the process returns to step S941 and the process is repeated.

このように、本発明の第5の実施の形態では、ハッシュ関数決定部370から確定ハッシュ関数保持部510にハッシュ関数を供給することによって、既に生成されたオブジェクトプログラムの再利用区間の開始アドレスからハッシュ値を生成することができる。   As described above, in the fifth embodiment of the present invention, the hash function is supplied from the hash function determination unit 370 to the deterministic hash function holding unit 510, so that the start address of the reuse interval of the already generated object program is obtained. A hash value can be generated.

このように、本発明の実施の形態によれば、値再利用の効率を改善することができる。すなわち、複数のハッシュ関数から選択したハッシュ関数を用いて開始アドレスからハッシュ値を生成することによって、ハッシュ値と入力値と実行結果とを実行履歴として履歴メモリ630に保持させることができる。このハッシュ値は、開始アドレスより短いビット幅で再利用区間を識別する値である。   Thus, according to the embodiment of the present invention, the efficiency of value reuse can be improved. That is, by generating a hash value from a start address using a hash function selected from a plurality of hash functions, the hash value, input value, and execution result can be held in the history memory 630 as an execution history. This hash value is a value for identifying a reuse section with a bit width shorter than the start address.

すなわち、本発明の実施の形態によれば、関数アドレスと入力値と実行結果とを実行履歴として履歴メモリ630に保存させる従来技術の装置と比較して、履歴メモリ630に保持されるデータ量を軽減することができる。これにより、履歴メモリ630に保持される実行履歴の数を増加させることができることによって、検索におけるヒット率を上昇させることができる。   That is, according to the embodiment of the present invention, the amount of data held in the history memory 630 is smaller than that of the prior art device that stores the function address, input value, and execution result in the history memory 630 as the execution history. Can be reduced. Thereby, the number of execution histories held in the history memory 630 can be increased, so that the hit rate in the search can be increased.

また、開始アドレスがハッシュ値となることにより、実行履歴の検索時に比較されるビット数が減少する。このことにより、検索回路を減少させることができることによって、検索に掛かる時間を減少させることができる。   In addition, since the start address becomes a hash value, the number of bits compared at the time of execution history search decreases. As a result, the number of search circuits can be reduced, so that the time required for the search can be 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 コンパイル処理装置
110 ソースプログラム記憶部
120 再利用命令判別部
121 再利用候補区間抽出部
122 再利用候補区間解析部
123 再利用度生成部
124 再利用命令変換部
140 機械語プログラム生成部
150 オブジェクトプログラム記憶部
170 ハッシュ値付再利用命令生成部
172 ハッシュ値付加部
200 ハッシュ関数決定部
210、710 開始アドレス取得部
220、720 候補ハッシュ関数保持部
230、730 候補ハッシュ値生成部
240、740 ハッシュ値テーブル
250 ハッシュ関数出力部
251、751 ユニークハッシュ値リスト判別部
252 確定ハッシュ関数選択部
300 データ処理装置
310 一次キャッシュ
311 命令キャッシュ
312 データキャッシュ
350 バス
360 主記憶部
370 ハッシュ関数決定部
400 プロセッサコア
410 フェッチ部
420 命令デコーダ
430 実行部
440 レジスタファイル
500 ハッシュ変換部
510 確定ハッシュ関数保持部
520 確定ハッシュ値生成部
600 履歴管理部
610 履歴対象データ保持部
620 履歴検索部
621 検索要求入力部
622 実行結果出力部
630 履歴メモリ
640 履歴登録部
700 ハッシュ値決定部
750 ハッシュ値出力部
752 確定ハッシュ値選択部
DESCRIPTION OF SYMBOLS 100 Compile processing apparatus 110 Source program memory | storage part 120 Reuse instruction discrimination | determination part 121 Reuse candidate area extraction part 122 Reuse candidate area analysis part 123 Reuse degree generation part 124 Reuse instruction conversion part 140 Machine language program generation part 150 Object program Storage unit 170 Reuse instruction generation unit with hash value 172 Hash value addition unit 200 Hash function determination unit 210, 710 Start address acquisition unit 220, 720 Candidate hash function holding unit 230, 730 Candidate hash value generation unit 240, 740 Hash value table 250 Hash function output unit 251, 751 Unique hash value list determination unit 252 Deterministic hash function selection unit 300 Data processing device 310 Primary cache 311 Instruction cache 312 Data cache 350 Bus 3 DESCRIPTION OF SYMBOLS 0 Main memory | storage part 370 Hash function determination part 400 Processor core 410 Fetch part 420 Instruction decoder 430 Execution part 440 Register file 500 Hash conversion part 510 Deterministic hash function holding | maintenance part 520 Definite hash value generation part 600 History management part 610 History object data holding part 620 History search unit 621 Search request input unit 622 Execution result output unit 630 History memory 640 History registration unit 700 Hash value determination unit 750 Hash value output unit 752 Determined hash value selection unit

Claims (16)

プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、前記区間識別値の候補である候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成部と、
前記候補値生成部により生成された前記候補値を前記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する区間識別値生成関数出力部と、
前記区間識別値生成関数が埋め込まれた機械語プログラムを前記解析されたプログラムおよび前記区間識別値生成関数に基づいて生成する機械語プログラム生成部と
を具備するコンパイル処理装置。
An analysis unit for analyzing a usage state of a plurality of instruction sections in a program and determining a reuse section in which an execution result is reused among the instruction sections;
By using a candidate function that is a candidate of a section identification value generation function for generating a section identification value for identifying the reuse section by a value having a bit width narrower than the bit width of the start address of the reuse section, the section A candidate value generating unit that generates a candidate value that is a candidate for an identification value from the start address in association with the candidate function;
A candidate value table that holds the candidate values generated by the candidate value generation unit as a candidate value list for each of the associated candidate functions;
The candidate value lists having all the candidate values different from each other are extracted, and the associated candidate function of the candidate value list selected based on the bit width of the candidate value is extracted from the extracted candidate value lists. An interval identification value generation function output unit that outputs as a value generation function;
A compile processing apparatus comprising: a machine language program generating unit that generates a machine language program in which the section identification value generation function is embedded based on the analyzed program and the section identification value generation function.
前記候補関数は、ハッシュ関数であり、
前記区間識別値生成関数出力部は、前記抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられたハッシュ関数を前記区間識別値生成関数として出力する
請求項1記載のコンパイル処理装置。
The candidate function is a hash function;
The section identification value generation function output unit outputs, as the section identification value generation function, the associated hash function of the candidate value list selected based on the bit width of the candidate value in the extracted candidate value list. The compile processing apparatus according to claim 1.
前記ハッシュ関数は、前記開始アドレスの最下位ビットから所定の数のビットにおける値を前記候補値とするハッシュ関数であり、
前記区間識別値生成関数出力部は、前記抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられたハッシュ関数を前記区間識別値生成関数として出力する
請求項2記載のコンパイル処理装置。
The hash function is a hash function having a value in a predetermined number of bits from the least significant bit of the start address as the candidate value,
The section identification value generation function output unit outputs, as the section identification value generation function, the associated hash function of the candidate value list selected based on the bit width of the candidate value in the extracted candidate value list. The compile processing apparatus according to claim 2.
前記区間識別値生成関数出力部は、前記抽出された候補値リストのうちビット幅が最も狭い前記候補値の候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する請求項1記載のコンパイル処理装置。   The section identification value generation function output unit outputs, as the section identification value generation function, the associated candidate function of the candidate value list of the candidate value having the narrowest bit width in the extracted candidate value list. The compilation processing apparatus according to 1. 前記区間識別値生成関数出力部は、前記区間識別値生成関数として前記区間識別値生成関数を識別するための識別子を出力し、
前記機械語プログラム生成部は、前記識別子が埋め込まれた機械語プログラムを生成する
請求項1記載のコンパイル処理装置。
The section identification value generation function output unit outputs an identifier for identifying the section identification value generation function as the section identification value generation function,
The compile processing apparatus according to claim 1, wherein the machine language program generation unit generates a machine language program in which the identifier is embedded.
複数の命令区間を実行して実行結果を出力する実行部と、
前記命令区間のうち実行結果が再び利用される再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値とその前記再利用区間の入力値とその前記再利用区間の実行結果とを実行履歴として保持する履歴メモリと、
前記区間識別値および前記入力値に基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する履歴検索部と
を具備するデータ処理装置。
An execution unit that executes a plurality of instruction sections and outputs an execution result; and
Among the instruction sections, a section identification value for identifying the reuse section by a value of a bit width narrower than a bit width of a start address of a reuse section in which an execution result is reused, an input value of the reuse section, and the A history memory that holds the execution result of the reuse section as an execution history;
A data processing apparatus comprising: a history search unit that searches the execution history from the history memory based on the section identification value and the input value, and outputs the execution result when the execution history is searched.
前記実行部が前記再利用区間を実行したときに前記開始アドレスを出力した場合には、前記区間識別値を生成するための区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する区間識別値生成部をさらに具備し、
前記実行部は、前記区間識別値生成部に前記区間識別値生成関数を供給し、
前記履歴メモリは、前記区間識別値生成部により生成された前記区間識別値と前記入力値と前記実行結果とを前記実行履歴として保持し、
前記履歴探索部は、前記区間識別値と前記入力値とに基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する
請求項6記載のデータ処理装置。
When the execution unit outputs the start address when executing the reuse section, the section identification value is generated from the start address using a section identification value generation function for generating the section identification value. Further comprising a section identification value generation unit,
The execution unit supplies the section identification value generation function to the section identification value generation unit,
The history memory holds the section identification value, the input value, and the execution result generated by the section identification value generation unit as the execution history,
The said history search part searches the said execution log from the said log | history memory based on the said area identification value and the said input value, and when the said execution log is searched, the said execution result is output. Data processing device.
前記実行部は、前記区間識別値生成関数を前記区間識別値生成部に供給し、
前記区間識別値生成部は、前記実行部が前記再利用区間を実行したときに前記開始アドレスを出力した場合には、前記実行部から供給された前記区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する
請求項7記載のデータ処理装置。
The execution unit supplies the section identification value generation function to the section identification value generation unit,
When the execution unit outputs the start address when the execution unit executes the reuse section, the section identification value generation unit uses the section identification value generation function supplied from the execution unit to generate the start address. The data processing apparatus according to claim 7, wherein the section identification value is generated from the data.
前記実行部は、前記区間識別値生成関数を識別する識別子を前記区間識別値生成部に供給し、
前記区間識別値生成部は、前記区間識別値生成関数の候補である候補関数から前記区間識別値生成関数を前記識別子に基づいて選択し、前記実行部が前記再利用区間を実行したときに前記開始アドレスを出力した場合には前記選択した区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する
請求項7記載のデータ処理装置。
The execution unit supplies an identifier for identifying the section identification value generation function to the section identification value generation unit,
The section identification value generation unit selects the section identification value generation function from candidate functions that are candidates for the section identification value generation function based on the identifier, and when the execution unit executes the reuse section, 8. The data processing apparatus according to claim 7, wherein when a start address is output, the section identification value is generated from the start address using the selected section identification value generation function.
前記実行部は、前記区間識別値が含まれる命令により前記再利用区間を実行した場合には前記区間識別値を前記履歴メモリに供給し、
前記履歴メモリは、前記区間識別値と前記入力値と前記実行結果とを前記実行履歴として保持し、
前記履歴探索部は、前記区間識別値と前記入力値とに基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する
請求項6記載のデータ処理装置。
The execution unit supplies the section identification value to the history memory when the reuse section is executed by an instruction including the section identification value.
The history memory holds the section identification value, the input value, and the execution result as the execution history,
The said history search part searches the said execution log from the said log | history memory based on the said area identification value and the said input value, and when the said execution log is searched, the said execution result is output. Data processing device.
プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、前記区間識別値の候補である候補値を前記候補関数に関連付けて生成する候補値生成部と、
前記候補値生成部により生成された前記候補値を前記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記候補値を前記区間識別値として出力する区間識別値出力部と、
前記再利用区間を呼び出す命令を前記区間識別値が含まれる区間識別値付命令に変換する命令変換部と、
前記再利用区間が前記区間識別値付命令により呼び出される機械語プログラムを前記区間識別値付命令が含まれるソースプログラムに基づいて生成する機械語プログラム生成部と
を具備するコンパイル処理装置。
An analysis unit for analyzing a usage state of a plurality of instruction sections in a program and determining a reuse section in which an execution result is reused among the instruction sections;
By using a candidate function that is a candidate of a section identification value generation function for generating a section identification value for identifying the reuse section by a value having a bit width narrower than the bit width of the start address of the reuse section, the section A candidate value generation unit that generates a candidate value that is a candidate for an identification value in association with the candidate function;
A candidate value table that holds the candidate values generated by the candidate value generation unit as a candidate value list for each of the associated candidate functions;
Extracting the candidate value lists whose candidate values are all different from each other, and outputting the candidate values of the candidate value list selected based on the bit width of the candidate values as the section identification value An interval identification value output unit
An instruction conversion unit for converting an instruction for calling the reuse section into an instruction with a section identification value including the section identification value;
A compile processing apparatus comprising: a machine language program generation unit that generates a machine language program in which the reuse interval is called by the instruction with interval identification value based on a source program including the instruction with interval identification value.
前記候補値生成部は、前記開始アドレスの所定の順序に従って付与された番号を入力の値とする前記候補関数を用いることによって前記候補値を生成する請求項11記載のコンパイル処理装置。   12. The compile processing apparatus according to claim 11, wherein the candidate value generation unit generates the candidate value by using the candidate function having a number given according to a predetermined order of the start address as an input value. 前記候補値生成部は、前記開始アドレスを入力の値とする前記候補関数を用いることによって前記候補値を生成する請求項11記載のコンパイル処理装置。   12. The compile processing apparatus according to claim 11, wherein the candidate value generation unit generates the candidate value by using the candidate function having the start address as an input value. 複数の命令区間を実行して実行結果を出力する実行部と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、前記区間識別値の候補である候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成部と、
前記候補値生成部により生成された前記候補値を前記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を区間識別値生成関数として出力する区間識別値生成関数出力部と、
前記実行部が前記再利用区間を実行したときに前記開始アドレスが出力された場合には前記区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する区間識別値生成部と、
前記再利用区間の前記区間識別値と入力値と実行結果とを実行履歴として保持する履歴メモリと、
前記区間識別値および前記入力値に基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する履歴検索部と
を具備するデータ処理装置。
An execution unit that executes a plurality of instruction sections and outputs an execution result; and
By using a candidate function that is a candidate of a section identification value generation function for generating a section identification value for identifying the reuse section by a value having a bit width narrower than the bit width of the start address of the reuse section, the section A candidate value generating unit that generates a candidate value that is a candidate for an identification value from the start address in association with the candidate function;
A candidate value table that holds the candidate values generated by the candidate value generation unit as a candidate value list for each of the associated candidate functions;
The candidate value lists that are all different from each other in the candidate value are extracted, and the associated candidate function of the candidate value list selected based on the bit width of the candidate value in the extracted candidate value list is the section identification value An interval identification value generation function output section to output as a generation function;
A section identification value generation unit that generates the section identification value from the start address using the section identification value generation function when the start address is output when the execution unit executes the reuse section;
A history memory that holds the section identification value, input value, and execution result of the reuse section as an execution history;
A data processing apparatus comprising: a history search unit that searches the execution history from the history memory based on the section identification value and the input value, and outputs the execution result when the execution history is searched.
区間識別値の候補である候補値を前記候補値を生成した候補関数ごとに候補値リストとして保持する候補値テーブルを備えるコンピュータにおけるデータ処理方法であって、
プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析手順と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する前記区間識別値を生成するための区間識別値生成関数の候補である前記候補関数を用いることによって、前記区間識別値の候補である前記候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成手順と、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する区間識別値生成関数出力手順と、
前記区間識別値生成関数が埋め込まれた機械語プログラムを前記解析されたプログラムおよび前記区間識別値生成関数に基づいて生成する機械語プログラム生成手順と
を具備するコンパイル処理方法。
A data processing method in a computer comprising a candidate value table that holds candidate values that are candidates for section identification values as a candidate value list for each candidate function that generated the candidate value,
An analysis procedure for analyzing a usage mode of a plurality of instruction sections in a program and determining a reuse section in which an execution result is reused among the instruction sections;
By using the candidate function that is a candidate for the section identification value generation function for generating the section identification value for identifying the reuse section by a value of a bit width narrower than the bit width of the start address of the reuse section, A candidate value generation procedure for generating the candidate value, which is a candidate for the section identification value, from the start address in association with the candidate function;
The candidate value lists having all the candidate values different from each other are extracted, and the associated candidate function of the candidate value list selected based on the bit width of the candidate value is extracted from the extracted candidate value lists. Section identification value generation function output procedure to output as a value generation function,
A compiling method comprising: a machine language program generation procedure for generating a machine language program in which the section identification value generation function is embedded based on the analyzed program and the section identification value generation function.
区間識別値の候補である候補値を前記候補値を生成した候補関数ごとに候補値リストとして保持する候補値テーブルを備えるコンピュータにおけるプログラムであって、
プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析手順と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する前記区間識別値を生成するための区間識別値生成関数の候補である前記候補関数を用いることによって、前記区間識別値の候補である前記候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成手順と、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する区間識別値生成関数出力手順と、
前記区間識別値生成関数が埋め込まれた機械語プログラムを前記解析されたプログラムおよび前記区間識別値生成関数に基づいて生成する機械語プログラム生成手順と
をコンピュータに実行させるプログラム。
A program in a computer comprising a candidate value table that holds candidate values that are candidates for section identification values as a candidate value list for each candidate function that generated the candidate value,
An analysis procedure for analyzing a usage mode of a plurality of instruction sections in a program and determining a reuse section in which an execution result is reused among the instruction sections;
By using the candidate function that is a candidate for the section identification value generation function for generating the section identification value for identifying the reuse section by a value of a bit width narrower than the bit width of the start address of the reuse section, A candidate value generation procedure for generating the candidate value, which is a candidate for the section identification value, from the start address in association with the candidate function;
The candidate value lists having all the candidate values different from each other are extracted, and the associated candidate function of the candidate value list selected based on the bit width of the candidate value is extracted from the extracted candidate value lists. Section identification value generation function output procedure to output as a value generation function,
A program for causing a computer to execute a machine language program in which the section identification value generation function is embedded based on the analyzed program and the section identification value generation function.
JP2009251586A 2009-08-13 2009-11-02 Compile processing device, data processing device, compile processing method, and program Pending JP2011096153A (en)

Priority Applications (7)

Application Number Priority Date Filing Date Title
JP2009251586A JP2011096153A (en) 2009-11-02 2009-11-02 Compile processing device, data processing device, compile processing method, and program
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
JP2009251586A JP2011096153A (en) 2009-11-02 2009-11-02 Compile processing device, data processing device, compile processing method, and program

Publications (1)

Publication Number Publication Date
JP2011096153A true JP2011096153A (en) 2011-05-12

Family

ID=44112962

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009251586A Pending JP2011096153A (en) 2009-08-13 2009-11-02 Compile processing device, data processing device, compile processing method, and program

Country Status (1)

Country Link
JP (1) JP2011096153A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018509855A (en) * 2015-03-27 2018-04-05 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Media key block-based broadcast encryption method
US10789203B2 (en) 2016-05-23 2020-09-29 Nec Corporation Data processing apparatus, data processing method, and program recording medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018509855A (en) * 2015-03-27 2018-04-05 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Media key block-based broadcast encryption method
US10789203B2 (en) 2016-05-23 2020-09-29 Nec Corporation Data processing apparatus, data processing method, and program recording medium

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
CN106295335B (en) Firmware vulnerability detection method and system for embedded equipment
JP6160259B2 (en) Character string search method, character string search device, and character string search program
JP2009237762A (en) Program analyzer, program analytical method, and analytical program
JP2011096153A (en) Compile processing device, data processing device, compile processing method, and program
KR20130111170A (en) Compression and decompression system, compression apparatus, decompression apparatus, compression and decompression method, computer readable recording medium having compression program, and computer readable recording medium having decompression program
JP4930435B2 (en) Variable length code decoding apparatus, variable length code decoding method and program
CN111611788B (en) Data processing method and device, electronic equipment and storage medium
JP6201788B2 (en) Loop division detection program and loop division detection method
CN109783074A (en) The data type conversion method of programming, electronic equipment
CN101911011B (en) Determine the system and method for the address of the element in showing
JP5440287B2 (en) Symbolic execution support program, method and apparatus
US10789203B2 (en) Data processing apparatus, data processing method, and program recording medium
US10108405B2 (en) Compiling apparatus and compiling method
JP6723726B2 (en) Input support device
CN113031952A (en) Method and device for determining execution code of deep learning model and storage medium
JP2011039856A (en) Data processing device, data processing method, program conversion processing device, and program conversion processing method
JP2011039858A (en) Data processing device, data processing method, program analysis processing device, and program analysis processing method
JP2008243074A (en) Device, method, and program for retrieving document
KR102370851B1 (en) Method for High-Speed String Extraction using Vector Instruction
CN116168765B (en) Gene sequence generation method and system based on improved stroboemer
JP6091471B2 (en) Source code analysis apparatus, source code analysis method, and source code analysis program
JP6075060B2 (en) Information processing device
JP6214455B2 (en) Instruction table generation apparatus, instruction decode program generation apparatus, instruction table generation method, instruction decode program generation method, and program
JP5462215B2 (en) SEARCH DEVICE, SEARCH METHOD, AND PROGRAM