dqua
Decimal Quantize
dqua. FRT,FRA,FRB,RMC
Adjusts the exponent of a DFP number to match a reference. Critical for aligning decimal points before addition.
Details
Adjusts the exponent of a 64-bit DFP number to match a reference exponent, rounding the significand as needed according to the RMC control bits. This operation is essential for aligning decimal points before addition in financial calculations. The instruction can optionally update CR0 via the dot form; FPSCR is always updated with exception flags.
Pseudocode Operation
FPR[FRT] ← DFP_quantize(FPR[FRA], FPR[FRB], RMC)
FPSCR ← updated with exception flags
if Rc = 1 then CR0 ← condition_code(FPR[FRT])
Programming Note
DFP Quantize can be used to adjust one DFP value to a form having the same exponent as another DFP value. If the adjustment requires the significand to be shifted left and would cause overflow from the most significant digit, the result is a default QNaN.
Extended Mnemonics
| Extended Mnemonic | Equivalent Instruction |
|---|---|
Example
// Align decimal points.
Encoding
Operands
-
FRT
Target -
FRA
Source Value -
FRB
Reference Exponent -
RMC
Rounding Mode Control