diex
Decimal Insert Exponent
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
Encoding
Operands
-
FRT
Target -
FRA
Coeff Source -
FRB
Exp Source