diex

Decimal Insert Exponent

diex FRT, FRA, FRB

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

Encoding

Binary Layout
59
0:5
FRT
6:10
FRA
11:15
FRB
16:20
866
21:30
/
31
 
Format X-form
Opcode 0xEC0006C4

Operands

  • FRT
    Target
  • FRA
    Coeff Source
  • FRB
    Exp Source

Example

diex f1, f2, f3

Registers Altered

FPSCR

Related

More in Decimal Floating-Point

Reference

Description

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.

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.