发明名称 Method for optimizing binary code in language having access to binary coded decimal variable, and computer and computer program
摘要 A method for optimizing binary code in a language having access to binary coded decimal variable. The method includes: generating a first compiler expression of the binary code; analyzing a use-definition and/or a definition-use for the first compiler expression; generating a second compiler expression by identifying logical binary coded decimal (BCD) variables in the first compiler expression; assigning temporary variables to the logical BCD variables, wherein the second compiler expression includes packed decimal operations and the assigned temporary variables; and converting a packed decimal operation in the second compiler expression and an assigned temporary variable to a decimal floating point (DFP) if sign information and precision information are not lost during conversion from BCD to DFP, wherein identifying logical BCD variables includes: in the use-definition and/or definition-use of operands, regarding an operand of definition and an operand of use as the same logical BCD variables.
申请公布号 US9280328(B2) 申请公布日期 2016.03.08
申请号 US201414248500 申请日期 2014.04.09
申请人 INTERNATIONAL BUSINESS MACHINES CORPORATION 发明人 Koju Toshihiko;Sheikh Ali I
分类号 G06F9/45 主分类号 G06F9/45
代理机构 代理人 Hobson Mercedes L
主权项 1. A computer implemented method of optimizing a binary code in a language having access to a binary coded decimal (hereinafter referred to as BCD) variable by converting a BCD operation to a decimal floating point (hereinafter referred to as DFP) operation, the method comprising: generating a first compiler expression of the binary code; analyzing a use-definition chain and/or a definition-use chain for the first compiler expression; generating a second compiler expression by identifying logical BCD variables in the first compiler expression based on a result of the analysis; assigning temporary variables to the identified logical BCD variables, wherein the second compiler expression includes packed decimal operations and the assigned temporary variables; and converting at least one of the packed decimal operations in the second compiler expression and at least one of the assigned temporary variables to the DFP operation if sign information and precision information are not lost by the conversion from the BCD operation to the DFP operation, wherein identifying logical BCD variables in the first compiler expression based the result of the analysis includes, in the use-definition and/or definition-use chains of operands in the first compiler expression, regarding an operand of definition (def) and an operand of use (use) as the same logical BCD variables, wherein regarding the operands as the same logical BCD variables further comprises: if, in the use-definition and/or definition-use chains of the operands in the first compiler expression, there is a use (use) dominated by a definition (def), there is not another definition (def) for the use (use) in any path between the definition (def) and the use (use), and the use (use) exists for the definition (def) as only one use,regarding operands of the use (use) and the definition (def) as the same logical BCD variables if:right-end addresses of the operands of the use (use) and the definition (def) are the same;the operands of the use (use) and the definition (def) are the same BCD type;a size of the operand of use (use) is smaller than the size of the operand of definition (def); andan instruction for digit adjustment is inserted into the first compiler expression in generation of the second compiler expression.
地址 Armonk NY US