WO2010128582A1 - プロセッサ - Google Patents

プロセッサ Download PDF

Info

Publication number
WO2010128582A1
WO2010128582A1 PCT/JP2010/002939 JP2010002939W WO2010128582A1 WO 2010128582 A1 WO2010128582 A1 WO 2010128582A1 JP 2010002939 W JP2010002939 W JP 2010002939W WO 2010128582 A1 WO2010128582 A1 WO 2010128582A1
Authority
WO
WIPO (PCT)
Prior art keywords
instruction
resource
ready
instructions
dependency relationship
Prior art date
Application number
PCT/JP2010/002939
Other languages
English (en)
French (fr)
Inventor
山名智尋
Original Assignee
パナソニック株式会社
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 パナソニック株式会社 filed Critical パナソニック株式会社
Priority to CN201080020018.8A priority Critical patent/CN102422262B/zh
Publication of WO2010128582A1 publication Critical patent/WO2010128582A1/ja
Priority to US13/285,137 priority patent/US20120047352A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3838Dependency mechanisms, e.g. register scoreboarding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3802Instruction prefetching
    • G06F9/3814Implementation provisions of instruction buffers, e.g. prefetch buffer; banks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3885Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units

Definitions

  • the present invention relates to a processor capable of executing a plurality of instructions in parallel, and more particularly to a processor having a superscalar architecture.
  • the processor executes the instruction sequence stored in the memory. In order to improve execution performance, it is better to simultaneously execute a plurality of instructions that can be executed in parallel when executing an instruction sequence.
  • a superscalar architecture exists as a processor architecture that can execute multiple instructions in parallel. In a superscalar, if the definition of a resource (register, etc.) has not been completed by an instruction that is already being executed, the instruction that refers to that resource is stopped and the instruction without the next dependency is executed first. Control by hardware is performed.
  • the superscalar requires a complicated mechanism for holding and restoring the state of the processor at the time when the exception occurs.
  • VLIW Very Long Instruction Word
  • an instruction that can be executed in parallel by a compiler is extracted in advance during compilation, and a parallel execution code composed of a plurality of instructions that can be executed in parallel is generated.
  • the processor has a relatively simple configuration.
  • the code size is increased by inserting the NOP instruction and incompatibility with the existing instruction set.
  • Patent Document 1 An example of a command issue control method is disclosed in Patent Document 1.
  • issuance of instructions is controlled in units of instruction groups composed of one or more instructions in advance.
  • Patent Document 1 a table for storing information on resources (register files, etc.) defined and referenced by individual instructions in a predetermined issue group and waiting time information on the resources is prepared. . By utilizing the waiting time information, the dependency relationship with the instruction in the already issued instruction group is detected, and if there is a dependency, the issue of the instruction in the corresponding instruction group is stopped and the dependency relationship is detected. A method is proposed in which instructions in an instruction group with no error are issued first.
  • Patent Document 2 relates to an apparatus that counts the number of instructions that can be executed simultaneously in a thread, calculates the number of cycles spent in thread processing, considers priority, and efficiently issues instructions in a plurality of threads. Is disclosed.
  • Paragraph 0040 to Paragraph 0045 of Patent Document 2 describe a general instruction grouping technique implemented by existing hardware.
  • the present invention has been made in order to solve the above-described problems, and a processor capable of realizing, with simple hardware, efficient issue group determination (instruction grouping) from the viewpoint of execution performance when issuing instructions.
  • the purpose is to provide.
  • a processor is a processor capable of simultaneously issuing a plurality of instructions to a plurality of arithmetic units, wherein a cycle of the last instruction issuance to the plurality of arithmetic units is provided.
  • An instruction buffer for storing a plurality of instructions to be issued to the plurality of computing units in a next cycle; a first dependency existing between any two instructions stored in the instruction buffer; and the instruction buffer A second dependency existing between each stored instruction and each issued instruction is obtained, and the first dependency and the second dependency among the plurality of instructions stored in the instruction buffer are obtained.
  • a group determining unit that determines a group of instructions having no relationship as a group of instructions that can be issued to the plurality of computing units in the next cycle; The instructions included in the group, in the next cycle, and a dispatch unit for issuing to said plurality of arithmetic units.
  • the essential cause of the penalty cycle between instruction groups due to the grouping implemented by the instruction grouping mechanism of existing hardware is that the existing hardware only considers the dependency relationship between instructions stored in the instruction buffer. This is because it is impossible to detect a dependency relationship with an already issued instruction group.
  • the instruction group to be issued in the next cycle is determined by referring not only to the dependency relationship between the instructions stored in the instruction buffer but also to the dependency relationship with the already issued instruction. .
  • the penalties that occur between issued instruction groups can be alleviated, and when issuing instructions, efficient issue group determination (instruction grouping) is realized with simple hardware from the viewpoint of execution performance. it can.
  • the present invention can be realized not only as a processor having such a characteristic processing unit, but also as an instruction issuance control method using steps executed by the characteristic processing unit included in the processor as a step. be able to. It can also be realized as a program that causes a computer to execute the characteristic steps included in the instruction issue control method. Such a program can be distributed via a non-volatile recording medium such as a CD-ROM (Compact Disc-Read Only Memory) or a communication network such as the Internet.
  • a non-volatile recording medium such as a CD-ROM (Compact Disc-Read Only Memory) or a communication network such as the Internet.
  • the present invention not only the dependency relationship between the instructions existing in the instruction buffer to be issued, but also the dependency relationship between the instruction existing in the instruction buffer and the instruction in the already issued instruction group is detected and the instruction grouping is performed. To do. This alleviates the penalty between issued instruction groups and contributes to improved performance.
  • FIG. 1 is a diagram for comparing execution performance by ideal instruction grouping and instruction grouping with existing hardware.
  • FIG. 2 is a diagram showing a configuration of existing hardware (conventional processor).
  • FIG. 3 is a diagram showing details of instruction grouping implemented by existing hardware.
  • FIG. 4 is a diagram showing a configuration of the processor according to the embodiment of the present invention.
  • FIG. 5 is a diagram illustrating an example of a resource state storage table.
  • FIG. 6 is a diagram showing details of grouping performed by the processor according to the embodiment of the present invention.
  • FIG. 7 is a diagram showing execution performance by instruction grouping in the processor according to the embodiment of the present invention.
  • FIG. 8 is a flowchart of processing for detecting a resource in a non-ready state.
  • FIG. 9 is a flowchart of data write processing to the resource state storage table.
  • FIG. 10 is a flowchart of a command issue control method.
  • Fig. 1 is a diagram comparing the execution performance of two types of instruction grouping.
  • the comparison diagram of FIG. 1 includes columns of an instruction code 101, an ideal result 102, and a conventional result 103.
  • the instruction code 101 indicates an instruction code constituting a loop process.
  • the instruction code 101 includes a branch destination label, a mnemonic expression of the instruction code, and a resource to which the instruction refers or defines.
  • a processor in which each instruction indicated by the instruction code 101 is executed can execute a maximum of three instructions in parallel, and a load / store arithmetic unit, a product-sum arithmetic unit, an arithmetic arithmetic unit, and branch execution. Assume that the unit is composed of one element each.
  • the essence of the present invention is not limited by the configuration such as the maximum number of processors that can be executed in parallel, the type and number of arithmetic units, and the like.
  • the ld instruction and ldp instruction in the instruction code 101 are a load instruction and a load pair instruction that are executed by the load / store arithmetic unit, respectively.
  • the mac instruction is a product-sum operation instruction executed by the product-sum operation unit.
  • the add instruction is an addition instruction executed by an arithmetic operator.
  • the br instruction is a branch instruction executed by the branch execution unit. The details of the operation of the above instruction can be easily guessed by those skilled in the art. Therefore, detailed description thereof will not be repeated here.
  • the ld instruction and the ldp instruction have the number of cycles to completion of execution, that is, the latency is 2 cycles, and the latency of the other instructions is 1 cycle.
  • these execution cycles are provisional definitions, and the essence of the present invention is not limited by the definition of the number of cycles.
  • the ideal result 102 in the comparison table of FIG. 1 shows an ideal instruction grouping result.
  • the instruction code up to that row is defined as an issue group (a group of instructions issued in the same cycle), and the instruction immediately after that is newly issued. Defined as the first instruction code of the group.
  • the Penalty column indicates a penalty cycle, and the issue group up to that line indicates the number of penalty cycles when any instruction execution after the next issue group is stalled.
  • the ideal result 102 represents a result of instruction grouping in which a penalty cycle does not occur between instruction groups, that is, efficient in terms of execution performance.
  • the conventional result 103 in the comparison table of FIG. 1 shows the result of instruction grouping by the existing instruction grouping process.
  • the result of instruction grouping in the conventional result 103 is shown below. [ld r1, (r4 +)] [mac acc, r2, r5] [add r0, -1] (first instruction group) [ld r5, (r4 +)] [mac acc, r3, r1] (second instruction group) [ldp r2, r3, (r6 +)] [br r0,0 L0001] (third instruction group)
  • FIG. 2 is a diagram showing a configuration of existing hardware (conventional processor).
  • general instruction issuance control is performed on the premise of in-order parallel execution.
  • FIG. 2 shows a processor capable of executing three instructions in parallel, but the essence of the present invention is not limited by the number of parallel executions.
  • the processor includes instruction buffers 201 to 203, resource decoding units 211 to 213, dependency relationship detection units 231 and 232, and dispatch units 241 to 243.
  • Each of the instruction buffers 201 to 203 is a storage device that stores an instruction fetched from an instruction cache (not shown).
  • the resource decoding units 211 to 213 extract information on resources defined or referred to by instructions stored in the instruction buffers 201 to 203, information on computing units on which the instructions are executed, and the like.
  • Each of the dependency relationship detection units 231 and 232 detects the dependency relationship of the arithmetic unit in which the instruction is executed and the dependency relationship of the resource defined or referred to by the instruction. That is, each of the dependency relationship detection units 231 and 232 detects a dependency relationship between instructions that use a common arithmetic unit and a dependency relationship between instructions that define or refer to a common resource.
  • the dispatch units 241 to 243 issue each instruction included in the instruction group to the arithmetic unit as appropriate.
  • Fig. 3 shows the details of the grouping implemented by the existing hardware shown in Fig. 2.
  • All three instructions which are the instructions of the maximum number of parallel executions, are dispatched by the dispatch units 241, 242, and 243, and the instructions 311, 312, and 313 are issued to each arithmetic unit.
  • instructions 321, 322, and 323 are stored in the instruction buffers 201, 202, and 203, respectively.
  • both the instruction 321 and the instruction 323 are instructions executed by the load / store arithmetic unit and cannot be executed at the same time, so that resource constraints occur between the instructions 321 and 323. Therefore, only instruction 331 and instruction 332 are dispatched.
  • instructions 341 and 342 are stored in the instruction buffers 201 and 202, respectively. Since neither the resource constraint nor the data dependency constraint exists between the instructions 341 and 342, the instructions 351 and 352 are dispatched.
  • the register r1 defined by the instruction 311 (ld instruction) in the first instruction group is referred to by the instruction 332 (mac instruction) in the second instruction group, and therefore, between the first instruction group and the second instruction group.
  • Data dependency that is, true dependency occurs.
  • the latency of the ld instruction is 2 cycles. For this reason, a penalty of one cycle occurs before the execution of the instruction of the second instruction group starts. Therefore, in the comparison diagram of FIG. 1, “1” is shown in the Penalty item of the column of the add instruction of the conventional result 103.
  • FIG. 4 is a diagram showing a configuration of the processor according to the embodiment of the present invention.
  • the processor according to the present embodiment is a processor that can execute a maximum of three instructions in parallel.
  • the essence of the present invention is not limited to the maximum number that can be executed in parallel.
  • the processor includes instruction buffers 401 to 403, resource decode units 411 to 413, dispatch units 441 to 443, cycle decode units 451 to 453, non-ready detection units 461 to 463, dependency relationship detection units 431 and 432, Resource state storage table 470.
  • the instruction buffers 401 to 403, the resource decode units 411 to 413, and the dispatch units 441 to 443 are respectively the instruction buffers 201 to 203, the resource decode units 211 to 213, and the dispatch units 241 to 243 in the existing hardware shown in FIG. It is a component having the same function. Therefore, detailed description thereof will not be repeated here.
  • the cycle decode units 451, 452, and 453 decode the latency of the instructions stored in the instruction buffers 401, 402, and 403, respectively.
  • the non-ready detection units 461, 462, and 463 are the latency of the instructions stored in the instruction buffers 401, 402, and 403 output from the cycle decoding units 451, 452, and 453, respectively, and the resource decoding units 411, 412, and 413, respectively.
  • the resource information defined by the instruction stored in the output instruction buffer 401, 402, 403 is input and the latency is 2 or more, the resource defined by each instruction is determined to be non-ready in the cycle after the instruction group is issued. To do. That is, it is determined that the resource cannot be referenced or defined in the cycle (next cycle) after the instruction group is issued.
  • the instruction code [ld r1, (r4 +)] is stored in the instruction buffer 401.
  • This instruction is an instruction for defining the value of the memory at the address specified by referring to the register r4 in the register r1, and the latency is 2. Therefore, the register r1 defined by this instruction is determined to be non-ready in the cycle after the ld instruction is issued.
  • the resource determined to be non-ready (register r1) is registered in the resource state storage table 470.
  • FIG. 5 is a diagram illustrating an example of the resource state storage table 470.
  • the resource state storage table 470 is a storage device that stores a resource state for each resource, and stores a resource number 471, a ready flag 472, and a non-ready continuous cycle number 473 for each resource.
  • the ready flag 472 is a flag indicating whether or not resources can be referred from the next issue cycle.
  • the ready flag 472 is 1, it is possible to immediately refer to the resource from the next issue cycle, that is, the resource is not non-ready (that is, ready).
  • the ready flag 472 is 0, it is impossible to immediately refer to the resource from the next issue cycle, that is, the resource is not ready.
  • the non-ready continuous cycle number 473 indicates the number of cycles in which the non-ready state continues.
  • the register r1 is determined to be non-ready in the cycle after the ld instruction, so that the resource state storage table 470 has the non-ready output from the non-ready detection unit 461.
  • the ready flag 472 of the table entry corresponding to the register r1 is 1, the ready flag 472 is changed to 0, and 2 is registered in the non-ready continuing cycle number 473.
  • the resource state storage table 470 compares the number of non-ready continuous cycles to be newly registered with the number of existing cycles registered in the number of non-ready continuous cycles 473. . If the number of non-ready continuous cycles to be newly registered is larger, the resource state storage table 470 registers the new number of non-ready continuous cycles as the number of non-ready continuous cycles 473. In the resource state storage table 470, when the number of non-ready continuous cycles to be newly registered is smaller, the new cycle number is not registered in the non-ready continuous cycle number 473, and the existing cycle number is not registered. The non-ready continuous cycle number 473 continues to be registered.
  • the dependency relationship detection units 431 and 432 not only depend on the dependency relationship between the instructions stored in the instruction buffers 401, 402, and 403 (first dependency relationship in the claims), but also the instruction buffers 401 and 402 as in the existing hardware. , 403 and a dependency relationship (second dependency relationship in the claims) between each resource entry in the resource state storage table 470 is detected. That is, the dependency relationship detection units 431 and 432 refer to the ready flag 472 of each resource entry registered in the resource state storage table 470 and detect an instruction having a dependency relationship with an entry in a non-ready state.
  • the dependency relationship detection units 431 and 432 detect a dependency between the instructions stored in the instruction buffers 401, 402, and 403, or each instruction stored in the instruction buffers 401, 402, and 403 and the resource state storage table 470 When a dependency is detected between the entries corresponding to each resource, the instruction immediately before the instruction that detected the dependency is used as the issue group delimiter. Instructions up to the issue group delimiter are stored in the dispatch units 441, 442, and 443, and instructions up to the issue group delimiter stored in the dispatch units 441, 442, and 443 are issued to the computing unit as appropriate.
  • the non-ready detection units 461 to 463 set the ready flag 472 of the corresponding entry to 1 and the non-ready continuing cycle number 473 to 0. To do.
  • FIG. 6 shows details of the grouping performed by the processor shown in FIG.
  • the dispatch units 441, 442, and 443 issue all three instructions (instructions 511, 512, and 513), which are the maximum number of parallel executions, to each arithmetic unit.
  • instructions 521, 522, and 523 are stored in the instruction buffers 401, 402, and 403, respectively.
  • a resource constraint is generated between the instructions 521 and 523.
  • a true dependency relationship is generated between the instruction 511 and the instruction 522 by the register r1, and the latency of the ld instruction is 2. For this reason, the register r1 cannot be referred to immediately after the execution of the instructions 511, 512, and 513 of the first instruction group.
  • instructions 541, 542, and 543 are stored in the instruction buffers 401, 402, and 403, respectively. Since neither the resource constraint nor the data dependency constraint exists between the instructions 541, 542, and 543, the instructions 551, 552, and 553 are dispatched.
  • Figure 7 shows the execution performance of the proposed method.
  • the comparison diagram of FIG. 7 is obtained by adding the column of the result 604 of the present invention to the comparison diagram of FIG.
  • the column of the present invention result 604 shows the grouping result of instructions according to the present embodiment.
  • a one-cycle penalty occurs in the instruction grouping by the existing hardware shown in the column of the conventional result 103.
  • the penalty cycle does not occur in the result 604 of the present invention. Therefore, the problem of degrading execution performance has been solved.
  • FIG. 8 is a flowchart of a non-ready resource detection process using the non-ready detection unit 461. Note that the non-ready detection units 462 and 463 also perform the same processing as the non-ready detection unit 461, and thus detailed description thereof will not be repeated.
  • the resource decoding unit 411 detects a resource defined by an instruction in the instruction buffer 401 (S701).
  • the cycle decoding unit 451 detects the latency of the instruction in the instruction buffer 401 (S702).
  • the non-ready detection unit 461 determines whether or not the instruction in the instruction buffer 401 defines the resource used in the instruction based on the information obtained in S701 and S702 (S703).
  • the non-ready detection unit 461 determines that the resource is not in a non-ready state, that is, can be referred immediately from the next issue cycle (S705). ).
  • the non-ready detection unit 461 determines whether or not the latency of the instruction in the instruction buffer 401 is 2 or more (S704). If the latency is not 2 or more, that is, if the latency is 1 (NO in S704), the non-ready detection unit 461 indicates that the resource is not non-ready, that is, can be referred immediately from the next issue cycle. Determination is made (S705).
  • FIG. 9 is a flowchart of data write processing to the resource state storage table 470.
  • the resource state storage table 470 determines the total number of non-ready information detected by the non-ready detection algorithm described in FIG. 8 (S801). If there is no non-ready information (NO in S801), the resource state storage table 470 sets a predetermined number (in a typical example) of the number of non-ready continuing cycles 473 of all the non-ready entries in the table. Only "1") is subtracted (S808).
  • the resource state storage table 470 determines whether there is an overlap in the resource numbers of the non-ready information (S802). If there is an overlap in the resource numbers of the non-ready information (YES in 802), the resource state storage table 470 selects the non-ready information with the highest latency among the non-ready information of the same resource number (S803).
  • the resource state storage table 470 refers to the entry of the corresponding resource (non-ready resource) in the table (S804). This entry reference and subsequent entry content update are implemented in hardware in a maximum of three in parallel when the non-ready information output from the non-ready detection units 461 to 463 does not overlap.
  • the resource state storage table 470 determines whether the corresponding resource entry designated by the resource number of the non-ready information is in a ready state (S805).
  • the resource state storage table 470 immediately sets the ready flag 472 of the resource entry to 0 and registers the latency of the non-ready information in the non-ready continuing cycle number 473. (S807).
  • the resource state storage table 470 determines whether the number of non-ready continuous cycles of the corresponding resource entry is smaller than the latency of the non-ready information. (S806).
  • the resource state storage table 470 immediately stores the non-ready continuous cycle number 473 of the resource entry.
  • the latency of the non-ready information is registered.
  • the existing non-ready continuous cycle number is held in the corresponding entry of the resource state storage table 470 as it is.
  • the ready state of each resource in the resource state storage table 470 is appropriately updated by the above processing.
  • FIG. 10 shows a flowchart of a command issue control method.
  • the dependency relationship detection unit 431 detects the dependency relationship between the instruction stored in the instruction buffer 401 and the instruction stored in the instruction buffer 402. This dependency is defined as (dependency A-1) (S901).
  • the dependency relationship detection unit 432 stores the dependency relationship between the instruction stored in the instruction buffer 401 and the instruction stored in the instruction buffer 403, and the instruction stored in the instruction buffer 402 and the instruction buffer 403. Detect dependencies with the current instruction. This dependency is defined as (dependency A-2) (S901).
  • dependency relationship detection unit 431 detects the dependency relationship between the instruction stored in the instruction buffer 402 and each resource in the resource state storage table 470 together with the above (dependency A-1). This dependency is defined as (dependency B-1) (S902).
  • the dependency relationship detection unit 432 detects the dependency relationship between the instruction stored in the instruction buffer 403 and the entry of each resource in the resource state storage table 470 in both cases (dependency A-2). This dependency is defined as (dependency B-2) (S902).
  • the dependency relationship detection unit 431 detects the dependency and sends a control signal to the dispatch units 442 to 443 to suppress the dispatch of instructions stored in the instruction buffers 402 and 403. That is, only instructions stored in the instruction buffer 401 are dispatched (S905, S906).
  • the dependency relationship detection unit 432 detects the dependency and sends a control signal to the dispatch unit 443 to suppress the dispatch of the instruction stored in the instruction buffer 403. That is, only the instructions stored in the instruction buffers 401 and 402 are dispatched (S905, S906).
  • the above method is processing when there are three instruction buffers. However, even when there are four or more instruction buffers, when a plurality of dependency relationships are detected between instructions, the issue group for the closest dependency from the first instruction is detected. The method for controlling the issue group is the same so that there is no dependency between the instructions in the instruction group.
  • FIG. 4 shows an example in which the leading instruction buffer is fixed, but the instruction buffer is ring-coupled, the pointer indicating the leading instruction associated therewith is updated, and the dependency detecting unit and dispatching unit are changed by changing the leading pointer. It is also possible to implement more efficient processing such as changing the control of the above, but since this content is not the essence of this patent, description thereof will be omitted.
  • the present invention is a technology related to the basis of a parallel execution architecture, and can provide a processor with high execution performance despite simple hardware. According to the present invention, a simple architecture that can be executed in parallel can be realized while maintaining binary compatibility.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Advance Control (AREA)

Abstract

 プロセッサは、複数の演算器に発行する予定の複数の命令を格納する命令バッファ(401)~(403)と、命令バッファに格納された任意の2つの命令間に存在する依存関係である第1依存関係と、命令バッファに格納された各命令と発行済みの各命令との間に存在する依存関係である第2依存関係とを検出し、命令バッファに格納されている複数の命令のうち、第1依存関係及び第2依存関係のいずれをも有しない命令のグループを、複数の演算器に発行することが可能な命令のグループとして決定する依存関係検出部(431、432)と、決定されたグループに含まれる命令を、複数の演算器に発行するディスパッチ部(441)~(443)とを備える。

Description

プロセッサ
 本発明は、複数命令を並列実行可能なプロセッサに関し、特に、スーパースカラ型のアーキテクチャを有するプロセッサに関する。
 プロセッサは、メモリに格納された命令シーケンスを実行する。実行性能を向上させるには、命令シーケンスを実行する際に、並列実行可能な複数の命令を同時実行させる方がよい。
 複数命令を並列実行可能なプロセッサアーキテクチャに、スーパースカラというアーキテクチャが存在する。スーパースカラでは、あるリソース(レジスタ等)の定義が、既に実行中の命令により完了していない場合、そのリソースを参照する命令の発行を止めて、次の依存関係の無い命令を先に実行するハードウェアによる制御が行なわれる。
 しかしながら、上記スーパースカラでは、例外が発生した時点におけるプロセッサの状態を、保持及び復元するための複雑な機構が必要である。
 一方、複数の命令を並列実行可能なプロセッサアーキテクチャにVLIW(Very Long Instruction Word)というアーキテクチャが存在する。VLIWでは、コンパイラが並列実行可能な命令を予めコンパイル時に抽出し、並列実行可能な複数命令で構成された並列実行コードを生成する。
 VLIWでは、プロセッサは比較的シンプルな構成となる。しかしながら、NOP命令を挿入することによるコードサイズの増加、及び既存命令セットとの非互換という問題を有している。
 上述のように、複数命令を並列実行する方式には、スーパースカラ、VLIWが存在し、各々に長所及び短所が存在する。
 命令発行制御の方法の一例が特許文献1に開示されている。特許文献1では、予め1つ以上の命令で構成される命令グループ単位で、命令の発行を制御している。
 また、特許文献1によれば、予め定められた発行グループ内の個々の命令が定義及び参照するリソース(レジスタファイル等)の情報とそのリソースの待ち時間情報とを格納するテーブルが用意されている。その待ち時間情報を活用する事によって、既に発行されている命令グループ内の命令との依存関係を検出し、依存が存在する場合には、該当する命令グループ内の命令の発行を止め、依存関係の無い命令グループ内の命令を先に発行するという手法を提案している。
 上記発行制御の方法によって、命令発行前に依存関係にある1つ以上の命令を有する命令グループを抽出し、命令スケジューリングを実施する事が可能となる。
 命令発行制御の方法の他の一例が特許文献2に開示されている。特許文献2は、スレッド内で同時実行可能な命令の数をカウントし、スレッド処理に費やすサイクル数を計算し、優先度を考慮し、複数のスレッド内の命令を効率的に発行する装置に関する発明を開示している。
 特許文献2の段落0040~段落0045では、既存ハードウェアで実施される一般的な命令グルーピングの手法について、説明されている。
 上記説明における、命令発行前の時点で実施される既存の命令グルーピング機構においては、発行しようとしている命令グループ内の命令に限って依存関係が抽出され、適宜発行グループの制御が実施される。
特許第3984786号公報 特開2008-123045号公報(段落0040~0045)
 しかしながら、特許文献1に記載の発行制御方法では、命令キュー内に依存関係のある命令を保持し、その依存関係を逐次検出しながら、複数の命令グループに対して発行制御を実施する必要がある。また、命令発行時に命令グループ単位で動的に命令スケジューリングが実行されるため、命令発行後に例外が発生した場合のプロセッサの状態を復元するためのハードウェアの投資が必要になる。したがって、特許文献1に記載の発行制御方法では、上記2点の理由によりハードウェアが複雑化するという問題がある。
 また、特許文献2に記載の手法では、上記グルーピングの制約により、命令グループ内の命令間の依存関係、及び命令グループを跨った命令間の依存関係を考慮したグルーピングによる発行制御が実施できない。このため、命令実行時に、本来適切にグルーピングが実施されていれば発生しなかった、ペナルティサイクルが生じる場合がある。したがって、既存の命令発行前の時点における命令グルーピング機構では、最適な性能が達成できていないケースが発生する場合が考えられるという問題がある。
 本発明は、上述の課題を解決するためになされたものであり、命令発行の際に、実行性能の観点で効率的な発行グループの決定(命令グルーピング)を、簡素なハードウェアで実現できるプロセッサを提供することを目的とする。
 上記目的を達成するために、本発明のある局面に係るプロセッサは、複数の命令を複数の演算器に同時発行可能なプロセッサであって、前記複数の演算器への最後の命令発行のサイクルの次サイクルにて前記複数の演算器に発行する予定の複数の命令を格納する命令バッファと、前記命令バッファに格納された任意の2つの命令間に存在する第1依存関係と、前記命令バッファに格納された各命令と発行済みの各命令との間に存在する第2依存関係とを求め、前記命令バッファに格納されている前記複数の命令のうち、前記第1依存関係及び前記第2依存関係を有しない命令のグループを、前記次サイクルにて前記複数の演算器に発行することが可能な命令のグループとして決定するグループ決定部と、前記グループ決定部で決定された前記グループに含まれる前記命令を、前記次サイクルにおいて、前記複数の演算器に発行するディスパッチ部とを備える。
 既存ハードウェアの命令グルーピング機構で実施されるグルーピングにより、命令グループ間でペナルティサイクルが発生する本質的な原因は、既存ハードウェアでは命令バッファに格納された命令間の依存関係しか考慮しておらず、既に発行された命令グループとの依存関係を検出する事ができないからである。
 この構成によると、命令バッファに格納された命令間の依存関係だけでなく、すでに発行済みの命令との依存関係をも参照して、次サイクルにて発行される命令のグループを決定している。このため、発行済みの命令グループ間で発生するペナルティを緩和することができ、命令発行の際に、実行性能の観点で効率的な発行グループの決定(命令グルーピング)を、簡素なハードウェアで実現できる。
 なお、本発明は、このような特徴的な処理部を備えるプロセッサとして実現することができるだけでなく、プロセッサに含まれる特徴的な処理部が実行する処理をステップとする命令発行制御方法として実現することができる。また、命令発行制御方法に含まれる特徴的なステップをコンピュータに実行させるプログラムとして実現することもできる。そして、そのようなプログラムは、CD-ROM(Compact Disc-Read Only Memory)等の不揮発性の記録媒体やインターネット等の通信ネットワークを介して流通させることができるのは言うまでもない。
 本発明によると、発行しようとする命令バッファ内に存在する命令間の依存関係だけでなく、命令バッファ内に存在する命令と既に発行された命令グループ内の命令との依存関係も検出し命令グルーピングを行なう。このため、発行された命令グループ間のペナルティを緩和し、性能向上に寄与する。
 上記性能向上に関する理由をより詳細に考察すると、定性的には下記2点の様に説明できる。
 (1)本来先行して発行可能である命令が、既に発行された命令と依存関係を持つ後続の命令と同時発行されるために、既に発行された命令が完了するまで、依存関係を持つ後続命令と共に、発行を待たされるというケースを解消できるから。
 (2)既に発行された命令と依存関係を持つ後続命令を命令発行の先頭命令としてグルーピングを実施した方が並列度が向上する場合において、その後続命令が先頭命令とされない事によるグルーピング効率の悪化が削減できるから。
図1は、理想的な命令グルーピング及び既存ハードウェアでの命令グルーピングによる実行性能を比較する図である。 図2は、既存ハードウェア(従来のプロセッサ)の構成を示す図である。 図3は、既存ハードウェアにより実施される命令グルーピングの詳細を示す図である。 図4は、本発明の実施の形態に係るプロセッサの構成を示す図である。 図5は、リソース状態記憶テーブルの一例を示す図である。 図6は、本発明の実施の形態に係るプロセッサにより実施されるグルーピングの詳細を示す図である。 図7は、本発明の実施の形態に係るプロセッサでの命令グルーピングによる実行性能を示す図である。 図8は、非レディ状態のリソースの検出処理のフローチャートである。 図9は、リソース状態記憶テーブルへのデータの書込み処理のフローチャートである。 図10は、命令発行の制御方法のフローチャートである。
 まず、一般的なスーパースカラ型のアーキテクチャを有するプロセッサについて説明した後に、本実施の形態に係るプロセッサについて説明する。
 図1は、2種類の命令グルーピングによる実行性能を比較した図である。
 図1の比較図は、命令コード101と、理想的結果102と、従来結果103との各欄より構成される。
 命令コード101には、ループ処理を構成する命令コードが示されており、命令コード101は、分岐先のラベルと、命令コードのニーモニック表現と、命令が参照又は定義するリソースとからなる。
 ここで、命令コード101に示される各命令が実行されるプロセッサ(図示せず)は、最大3命令を並列実行可能であり、ロード・ストア演算器、積和演算器、算術演算器及び分岐実行ユニットが各1要素で構成されているものとする。しかし、本発明の本質は、プロセッサの最大並列実行可能数、演算器の種類及び個数等の構成によりなんら制限されるものではない。
 命令コード101内のld命令及びldp命令は、それぞれ、ロード・ストア演算器で実行される、ロード命令及びロードペア命令である。mac命令は積和演算器で実行される、積和演算命令である。add命令は算術演算器で実行される、加算命令である。br命令は分岐実行ユニットで実行される、分岐命令である。上記命令の動作の詳細については、当業者ならば容易に推察できよう。このため、その詳細な説明はここでは繰り返さない。
 ここで、ld命令、ldp命令は、実行完了までのサイクル数、即ちレイテンシは2サイクルであり、その他の命令のレイテンシは1サイクルである事を想定する。しかし、これらの実行サイクルは仮の定義であり、本発明の本質は、これらのサイクル数の定義によりなんら制限されるものではない。
 図1の比較表の理想的結果102は、理想的な命令のグルーピング結果を示す。理想的結果102のGrpの列に“//”が存在する場合、その行までの命令コードが発行グループ(同一サイクルで発行される命令のグループ)として定義され、その直後の命令が新たな発行グループの先頭命令コードとして定義される。また、Penaltyの列はペナルティサイクルを示し、その行までの発行グループが、次発行グループ以降の何れかの命令実行をストールさせる場合のペナルティサイクル数を示すものとする。
 理想的結果102での命令グルーピングの結果を下記に示す。
[ld r1,(r4+)] [mac acc,r2,r5] [add r0,-1] (第1命令グループ)
[ld r5,(r4+)] (第2命令グループ)
[mac acc,r3,r1] [ldp r2,r3,(r6+)] [br r0,0 L0001] (第3命令グループ)
 理想的結果102は、命令グループ間にペナルティサイクルが発生しない、即ち実行性能の観点で効率が良い、命令グルーピングの結果を表す。
 なぜなら、理想的結果102では、第1命令グループ(ld,mac,add)と第2命令グループ(ld)との間、及び第2命令グループ(ld)と第3命令グループ(mac,ldp,br)との間で、ペナルティサイクルが発生していないからである。つまり、命令グループ間に依存関係にある場合には、全て命令実行開始までに、リソースの参照が可能となっている。
 図1の比較表の従来結果103は、既存の命令グルーピング処理による命令グルーピングの結果を示す。従来結果103での命令グルーピングの結果を下記に示す。
[ld r1,(r4+)] [mac acc,r2,r5] [add r0,-1] (第1命令グループ)
[ld r5,(r4+)] [mac acc,r3,r1] (第2命令グループ)
[ldp r2,r3,(r6+)] [br r0,0 L0001] (第3命令グループ)
 従来結果103では、命令グループ間での依存関係を考慮していないため、第1命令グループ(ld,mac,add)と第2命令グループ(ld,mac)との間に真の依存関係によるペナルティサイクルが発生する。なぜなら、ld命令が定義するレジスタr1を次のサイクルで、mac命令が参照するためである。ld命令の実行完了までには2サイクルを要するため、mac命令の実行開始までに1サイクルのペナルティサイクルが発生するからである。
 結局、理想的結果102では、下記に示す様にループ1回の実行に4サイクル要する。
   3(3命令グループの発行サイクル)+1(ldpのループ運搬依存サイクル)=4
 一方、従来結果103では、下記に示す様にループ1回の実行に5サイクル要する。
   3(3命令グループの発行サイクル)+1(レジスタr1の依存に関するペナルティサイクル)+1(ldpのループ運搬依存サイクル)=5
 高々1サイクルの差であるが、繰り返し実行されるループ内のペナルティサイクルであるため、メディア処理等では25%の性能劣化として問題が顕在化してしまう。
 次に、従来結果103では上記のようなグルーピングを実施してしまう理由について詳細に説明を行う。図2は、既存ハードウェア(従来のプロセッサ)の構成を示す図である。図2では、インオーダーな並列実行を前提とした、一般的な命令発行制御が行なわれる。なお、図2では、3つの命令を並列実行可能なプロセッサについて示しているが、本発明の本質は並列実行数により、なんら制限されるものではない。
 プロセッサは、命令バッファ201~203と、リソースデコード部211~213と、依存関係検出部231及び232と、ディスパッチ部241~243とを含む。
 命令バッファ201~203の各々は、命令キャッシュ(図示せず)からフェッチした命令を格納する記憶装置である。
 リソースデコード部211~213は、それぞれ、命令バッファ201~203に格納された命令が定義又は参照するリソースの情報、及び当該命令が実行される演算器の情報等を抽出する。
 依存関係検出部231及び232の各々は、命令が実行される演算器の依存関係、及び命令が定義又は参照するリソースの依存関係を検出する。つまり、依存関係検出部231及び232の各々は、共通の演算器を使用する命令間の依存関係、共通のリソースを定義又は参照する命令間の依存関係を検出する。
 ディスパッチ部241~243は、命令グループに含まれる各命令を適宜演算器に発行する。
 図3に、図2に示した既存ハードウェアにより実施されるグルーピングの詳細を示す。まず命令バッファ201、202、203にそれぞれ格納された命令301、302、303の間には資源制約、及びデータ依存制約のいずれもが存在しない。このため、最大並列実行数の命令である全3命令が、ディスパッチ部241、242、243によりディスパッチされ、命令311、312、313が各演算器へ発行される。
 次に命令バッファ201、202、203には、命令321、322、323がそれぞれ格納される。ここで命令321と命令323はどちらもロード・ストア演算器で実行される命令であり、同時に実行することができないため、命令321、323間には資源制約が発生する。したがって、命令331と命令332のみがディスパッチされる。
 最後に命令バッファ201、202には、命令341、342がそれぞれ格納される。命令341、342間には資源制約、データ依存制約のいずれも存在しないため、命令351、352がディスパッチされる。
 この時、第1命令グループの命令311(ld命令)が定義するレジスタr1を、第2命令グループの命令332(mac命令)が参照するため、第1命令グループと第2命令グループとの間には、データ依存関係、即ち真の依存関係が発生する。ld命令のレイテンシは2サイクルである。このため、第2命令グループの命令の実行開始までに1サイクルのペナルティが発生してしまう。したがって、図1の比較図では、従来結果103のadd命令の列のPenaltyの項目に“1”が示されている。
 前述の通り、理想的な命令グルーピングではペナルティサイクルが発生していなかったので、既存ハードウェアの命令グルーピングでは、5/4=1.25、即ち25%の性能劣化が顕在化する事になる。
 図4は、本発明の実施の形態に係るプロセッサの構成を示す図である。本実施の形態に係るプロセッサは、最大3命令を並列実行可能なプロセッサである。しかし、本発明の本質は最大並列実行可能数になんら制限されるものではない。
 プロセッサは、命令バッファ401~403と、リソースデコード部411~413と、ディスパッチ部441~443と、サイクルデコード部451~453と、非レディ検出部461~463と、依存関係検出部431及び432と、リソース状態記憶テーブル470とを含む。
 命令バッファ401~403、リソースデコード部411~413及びディスパッチ部441~443は、図2で示した既存ハードウェアにおける命令バッファ201~203、リソースデコード部211~213及びディスパッチ部241~243と、それぞれ同じ機能を有する構成要素である。このため、その詳細な説明はここでは繰り返さない。
 以下では、新規に追加された構成要素について説明する。
 サイクルデコード部451、452、453は、それぞれ、命令バッファ401、402、403に格納されている命令のレイテンシをデコードする。
 非レディ検出部461、462、463は、サイクルデコード部451、452、453からそれぞれ出力される命令バッファ401、402、403に格納された命令のレイテンシ、及びリソースデコード部411、412、413からそれぞれ出力される命令バッファ401、402、403に格納された命令が定義するリソース情報を入力として、レイテンシが2以上の場合、各命令が定義するリソースを命令グループ発行後のサイクルにて非レディと判定する。つまり、命令グループ発行後のサイクル(次サイクル)において、そのリソースを参照又は定義することができないと判定する。
 具体的には以下の様になる。
 例えば、命令バッファ401に命令コード[ld r1,(r4+)]が格納されているものとする。この命令はレジスタr4を参照することにより指定されるアドレスのメモリの値をレジスタr1に定義する命令であり、レイテンシは2である。したがって、この命令で定義されるレジスタr1は、ld命令発行後のサイクルにおいては、非レディと判定される。
 上記非レディと判定されたリソース(レジスタr1)は、リソース状態記憶テーブル470に登録される。
 ここで、リソース状態記憶テーブル470について説明する。図5は、リソース状態記憶テーブル470の一例を示す図である。リソース状態記憶テーブル470は、リソースごとにリソースの状態を記憶する記憶装置であり、リソースごとに、リソース番号471と、レディフラグ472と、非レディ継続サイクル数473とを記憶している。
 レディフラグ472は、次発行サイクルからリソースを参照可能か否かを示すフラグである。レディフラグ472が1の場合には、次発行サイクルからリソースを直ちに参照することが可能である、即ちリソースは非レディではないこと(レディであること)を示す。レディフラグ472が0の場合には、次発行サイクルからリソースを直ちに参照することが不可能である、即ちリソースは非レディであることを示す。
 非レディ継続サイクル数473は、非レディの状態が継続するサイクル数を示す。
 上述のld命令のレジスタr1に話を戻すと、レジスタr1は、ld命令後のサイクルにおいて非レディと判定されることより、リソース状態記憶テーブル470は、非レディ検出部461から出力された非レディ情報を受けて、レジスタr1に対応するテーブルエントリのレディフラグ472が1である場合には、レディフラグ472を0に変更し、非レディ継続サイクル数473に2を登録する。
 既にレディフラグ472が0の場合には、リソース状態記憶テーブル470は、新規に登録しようとする非レディ継続サイクル数と、非レディ継続サイクル数473に登録されている既存のサイクル数とを比較する。リソース状態記憶テーブル470は、新規に登録しようとする非レディ継続サイクル数のほうが大きい場合には、新規の非レディ継続サイクル数を、非レディ継続サイクル数473に登録する。リソース状態記憶テーブル470は、新規に登録しようとする非レディ継続サイクル数のほうが小さい場合には、新規のサイクル数を非レディ継続サイクル数473に登録することは行なわずに、既存のサイクル数が非レディ継続サイクル数473に継続して登録されたままとなる。以上、非レディ検出部461から出力される非レディ情報に関する、リソース状態記憶テーブル470の処理について説明したが、非レディ検出部462及び463から出力される非レディ情報に関しても同様の処理が並列に実施されるものとする。
 依存関係検出部431、432は、既存ハードウェアと同様に、命令バッファ401、402、403に格納された命令間の依存関係(請求項における第1依存関係)だけでなく、命令バッファ401、402、403に格納された各命令とリソース状態記憶テーブル470の各リソースのエントリとの間の依存関係(請求項における第2依存関係)を検出する。即ち、依存関係検出部431、432は、リソース状態記憶テーブル470に登録された、各リソースのエントリのレディフラグ472を参照し、非レディ状態であるエントリと依存関係にある命令の検出を行う。
 依存関係検出部431、432は、命令バッファ401、402、403に格納された命令間に依存を検出するか、又は命令バッファ401、402、403に格納された各命令とリソース状態記憶テーブル470の各リソースに対応したエントリとの間に依存を検出した場合、依存を検出した命令の直前の命令を発行グループの区切りとする。発行グループの区切りまでの命令がディスパッチ部441、442、443に格納され、ディスパッチ部441、442、443に格納された発行グループの区切りまでの命令が適宜演算器ユニットに発行される。
 リソース状態記憶テーブル470のエントリの依存関係によって、発行グループが決定された場合、非レディ検出部461~463は、該当するエントリのレディフラグ472を1に、非レディ継続サイクル数473を0に設定する。
 図6に、図4に示したプロセッサにより実施されるグルーピングの詳細を示す。まず、命令バッファ401、402、403にそれぞれ格納された命令501、502、503間には資源制約、データ依存制約いずれも存在しない。このため、ディスパッチ部441、442、443により最大並列実行数である全3命令(命令511、512、513)が各演算器へ発行される。
 次に命令バッファ401、402、403には、命令521、522、523がそれぞれ格納される。ここで命令521と命令523はどちらもロード・ストア演算器で実行されるため、命令521、523間には資源制約が発生する。さらに、命令511と命令522との間にはレジスタr1による真の依存関係が発生し、かつld命令のレイテンシは2である。このため、第1命令グループの命令511、512、513の実行直後にはレジスタr1を参照する事ができない。
 したがって、命令511と命令522との間には依存関係があると判定され、命令522の直前の命令521のみが第2命令グループとなる。したがって、命令531のみがディスパッチされる。
 最後に命令バッファ401、402、403には、命令541、542、543がそれぞれ格納される。命令541、542、543間には資源制約、データ依存制約いずれも存在しないため、命令551、552、553がディスパッチされる。
 この様に命令グループを定義すると、第1命令グループの511が定義するレジスタr1を、第3命令グループの541が参照するまでに、第1命令グループの511の実行が完了している。このため、命令511と命令551との間にはペナルティサイクルが発生しない。
 図7に本提案手法による実行性能を示す。図7の比較図は、図1の比較図に本発明結果604の欄を加えたものである。
 本発明結果604の欄は、本実施の形態による命令のグルーピング結果を示す。従来結果103の欄に示す既存ハードウェアによる命令グルーピングでは1サイクルのペナルティが発生している。しかし、本発明結果604では理想的結果102と同様にペナルティサイクルが発生しない。したがって、実行性能を劣化させる課題が解決されている。
 上記でも概要を説明したが、以下では図4の非レディ検出部461、462、463が実行する処理について詳細に説明する。図8は、非レディ検出部461を用いた非レディ状態のリソースの検出処理のフローチャートである。なお、非レディ検出部462、463も、非レディ検出部461と同様の処理を実行するため、その詳細な説明は繰り返さない。
 まず、リソースデコード部411にて、命令バッファ401内の命令が定義するリソースを検出する(S701)。次にサイクルデコード部451が、命令バッファ401内の命令のレイテンシを検出する(S702)。
 非レディ検出部461は、S701、S702で得た情報に基づき、命令バッファ401内の命令がその命令内で使用しているリソースを定義するか否かを判断する(S703)。
 命令がリソースを定義しないと判断した場合には(S703でNO)、非レディ検出部461は、そのリソースは非レディ状態ではない、つまり、次発行サイクルから直ちに参照可能であると判定する(S705)。
 命令がリソースを定義すると判断した場合には(S703でYES)、非レディ検出部461は、命令バッファ401内の命令のレイテンシが2以上か否かを判断する(S704)。レイテンシが2以上ではない場合、つまり、レイテンシが1の場合には(S704でNO)、非レディ検出部461は、そのリソースは非レディではない、つまり、次発行サイクルから直ちに参照可能であると判定する(S705)。
 逆に、S703、S704の判定結果がどちらも真、即ち命令が特定のリソースを定義し、かつレイテンシが2以上であると判定した場合には(S703でYES、かつS704でYES)、非レディ検出部461は、そのリソースは非レディあると判定する(S706)。リソースが非レディであるとは、即ち次発行サイクルからは直ちに参照することができない事を示す。
 図9は、リソース状態記憶テーブル470へのデータの書込み処理のフローチャートである。
 まず、リソース状態記憶テーブル470には、非レディ検出部461~463から出力された非レディ情報(リソース番号、非レディ継続サイクル数(=命令のレイテンシ))が入力される。リソース状態記憶テーブル470は、図8で説明した非レディ検出のアルゴリズムにより検出された、この非レディ情報の合計数を判定する(S801)。非レディ情報が1つも存在しない場合(S801でNO)、リソース状態記憶テーブル470は、テーブル内の全ての非レディ状態にあるエントリの非レディ継続サイクル数473を所定の数(典型的な例では“1”)だけ減算する(S808)。
 非レディ情報が1つ以上存在する場合(S801でYES)、リソース状態記憶テーブル470は、非レディ情報のリソース番号に重なりがあるか判定する(S802)。非レディ情報のリソース番号に重なりがある場合(802でYES)、リソース状態記憶テーブル470は、同一のリソース番号の非レディ情報の内、最もレイテンシの大きい非レディ情報を選択する(S803)。
 リソース状態記憶テーブル470は、テーブル内の該当リソース(非レディリソース)のエントリを参照する(S804)。このエントリ参照及び以降のエントリ内容更新は、非レディ検出部461~463から出力された非レディ情報に重なりがない場合、最大3並列でハードウェア的に実施されるものとする。
 リソース状態記憶テーブル470は、非レディ情報のリソース番号で指定される該当リソースエントリがレディ状態であるかを判定する(S805)。
 該当リソースエントリがレディ状態であれば(S805でYES)、リソース状態記憶テーブル470は、直ちに該当リソースエントリのレディフラグ472を0にし、非レディ継続サイクル数473に、非レディ情報のレイテンシを登録する(S807)。
 該当リソースエントリが既に非レディ状態である場合(S805でNO)、リソース状態記憶テーブル470は、該当リソースエントリの非レディ継続サイクル数が、非レディ情報のレイテンシよりも小さい値であるかを判定する(S806)。
 該当リソースエントリの非レディ継続サイクル数473が、非レディ情報のレイテンシよりも小さい値である場合には(S806でYES)、リソース状態記憶テーブル470は、直ちに該当リソースエントリの非レディ継続サイクル数473に、非レディ情報のレイテンシを登録する(S807)。
 該当リソースエントリの非レディ継続サイクル数473が、非レディ情報のレイテンシ以上の場合には(S806でNO)、既存の非レディ継続サイクル数がそのままリソース状態記憶テーブル470の該当エントリに保持される。
 S807の処理の実施の有無に係わらず、最終的にはS808の処理が実施される。
 上述の処理により、リソース状態記憶テーブル470の各リソースのレディ状態が適切に更新される。
 図10に、命令発行の制御方法のフローチャートを示す。
 まず、依存関係検出部431は、命令バッファ401に格納されている命令と命令バッファ402に格納されている命令との依存関係を検出する。この依存関係を(依存A-1)と定義する(S901)。
 同時に、依存関係検出部432は、命令バッファ401に格納されている命令と命令バッファ403に格納されている命令との依存関係、及び命令バッファ402に格納されている命令と命令バッファ403に格納されている命令との依存関係を検出する。この依存関係を(依存A-2)と定義する(S901)。
 さらに、依存関係検出部431は、上記(依存A-1)と共に、命令バッファ402に格納されている命令とリソース状態記憶テーブル470の各リソースとの依存関係を検出する。この依存関係を(依存B-1)と定義する(S902)。
 さらに同時に、依存関係検出部432は、上記(依存A-2)共に、命令バッファ403に格納されている命令とリソース状態記憶テーブル470の各リソースのエントリとの依存関係を検出する。この依存関係を(依存B-2)と定義する(S902)。
 (依存A-1)、(依存A-2)、(依存B-1)及び(依存B-2)の何れもが存在しない場合には(S903でYES)、ディスパッチ部441、442、443は、命令バッファ401、402、403に格納されている全ての命令をディスパッチする(S904)。
 (依存A-1)、(依存A-2)、(依存B-1)及び(依存B-2)の何れかが存在する場合には(S903でNO)、以下に示す命令ディスパッチの制御が行なわれる。
 つまり、(依存A-2)及び(依存B-2)がどちらも存在せず、(依存A-1)もしくは(依存B-1)が存在する場合、命令バッファ401に記憶されている命令もしくはリソース状態記憶テーブル470の対応エントリと、命令バッファ402に記憶されている命令との間に依存関係が存在する事を意味する。この場合、依存関係検出部431が上記依存を検出し、ディスパッチ部442~443に制御信号を送り、命令バッファ402、403に格納されている命令のディスパッチを抑制する。即ち、命令バッファ401に格納された命令のみがディスパッチされる(S905、S906)。
 また、(依存A-1)及び(依存B-1)がどちらも存在せず、(依存A-2)もしくは(依存B-2)が存在する場合、命令バッファ401もしくは命令バッファ402に記憶されている命令又はリソース状態記憶テーブル470の対応エントリと、命令バッファ403に記憶されている命令との間に、依存関係が存在する事を意味する。この場合、依存関係検出部432は上記依存を検出し、ディスパッチ部443に制御信号を送り、命令バッファ403に格納されている命令のディスパッチを抑制する。即ち、命令バッファ401、402に格納された命令のみがディスパッチされる(S905、S906)。
 さらに、(依存A-1)あるいは(依存B-1)が存在し、かつ(依存A-2)あるいは(依存B-2)が存在する場合(数学的に表すと「((依存A-1)||(依存B-1))&&((依存A-2)||(依存B-2))」)、命令バッファ402のディスパッチの抑制が優先される。即ち、(依存A-1)あるいは(依存B-1)が存在する場合、(依存A-2)あるいは(依存B-2)の存在に係わらず、命令バッファ402、403のディスパッチが抑制され、命令バッファ401に格納されている命令のみがディスパッチされる(S905、S906)。ここで、「&&」は論理積を示し、「||」は論理和を示す。
 上述の処理により、命令バッファ401、402、403に格納されている命令間の依存関係だけでなく、既に発行された命令グループ内の命令との間の依存関係も検出し、命令グループの発行を制御することができる。このため、発行された命令グループ間のペナルティを緩和し、性能向上に寄与する事が可能となる。
 また上記方法は、命令バッファが3つの場合における処理であるが、命令バッファが4以上の場合においても、命令間に複数の依存関係が検出された場合、先頭命令から、最も近い依存に関して発行グループを制御する、即ち、命令グループ内の命令間に依存関係が存在しない様に、発行グループを制御する方法は同一となる。
 また、図4においては先頭の命令バッファが固定されている例であるが、命令バッファをリング結合し、それに伴う先頭命令を示すポインタを更新し、先頭ポインタ変更による、依存関係検出部、ディスパッチ部の制御変更を行う様な、より効率的な処理を実施する事も可能であるが、この内容については、本特許の本質ではない為、説明を省略する。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて請求の範囲によって示され、請求の範囲と均等の意味及び範囲内でのすべての変更が含まれることが意図される。
 本発明は並列実行アーキテクチャの根幹に係わる技術であり、簡素なハードウェアにも係わらず、実行性能の高いプロセッサを提供可能とする技術である。本発明により、並列実行可能な簡素なアーキテクチャを、バイナリ互換性を維持しつつ実現可能である。
 したがって、組み込み分野、汎用PC(Personal Computer)分野、スーパーコンピューティング分野等の何れにおいても有用な技術となろう。
 201~203、401~403 命令バッファ
 211~213、411~413 リソースデコード部
 231、232、431、432 依存関係検出部
 241~243、441~443 ディスパッチ部
 451~453 サイクルデコード部
 461~463 非レディ検出部
 470 リソース状態記憶テーブル

Claims (14)

  1.  複数の命令を複数の演算器に同時発行可能なプロセッサであって、
     複数の演算器に発行する予定の複数の命令を格納する命令バッファと、
     前記命令バッファに格納された任意の2つの命令間に存在する依存関係である第1依存関係と、前記命令バッファに格納された各命令と発行済みの各命令との間に存在する依存関係である第2依存関係とを検出し、前記命令バッファに格納されている前記複数の命令のうち、前記第1依存関係及び前記第2依存関係のいずれをも有しない命令のグループを、前記複数の演算器に発行することが可能な命令のグループとして決定するグループ決定部と、
     前記グループ決定部で決定された前記グループに含まれる前記命令を、前記複数の演算器に発行するディスパッチ部と
     を備えるプロセッサ。
  2.  前記グループ決定部は、
     前記命令バッファに格納された各命令によって、定義又は参照されるリソースの情報と実行される演算器の情報とを特定するリソースデコード部と、
     前記リソースデコード部が特定した前記リソースの情報及び前記演算器の情報に基づいて、前記第1依存関係及び前記第2依存関係を検出する依存関係検出部とを含む
     請求項1記載のプロセッサ。
  3.  前記依存関係検出部は、前記命令バッファに格納された任意の2つの命令が、同一のリソースを定義もしくは参照する場合、又は、同一の演算器で実行される場合に、前記任意の2つの命令間に前記第1依存関係が存在すると判断する
     請求項2記載のプロセッサ。
  4.  前記依存関係検出部は、前記命令バッファに格納された各命令と発行済みの各命令とを比較し、2つの命令が、同一のリソースを定義もしくは参照する場合、又は、同一の演算器で実行される場合に、前記2つの命令間に前記第2依存関係が存在すると判断する
     請求項2又は3記載のプロセッサ。
  5.  前記グループ決定部は、さらに、
     前記命令バッファに格納された命令ごとに、当該命令の前記演算器上での実行が完了するまでのサイクル数を抽出するサイクルデコード部と、
     前記サイクルデコード部での抽出結果に基づいて、前記命令バッファに格納された命令ごとに、当該命令によって定義されるリソースの定義が完了するまでに所定のサイクル数以上を要するリソースを検出し、検出した前記リソースを、次サイクルにおいて参照することができない非レディ状態であると判定する非レディ検出部とを含み、
     前記依存関係検出部は、前記命令バッファに格納された命令ごとに、当該命令が、発行済みの命令によって定義されるリソースが非レディ状態であると判定された前記リソースを参照する場合に、当該命令と前記発行済みの命令との間に前記第2依存関係が存在すると判断する
     請求項4記載のプロセッサ。
  6.  前記グループ決定部は、さらに、前記レディ検出部における判定結果に基づいて、リソースごとに、当該リソースが非レディ状態であるか否かを記憶しているリソース状態記憶テーブルを含み、
     前記依存関係検出部は、前記リソース状態記憶テーブルを参照することにより、前記第2依存関係が存在するか否かを判断する
     請求項5記載のプロセッサ。
  7.  前記リソース状態記憶テーブルは、リソースごとに、当該リソースが次サイクルにおいて参照することができるレディ状態であるか否かを示すレディフラグと、当該リソースの前記非レディ状態が継続するサイクル数を示す非レディ継続サイクル数とを記憶している
     請求項6記載のプロセッサ。
  8.  前記リソース状態記憶テーブルは、前記ディスパッチ部により前記グループに含まれる前記命令が、前記複数の演算器に発行されるごとに、前記リソース状態記憶テーブルに記憶されている前記非レディ継続サイクル数を所定数減算する
     請求項7記載のプロセッサ。
  9.  前記リソース状態記憶テーブルは、前記命令バッファに格納された複数の命令が同一リソースを定義する場合、前記サイクルデコード部での抽出結果に基づいて、各命令の前記サイクル数のうち、最大のサイクル数を、前記リソース状態記憶テーブルに、前記同一リソースに対応する前記非レディ継続サイクル数として格納する
     請求項7又は8記載のプロセッサ。
  10.  前記リソース状態記憶テーブルに記憶されている前記レディフラグが既に前記非レディ状態を示しており、かつ前記非レディ継続サイクル数として既にサイクル数が設定されているリソースについて、前記命令バッファに格納されている命令が当該リソースを定義する場合には、前記命令バッファに格納されている前記命令の前記演算器上での実行が完了するまでのサイクル数が前記非レディ継続サイクル数よりも大きい場合にのみ、前記非レディ継続サイクル数に、前記命令バッファに格納されている前記命令の前記演算器上での実行が完了するまでのサイクル数を上書きする
     請求項8記載のプロセッサ。
  11.  前記依存関係検出部は、前記リソース状態記憶テーブルの前記レディフラグを参照することにより前記第2依存関係を検出する
     請求項7~10のいずれか1項に記載のプロセッサ。
  12.  前記グループ決定部は、前記依存関係検出部により前記第1依存関係及び前記第2依存関係のいずれかが検出された場合、前記命令バッファに記憶されている命令のうち、検出された依存関係を有する命令よりも実行順で直前までの命令を、次サイクルに前記複数の演算器に発行することが可能な命令のグループとして決定する
     請求項11記載のプロセッサ。
  13.  前記グループ決定部は、前記第2依存関係に基づいて、新たな前記グループを決定した場合、前記第2依存関係を求める際に参照した前記レディフラグに前記レディ状態であることを示す値を設定し、当該レディフラグに対応するエントリの前記非レディ継続サイクル数を0に設定する
     請求項12記載のプロセッサ。
  14.  前記グループ決定部により、前記グループが決定された後、当該グループに含まれる命令の実行順で直後の命令を、次サイクルで発行される命令のグループの先頭命令とする
     請求項12又は13に記載のプロセッサ。
PCT/JP2010/002939 2009-05-08 2010-04-23 プロセッサ WO2010128582A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201080020018.8A CN102422262B (zh) 2009-05-08 2010-04-23 处理器
US13/285,137 US20120047352A1 (en) 2009-05-08 2011-10-31 Processor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009-113996 2009-05-08
JP2009113996A JP5436033B2 (ja) 2009-05-08 2009-05-08 プロセッサ

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/285,137 Continuation US20120047352A1 (en) 2009-05-08 2011-10-31 Processor

Publications (1)

Publication Number Publication Date
WO2010128582A1 true WO2010128582A1 (ja) 2010-11-11

Family

ID=43050093

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/002939 WO2010128582A1 (ja) 2009-05-08 2010-04-23 プロセッサ

Country Status (4)

Country Link
US (1) US20120047352A1 (ja)
JP (1) JP5436033B2 (ja)
CN (1) CN102422262B (ja)
WO (1) WO2010128582A1 (ja)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222108B (zh) * 2011-06-28 2013-06-05 用友软件股份有限公司 脚本处理方法和脚本处理装置
US9710278B2 (en) 2014-09-30 2017-07-18 International Business Machines Corporation Optimizing grouping of instructions
CN105278915B (zh) * 2015-01-15 2018-03-06 北京国睿中数科技股份有限公司 基于解耦‑签出操作的超标量处理器指令分配装置
CN108614736B (zh) * 2018-04-13 2021-03-02 杭州中天微系统有限公司 实现资源索引替换的装置及处理器
CN113434169B (zh) * 2021-06-22 2023-03-28 重庆长安汽车股份有限公司 一种基于依赖关系生成空中升级并行任务组的方法及系统
CN114116015B (zh) * 2022-01-21 2022-06-07 上海登临科技有限公司 用于管理硬件命令队列的方法及系统
US11954491B2 (en) 2022-01-30 2024-04-09 Simplex Micro, Inc. Multi-threading microprocessor with a time counter for statically dispatching instructions
US12001848B2 (en) 2022-01-30 2024-06-04 Simplex Micro, Inc. Microprocessor with time counter for statically dispatching instructions with phantom registers
US20230350680A1 (en) * 2022-04-29 2023-11-02 Simplex Micro, Inc. Microprocessor with baseline and extended register sets

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05181676A (ja) * 1991-04-05 1993-07-23 Toshiba Corp 並列処理型プロセッサシステム
JPH0926877A (ja) * 1995-03-31 1997-01-28 Sun Microsyst Inc 読取りおよび/または書込みポートのバンドワイドが狭いレジスタ・ファイルを有するコンピュータ・プロセッサ
JP2001092656A (ja) * 1999-09-07 2001-04-06 Hewlett Packard Co <Hp> 命令のインオーダ処理を効率的に実行するスーパースケーラ処理システム及び方法
JP2006517322A (ja) * 2003-02-10 2006-07-20 アナログ・デバイシズ・インコーポレーテッド パイプライン化ディジタルプロセッサにおけるハザード検出および管理のための方法および装置
JP2009099097A (ja) * 2007-10-19 2009-05-07 Renesas Technology Corp データ処理装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5488729A (en) * 1991-05-15 1996-01-30 Ross Technology, Inc. Central processing unit architecture with symmetric instruction scheduling to achieve multiple instruction launch and execution
EP0518420A3 (en) * 1991-06-13 1994-08-10 Ibm Computer system for concurrent processing of multiple out-of-order instructions
KR100309566B1 (ko) * 1992-04-29 2001-12-15 리패치 파이프라인프로세서에서다중명령어를무리짓고,그룹화된명령어를동시에발행하고,그룹화된명령어를실행시키는방법및장치
US5958042A (en) * 1996-06-11 1999-09-28 Sun Microsystems, Inc. Grouping logic circuit in a pipelined superscalar processor
US6304955B1 (en) * 1998-12-30 2001-10-16 Intel Corporation Method and apparatus for performing latency based hazard detection
US7953959B2 (en) * 2005-06-15 2011-05-31 Panasonic Corporation Processor
US20070101332A1 (en) * 2005-10-28 2007-05-03 International Business Machines Corporation Method and apparatus for resource-based thread allocation in a multiprocessor computer system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05181676A (ja) * 1991-04-05 1993-07-23 Toshiba Corp 並列処理型プロセッサシステム
JPH0926877A (ja) * 1995-03-31 1997-01-28 Sun Microsyst Inc 読取りおよび/または書込みポートのバンドワイドが狭いレジスタ・ファイルを有するコンピュータ・プロセッサ
JP2001092656A (ja) * 1999-09-07 2001-04-06 Hewlett Packard Co <Hp> 命令のインオーダ処理を効率的に実行するスーパースケーラ処理システム及び方法
JP2006517322A (ja) * 2003-02-10 2006-07-20 アナログ・デバイシズ・インコーポレーテッド パイプライン化ディジタルプロセッサにおけるハザード検出および管理のための方法および装置
JP2009099097A (ja) * 2007-10-19 2009-05-07 Renesas Technology Corp データ処理装置

Also Published As

Publication number Publication date
US20120047352A1 (en) 2012-02-23
JP5436033B2 (ja) 2014-03-05
CN102422262A (zh) 2012-04-18
JP2010262542A (ja) 2010-11-18
CN102422262B (zh) 2015-02-25

Similar Documents

Publication Publication Date Title
JP5436033B2 (ja) プロセッサ
US6216220B1 (en) Multithreaded data processing method with long latency subinstructions
CN107810483B (zh) 验证处理器中的跳转目标的装置、存储设备和方法
JP5043560B2 (ja) プログラム実行制御装置
US5790822A (en) Method and apparatus for providing a re-ordered instruction cache in a pipelined microprocessor
JP2518616B2 (ja) 分岐方法
US9116686B2 (en) Selective suppression of branch prediction in vector partitioning loops until dependency vector is available for predicate generating instruction
US20130117543A1 (en) Low overhead operation latency aware scheduler
JP4841861B2 (ja) 演算処理装置及びデータ転送処理の実行方法
US5604878A (en) Method and apparatus for avoiding writeback conflicts between execution units sharing a common writeback path
US20130227251A1 (en) Branch mispredication behavior suppression on zero predicate branch mispredict
JP2007515715A (ja) 命令キャッシュからラベル境界上のトレースキャッシュに遷移させる方法
US9471324B2 (en) Concurrent execution of heterogeneous vector instructions
US9389860B2 (en) Prediction optimizations for Macroscalar vector partitioning loops
US7523295B2 (en) Processor and method of grouping and executing dependent instructions in a packet
CN105094747B (zh) 基于smt的中央处理单元以及用于检测指令的数据相关性的装置
US8977837B2 (en) Apparatus and method for early issue and recovery for a conditional load instruction having multiple outcomes
WO2021111272A1 (en) Processor unit for multiply and accumulate operations
US8447961B2 (en) Mechanism for efficient implementation of software pipelined loops in VLIW processors
JP2016006632A (ja) 条件付き命令を有するプロセッサ
KR100837400B1 (ko) 멀티스레딩/비순차 병합 기법에 따라 처리하는 방법 및장치
US6944750B1 (en) Pre-steering register renamed instructions to execution unit associated locations in instruction cache
CN116113940A (zh) 一种图计算装置、处理方法及相关设备
JP2004508607A (ja) 例外ルーチンを有するプロセッサのレジスタライトトラフィックを減じる装置及び方法
JP3915019B2 (ja) Vliwプロセッサ、プログラム生成装置、および記録媒体

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201080020018.8

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10772109

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10772109

Country of ref document: EP

Kind code of ref document: A1