diex

Decimal Insert Exponent

diex FRT, FRA, FRB

Combines a sign/coefficient from FRA and exponent from FRB.

Details

Combines a sign and coefficient from FRA with an exponent from FRB to form a decimal floating-point result in FRT. FRA provides the mantissa/coefficient; FRB provides the exponent. The instruction reconstructs a DFP value from its components. FPSCR is updated if the result is invalid or out of range.

Pseudocode Operation

coefficient ← extract_mantissa(FRA)
Sign ← extract_sign(FRA)
exponent ← extract_exponent_field(FRB)
FRT ← compose_DFP(Sign, coefficient, exponent)
FPSCR ← updated based on composition result

Programming Note

The diex instruction is used to adjust the exponent of a decimal floating-point number by inserting the exponent from one operand (FRA) into another (FRB). Ensure that both operands are properly aligned and in the correct format to avoid exceptions. This operation requires FPSCR to manage rounding modes and exception flags.

Example

diex f1, f2, f3

Encoding

Binary Layout
59
0
FRT
6
FRA
11
FRB
16
866
21
/
31
 
Format X-form
Opcode 0xEC0006C4
Extension Decimal Floating-Point
Registers Altered FPSCR

Operands

  • FRT
    Target
  • FRA
    Coeff Source
  • FRB
    Exp Source