Shift significand of decimal floating point data
AssigneeInternational Business Machines Corporation
InventorsShawn D. Lundvall, Eric M. Schwarz, Ronald M. Smith, SR., Phil C. Yeh
Life of this patent
Estimating the term…
Abstract
A decimal floating point finite number in a decimal floating point format is composed from the number in a different format. A decimal floating point format includes fields to hold information relating to the sign, exponent and significand of the decimal floating point finite number. Other decimal floating point data, including infinities and NaNs (not a number), are also composed. Decimal floating point data are also decomposed from the decimal floating point format to a different format. For composition and decomposition, one or more instructions may be employed, including a shift significand instruction.
Claims24
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 for performing a shift 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:
- obtaining a densely packed decimal (DPD) floating point operand, the DPD floating point operand comprising a sign bit, a DPD trailing significand portion and a combination portion, the combination portion comprising an encoded leftmost digit (LMD) of a decimal floating point (DFP) significand value and an encoded biased exponent value, the DPD trailing significand portion being a DPD encoded value of digits of the DFP significand value;
- extracting the LMD of the DFP significand value from the combination portion;
- extracting the digits of the DFP significand value from the DPD trailing significand portion;
- shifting the DFP significand value a number of digits specified in the instruction in one direction, the shifting producing a result DFP significand value, the result DFP significand value comprising a result leftmost digit and a result plurality of rightmost digits;
- encoding the result leftmost digit into a result combination portion;
- encoding the result plurality of rightmost digits into a result DFP significand portion;
- and
- storing the result combination portion and the result DFP significand portion.
A method of executing a machine instruction in a central processing unit, the machine instruction being defined for computer execution according to a computer architecture, said method comprising:
- obtaining a densely packed decimal (DPD) floating point operand, the DPD floating point operand comprising a sign bit, a DPD trailing significand portion and a combination portion, the combination portion comprising an encoded leftmost digit (LMD) of a decimal floating point (DFP) significand value and an encoded biased exponent value, the DPD trailing significand portion being a DPD encoded value of digits of the DFP significand value;
- extracting the LMD of the DFP significand value from the combination portion;
- extracting the digits of the DFP significand value from the DPD trailing significand portion;
- shifting the DFP significand value a number of digits specified in the instruction in one direction, the shifting producing a result DFP significand value, the result DFP significand value comprising a result leftmost digit and a result plurality of rightmost digits;
- encoding the result leftmost digit into a result combination portion;
- encoding the result plurality of rightmost digits into a result DFP significand portion;
- and
- storing the result combination portion and the result DFP significand portion.
A system of executing a machine instruction in a central processing unit, the machine instruction being defined for computer execution according to a computer architecture, 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:
- obtaining a densely packed decimal (DPD) floating point operand, the DPD floating point operand comprising a sign bit, a DPD trailing significand portion and a combination portion, the combination portion comprising an encoded leftmost digit (LMD) of a decimal floating point (DFP) significand value and an encoded biased exponent value, the DPD trailing significand portion being a DPD encoded value of digits of the DFP significand value;
- extracting the LMD of the DFP significand value from the combination portion;
- extracting the digits of the DFP significand value from the DPD trailing significand portion;
- shifting the DFP significand value a number of digits specified in the instruction in one direction, the shifting producing a result DFP significand value, the result DFP significand value comprising a result leftmost digit and a result plurality of rightmost digits;
- encoding the result leftmost digit into a result combination portion;
- encoding the result plurality of rightmost digits into a result DFP significand portion;
- and
- storing the result combination portion and the result DFP significand portion.
Dependencies are inferred from the claim text.