ddiv

Decimal Divide

ddiv FRT,FRA,FRB
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

ddiv f1, f2, f3

Encoding

Binary Layout
59
0
FRT
6
FRA
11
FRB
16
546
31
/
 
Format X-form
Opcode 0xEC000444
Extension Decimal Floating-Point
Registers Altered FPSCR, CR1

Operands

  • FRT
    Target
  • FRA
    Src A
  • FRB
    Src B