Method, compiler and the instruction processing unit of process instruction
Technical field
The present invention relates to technical field of information processing, at more particularly to a kind of method of process instruction, compiler and instruction
Manage device.
Background technology
Instruction is the order for indicating certain operation of computing device, and expected work(can be realized by handling each bar instruction
Can, for example, each bar instruction included by handling message completes the processing of message.Instruction is divided into the duplication for realizing data
Assignment directive and other instructions with relocating work, assignment directive can be divided into condition assignment directive again and unconditional assignment refers to
Order.And in actual applications, assignment directive be apply more instruction, therefore, how process instruction, specifically how handle tax
Value instruction, is to reduce instruction processing time, improves the speed of service of program, and then improve the pass of the execution performance of process instruction
Key.
At present, the method for process instruction is:Perform one instruction when, the operation of the instruction is divided into take location, decoding,
Perform, internal memory operation and multiple stages such as write back.All stages of this instruction perform by independent pipelined functional unit,
While performing a plurality of instruction by way of performing multiple execution units parallel, so as to improve the speed of service of process instruction.
During the present invention is realized, inventor has found that prior art at least has problems with:
Because processor is instructed by each bar in multiple execution unit processing routines that can be performed parallel, and assignment refers to
The duplication and resettlement due to being related to data are made, thus assignment directive needs special execution unit to perform, this in processor is special
The quantity of execution unit is limited, therefore, limits the quantity of the assignment directive of parallel processing, causes this kind of process instruction
Mode has certain limitation, and treatment effeciency is not high.Simultaneously because assignment directive is related to the duplication and resettlement of data, make
Obtaining assignment directive can be with producing dependence in other instructions, and the instruction that there is dependence can not be performed parallel, therefore limit
The quantity of the instruction of parallel processing has been made, treatment effeciency is reduced.
The content of the invention
In order to solve problem of the prior art, the embodiments of the invention provide a kind of method of process instruction, compiler and
Instruction processing unit.The technical scheme is as follows:
First aspect includes there is provided a kind of method for instructing processing, methods described:
Instruction template group is obtained, the instruction template group includes the instruction template of every instruction;
Obtain each instruction template in the instruction template group, the instruction template be used to describing the command word of instruction,
Source data interface and target data interface, the source data interface are the interface of input instruction processing data, the target data
Interface is the interface of output order result;
The instruction template instructed according to each bar determines command word, source data interface and the target data interface that each bar is instructed;
The corresponding data of source data interface of each bar instruction of order word processing instructed according to each bar, and instructed from each bar
Target data interface output manages result.
With reference in a first aspect, in the first possible implementation of first aspect, the finger instructed according to each bar
Template is made to determine command word, source data interface and the target data interface of each bar instruction, including:
Position of the instruction template instructed according to each bar in the instruction template group determines the target data that each bar is instructed
Interface;
The content of the instruction template instructed according to each bar determines the command word and source data interface of each bar instruction.
With reference to the first possible implementation of first aspect, in second of possible implementation of first aspect
In, the content of the instruction template instructed according to each bar determines the command word and source data interface of each bar instruction, including:
Connect if the instruction template of any instruction includes banner word mark, the first source data interface and the second source data
Mouthful, it is determined that the command word of any instruction is condition assignment command word, and identified according to the banner word from described first
The source data interface of any instruction is selected in source data interface and the second source data interface.
With reference to the first possible implementation of first aspect, in the third possible implementation of first aspect
In, the content of the instruction template instructed according to each bar determines the command word and source data interface of each bar instruction, including:
If the instruction template of any instruction includes the 3rd source data interface, it is determined that the command word of any instruction
For unconditional assignment command word, and the 3rd source data interface is defined as to the source data interface of any instruction.
With reference to the first possible implementation of first aspect, in the 4th kind of possible implementation of first aspect
In, the instruction template group also includes order character matrix plate, and the order character matrix plate is used to describe each ALU(Arithmetic
Logic Unit, arithmetic logical unit)Corresponding command word;
The content of the instruction template instructed according to each bar determines the command word and source data interface of each bar instruction, bag
Include:
If the instruction template of any instruction includes the 4th source data interface and the 5th source data interface, by described
Four source data interfaces and the 5th source data interface are defined as the source data interface of any instruction;
The ALU of any instruction is determined according to the target data interface of any instruction, according to any instruction
ALU and the order character matrix plate determine the command word of any instruction.
With reference in a first aspect, in the 5th kind of possible implementation of first aspect, the life instructed according to each bar
The corresponding data of source data interface of each bar instruction of word processing are made, and the target data interface output instructed from each bar manages knot
Really, including:
The corresponding data of source data interface of each bar instruction are obtained, and the target data interface output instructed from each bar is described
Data.
Second aspect includes there is provided a kind of generation method of instruction template group, methods described:
Obtain command word, source data interface and the target data interface of each bar instruction, and the command word instructed according to each bar
And source data interface generates the instruction template of each bar instruction;
Target data interface and the instruction template generation instructed according to each bar and store instruction template, think instruction processing
Method provides instruction template group.
With reference to second aspect, in the first possible implementation of second aspect, the life instructed according to each bar
Word and source data interface is made to generate the instruction template of each bar instruction, including:
If the command word of any instruction is condition assignment command word, the first source data is determined according to any instruction
Interface and the second source data interface, determine that banner word is identified according to the source data interface of any instruction;
It is described any according to banner word mark, the first source data interface and the second source data interface generation
The instruction template of instruction.
With reference to second aspect, in second of possible implementation of second aspect, the life instructed according to each bar
Word and source data interface is made to generate the instruction template of each bar instruction, including:
If the command word of any instruction is unconditional assignment command word, and the source data interface of any instruction is true
It is set to the 3rd source data interface;
The instruction template of any instruction is generated according to the 3rd source data interface.
With reference to second aspect, in the third possible implementation of second aspect, the life instructed according to each bar
Word and source data interface is made to generate the instruction template of each bar instruction, including:
If the command word of any instruction is other orders outside unconditional assignment command word and condition assignment command word
Word, then determine the 4th source data interface and the 5th source data interface, according to the mesh of any instruction according to any instruction
Mark data-interface determines the ALU of any instruction, and according to the 4th source data interface and the 5th source data interface
Generate the instruction template of any instruction;
The target data interface instructed according to each bar and the instruction template generation and store instruction template group, including:
The ALU instructed according to each bar generates order character matrix plate;
The target data interface and instruction template generation and store instruction template instructed according to the order character matrix plate, each bar
Group.
With reference to second aspect, in the 4th kind of possible implementation of second aspect, the mesh instructed according to each bar
Data-interface and instruction template generation and store instruction template group are marked, including:
The target data interface instructed according to each bar determines position of the instruction template of each bar instruction in instruction template group,
The instruction template that position and each bar of the instruction template instructed according to each bar in instruction template group are instructed is generated and store instruction
Template group.
With reference to the third possible implementation of second aspect, in the 5th kind of possible implementation of second aspect
In, the target data interface instructed according to the order character matrix plate, each bar and instruction template generation and store instruction template
Group, including:
The target data interface instructed according to each bar determines position of the instruction template of each bar instruction in instruction template group,
The instruction template that position and each bar of the instruction template instructed according to the order character matrix plate, each bar in instruction template group are instructed
Generate and store instruction template group.
The third aspect includes there is provided a kind of instruction processing unit for instructing and handling, the instruction processing unit:
First acquisition module, for obtaining instruction template group, the instruction template group includes the instruction template of every instruction;
Second acquisition module, for obtaining each instruction mould in the instruction template group that first acquisition module is got
Plate, the instruction template is used for command word, source data interface and the target data interface for describing instruction, and the source data interface is
The interface of input instruction process content, the target data interface is the interface of output order result;
Determining module, the instruction template for being instructed according to each bar determine the command word of each bar instruction, source data interface and
Target data interface;
Input module, the corresponding data of source data interface of each bar instruction of order word processing for being instructed according to each bar,
And the target data interface output instructed from each bar manages result.
With reference to the third aspect, in the first possible implementation of the third aspect, the determining module, including:
First determining unit, is determined each for the position of the instruction template that is instructed according to each bar in the instruction template group
The target data interface of bar instruction;
Second determining unit, the content of the instruction template for being instructed according to each bar determines command word and the source of each bar instruction
Data-interface.
With reference to the first possible implementation of the third aspect, in second of possible implementation of the third aspect
In, second determining unit, for when the instruction template of any instruction include banner word mark, the first source data interface and
During the second source data interface, the command word for determining any instruction is condition assignment command word, and according to the banner word mark
Know the source data interface that any instruction is selected from the first source data interface and the second source data interface.
With reference to the first possible implementation of the third aspect, in the third possible implementation of the third aspect
In, second determining unit, for when the instruction template of any instruction includes the 3rd source data interface, it is determined that described
The command word of one instruction is unconditional assignment command word, and the 3rd source data interface is defined as to the source of any instruction
Data-interface.
With reference to the first possible implementation of the third aspect, in the 4th kind of possible implementation of the third aspect
In, the instruction template group also includes order character matrix plate, and the order character matrix plate is used to describe the corresponding command words of each ALU;
Second determining unit, for including the 4th source data interface and the 5th source when the instruction template of any instruction
During data-interface, the 4th source data interface and the 5th source data interface are defined as to the source number of any instruction
According to interface;The ALU of any instruction is determined according to the target data interface of any instruction, according to any instruction
ALU and the order character matrix plate determine the command word of any instruction.
With reference to the third aspect, in the 5th kind of possible implementation of the third aspect, the output module, for obtaining
The corresponding data of source data interface of each bar instruction, and the target data interface instructed from each bar exports the data.
Fourth aspect includes there is provided a kind of compiler, the compiler:
Acquisition module, command word, source data interface and target data interface for obtaining each bar instruction;
Generation module, command word and source data interface for being instructed according to each bar generate the instruction template of each bar instruction;
Memory module, for target data interface and the instruction template generation instructed according to each bar and store instruction template
Group, instruction template group is provided in the method for instruction processing.
With reference to fourth aspect, in the first possible implementation of fourth aspect, the generation module, including:
First determining unit, for when the command word of any instruction is condition assignment command word, according to any finger
Order determines the first source data interface and the second source data interface;
Second determining unit, for determining that banner word is identified according to the source data interface of any instruction;
First generation unit, the banner word for being determined according to second determining unit is identified, described first determines list
The first source data interface and the second source data interface that member is determined generate the instruction template of any instruction.
With reference to fourth aspect, in second of possible implementation of fourth aspect, the generation module, including:
3rd determining unit, for when the command word of any instruction is unconditional assignment command word, by any finger
The source data interface of order is defined as the 3rd source data interface;
Second generation unit, the 3rd source data interface generation for being determined according to the 3rd determining unit is described any
The instruction template of instruction.
With reference to fourth aspect, in the third possible implementation of fourth aspect, the generation module, including:
4th determining unit, for being unconditional assignment command word and condition assignment command word when the command word of any instruction
Outside other command words when, the 4th source data interface and the 5th source data interface are determined according to any instruction;
5th determining unit, the ALU for determining any instruction according to the target data interface of any instruction;
3rd generation unit, for the 4th source data interface determined according to the 4th determining unit and described
Five source data interfaces generate the instruction template of any instruction;
The memory module, including:
Generation unit, the ALU for being instructed according to each bar generates order character matrix plate;
First memory cell, the target data that order character matrix plate, each bar for being generated according to the generation unit are instructed
Interface and instruction template generation and store instruction template group.
With reference to fourth aspect, in the 4th kind of possible implementation of fourth aspect, the memory module, including:
Determining unit, the target data interface for being instructed according to each bar determines the instruction template of each bar instruction in instruction mould
Position in plate group;
Second memory cell, the instruction template that each bar for being determined according to the determining unit is instructed is in instruction template group
In position and each bar instruction instruction template generation and store instruction template group.
With reference to the third possible implementation of fourth aspect, in the 5th kind of possible implementation of fourth aspect
In, first memory cell, the target data interface for being instructed according to each bar determines that the instruction template of each bar instruction is referring to
Make the position in template group, position of the instruction template in instruction template group that is instructed according to the order character matrix plate, each bar and
The instruction template generation of each bar instruction and store instruction template group.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
By obtaining command word, source data interface and target data interface that each bar is instructed, the order instructed according to each bar
The corresponding data of source data interface of each bar instruction of word processing, and the target data interface output instructed from each bar manages result,
Make process instruction independent of execution unit, while improving the speed of service of instruction processing, eliminate the instruction of parallel processing
Quantity limitation, and improve treatment effeciency and the execution performance of process instruction.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, on the premise of not paying creative work, it can also obtain other according to these accompanying drawings
Accompanying drawing.
Fig. 1 is a kind of method flow diagram for process instruction that the embodiment of the present invention one is provided;
Fig. 2 is a kind of generation method flow chart for instruction template group that the embodiment of the present invention one is provided;
Fig. 3 is a kind of generation method flow chart for instruction template group that the embodiment of the present invention two is provided;
Fig. 4 is a kind of schematic diagram for instruction template generating process that the embodiment of the present invention two is provided;
Fig. 5 is a kind of method flow diagram for process instruction that the embodiment of the present invention three is provided;
Fig. 6 is command word and the signal of source data interface procedure for a kind of determine instruction that the embodiment of the present invention three is provided
Figure;
Fig. 7 is a kind of command word, source number that each bar instruction is determined by data routing device that the embodiment of the present invention three is provided
According to interface and the schematic diagram of target data interface procedure;
Fig. 8 is that a kind of method by very long instruction word motor unit process instruction that the embodiment of the present invention three is provided is performed
The schematic diagram of process;
Fig. 9 is a kind of structural representation for instruction processing unit that the embodiment of the present invention four is provided;
Figure 10 is a kind of structural representation for determining module that the embodiment of the present invention four is provided;
Figure 11 is a kind of structural representation for compiler that the embodiment of the present invention five is provided;
Figure 12 is the structural representation for the first generation module that the embodiment of the present invention five is provided;
Figure 13 is the structural representation for second of generation module that the embodiment of the present invention five is provided;
Figure 14 is the structural representation for the third generation module that the embodiment of the present invention five is provided;
Figure 15 is a kind of structural representation for memory module that the embodiment of the present invention five is provided;
Figure 16 is the structural representation for another memory module that the embodiment of the present invention five is provided.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Because the quantity for the execution unit that assignment directive is performed in instruction processing unit is limited, so as to limit parallel place
The quantity of the assignment directive of reason, causes instruction processing efficiency not high;Simultaneously because assignment directive produces dependence, limit simultaneously
The quantity of the instruction of row processing, reduces treatment effeciency.In order to improve instruction processing efficiency, the embodiments of the invention provide one kind
The method of process instruction.The method of the process instruction, which is applied to operation in a kind of terminal, the terminal, instruction processing unit, the instruction
Instruction processing unit of the processor as described in following example IVs.The instruction processing unit can be according to the compiler described in embodiment five
Each bar instructs the corresponding data of source data interface of corresponding each bar instruction of order word processing in the instruction template group of generation, and from
The target data interface output reason result of each bar instruction, makes process instruction independent of execution unit, improves instruction processing
While the speed of service, treatment effeciency and the execution performance of process instruction are improved.
Embodiment one
A kind of method of process instruction is present embodiments provided, referring to Fig. 1, the method that the present embodiment is provided includes:
101:Instruction template group is obtained, instruction template group includes the instruction template of every instruction;
102:Each instruction template in instruction template group is obtained, instruction template is used for command word, the source number for describing instruction
According to interface and target data interface, source data interface is the interface of input instruction processing data, and target data interface refers to for output
Make the interface of result;
103:The instruction template instructed according to each bar determines that command word, source data interface and target data that each bar is instructed connect
Mouthful;
Alternatively, the instruction template instructed according to each bar determines command word, source data interface and the number of targets that each bar is instructed
According to interface, including:
Position of the instruction template instructed according to each bar in instruction template group determines the target data interface that each bar is instructed;
The content of the instruction template instructed according to each bar determines the command word and source data interface of each bar instruction.
Alternatively, the content of the instruction template instructed according to each bar determines the command word and source data interface of each bar instruction,
Including:
Connect if the instruction template of any instruction includes banner word mark, the first source data interface and the second source data
Mouthful, it is determined that the command word of any instruction is condition assignment command word, and according to banner word mark from the first source data interface and
The source data interface of any instruction is selected in second source data interface.
Alternatively, the content of the instruction template instructed according to each bar determines the command word and source data interface of each bar instruction,
Including:
If the instruction template of any instruction includes the 3rd source data interface, it is determined that the command word of any instruction is non-
Condition assignment command word, and the 3rd source data interface is defined as to the source data interface of any instruction.
Alternatively, instruction template group also includes order character matrix plate, and order character matrix plate is used to describe the corresponding orders of each ALU
Word;
The content of the instruction template instructed according to each bar determines the command word and source data interface of each bar instruction, including:
If the instruction template of any instruction includes the 4th source data interface and the 5th source data interface, by the 4th source
Data-interface and the 5th source data interface are defined as the source data interface of any instruction;
The ALU of any instruction is determined according to the target data interface of any instruction, according to the ALU and command word of any instruction
Template determines the command word of any instruction.
104:The corresponding data of source data interface of each bar instruction of order word processing instructed according to each bar, and refer to from each bar
The target data interface output reason result of order.
Alternatively, the corresponding data of source data interface of each bar of the order word processing instruction instructed according to each bar, and from each
The target data interface output reason result of bar instruction, including:
The corresponding data of source data interface of each bar instruction are obtained, and the target data interface instructed from each bar exports number
According to.
The present embodiment additionally provides a kind of generation method of instruction template group, the method bag provided referring to Fig. 2, the present embodiment
Include:
201:Obtain command word, source data interface and the target data interface of each bar instruction, and the life instructed according to each bar
Word and source data interface is made to generate the instruction template of each bar instruction;
202:Target data interface and the instruction template generation instructed according to each bar and store instruction template group, think instruction
The method of processing provides instruction template group.
Alternatively, the command word and source data interface instructed according to each bar generates the instruction template that each bar is instructed, including:
If the command word of any instruction is condition assignment command word, the first source data interface is determined according to any instruction
And the second source data interface, determine that banner word is identified according to the source data interface of any instruction;
Identified according to banner word, the first source data interface and the second source data interface generate the instruction template of any instruction.
Alternatively, the command word and source data interface instructed according to each bar generates the instruction template that each bar is instructed, including:
If the command word of any instruction is unconditional assignment command word, the source data interface of any instruction is defined as
3rd source data interface;
The instruction template of any instruction is generated according to the 3rd source data interface.
Alternatively, the command word and source data interface instructed according to each bar generates the instruction template that each bar is instructed, including:
If the command word of any instruction is other orders outside unconditional assignment command word and condition assignment command word
Word, then determine the 4th source data interface and the 5th source data interface according to any instruction, connect according to the target data of any instruction
Mouth determines the ALU of any instruction, and according to the 4th source data interface and the instruction mould of any instruction of the 5th source data interface generation
Plate;
Target data interface and the instruction template generation instructed according to each bar and store instruction template group, including:
The ALU instructed according to each bar generates order character matrix plate;
The target data interface and instruction template generation and store instruction template group instructed according to order character matrix plate, each bar.
Alternatively, target data interface and the instruction template generation instructed according to each bar and store instruction template group, including:
The target data interface instructed according to each bar determines position of the instruction template of each bar instruction in instruction template group,
The instruction template that position and each bar of the instruction template instructed according to each bar in instruction template are instructed is generated and store instruction mould
Plate group.
Alternatively, the target data interface and instruction template generation and store instruction instructed according to order character matrix plate, each bar
Template group, including:
The target data interface instructed according to each bar determines position of the instruction template of each bar instruction in instruction template group,
The instruction template generation that position and each bar of the instruction template instructed according to order character matrix plate, each bar in instruction template group are instructed
And store instruction template group.
Method provided in an embodiment of the present invention, by obtaining command word, source data interface and target data that each bar is instructed
Interface, the corresponding data of source data interface of each bar instruction of order word processing instructed according to each bar, and the mesh instructed from each bar
Data-interface output result is marked, makes process instruction independent of execution unit, improves the same of the speed of service that instruction is handled
When, the quantity limitation of the instruction of parallel processing is eliminated, and improve treatment effeciency and the execution performance of process instruction.
Embodiment two
The embodiments of the invention provide a kind of generation method of instruction template group, with reference to the content of above-described embodiment one, it is
It is easy to explanation, the present embodiment is to instruct 1 for MOV r4, r5, and instruction 2 is MOVC r6, r7, r8,1, and instruction 3 is ADD r1,
Exemplified by r2, r3, the method for the instruction processing provided the present embodiment is illustrated.The method stream provided referring to Fig. 3, the present embodiment
Journey includes:
301:Obtain command word, source data interface and the target data interface of each bar instruction;
Wherein, source data interface is the interface of input instruction processing data, and target data interface is that output order handles knot
The interface of fruit.Because the equipment of store instruction processing data can be register, or internal memory, or other storages are set
It is standby, therefore be connected with source data interface can be register, or internal memory, or other storage devices, the present embodiment
The specific equipment to store instruction processing data is not defined, and what the present embodiment pair was not connected with source data interface yet specific sets
It is standby to be defined.Because the equipment of store instruction result can be register, or internal memory, or other storages are set
It is standby, therefore be connected with target data interface can be register, or internal memory, or other storage devices, this implementation
Specific equipment of the example not to store instruction result is defined, the present embodiment also not pair tool being connected with target data interface
Body equipment is defined.
In addition, for the ease of being illustrated to the method that the present embodiment is provided, the present embodiment and subsequent embodiment are to deposit
The equipment for storing up instruction treatmenting data is register, and the equipment of store instruction result is also for exemplified by register.
Because each bar instructs the instruction rule for being to instruct according to each bar to generate, therefore referred to according to the instruction of each bar and each bar
The instruction rule of order can obtain command word, source data interface and the target data interface of each bar instruction, and the present embodiment is not to obtaining
The concrete mode of command word, source data interface and the target data interface of each bar instruction is taken to be defined.
For example, for instruction 1:The corresponding instructions of MOV r4, r5, MOV are unconditional assignment directive, and the instruction of the instruction is advised
It is then from the corresponding data of target data interface output source data-interface.By taking unconditional assignment directive MOV r9, r10 as an example, its
Instruction rule be:Data from register r10 is obtained with interface that register r10 is connected, and from being connected with register r9
Data in interface output register r10.Therefore, it is according to the command word of the instruction Rule of instruction 1 and instruction 1 instruction 1
Non- assignment directive command word, source data interface is the interface being connected with r5, and target data interface is the interface being connected with r4.
For instruction 2:MOVC r6, r7, r8,1, the corresponding instructions of MOVC are condition assignment directive, and the instruction of the instruction is advised
It is then that a source data interface is chosen from two source data interfaces according to a certain condition, and selection is exported from target data interface
The corresponding data of source data interface.By taking condition assignment directive MOVCr11, r12, r13, FLAG as an example, its instruction rule is:When
When FLAG is 0, data from interface that register r12 be connected acquisition register r12, and from being connected with register r11
Data in interface output register r12;When FLAG is non-zero, from register r13 is obtained with the interface that register r13 is connected
Data, and data from the interface output register r13 that register r11 is connected.Therefore, according to instruction 2 and instruction 2
The command word for instructing Rule instruction 2 is assignment directive command word, and source data interface is the interface being connected with r8, target data
Interface is the interface being connected with r6.
For instruction 3:The corresponding instructions of ADD r1, r2, r3, ADD are summarizing instruction, and the instruction rule of the instruction is from mesh
Mark the sum that data-interface exports the corresponding data of two source data interfaces.By taking summarizing instruction ADD r14, r15, r16 as an example, it refers to
The rule is made to be:Data from register r15 is obtained with the interface that register r15 is connected, from the interface being connected with register r16
Obtain the data in register r16, and data and register from the interface output register r15 that register r14 is connected
The sum of data in r16.Therefore, it is summation command word according to the command word of instruction 3 and the instruction Rule instruction 3 of instruction 3,
Source data interface is the interface being connected with r2 and the interface being connected with r3, and target data interface is the interface being connected with r1.
Certainly, the instruction rule of each bar instruction can also be Else Rule, and the present embodiment is not referred specifically to each bar instruction
Rule is made to be defined.The title of register can also be other titles, and the present embodiment is not carried out to the specific name of register
Limit.
302:The instruction template that each bar is instructed is generated according to the command word of each bar instruction, source data interface;
The instruction template of generation changes with the difference of the command word of instruction, and the present embodiment according to each bar to not instructing
The specific method that command word, source data interface generate the instruction template of each bar instruction is defined.For example, for any instruction,
Its command word can be any one command word in following three kinds of command words:
The first command word:Condition assignment command word;
For the first command word, the instruction template of any instruction is generated according to the command word of instruction, source data interface
Method is:First source data interface and the second source data interface are determined according to any instruction, connect according to the source data of any instruction
Mouth determines banner word mark;Identified according to banner word, the first source data interface and the second source data interface generate any instruction
Instruction template.
Exemplified by instructing 2:Because the command word of instruction 2 is condition assignment command word, source data interface is what is be connected with r8
Interface, target data interface is the interface being connected with r6, then according to instruction 2:MOVC r6, r7, r8,1 determine that the first source data connects
Mouth is the interface being connected with r7, and the second source data interface is the interface being connected with r8, and is determined according to the source data interface of instruction 2
Banner word is designated 1;Identified according to banner word, the first source data interface and the second source data interface generation instruction 2 instruction mould
Plate 2 is as shown in table 1.
Table 1
Banner word is identified |
First source data interface |
Second source data interface |
1 |
The interface being connected with r7 |
The interface being connected with r8 |
The instruction template 2 of the instruction 2 of generation can also be other forms, and the present embodiment is not to the instruction template 2 of generation
Concrete form is defined.The content of the instruction template 2 of generation can also be other contents, the instruction of the present embodiment not to generation
The particular content of template 2 is defined.The title of instruction template can also be other titles, and the present embodiment is not to instruction template
Specific name is defined.
Second of command word:Unconditional assignment command word;
For second of command word, the instruction template of any instruction is generated according to the command word of instruction, source data interface
Method is:The source data interface of any instruction is defined as the 3rd source data interface;Generated according to the 3rd source data interface any
The instruction template of instruction.
Exemplified by instructing 1:Because the command word of instruction 1 is unconditional assignment command word, source data interface is to be connected with r5
Interface, target data interface is the interface that be connected with r4, then will instruction 1 source data interface:The interface being connected with r5 is determined
For the 3rd source data interface;It is as shown in table 2 according to the instruction template 1 that the 3rd source data interface generates instruction 1.
Table 2
3rd source data interface |
The interface being connected with r5 |
The third command word:Other command words outside unconditional assignment command word and condition assignment command word.
For the third command word, the instruction template of any instruction is generated according to the command word of instruction, source data interface
Method is:4th source data interface and the 5th source data interface are determined according to any instruction;According to the 4th source data interface and
Five source data interfaces generate the instruction template of any instruction.
Exemplified by instructing 3:Because the command word of instruction 3 is summation command word, source data interface is the interface being connected with r2
With the interface being connected with r3, target data interface is the interface being connected with r1, then according to instruction 3:ADD r1, r2, r3 determine
Four source data interfaces are the interface being connected with r2, and the 5th source data interface is the interface being connected with r3;Connect according to the 4th source data
Mouth and the instruction template 3 of the 5th source data interface generation instruction 3 are as shown in table 3.
Table 3
4th source data interface |
5th source data interface |
The interface being connected with r2 |
The interface being connected with r3 |
In addition, for the third command word, can also be according to any instruction in addition to the instruction template for generating any instruction
Target data interface determines the ALU of any instruction, to describe the command word of any instruction.
Still exemplified by instructing 3, in addition to the instruction template shown in the table 3 of generation instruction 3, always according to the target of instruction 3
Data-interface:Corresponding relation determine instruction 3 between the interface being connected with r1 and the target data interface and ALU that prestore
ALU is ALU1.
Certainly, except between the target data interface according to any instruction and the target data interface and ALU that prestore
Corresponding relation determine outside the ALU mode of any instruction, the ALU of any instruction can also be determined otherwise, this
Embodiment according to the target data interface of any instruction to not determining that the ALU of any instruction concrete mode is defined.
303:Target data interface and the instruction template generation instructed according to each bar and store instruction template group, think instruction
The method of processing provides instruction template group.
The present embodiment is not to target data interface and the instruction template generation instructed according to each bar and store instruction template group
Concrete mode be defined.For example:The target data interface instructed according to each bar determines that the instruction template that each bar is instructed is referring to
The position in template group is made, the instruction mould that position and each bar of the instruction template instructed according to each bar in instruction template group are instructed
Plate generation and store instruction template group.
Exemplified by instructing 1 and instruction 2, if the instruction template 1 of instruction 1 is as shown in table 2, the instruction template 2 such as table of instruction 2
Shown in 1.It is the interface being connected with r4 due to its target data interface, it is thus determined that the instruction template 1 of instruction 1 exists for instruction 1
Position in instruction template group is the 4th;It is the interface being connected with r6 due to its target data interface for instruction 2, therefore really
Surely position of the instruction template 2 of instruction 2 in instruction template group is the 6th.Referred to according to the instruction template of instruction 1 and instruction 2
The instruction template for making the position in template group and each bar instruct is generated and store instruction template group is as shown in table 4.
Table 4
The instruction template group of generation can also be other forms, the specific shape of the present embodiment not to the instruction template group of generation
Formula is defined.The content of the instruction template group of generation can also be other contents, the instruction template of the present embodiment not to generation
The particular content of group is defined.
In addition, if each bar instruction includes other lives in addition to unconditional assignment command word and condition assignment command word
Word is made, then target data interface and the instruction template generation instructed according to each bar the and specific method of store instruction template group can be with
For:The target data interface instructed according to each bar determines position of the instruction template of each bar instruction in instruction template group, and root
The ALU for instructing generation according to each bar generates order character matrix plate;The instruction template instructed according to order character matrix plate, each bar is in instruction template
Position and the instruction template generation of each bar instruction and store instruction template group in group.
Wherein, order character matrix plate is used to describe the corresponding command words of each ALU.
Exemplified by instructing 1, instruction 2 and instruction 3, if the instruction template 1 of instruction 1 is as shown in table 2, the instruction mould of instruction 2
As shown in table 1, the instruction template 3 of instruction 3 is as shown in table 3 for plate 2.For instruction 1, its instruction template 1 is in instruction template group
Position is the 4th;For instruction 2, its position of instruction template 2 in instruction template group is the 6th.For instruction 3, due to it
Target data interface is the interface that be connected with r1, it is thus determined that position of the instruction template 3 of instruction 3 in instruction template group is the
1.According to the ALU1 generation orders character matrix plate of the generation of instruction 3 as shown in table 5, then order character matrix plate according to table 5, instruction
1st, the instruction template life of position and instruction 1, instruction 2 and instruction 3 of the instruction template of instruction 2 and instruction 3 in instruction template group
It is as shown in table 6 into simultaneously store instruction template group.
Table 5
Table 6
The order character matrix plate of each instruction of generation can also be other forms, the order type matrix of the present embodiment not to generation
The concrete form of plate is defined.The content of the order character matrix plate of each instruction of generation can also be other contents, this implementation
Example is not defined to the particular content of the order character matrix plate of generation.Position of the order character matrix plate in instruction template group can be with
For other positions, the present embodiment is not defined to particular location of the order character matrix plate in instruction template group.
It should be noted that when performing the method that the present embodiment is provided, without being performed both by step 301 to step every time
303, i.e., only perform the step when compiling the instruction of each bar, in the operation of subsequent instructions processing, can directly using step 301 to
The instruction template group that step 303 is generated, so as to continue executing with following step.But during instruction change, that is, need to recompilate instruction
When, step 301 can be re-executed to step 303.
Further, since specific implementation when instruct it is more, in order to reduce generation instruction template group time, perform step
The instruction of each bar is divided into different streamlines by the dependence between can also being instructed according to each bar before 301, there will be no according to
The instruction for the relation of relying is divided into same streamline, and the precedence of each streamline is determined according to the dependence of each instruction, with
The precedence according to every streamline performs step 301 to step 303 afterwards, generates the instruction template group of each bar streamline.
In addition, in the specific implementation, because assignment directive is to apply more instruction, and assignment directive can refer to other
Dependence is produced in order, therefore can be closed when instructing generation instruction template according to each bar according to the dependence between the instruction of each bar
It is to instruct the order bloc of composition to be ranked up each bar so that the instruction template of preferential generation assignment directive.
The specific generating process of instruction template group can as shown in figure 4, obtain utilization programming language program after, root
The order of assignment directive is adjusted according to the dependence of each bar instruction in program, instruction template group is generated.
The method that the present embodiment is provided, passes through the command word instructed according to each bar, source data interface and target data interface
Instruction template group is generated, instruction processing unit is obtained command word, source data interface and the target data interface of each bar instruction, according to
The corresponding data of source data interface of each bar instruction of order word processing of each bar instruction, and the target data interface instructed from each bar
Result is exported, makes process instruction independent of execution unit, while improving the speed of service of instruction processing, eliminates simultaneously
The quantity limitation of the instruction of row processing, and improve treatment effeciency and the execution performance of process instruction.
Embodiment three
The embodiments of the invention provide a kind of method for instructing processing, with reference in above-described embodiment one and embodiment two
Hold, for convenience of description, the present embodiment is to instruct 1 for MOV r4, r5, and instruction 2 is MOVC r6, r7, r8,1, and instruction 3 is ADD
Exemplified by r1, r2, r3, the method for the instruction processing provided the present embodiment is illustrated.The side provided referring to Fig. 5, the present embodiment
Method flow includes:
501:Instruction template group is obtained, and obtains each instruction template in instruction template group, the finger instructed according to each bar
Template is made to determine command word, source data interface and the target data interface of each bar instruction;
Wherein, the instruction template group of acquisition is the generation method generation of the instruction template group provided by the present embodiment two
Instruction template group.
The present embodiment is not defined to the specific method for obtaining instruction template group.Including but not limited to, if each bar refers to
The storage address for instructing corresponding instruction template group is stored in order, then instruction template is obtained according to instruction template group storage address
Group.The present embodiment is not also defined to the specific method for obtaining each instruction template in instruction template group.
For example, obtaining instruction template 1, instruction template 2 and the instruction template 3 in the instruction template group shown in table 6.
In addition, the present embodiment does not determine command word, the source data of each bar instruction to the instruction template instructed according to each bar yet
Interface and target data interface specific method are defined.For example:The instruction template instructed according to each bar is in instruction template group
Position determine the target data interface of each bar instruction;The content of the instruction template instructed according to each bar determines the life that each bar is instructed
Make word and source data interface.
The target data of each bar instruction is determined for the position of the instruction template that is instructed according to each bar in instruction template group
The step of interface, by taking table 6 as an example, position of the instruction template 1 in instruction template group of instruction 1 is the 4th, determine instruction 1
Target data interface is r4.Position of the instruction template 2 of instruction 2 in instruction template group is the 6th, the target of determine instruction 1
Data-interface is r6.Position of the instruction template 3 of instruction 3 in instruction template group is the 1st, the target data of determine instruction 3
Interface is r1.
The content of instruction template for being instructed according to each bar determines the command word of each bar instruction and the step of source data interface
Suddenly, the content for the instruction template that the command word of each bar instruction and the specific method of source data interface are instructed with each bar is determined not
Change together, the content of the instruction template of the present embodiment not to being instructed according to each bar determines the command word and source data of each bar instruction
The specific method of interface is defined.For example, for the instruction template of any instruction, its content can be in following three kinds of contents
One kind:
The first instruction template content:Banner word mark, the first source data interface and the second source data interface;
For the first instruction template content, the content of the instruction template instructed according to each bar determines the order that each bar is instructed
The method of word and source data interface is:The command word for determining any instruction is condition assignment command word, and is identified according to banner word
The source data interface of any instruction is selected from the first source data interface and the second source data interface.
By taking the instruction template 2 of instruction 2 shown in table 1 as an example, because instruction template 2 includes:Banner word mark, the first source number
According to interface and the second source data interface, it is determined that the command word of instruction 2 is condition assignment command word.Referred to simultaneously according to condition assignment
The instruction rule of order, because the banner word in instruction template 2 is designated 1 from the first source data interface:The interface being connected with r7
And the second source data interface:The interface being connected with r8 is selected in the interface being connected with r8 to instruct 2 source data interface.
In addition, the content of the instruction template instructed according to each bar determines the command word of each bar instruction and the mistake of source data interface
Journey can be with as shown in fig. 6, get the source of determine instruction after banner word mark, the first source data interface and the second source data interface
Data-interface.
Second of instruction template content:3rd source data interface;
For second of instruction template content, the content of the instruction template instructed according to each bar determines the order that each bar is instructed
The method of word and source data interface is:The command word for determining any instruction is unconditional assignment command word, and by the 3rd source data
Interface is defined as the source data interface of any instruction.
By taking the instruction template 1 of instruction 1 shown in table 2 as an example, because instruction template 1 includes:3rd source data interface, then really
Surely the command word of instruction 1 is unconditional assignment command word.And by the 3rd source data interface:The interface being connected with r5 is defined as instruction
1 source data interface.
The third instruction template content:4th source data interface and the 5th source data interface;
For the third instruction template content, now instruction template will also include order character matrix plate.Instructed according to each bar
The content of instruction template determines that the command word of each bar instruction and the method for source data interface are:By the 4th source data interface and the 5th
Source data interface is defined as the source data interface of any instruction;Any instruction is determined according to the target data interface of any instruction
ALU, the command word of any instruction is determined according to the ALU of any instruction and order character matrix plate.
By taking the instruction template 3 of instruction 3 shown in table 3 as an example, because instruction template 3 includes:4th source data interface and
Five source data interfaces, then the 4th source data interface:The interface and the 5th source data interface being connected with r2:The interface being connected with r3 is equal
It is defined as the source data interface of instruction 3;According to the target data interface of instruction 3:The interface being connected with r1 and the mesh prestored
The ALU for marking the corresponding relation determine instruction 3 between data-interface and ALU is ALU1, according to the institute of table 5 included in ALU1 and table 6
The command word for the order character matrix plate determine instruction 3 shown is summation command word.
It should be noted that the instruction template instructed according to each bar determine the command word that each bar instructs, source data interface and
The process of target data interface can be with as shown in fig. 7, be realized by data routing device.Functionally, data routing device can
To regard an exchange network from N number of source data interface to N+n target data interface as.Data routing device is mainly by simultaneously
Capable MUX composition, the input of MUX can flexibly be defined according to application demand.It is, for example, possible to use complete
The exchange network of interconnection, such as Fig. 7(a)It is shown.This mode can provide best flexibility, and need not carry out volume
Outer processing.Or, using the exchange network of part interconnection, such as Fig. 7(b)It is shown.The hard-wired area of this mode
It is smaller, but needing to check whether occurs irrealizable operation.
502:The corresponding data of source data interface of each bar instruction of order word processing instructed according to each bar, and refer to from each bar
The target data interface output reason result of order.
The corresponding data of source data interface that the present embodiment is not instructed to each bar of order word processing instructed according to each bar, and
The specific method of the target data interface output reason result instructed from each bar is defined.For example, for condition assignment command
Word, or unconditional assignment command word, then obtain the corresponding data of source data interface of each bar instruction, and the mesh instructed from each bar
Mark data-interface exports the data.
Still exemplified by instructing 1, instruction 2 and instruction 3, for instruction 1,1 source number of instruction is obtained by the interface being connected with r5
According to the data in the corresponding register r5 of interface, and the data are exported from the interface being connected with r4.For instruction 2, by with r8
The interface of connection obtains the data in the corresponding register r8 of 2 source data interfaces of instruction, and should from the interface output being connected with r6
Data.For instruction 3, by the data in register r2 corresponding with the interface acquisition 3 source data interfaces of instruction that r2 is connected, lead to
Cross the data obtained with the interfaces of r3 connections in the corresponding register r3 of 3 source data interfaces of instruction, and from the interface being connected with r1
Data in output register r2 and data in register r3 and.
It should be noted that the method that the present embodiment is provided can be with as shown in figure 8, pass through VLIW(Very Long
Instruction Word, very long instruction word)Motor unit is realized.Obtained after instruction template is got by template translation module
To each instruction template in instruction template.The order of each bar instruction will be obtained in each instruction template input data routing template
Word, source data interface and target data interface.The source data interface that each bar is instructed is handled by the corresponding A LU in order character matrix plate
Corresponding data(Source operand), and the target data interface instructed from each bar exports the data.
The method that the present embodiment is provided, by obtaining command word, source data interface and target data interface that each bar is instructed,
The corresponding data of source data interface of each bar instruction of order word processing instructed according to each bar, and the target data instructed from each bar
Interface output manages result, makes process instruction independent of execution unit, while improving the speed of service of instruction processing, cancels
The quantity limitation of the instruction of parallel processing, and improve treatment effeciency and the execution performance of process instruction.
Example IV
The embodiments of the invention provide a kind of instruction processing unit, referring to Fig. 9, the instruction processing unit includes:
First acquisition module 901, for obtaining instruction template group, instruction template group includes the instruction template of every instruction;
Second acquisition module 902, for obtaining each instruction in the instruction template group that the first acquisition module 901 is got
Template, instruction template is used for command word, source data interface and the target data interface for describing instruction, and source data interface refers to for input
The interface of processing data is made, target data interface is the interface of input instruction result;
Determining module 903, the instruction template for being instructed according to each bar determines the command word of each bar instruction, source data interface
And target data interface;
Output module 904, the corresponding number of source data interface of each bar instruction of order word processing for being instructed according to each bar
According to, and the target data interface output instructed from each bar manages result.
Referring to Figure 10, determining module 903, including:
First determining unit 9031, is determined each for the position of the instruction template that is instructed according to each bar in instruction template group
The target data interface of bar instruction;
Second determining unit 9032, the content of the instruction template for being instructed according to each bar determines the command word of each bar instruction
And source data interface.
Wherein, the second determining unit 9032, for including banner word mark, the first source when the instruction template of any instruction
When data-interface and the second source data interface, the command word for determining any instruction is condition assignment command word, and according to banner word
Mark selects the source data interface of any instruction from the first source data interface and the second source data interface.
Alternatively, the second determining unit 9032, for including the 3rd source data interface when the instruction template of any instruction
When, the command word for determining any instruction is unconditional assignment command word, and the 3rd source data interface is defined as into any instruction
Source data interface.
Alternatively, instruction template group also includes order character matrix plate, and order character matrix plate is used to describe the corresponding orders of each ALU
Word;
Second determining unit 9032, for including the 4th source data interface and the 5th source when the instruction template of any instruction
During data-interface, the 4th source data interface and the 5th source data interface are defined as to the source data interface of any instruction;According to
The target data interface of any instruction determines the ALU of any instruction, is determined according to the ALU and order character matrix plate of any instruction any
The command word of instruction.
Wherein, output module 904, for obtaining the corresponding data of source data interface of each bar instruction, and are instructed from each bar
Target data interface output data.
In summary, instruction processing unit described in the embodiment of the present invention, command word, the source data instructed by obtaining each bar connects
Mouth and target data interface, the corresponding data of source data interface of each bar instruction of order word processing instructed according to each bar, and from
The target data interface output reason result of each bar instruction, makes process instruction independent of execution unit, improves instruction processing
While the speed of service, the quantity limitation of the instruction of parallel processing is eliminated, and improves holding for treatment effeciency and process instruction
Row performance.
Embodiment five
The embodiments of the invention provide a kind of compiler, referring to Figure 11, the compiler includes:
Acquisition module 1101, command word, source data interface and target data interface for obtaining each bar instruction;
Generation module 1102, the instruction mould of each bar instruction is generated for the command word that is instructed according to each bar, source data interface
Plate;
Memory module 1103, for target data interface and the instruction template generation instructed according to each bar and store instruction mould
Plate group, instruction template group is provided in the method for instruction processing.
Referring to Figure 12, generation module 1102, including:
First determining unit 11021, for when the command word of any instruction is condition assignment command word, being referred to according to any
Order determines the first source data interface and the second source data interface;
Second determining unit 11022, for determining that banner word is identified according to the source data interface of any instruction;
First generation unit 11023, the banner word for being determined according to the second determining unit 11022 is identified, first determines
The first source data interface and the second source data interface that unit is determined generate the instruction template of any instruction.
Referring to Figure 13, generation module 1102, including:
3rd determining unit 11024, for when the command word of any instruction is unconditional assignment command word, referring to any
The source data interface of order is defined as the 3rd source data interface;
Second generation unit 11025, the 3rd source data interface generation for being determined according to the 3rd determining unit 11024 is appointed
The instruction template of one instruction.
Referring to Figure 14, generation module 1102, including:
4th determining unit 11026, for being unconditional assignment command word and condition assignment when the command word of any instruction
During other command words outside command word, the 4th source data interface and the 5th source data interface are determined according to any instruction;
5th determining unit 11027, the ALU for determining any instruction according to the target data interface of any instruction;
3rd generation unit 11028, for the 4th source data interface and the 5th determined according to the 4th determining unit 11026
Source data interface generates the instruction template of any instruction;
Referring to Figure 15, memory module 1103, including:
Generation unit 11031, for being instructed the ALU of generation to generate order character matrix plate according to each bar;
First memory cell 11032, for order character matrix plate, the mesh of each bar instruction generated according to generation unit 11031
Mark data-interface and instruction template generation and store instruction template group.
Referring to Figure 16, memory module 1103, including:
Determining unit 11033, the target data interface for being instructed according to each bar determines that the instruction template of each bar instruction exists
Position in instruction template group;
Second memory cell 11034, the instruction template that each bar for being determined according to determining unit 11033 is instructed is in instruction
Position and the instruction template generation of each bar instruction and store instruction template group in template group.
Wherein, the first memory cell 11032, the target data interface for being instructed according to each bar determines the finger of each bar instruction
Position of the template in instruction template group is made, the instruction template instructed according to order character matrix plate, each bar is in instruction template group
Position and the instruction template generation of each bar instruction and store instruction template group.
In summary, compiler described in the embodiment of the present invention, by the command word instructed according to each bar, source data interface and
Target data interface generates instruction template group, instruction processing unit is obtained the command word of each bar instruction, source number in instruction template group
According to interface and target data interface, and the corresponding number of source data interface of each bar instruction of order word processing instructed according to each bar
According to the target data interface output instructed from each bar is managed into result, makes process instruction independent of execution unit, improves instruction
While the speed of service of processing, eliminate parallel processing instruction quantity limitation, and improve treatment effeciency and processing refer to
The execution performance of order.
Embodiment six
A kind of equipment for instructing processing is present embodiments provided, the equipment includes:Processor and memory.
Wherein, processor, for obtaining instruction template group, instruction template group includes the instruction template of every instruction;Obtain
Each instruction template in instruction template group, instruction template is used for command word, source data interface and the target data for describing instruction
Interface, source data interface is the interface of input instruction process content, and target data interface is the interface of output order result;
The instruction template instructed according to each bar determines command word, source data interface and the target data interface that each bar is instructed;According to each bar
The corresponding data of source data interface of each bar instruction of order word processing of instruction;
Memory, for the target data interface output data instructed from each bar.
Alternatively, the processor, is additionally operable to be determined according to position of the instruction template of each bar instruction in instruction template group
The target data interface of each bar instruction;The content of the instruction template instructed according to each bar determines the command word and source number of each bar instruction
According to interface.
Alternatively, the processor, is additionally operable to when the instruction template of any instruction includes banner word mark, the first source data
When interface and the second source data interface, the command word for determining any instruction is condition assignment command word, and is identified according to banner word
The source data interface of any instruction is selected from the first source data interface and the second source data interface.
Alternatively, the processor, is additionally operable to when the instruction template of any instruction includes the 3rd source data interface, it is determined that
The command word of any instruction is unconditional assignment command word, and the source data that the 3rd source data interface is defined as any instruction is connect
Mouthful.
Alternatively, instruction template group also includes order character matrix plate, and order character matrix plate is used to describe the corresponding orders of each ALU
Word;The processor, is additionally operable to when the instruction template of any instruction includes the 4th source data interface and the 5th source data interface,
4th source data interface and the 5th source data interface are defined as to the source data interface of any instruction;According to the mesh of any instruction
Mark data-interface determines the ALU of any instruction, and the order of any instruction is determined according to the ALU of any instruction and order character matrix plate
Word.
Alternatively, the processor, is additionally operable to obtain the corresponding data of source data interface of each bar instruction.
In summary, the equipment that the present embodiment is provided, by obtaining command word, source data interface and target that each bar is instructed
Data-interface, the corresponding data of source data interface of each bar instruction of order word processing instructed according to each bar, and instructed from each bar
Target data interface output reason result, make process instruction independent of execution unit, improve the speed of service of instruction processing
While, the quantity limitation of the instruction of parallel processing is eliminated, and improve treatment effeciency and the execution performance of process instruction.
Embodiment seven
A kind of compiling equipment is present embodiments provided, the equipment includes:Processor and memory.
Wherein, processor, command word, source data interface and target data interface for obtaining each bar instruction, and according to
The command word of each bar instruction, source data interface generate the instruction template of each bar instruction;The target data interface instructed according to each bar
And instruction template generation instruction template group.
Memory, for store instruction template group.
Alternatively, the processor, is additionally operable to, when the command word of any instruction is condition assignment command word, according to any be referred to
Order determines the first source data interface and the second source data interface, determines that banner word is identified according to the source data interface of any instruction;
Identified according to banner word, the first source data interface and the second source data interface generate the instruction template of any instruction.
Alternatively, the processor, is additionally operable to, when the command word of any instruction is unconditional assignment command word, by any refer to
The source data interface of order is defined as the 3rd source data interface;The instruction template of any instruction is generated according to the 3rd source data interface.
Alternatively, the processor, is additionally operable to when the command word of any instruction is unconditional assignment command word and condition assignment
During other command words outside command word, the 4th source data interface and the 5th source data interface are determined according to any instruction, according to
The target data interface of any instruction determines the ALU of any instruction, and according to the 4th source data interface and the 5th source data interface
Generate the instruction template of any instruction;The ALU for instructing generation according to each bar generates order character matrix plate;According to order character matrix plate, respectively
The target data interface and instruction template generation instruction template group of bar instruction.
Alternatively, the processor, is additionally operable to determine the instruction mould that each bar is instructed according to the target data interface that each bar is instructed
Position of the plate in instruction template group, position and each bar of the instruction template instructed according to each bar in instruction template group is instructed
Instruction template generates instruction template group.
Alternatively, the processor, is additionally operable to determine the instruction mould that each bar is instructed according to the target data interface that each bar is instructed
Position of the plate in instruction template group, position of the instruction template instructed according to order character matrix plate, each bar in instruction template group
And the instruction template generation instruction template group of each bar instruction.
In summary, compiler described in the embodiment of the present invention, by the command word instructed according to each bar, source data interface and
Target data interface generates instruction template group, instruction processing unit is obtained the command word of each bar instruction, source number in instruction template group
According to interface and target data interface, and the corresponding number of source data interface of each bar instruction of order word processing instructed according to each bar
According to the target data interface output instructed from each bar manages result, makes process instruction independent of execution unit, improves at instruction
While the speed of service of reason, the quantity limitation of the instruction of parallel processing is eliminated, and improves treatment effeciency and process instruction
Execution performance.
It should be noted that:Above-described embodiment provide instruction processing unit, compiler realize instruction processing when, only more than
The division progress of each functional module is stated for example, in practical application, as needed can distribute above-mentioned functions by difference
Functional module complete, i.e., the internal structure of instruction processing unit, compiler is divided into different functional modules, more than completion
The all or part of function of description.In addition, instruction processing unit, compiler and the method for instruction processing that above-described embodiment is provided
Embodiment belongs to same design, and it implements process and refers to embodiment of the method, repeats no more here.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.