denbcdq

Decimal Encode BCD Quad-Precision

denbcdq vD, vB, S

Encodes 128-bit DFP to BCD.

Details

Encodes a 128-bit decimal floating-point number from vB into binary-coded decimal (BCD) format, storing the result in vD. The sign field S specifies how the sign is encoded. The instruction converts the DFP representation to BCD digits with appropriate sign handling. The instruction is part of the Decimal Floating-Point extension.

Pseudocode Operation

vD ← EncodeBCDDFP128(vB, S)

Programming Note

The denbcdq instruction is used to convert BCD values into DPD format, which is essential for handling high-precision decimal arithmetic. Ensure that the input data is correctly aligned and formatted as BCD before encoding. This instruction operates at user privilege level and may raise exceptions if the input data contains invalid BCD values.

Example

denbcdq vd, vb, 0

Encoding

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

Operands

  • vD
    Target
  • vB
    Source
  • S
    Sign