主权项 |
1. A computer program product for detecting a Decimal Floating Point Quantum exception, the computer program product comprising:
a computer readable storage medium having program code embodied therewith, the program code readable by a computer processor to perform a method comprising: executing, by the processor, an instruction, the executing comprising: obtaining, by at least one processor of a processing environment, at least one decimal floating point operand; performing a decimal floating point operation on the at least one decimal floating point operand to produce a decimal floating point result having a quantum; determining a preferred quantum based upon the operation and on the at least one decimal floating point operand; based on determining that the quantum of the decimal floating point result is different from the preferred quantum, providing an output indicating a quantum exception, wherein providing an output indicating a quantum exception comprises:
determining whether a quantum exception mask bit is set;based on determining that the quantum exception mask bit is not set, storing the decimal floating point result and setting a quantum exception flag bit; andbased on determining that the quantum exception mask bit is set, storing the decimal floating point result and performing a trap operation; and based on determining that the quantum of the decimal floating point result is the same as the preferred quantum, providing an output without a quantum exception. |