Instruction operation size optimization5418959Abstract An improved optimizer, in conjunction with a set of initial instruction ordinal assignment policies, a set of instruction ordinal adjustment policies and a set of instruction ordinal to instruction operation size mapping policies, is provided to the code generator of a compiler of the target machine. In addition to logic for performing standard optimizations, the improved optimizer further comprises logic for assigning initial instruction ordinals to instructions in the code being generated for the program being compiled in accordance to the assignment policies, iteratively adjusting the assigned instruction ordinals in accordance to the adjustment policies until they converge into a set of compatible and optimized instruction ordinals, and mapping the final instruction ordinals to instruction operation sizes, inserting additional code where necessary, in accordance to the mapping policies. Claims What is claimed is:
______________________________________
instruction operation size = a byte,
if (i.sub.-- size) > BYTE.sub.-- plus.sub.-- size),
add code to
sign-extend an 8-bit register of the Byte load sign
extend
instruction to a 32-bit register.
______________________________________
5. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including a Byte load zero extend instruction type; said step (a) is performed with initial assignment policies embodying logic that assigns said BYTEsize instruction ordinal to an instruction of said Byte load zero extend instruction type as its initial instruction ordinal assignment; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said Byte load zero extend instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size=SIGNBsize) i.sub.-- size=ZEROXsize, if (p.sub.-- size>BYTE.sub.-- plus.sub.-- size) i.sub.-- size=ZEROXsize; and said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said Byte load zero extend instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a byte,
if (i.sub.-- size > BYTE.sub.-- plus.sub.-- size)
add code to clear a register of the Byte load zero extend
instruction.
______________________________________
6. The automated method as set forth in claim 1, wherein, said steps (a) through (c) are performed on instructions having instruction types including a 16-bit load sign extend instruction type; said step (a) is performed with initial assignment policies embodying logic that assigns said SIGNHsize to an instruction of said 16-bit load sign extend instruction type as its initial instruction ordinal; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said 16-bit load sign extend instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size=ZEROSsize) i.sub.-- size=ZEROSsize, else if (p.sub.-- size>HW.sub.-- plus.sub.-- size) i.sub.-- size=SIGNXsize; and said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said 16-bit load sign extend instruction type and conditionally inserting one or more instructions as follows:
______________________________________
if (i.sub.-- size = ZEROSsize)
instruction operation size = a word,
add code to
clear a result register of the instruction of said 16-bit
load sign extend instruction type,
load 16 bits into a right half of said result register,
else
instruction operation size = half of a word
if (i.sub.-- size > HW.sub.-- plus.sub.-- size)
add code to
sign extend a 16-bit register of the instruction
of
said 16-bit load sign extend instruction
type to a 32-bit register.
______________________________________
7. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including a 16-bit load zero extend instruction type; said step (a) is performed with initial assignment policies embodying logic that assigns said HWsize to an instruction of said 16-bit load zero extend instruction type as its initial instruction ordinal; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said 16-bit load zero extend instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size=SIGNHsize) i.sub.-- size=ZEROXsize, if (p.sub.-- size=ZEROSsize) i.sub.-- size=ZEROXsize, if (p.sub.-- size>HW.sub.-- plus.sub.-- size) i.sub.-- size=ZEROXsize; and said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said 16-bit load zero extend instruction type and conditionally inserting one or more instructions as follows:
______________________________________
if (i.sub.-- size <= HW.sub.-- plus.sub.-- size)
instruction operation size = half of a word,
else
instruction operation size = a word,
add code to
clear a result register of the instruction of said 16-bit
load zero extend instruction type,
load 16 bits into a right half of said result register.
______________________________________
8. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including a non-Byte and non-16-bit load instruction type; said step (a) is performed with initial assignment policies embodying logic that assigns said WDsize to an instruction of said non-Byte and non-16-bit load instruction type as its initial instruction ordinal; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said non-Byte and non-16-bit load instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>i.sub.-- size) i.sub.-- size=p.sub.-- size; and said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said non-byte and non 16-bit load zero extend instruction type and conditionally inserting one or more instructions as follows: instruction operation size=original load size. 9. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including a STORE instruction type, said STORE instruction type comprising STORE instructions for storing data, each of said data being stored having a data size of a selected one of said BYTEsize, HWsize and WDsize; said step (a) is performed with initial assignment policies embodying logic that assigns the size of the data being stored by an instruction of said STORE instruction type as its initial instruction ordinal; said step (b) is performed with assignment adjustment policies embodying logic that does not adjust the current instruction ordinal assignment of an instruction of said STORE instruction type, that is the immediate target of an instruction ordinal being propagated; and said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said STORE instruction type and conditionally inserting one or more instructions as follows: instruction operation size=original store size. 10. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including a sign extend convert instruction type, said sign extend convert instruction type comprising instructions for converting data to a selected one of said SIGNHsize and SIGNBsize; said step (a) is performed with initial assignment policies embodying logic that assigns the size of the data being converted by an instruction of said sign extend convert instruction type as its initial instruction ordinal; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said sign extend convert instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>i.sub.-- size) i.sub.-- size=p.sub.-- size; and said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said sign extend convert instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = one word;
if (i.sub.-- size = ZEROSsize) treat said instruction of the sign extend
convert instruction type as an instruction of a zero extend
convert type,
if (i.sub.-- size <= HW.sub.-- plus.sub.-- size and 16 bit extend and
size(operand) <= HW.sub.-- plus.sub.-- size) delete the instruction of
said sign extend convert instruction type,
if (i.sub.-- size <= BYTE.sub.-- plus.sub.-- size and 24 bit extend and
size(operand) <= BYTE.sub.-- plus.sub.-- size) delete the instruction
of said sign extend convert instruction type.
______________________________________
11. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including a zero extend convert instruction type, said zero extend convert instruction type comprising instructions for converting data to a selected one of said BYTEsize and HWsize; said step (a) is performed with initial assignment policies embodying logic that assigns the size of the data being converted by an instruction of said zero extend convert instruction type as its initial instruction ordinal; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said zero extend convert instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>i.sub.-- size) i.sub.-- size=p.sub.-- size; and said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said zero extend convert instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = one word;
if (i.sub.-- size <= HW.sub.-- plus.sub.-- size and 16 bit extend and
size(operand) <= HW.sub.-- plus.sub.-- size) delete the instruction of
said zero extend convert instruction type,
if(i.sub.-- size <= BYTE.sub.-- plus.sub.-- size and 24 bit extend and
size(operand) <= BYTE.sub.-- plus.sub.-- size) delete the instruction
of said zero extend convert instruction type.
______________________________________
12. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including an enter constant instruction type, said enter constant instruction type comprising instructions for entering constants; said step (a) is performed with initial assignment policies embodying logic that assigns the initial instruction ordinal of an instruction of said enter constant instruction type as follows: WDsize, if (-8000.ltoreq.n.ltoreq.7fff) then SIGNHsize, if (0.ltoreq.n.ltoreq.7fff) then HWsize, if (-80.ltoreq.n.ltoreq.7f) the SIGNBsize, if (0.ltoreq.n.ltoreq.7f) then BYTEsize, where n is said constant's value; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said enter constant instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>WDsize) i.sub.-- size=p.sub.-- size, if (-8000.ltoreq.n.ltoreq.7fff and p.sub.-- size=ZEROSsize) i.sub.-- size=p.sub.-- size, if (-8000.ltoreq.n.ltoreq.7fff and p.sub.-- size>HW.sub.-- plus.sub.-- size) i.sub.-- size=p.sub.-- size, if (-80.ltoreq.n.ltoreq.7f and p.sub.-- size>BYTE.sub.-- plus.sub.-- size) i.sub.-- size=p.sub.-- size; and said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said enter constant instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a word,
if (i.sub.-- size <= BYTE.sub.-- plus.sub.-- size)
instruction operation size = a byte.
else if (i.sub.-- size = ZEROSsize)
constant = constant and Oxff
______________________________________
13. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including a first comparison instruction type (Compare-eq, ne); said step (a) is performed with initial assignment policies embodying logic that does not assign an initial instruction ordinal to an instruction of said first comparison instruction type; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said first comparison instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows:
______________________________________
if (p.sub.-- size > i.sub.-- size) {
i.sub.-- size = p.sub.-- size,
if (p.sub.-- size = HWsize) i.sub.-- size = ZEROXsize,
if (p.sub.-- size = SIGNHsize) i.sub.-- size = ZEROSsize,
if (p.sub.-- size = HW.sub.-- plus.sub.-- size or p.sub.-- size =
BYTE.sub.-- plus.sub.-- size)
i.sub.-- size = SIGNXsize; and
______________________________________
said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said first comparison instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a word,
if (i.sub.-- size <= BYTE.sub.-- plus.sub.-- size)
instruction operation size = a byte.
______________________________________
14. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including a second comparison instruction type (Compare-gt, ge, lt, le); said step (a) is performed with initial assignment policies embodying logic that does not assign an initial instruction ordinal to an instruction of said second comparison instruction type; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said second comparison instruction type that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows:
______________________________________
if (p.sub.-- size > i.sub.-- size and p.sub.-- size i = ZEROSsize) {
i.sub.-- size = p.sub.-- size,
if (i.sub.-- size = HWsize) i.sub.-- size = ZEROXsize,
if (p.sub.-- size = HW.sub.-- plus.sub.-- size or p.sub.-- size =
BYTE.sub.-- plus.sub.-- size)
i.sub.-- size = SIGNXsize; and
______________________________________
said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said second comparison instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a word,
if (i.sub.-- size = HW.sub.-- size or i.sub.-- size = SIGNHsize)
add code to shift operands of the instruction of said second
comparison instruction type 16 bits with zero fill,
else if (i.sub.-- size < BYTE.sub.-- plus.sub.-- size)
instruction operation size = a byte.
______________________________________
15. The automated method as set forth in claim 3, wherein, said steps (a) through (c) are performed on instructions having instruction types including a move instruction type; said step (a) is performed with initial assignment policies embodying logic that does not assign an initial instruction ordinal to an instruction of said move instruction type; said step (b) is performed with assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said move type that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>i.sub.-- size) i.sub.-- size=p.sub.-- size; and said step (c) is performed with mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said move instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a word,
if (i.sub.-- size =<BYTE.sub.-- plus.sub.-- size)
instruction operation size = a byte.
______________________________________
16. A computer system comprising: I) execution means for executing compiled programs comprising instructions that have multiple instruction operation sizes; and II) optimizer means executed by said execution means, said optimizer means being equipped to optimize instruction operation sizes of said instructions when said instructions are being generated while a source program is being compiled, said optimizer means including a) a set of predetermined initial instruction ordinal assignment policies for governing initial assignment of instruction ordinals representative of instruction operation sizes to said instructions, said predetermined assignment policies embodying logic that assigns initial instruction ordinals which are representative of minimal instruction operation sizes of said instructions, without regard to the assigned instruction ordinals' compatibility with one another; b) assignment means for assigning a plurality of initial instruction ordinals to said instructions, upon generating said instruction for said source program being compiled, said assignment being made based on said set of predetermined initial instruction ordinal assignment policies; c) a set of predetermined instruction ordinal assignment adjustment policies for governing assignment adjustment of said assigned instruction ordinals, said predetermined assignment adjustment policies embodying logic that avoids unnecessary assignment adjustments to instruction ordinals representative of the larger instruction operation sizes; d) adjustment means for iteratively adjusting said instruction ordinal assignments until said instruction ordinal assignments converge into a set of assigned instruction ordinals compatible with one another, said iterative assignment adjustment being made based on said set of predetermined instruction ordinal assignment adjustment policies; e) a set of predetermined instruction ordinal mapping policies for governing mapping of assigned instruction ordinals to represented instruction operation sizes, said predetermined mapping policies embodying logic that identifies the instruction operation sizes represented by the instruction ordinals and necessary instruction insertions; and f) mapping means for mapping said compatible instruction ordinals to represented instruction operation sizes, and conditionally inserting additional instructions to the generated instructions if necessary, based on said set of predetermined mapping policies. 17. The computer system as set forth in claim 16, wherein, said adjustment means iteratively adjusts said instruction ordinal assignments by performing data flow analysis on said generated instructions to identify all data flow related instructions requiring propagation of their assigned instruction ordinals to their data flow related instructions to achieve instruction ordinal compatibility; deriving a first-in-first-out instruction ordinal propagation list based on the results of said data flow analysis, said propagation list comprising a plurality of instruction ordinal and propagation target pairs, each pair identifying an instruction ordinal to be propagated and an instruction that is the immediate target of the particular propagation; removing the frontmost instruction ordinal and propagation target instruction pair from said propagation list; conditionally adjusting the current instruction ordinal assignment of the propagation target instruction based on said predetermined assignment adjustment policies; adding one or more instruction ordinal and propagation target instruction pair to the front of said propagation list if an assignment adjustment is made, said addition being made based on said newly adjusted instruction ordinal assignment of said propagation target instruction and the immediate data flow related instruction of said propagation target instruction; and repeating said removal, said conditional assignment adjustment, and said conditional instruction insertions, until said propagation list is empty. 18. The computer system as set forth in claim 16, wherein, said assignment, adjustment and mapping means use instruction ordinals including, in ascending order, instruction ordinals BYTEsize, SIGNBsize, BYTE.sub.-- plus.sub.-- size, HWsize, SIGNHsize, ZEROSsize, HW.sub.-- plus.sub.-- size, ZEROXsize, SIGNXsize and WDsize representing an unsigned byte instruction operation size, a signed byte instruction operation size, a greater than 8-bit result from 8-bit operands instruction operation size, an unsigned short instruction operation size, a signed short instruction operation size, a signed short that can be used as unsigned short instruction operation size, a greater than 16-bit result from 16-bit operand instruction operation size, a zero extend before 32-bit operation instruction operation size, a sign extend before 32-bit operation instruction operation size, and a 32-bit instruction operation size respectively. 19. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a Byte load sign extend instruction type; said assignment means employs initial assignment policies embodying logic that assigns said SIGNBsize instruction ordinal to an instruction of said Byte load sign extend instruction type as its initial instruction ordinal assignment; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said Byte load sign extend instruction type that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>BYTE.sub.-- plus.sub.-- size) i.sub.-- size=SIGNXsize; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said Byte load sign extend instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a byte,
if (i.sub.-- size) > BYTE.sub.-- plus.sub.-- size),
add code to
sign-extend an 8-bit register of the Byte load sign
extend
instruction to a 32-bit register.
______________________________________
20. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a Byte load zero extend instruction type; said assignment means employs initial assignment policies embodying logic that assigns said BYTEsize instruction ordinal to an instruction of said Byte load zero extend instruction type as its initial instruction ordinal assignment; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said Byte load zero extend instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size=SIGNBsize) i.sub.-- size=ZEROXsize, if (p.sub.-- size>BYTE.sub.-- plus.sub.-- size) i.sub.-- size=ZEROXsize; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said Byte load zero extend instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a byte,
if (i.sub.-- size > BYTE.sub.-- plus.sub.-- size)
add code to clear a register of the Byte load zero extend
instruction.
______________________________________
21. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a 16-bit load sign extend instruction type; said assignment means employs initial assignment policies embodying logic that assigns said SIGNHsize to an instruction of said 16-load sign extend instruction type as its initial instruction ordinal; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said 16-bit load sign extend instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size=ZEROSsize) i.sub.-- size=ZEROSsize, else if (p.sub.-- size>HW.sub.-- plus.sub.-- size) i.sub.-- size=SIGNXsize; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said 16-bit load sign extend instruction type and conditionally inserting one or more instructions as follows:
______________________________________
if (i.sub.-- size = ZEROSsize)
instruction operation size = a word,
add code to
clear a result register of the instruction of said 16-bit
load sign extend instruction type,
load 16 bits into a right half of said result register,
else
instruction operation size = half of a word
if (i.sub.-- size > HW.sub.-- plus.sub.-- size)
add code to
sign extend a 16-bit register of the instruction of
said 16-bit load sign extend instruction type to a
32-bit register.
______________________________________
22. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a 16-bit load zero extend instruction type; said assignment means employs initial assignment policies embodying logic that assigns said HWsize to an instruction of said 16-bit load zero extend instruction type as its initial instruction ordinal; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said 16-bit load zero extend instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size=SIGNHsize) i.sub.-- size=ZEROXsize, if (p.sub.-- size=ZEROSsize) i.sub.-- size=ZEROXsize, if (p.sub.-- size>HW.sub.-- plus.sub.-- size) i.sub.-- size=ZEROXsize; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said 16-bit load zero extend instruction type and conditionally inserting one or more instructions as follows:
______________________________________
if (i.sub.-- size <= HW.sub.-- plus.sub.-- size)
instruction operation size = half of a word,
else
instruction operation size = a word,
add code to
clear a result register of the instruction of said 16-bit
load zero extend instruction type,
load 16 bits into a right half of said result register.
______________________________________
23. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a non-Byte and non-16-bit load instruction type; said assignment means employs initial assignment policies embodying logic that assigns WDsize to an instruction of said non-Byte and non-16-bit load instruction type as its initial instruction ordinal; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said non-Byte and non 16-bit load instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>i.sub.-- size) i.sub.-- size=p.sub.-- size; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said non-byte and non 16-bit load zero extend instruction type and conditionally inserting one or more instructions as follows: instruction operation size=original load size. 24. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a STORE instruction type, said STORE instruction type comprising STORE instructions for storing data, each of said data being stored having a data size of a selected one of said BYTEsize, HWsize and WDsize; said assignment means employs initial assignment policies embodying logic that assigns the size of the data being stored by an instruction of said STORE instruction type as its initial instruction ordinal; said adjustment means employs assignment adjustment policies embodying logic that does not adjust the current instruction ordinal assignment of an instruction of said STORE instruction type, that is the immediate target of an instruction ordinal being propagated; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said STORE instruction type and conditionally inserting one or more instructions as follows: instruction operation size=original store size. 25. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a sign extend convert instruction type, said sign extend convert instruction type comprising instructions for converting data to a selected one of said SIGNHsize and SIGNBsize; said assignment means employs initial assignment policies embodying logic that assigns the size of the data being converted by an instruction of said sign extend convert instruction type as its initial instruction ordinal; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said sign extend convert instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>i.sub.-- size) i.sub.-- size=p.sub.-- size; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said sign extend convert instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = one word;
if (i.sub.-- size = ZEROSsize) treat said instruction of the sign
extend convert
instruction type as an instruction of a zero extend convert type,
if (i.sub.-- size <= HW.sub.-- plus.sub.-- size and 16 bit extend and
size(operand) <= HW.sub.-- plus.sub.-- size) delete the instruction of
said sign extend convert instruction type,
if (i.sub.-- size <= BYTE.sub.-- plus.sub.-- size and 24 bit extend and
size(operand) <= BYTE.sub.-- plus.sub.-- size) delete the instruction of
said sign extend convert instruction type.
______________________________________
26. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a zero extend convert instruction type, said zero extend convert instruction type comprising instructions for converting data to a selected one of said BYTEsize and HWsize; said assignment means employs initial assignment policies embodying logic that assigns the size of the data being converted by an instruction of said zero extend convert instruction type as its initial instruction ordinal; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said zero extend convert instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>i.sub.-- size) i.sub.-- size=p.sub.-- size; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said zero extend convert instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = one word;
if (i.sub.-- size <= HW.sub.-- plus.sub.-- size and 16 bit extend and
size(operand) <= HW.sub.-- plus.sub.-- size) delete the instruction of
said zero extend convert instruction type,
if (i.sub.-- size <= BYTE.sub.-- plus.sub.-- size and 24 bit extend and
size(operand) <= BYTE.sub.-- plus.sub.-- size) delete the instruction of
said zero extend convert instruction type.
______________________________________
27. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including an enter constant instruction type, said enter constant instruction type comprising instructions for entering constants; said assignment means employs initial assignment policies embodying logic that assigns the initial instruction ordinal of an instruction of said enter constant instruction type as follows: WDsize, if (-8000.ltoreq.n.ltoreq.7fff) then SIGNHsize, if (0.ltoreq.n.ltoreq.7fff) then HWsize, if (-80.ltoreq.n.ltoreq.7f) the SIGNBsize, if (0.ltoreq.n.ltoreq.7f) then BYTEsize, where n is said constant's value; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said enter constant instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>WDsize) i.sub.-- size=p.sub.-- size, if (-8000.ltoreq.n.ltoreq.7fff and p.sub.-- size=ZEROSsize) i.sub.-- size=p.sub.-- size, if (-8000.ltoreq.n.ltoreq.7fff and p.sub.-- size>HW.sub.-- plus.sub.-- size) i.sub.-- size=p.sub.-- size, if (-80.ltoreq.n.ltoreq.7f and p.sub.-- size>BYTE.sub.-- plus.sub.-- size) i.sub.-- size=p.sub.-- size; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said enter constant instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = word,
if (i.sub.-- size <= BYTE.sub.-- plus.sub.-- size)
instruction operation size = a byte.
else if (i.sub.-- size = ZEROSsize)
constant = constant and Oxff
______________________________________
28. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a first comparison instruction type (Compare-eq, ne); said assignment means employs initial assignment policies embodying logic that does not assign an initial instruction ordinal to an instruction of said first comparison instruction type; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said first comparison instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows:
______________________________________
if (p.sub.-- size > i.sub.-- size) {
i.sub.-- size = p.sub.-- size,
if (p.sub.-- size = HWsize)i.sub.-- size = ZEROXsize,
if (p.sub.-- size = SIGNHsize)i.sub.-- size = ZEROSsize,
if (p.sub.-- size = HW.sub.-- plus.sub.-- size or p.sub.-- size =
BYTE.sub.-- plus.sub.-- size)
i.sub.-- size = SIGNXsize; and
______________________________________
said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said first comparison instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a word,
if (i.sub.-- size <= BYTE.sub.-- plus.sub.-- size)
instruction operation size = a byte.
______________________________________
29. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a second comparison instruction type (Compare-gt, ge, lt, le); said assignment means employs initial assignment policies embodying logic does not assign an initial instruction ordinal to an instruction of said second comparison instruction type; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said second comparison instruction type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows:
______________________________________
if (p.sub.-- size > i.sub.-- size and p.sub.-- size != ZEROSsize) {
i.sub.-- size = p.sub.-- size,
if (i.sub.-- size = HWsize)i.sub.-- size = ZEROXsize,
if (p.sub.-- size = HW.sub.-- plus.sub.-- size or p.sub.-- size =
BYTE.sub.-- plus.sub.-- size)
i.sub.-- size = SIGNXsize; and
______________________________________
said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said second comparison instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a word,
if (i.sub.-- size = HW.sub.-- size or i.sub.-- size = SIGNHsize)
add code to shift operands of the instruction of said second
comparison instruction type 16 bits with zero fill,
else if (i.sub.-- size < BYTE.sub.-- plus.sub.-- size)
instruction operation size = a byte.
______________________________________
30. The computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including a move instruction type; said assignment means employs initial assignment policies embodying logic that does not assign an initial instruction ordinal to an instruction of said move instruction type; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) an instruction of said move type, that is the immediate target of an instruction ordinal being propagated (p.sub.-- size), as follows: if (p.sub.-- size>i.sub.-- size) i.sub.-- size=p.sub.-- size; and said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said move instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a word,
if (i.sub.-- size = <BYTE.sub.-- plus.sub.-- size)
instruction operation size = a byte.
______________________________________
31. The automated method as set forth in claim 3, wherein, said steps (a) though (c) are performed on instructions having instruction types including an arithmetic and like operation instruction type (Add, Sub, etc.); said step (a) is performed using initial assignment policies embodying logic that assigns said BYTE.sub.-- plus.sub.-- size instruction ordinal to an instruction of said Add, Sub, etc. instruction type as its initial instruction ordinal assignment; said step (b) is performed using assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said Add, Sub, etc. instruction type that is the immediate target of an instruction ordinal being propagated (p.sub.-- size) as follows:
______________________________________
if (p.sub.-- size > i.sub.-- size) {
i.sub.-- size = p.sub.-- size,
if (p.sub.-- size <= HW.sub.-- plus.sub.-- size)i.sub.-- size = HW.sub.--
plus.sub.-- size,
if (p.sub.-- size <= BYTE.sub.-- plus.sub.-- size)i.sub.-- size =
BYTE.sub.-- plus.sub.-- size,
};and
______________________________________
said step (c) is performed using mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said Add, Sub etc. instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a word,
if (i.sub.-- size <= BYTE.sub.-- plus.sub.-- size and the instruction
has
a byte version),
instruction operation size = byte.
______________________________________
32. The improved computer system as set forth in claim 18, wherein, said assignment, adjustment and mapping means process instructions having instruction types including an arithmetic and like operation instruction type (Add, Sub, etc.); said assignment means employs initial assignment policies embodying logic that assigns said BYTE.sub.-- plus.sub.-- size instruction ordinal to an instruction of said Add, Sub, etc. instruction type as its initial instruction ordinal assignment; said adjustment means employs assignment adjustment policies embodying logic that adjusts the current instruction ordinal assignment (i.sub.-- size) of an instruction of said Add, Sub, etc. instruction type that is the immediate target of an instruction ordinal being propagated (p.sub.-- size) as follows:
______________________________________
if (p.sub.-- size > i.sub.-- size) {
i.sub.-- size = p.sub.-- size,
if (p.sub.-- size <= HW.sub.-- plus.sub.-- size)i.sub.-- size = HW.sub.--
plus.sub.-- size,
if (p.sub.-- size <= BYTE.sub.-- plus.sub.-- size)i.sub.-- size =
BYTE.sub.-- plus.sub.-- size,
};and
______________________________________
said mapping means employs mapping policies embodying logic that maps the assigned instruction ordinal of an instruction of said Add, Sub etc. instruction type and conditionally inserting one or more instructions as follows:
______________________________________
instruction operation size = a word,
if (i.sub.-- size <= BYTE.sub.-- plus.sub.-- size and the instruction
has a byte version),
instruction operation size = a byte.
______________________________________
Description BACKGROUND OF THE INVENTION
|
Same subclass Same class Consider this |
||||||||||
