q_data structure for arithmetic program interruptions

If one of the arithmetic program interruptions shown in Table 1 occurs, and the corresponding condition is signaled, Language Environment builds the q_data structure shown in Figure 1.

Table 1. Arithmetic program interruptions and corresponding conditions
Program interruption (see notes 1 and 2) Program interruption code Condition Message number
Fixed-point overflow exception 08 CEE348 3208
Fixed-point divide exception 09 CEE349 3209
Exponent-overflow exception 0C CEE34C 3212
Exponent-underflow exception 0D CEE34D 3213
Floating-point divide exception 0F CEE34F 3215
Unnormalized-operand exception 1E CEE34U 3230
Notes:
  1. The square root exception is also an arithmetic program interruption, but is treated like the condition from the square root mathematical routine.
  2. An arithmetic program interruption that occurs on a vector instruction is presented to a user-written condition handler in the same form as though it had occurred on a scalar instruction. A single vector instruction could cause multiple, possibly different, program interruptions to occur, but each interruption is presented individually.
Figure 1. q_data structure for arithmetic program interruption conditions
The q_data structure is built according to the conditions of exponent overflow, exponent underflow, floating-point divide, fixed-point overflow, fixed-point divide, and unnormalized-operand exceptions.
The q_data structure shown in Figure 1 is built by Language Environment for the conditions of exponent overflow, exponent underflow, floating-point divide, fixed-point overflow, fixed-point divide, and unnormalized-operand exceptions. As a result, the q_data structure provides the following information:
q_data_token (input)
The 4-byte address of the address list. This value is returned by the CEEGQDT callable service.
parm_count (input)
A 4-byte binary integer containing the value 6, which is the total number of q_data fields in the q_data structure, including parm_count.
mach_inst_result_desc (input)
The q_data descriptor for mach_inst_result. (See Format of q_data descriptors for information about q_data descriptors.)
mach_inst_result (input)
The value left in the machine register (general register, floating-point register, or element of a vector register) by the failing machine instruction. Based on the program interruption, mach_inst_result has one of the following lengths and types (as reflected in the q_data descriptor field mach_inst_result_desc):
Program interruption Length and type
Fixed-point overflow exception 4- or 8-byte binary integer
Fixed-point divide exception 8-byte binary integer
Exponent-overflow exception 4-, 8-, or 16-byte floating-point number
Exponent-underflow exception 4-, 8-, or 16-byte floating-point number
Floating-point divide exception 4-, 8-, or 16-byte floating-point number
Unnormalized-operand exception (occurs only on vector instructions) 4- or 8-byte floating-point number

This is also the result value with which execution is resumed when the user condition handler requests the resume action (result code 10).

fixup_resume_value_desc (input)
The q_data descriptor for fixup_resume_value.
fixup_resume_value (input/output)
The fix-up value which, for the exceptions other than the unnormalized-operand exception, is the result value with which execution is resumed when the user condition handler requests the fix-up and resume action (result code 60 with a condition token of CEE0CF). fixup_resume_value initially has one of the following values:
  • For an exponent-underflow exception, the value 0
  • For an unnormalized-operand exception, the value 0
  • For one of the other program interruptions, the same value as in mach_inst_result
Based on the program interruption, fixup_resume_value has the following lengths and types (as reflected in the q_data descriptor field fixup_resume_value_desc):
Program interruption Length and type
Fixed-point overflow exception 4- or 8-byte binary integer
Fixed-point divide exception 8-byte binary integer or two 4-byte binary integers (remainder, quotient)
Exponent-overflow exception 4-, 8-, or 16-byte floating-point number
Exponent-underflow exception 4-, 8-, or 16-byte floating-point number
Floating-point divide exception 4-, 8-, or 16-byte floating-point number
Unnormalized-operand exception (occurs only on vector instructions) 4- or 8-byte floating-point number
mach_inst_address (input)
The address of the machine instruction causing the program interruption.