Dismiss
InnovationQ/InnovationQ Plus content will be updated on Sunday, June 25, 10am ET, with new patent and non-patent literature collections. Click here to learn more.
Browse Prior Art Database

A method for testing floating-point exception handling

IP.com Disclosure Number: IPCOM000004789D
Publication Date: 2001-May-22
Document File: 2 page(s) / 11K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method for testing floating-point exception handling. Benefits include certainty in the correctness of a computing system's implementation of floating-point exception handling.

This text was extracted from a Microsoft Word 97 document.
This is the abbreviated version, containing approximately 84% of the total text.

A method for testing floating-point exception handling

Disclosed is a method for testing floating-point exception handling. Benefits include certainty in the correctness of a computing system's implementation of floating-point exception handling.

Manually selecting and checking a set of test cases cannot exercise the large number of critical special cases, and it is not obvious how to generate reference results automatically without using the floating-point and exception handling capabilities being tested. This invention overcomes these obstacles by using the non-floating-point functionality of the tested system to simulate and predict the correct behavior as defined by the exception handling specification. This provides a portable and automatic testing mechanism that is scalable to the large number of test cases required.

Predicting the correct exception handling behavior for a particular test case requires four pieces of information:

The floating-point instruction to be executed

The characteristics of the operands to the instruction

The values of all relevant environment parameters, and possibly

The characteristics of the result from executing the instruction

In the case of faults, such as occur with denormal operands or division by 0, information about the instruction, operands, and environment parameters is sufficient to identify the applicable part of the exception handling specification and therefore to predict the correct behavior. In the case of traps, such as inexact or overflow, information about the result is also required.

The key to this method is that the result itself is not required-only result information sufficient to identify the correct terminating state in the specification flowchart. The method determines this information by performing a partial simulation of the floating-point instruction using integer arithmetic. The type of simulation depends on the instruction and on the type of exception being checked. Overflow and underflow are checked by integer manipulation of the operands' exponents and comparison of the predicted result exponent against the range allowed under the current environment settings. Inexact is checked by integer manipulation of the operands' significands and comparison of the result precision against the destination precision.

Having established the correct predicted behavior, the method then executes the test instruction. Within the exception handler, the actual behavior is compared to the expected behavior.

Scalability and portability are the two primary advantages this method has over other methods. The approach allows automatic generation and checking of large numbers of critical test cases. An implementation of this approach has successfully tested the exception handling behavior of floating-point instructions with runs that exceed 10^9 boundary test cases. The method is self-contained and, therefore, portable. Reference values need not be generated on a different system than the one being tested.

The following...