dquaq
Decimal Quantize Quad-Precision
Adjusts exponent of 128-bit DFP number.
Details
The DFP Quantize Immediate Quad-Precision instruction (dquaq) converts and rounds a decimal floating-point operand to a specified exponent based on the rounding mode provided. It adjusts the significand by shifting it left or right as needed, handling overflow and rounding according to the RMC field.
Pseudocode Operation
FRT[p] ← ConvertAndRound(FRB[p], TE, RMC)
if (Rc = 1) then
SetCRBit()
SetFIAndFRStatusFlags()
SetFPRFFromResult()
Programming Note
The dquaq instruction is used to convert and round a decimal floating-point number to a specified exponent. Ensure the operand is correctly aligned and check the FPSCR for rounding mode settings. This instruction operates at the problem state privilege level and may raise exceptions if overflow occurs or if invalid operands are provided.
Example
Encoding
Operands
-
vD
Target -
vA
Source -
vB
Reference