首页 | 本学科首页   官方微博 | 高级检索  
     

基于编译时插桩的浮点异常检测方法
引用本文:郭思雨,王磊.基于编译时插桩的浮点异常检测方法[J].计算机工程与科学,2022,44(6):979-985.
作者姓名:郭思雨  王磊
作者单位:(中原工学院前沿信息技术研究院,河南 郑州 450007)
摘    要:浮点数是实数的有限精度编码,在进行浮点计算时,可能会导致不精确或者异常的结果,因此实现有效的浮点异常检测方法很重要。现有异常检测方法不面向浮点数学函数,由此提出了一种面向浮点数学函数的异常检测方法。该方法依据IEEE-754标准中定义的上溢出、下溢出、被零除、无效操作和不精确5类异常,并结合申威高性能数学函数库中使用的浮点控制寄存器FPCR和IEEE-754标准定义的浮点异常产生条件的相关理论,通过将异常类型和浮点运算指令进行对应分类,在程序编译时进行插桩以检测出浮点数学函数中出现的异常,同时记录代码覆盖率。最后将该方法应用于数学函数库,对库中100多个浮点数学函数进行了测试实验。实验结果表明,该浮点异常检测方法能够有效检测各类异常。

关 键 词:浮点数学函数  IEEE-754  插桩  异常检测  
收稿时间:2021-09-24
修稿时间:2021-12-14

A floating-point exception detection methodbased on pile insertion at compile time
GUO Si-yu,WANG Lei.A floating-point exception detection methodbased on pile insertion at compile time[J].Computer Engineering & Science,2022,44(6):979-985.
Authors:GUO Si-yu  WANG Lei
Affiliation:(The Frontier Information Technology Research Institute,Zhongyuan University of Technology,Zhengzhou 450007,China)
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.
Keywords:floating-point mathematical function  IEEE-754  insertion pile  exception detection  
点击此处可从《计算机工程与科学》浏览原始摘要信息
点击此处可从《计算机工程与科学》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号