Rate This Document
Findability
Accuracy
Completeness
Readability

Introduction to Floating-Point Exception Detection

BiSheng compiler provides the function of detecting floating-point arithmetic exceptions at program runtime and prints function stack information when exceptions occur. This function aims to improve the efficiency of locating floating-point computing exceptions in HPC applications. Due to the limitation of detection efficiency, only functions generated when floating-point exceptions are detected are supported. By default, the stack top function in the stack information prints the line number of the last line. You need to analyze the position of the abnormal line number in the function. The types of floating-point exception detection are as follows (FE_INEXACT is disabled by default, and other exception detection is enabled by default):

Floating-Point Exception Type

Description

FE_INVALID (0x00000001)

Invalid exception. Example: sqrt(-1)

FE_DIVBYZERO (0x00000002)

Divide-by-zero exception. Example: 1.0/0.0

FE_UNDERFLOW (0x00000004)

Underflow exception. Example: DBL_MIN/pow (2.0,52)

FE_OVERFLOW (0x00000008)

Overflow exception. Example: DBL_MAX*2.0

FE_INEXACT (0x00000010) (disabled by default)

Inexact exception. Example: 1.0/10.0, where floating-point values are rounded off.

FE_ALL_EXCEPT (0x0000001F)

All the above exceptions