Detection of potential need to use a larger data format in performing floating point operations
AssigneeInternational Business Machines Corporation
InventorsShawn D. Lundvall, Ronald M. Smith, SR., Phil C. Yeh, Michael Ferderic Cowlishaw
Life of this patent
Estimating the term…
Abstract
Detection of whether a result of a floating point operation is safe. Characteristics of the result are examined to determine whether the result is safe or potentially unsafe, as defined by the user. An instruction is provided to facilitate detection of safe or potentially unsafe results.
Claims25
A computer program product for executing a machine instruction in a central processing unit, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising an opcode, a first register field, a second register field, an index field, a base field and a displacement value, the machine instruction for performing a determining function, the computer program product comprising:
- a non-transitory computer readable medium readable by a processor and storing instructions for execution by the processor for performing a method comprising:
- performing a function defined by the opcode of the machine instruction of determining whether a first operand included in a register specified by the register field is a safe decimal floating point number or is a potentially unsafe decimal floating point number, said function comprising:
- determining a data group and a sign for the first operand;
- determining a plurality of second operand bits using the index field, base field and displacement value of the machine instruction, each bit of the plurality of second operand bits corresponding to a data group and sign combination;
- selecting a bit of the plurality of second operand bits based on the data group and sign determined for the first operand;
- determining a value of the selected bit;
- and
- setting a condition code based on the value of the selected bit, the condition code indicating whether a result of a floating point operation is safe or potentially unsafe.
A method for executing a machine instruction in a central processing unit, said method comprising:
- performing a function defined by the opcode of the machine instruction of determining whether a first operand included in a register specified by the register field is a safe decimal floating point number or is a potentially unsafe decimal floating point number, said function comprising:
- determining a data group and a sign for the first operand;
- determining a plurality of second operand bits using the index field, base field and displacement value of the machine instruction, each bit of the plurality of second operand bits corresponding to a data group and sign combination;
- selecting a bit of the plurality of second operand bits based on the data group and sign determined for the first operand;
- determining a value of the selected bit;
- and
- setting a condition code based on the value of the selected bit, the condition code indicating whether a result of a floating point operation is safe or potentially unsafe.
A system of executing a machine instruction in a central processing unit, said system comprising:
- a memory;
- and
- a processor configured to communicate with the memory, wherein the computer system is configured to perform a method, the method comprising:
- performing, by the processor, a function defined by the opcode of the machine instruction of determining whether a first operand included in a register specified by the register field is a safe decimal floating point number or is a potentially unsafe decimal floating point number, said function comprising:
- determining a data group and a sign for the first operand;
- determining a plurality of second operand bits using the index field, base field and displacement value of the machine instruction, each bit of the plurality of second operand bits corresponding to a data group and sign combination;
- selecting a bit of the plurality of second operand bits based on the data group and sign determined for the first operand;
- determining a value of the selected bit;
- and
- setting a condition code based on the value of the selected bit, the condition code indicating whether a result of a floating point operation is safe or potentially unsafe.
Dependencies are inferred from the claim text.