dquai
DFP Quantize Immediate
dquai. TE,FRT,FRB,RMC
Adjusts the value to a form having the specified exponent in the range -16 to 15.
Details
The DFP operand in FRB is converted and rounded to the form with the exponent specified by TE based on the rounding mode specified in the RMC field. The result of that form is placed in FRT. The sign of the result is the same as the sign of the operand in FRB.
Pseudocode Operation
if 'dquai' then
FRT <- (FRB) adjusted to exponent TE with rounding based on RMC
if result would cause overflow from the most significant digit, then
FRT <- default QNaN
else
FRT <- adjusted value (left shifted with matching exponent)
if 'dquai.' then
FRT <- (FRB) adjusted to exponent TE with rounding based on RMC
if result would cause overflow from the most significant digit, then
FRT <- default QNaN
else
FRT <- adjusted value (left shifted with matching exponent)
CR1 <- updated
Programming Note
DFP Quantize Immediate can be used to adjust values to a form having the specified exponent in the range -16 to 15. If the adjustment requires the significand to be shifted left, then: if the result would cause overflow from the most significant digit, the result is a default QNaN; otherwise the result is the adjusted value (left shifted with matching exponent). If the adjustment requires the significand to be shifted right, the result is rounded based on the value of the RMC field.
Extended Mnemonics
| Extended Mnemonic | Equivalent Instruction |
|---|---|
Example
Encoding
Operands
-
TE
Target Exponent -
FRT
Target Floating-Point Register -
FRB
Source Floating-Point Register -
RMC
Rounding Mode Control