ddiv
Decimal Divide
ddiv. FRT,FRA,FRB
Divides the contents of two decimal floating-point registers and places the result in a target register.
Details
The DFP operand in FRA is divided by the DFP operand in FRB. The result is rounded to the target-format precision under control of the DRN (bits 29:31 of the FPSCR). An appropriate form of the rounded result is selected based on the ideal exponent and is placed in FRT.
Pseudocode Operation
if 'ddiv' then
FRT <- (FRA) / (FRB)
if Rc=1 then
CR1 <- result of comparison
Programming Note
The ddiv instruction performs a decimal division, rounding the result according to the precision control bits in FPSCR. Ensure that operands are properly aligned and check for division by zero or overflow conditions, which may trigger exceptions. The result can be compared if Rc is set, updating CR1 accordingly.
Example
Encoding
Operands
-
FRT
Target -
FRA
Src A -
FRB
Src B