• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

Computer Engineering & Science ›› 2022, Vol. 44 ›› Issue (06): 979-985.

• High Performance Computing • Previous Articles     Next Articles

A floating-point exception detection method based on pile insertion at compile time

GUO Si-yu,WANG Lei   

  1. (The Frontier Information Technology Research Institute,Zhongyuan University of Technology,Zhengzhou 450007,China)
  • Received:2021-09-24 Revised:2021-12-14 Accepted:2022-06-25 Online:2022-06-25 Published:2022-06-17

Abstract: Floating point number is the finite precision coding of real number, which may lead to inexact or exception results in floating point calculation, so it is very important to realize effective floating point exception detection methods. The existing exception detection methods are not oriented to floating-point mathematical functions. In view of the above phenomena, a floating-point mathematical function-oriented exception detection method is proposed. This method is based on five types of exceptions defined in the IEEE-754 standard: overflow, underflow, division by zero, invalid operation and inexact, and is combined with the relevant theories of floating-point exception generation conditions defined by the floating-point control register FPCR and IEEE-754 standard used in Sunway high- performance mathematical function library. By classifying the exception types and floating-point operation instructions, pile insertion is carried out when the program is compiled, so as to detect the exceptions in the floating-point mathematical functions, and record the code coverage at the same time. In the experiment, this method is applied to a mathematical function library, and more than 100 floating-point mathematical functions in the library are tested. Experimental results show that the proposed floating-point exception detection method can effectively detect various types of exceptions. 


Key words: floating-point mathematical function, IEEE-754, insertion pile, exception detection