denbcdq
Decimal Encode BCD Quad-Precision
denbcdq vD, vB, S
Encodes 128-bit DFP to BCD.
Encoding
Binary Layout
63
0:5
vD
6:10
S
11:15
vB
16:20
834
21:30
/
31
Operands
-
vD
Target -
vB
Source -
S
Sign
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
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.
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.