dqua

Decimal Quantize

dqua FRT,FRA,FRB,RMC
dqua. FRT,FRA,FRB,RMC

Adjusts the exponent of a DFP number to match a reference. Critical for aligning decimal points before addition.

Details

The dqua instruction quantizes the DFP operand in register FRB to the form with the same exponent as that of the DFP operand in FRA based on the rounding mode specified by RMC. The result is placed in FRT.

Pseudocode Operation

if 'dqua' then
    FRT <- Quantize(FRA, FRB, RMC)
else if 'dqua.' then
    FRT <- Quantize(FRA, FRB, RMC)
    CR1 <- UpdateConditionRegister(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

dqua f1, f2, f3

Encoding

Binary Layout
0
0
FRT
6
FRA
11
FRB
16
RMC
21
Rc
23
3
28
21
31
23
 
Format X-form
Opcode 0xFC000084
Extension Decimal Floating-Point
Registers Altered FPSCR, FPRF, FR, FI, FX, XX, VXSNAN, VXCVI, CR1

Operands

  • FRT
    Target
  • FRA
    Source Value
  • FRB
    Reference Exponent
  • RMC
    Rounding Mode Control