dquaq

Decimal Quantize Quad-Precision

dquaq vD, vA, vB

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

dquaq vd, va, vb

Encoding

Binary Layout
63
0
vD
6
vA
11
vB
16
66
21
/
31
 
Format X-form
Opcode 0xFC000082
Extension Decimal Floating-Point
Registers Altered FPSCR

Operands

  • vD
    Target
  • vA
    Source
  • vB
    Reference