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

浮点数学函数异常处理方法
引用本文:许瑾晨,郭绍忠,黄永忠,王磊,周蓓. 浮点数学函数异常处理方法[J]. 软件学报, 2015, 26(12): 3088-3103
作者姓名:许瑾晨  郭绍忠  黄永忠  王磊  周蓓
作者单位:解放军信息工程大学, 河南 郑州 450001;数学工程与先进计算国家重点实验室, 江苏 无锡 214125,解放军信息工程大学, 河南 郑州 450001,解放军信息工程大学, 河南 郑州 450001,解放军信息工程大学, 河南 郑州 450001,解放军信息工程大学, 河南 郑州 450001
基金项目:国家高技术研究发展计划(863)(2009AA012201)
摘    要:异常会造成程序错误,实现完全没有异常的浮点计算软件也很艰难,因此,实现有效的异常处理方法很重要.但现有的异常处理并不针对浮点运算,并且研究重点都集中在整数溢出错误上,而浮点类型运算降低了整数溢出存在的可能.针对上述现象,面向基于汇编实现的数学函数,提出了一种针对浮点运算的分段式异常处理方法.通过将异常类型映射为64位浮点数,以核心运算为中心,将异常处理过程分为3个阶段:输入参数检测(处理INV异常)、特定代码检测(处理DZE异常和INF异常)以及输出结果检测(处理FPF异常和DNO异常),并从数学运算的角度对该方法采用分段式处理的原因进行了证明.实验将该方法应用于Mlib浮点函数库,对库中600多个面向不同平台的浮点函数进行了测试.测试结果表明:该方法能够将出现浮点异常即中断的函数个数从90%降到0%.同时,实验结果验证了该方法的高效性.

关 键 词:浮点数  数学函数  异常处理
收稿时间:2013-12-16
修稿时间:2015-01-08

Exception Handling Approach of Floating Mathematical Functions
XU Jin-Chen,GUO Shao-Zhong,HUANG Yong-Zhong,WANG Lei and ZHOU Bei. Exception Handling Approach of Floating Mathematical Functions[J]. Journal of Software, 2015, 26(12): 3088-3103
Authors:XU Jin-Chen  GUO Shao-Zhong  HUANG Yong-Zhong  WANG Lei  ZHOU Bei
Affiliation:PLA Information Engineering University, Zhengzhou 450001, China;State Key Laboratory of Mathematical Engineering and Advanced Computing, Wuxi 214125, China,PLA Information Engineering University, Zhengzhou 450001, China,PLA Information Engineering University, Zhengzhou 450001, China,PLA Information Engineering University, Zhengzhou 450001, China and PLA Information Engineering University, Zhengzhou 450001, China
Abstract:Floating-point exception usually brings unpredictable errors to applications, as it is fairly difficult to design software free of exceptions. Implementing an efficient exception handling approach is thus important. However, existing techniques, while focusing on handing integer overflow errors, are not floating-point oriented. Considering the fact that floating-point calculation reduces the integer overflow error, this study proposes a floating-point oriented exception handling approach for mathematical function written in assembly language. It first maps various exceptions into 64-bit floating-point numbers, and then stages the handling process into three parts on basis of their kernel computations. These stages are input parameter detection, which handles INV exception, specific code detection, which handles DZE and INF exceptions, and output parameter detection, which handles FPF and DNO exceptions. In the meanwhile, the paper presents a theoretical proof as well to illustrate the validity of such staging technique. More than 600 floating-point functions are extracted from the mathematical function library Mlib to test the performance for different systems. The evaluation shows that the proposed technique is capable to decrease the occupation of functions with floating-point exceptions from 90% to 0%, and the result demonstrates its high efficiency.
Keywords:floating-point number  mathematical function  exception handling
点击此处可从《软件学报》浏览原始摘要信息
点击此处可从《软件学报》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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