引用本文:许瑾晨,郭绍忠,黄永忠,王磊,周蓓.浮点数学函数异常处理方法.软件学报,2015,26(12):3088-3103
【打印本页】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览 3869次   下载 10133 本文二维码信息
码上扫一扫!
分享到: 微信 更多
浮点数学函数异常处理方法
许瑾晨1,2, 郭绍忠1, 黄永忠1, 王磊1, 周蓓1
1.解放军信息工程大学, 河南 郑州 450001;2.数学工程与先进计算国家重点实验室, 江苏 无锡 214125
摘要:
异常会造成程序错误,实现完全没有异常的浮点计算软件也很艰难,因此,实现有效的异常处理方法很重要.但现有的异常处理并不针对浮点运算,并且研究重点都集中在整数溢出错误上,而浮点类型运算降低了整数溢出存在的可能.针对上述现象,面向基于汇编实现的数学函数,提出了一种针对浮点运算的分段式异常处理方法.通过将异常类型映射为64位浮点数,以核心运算为中心,将异常处理过程分为3个阶段:输入参数检测(处理INV异常)、特定代码检测(处理DZE异常和INF异常)以及输出结果检测(处理FPF异常和DNO异常),并从数学运算的角度对该方法采用分段式处理的原因进行了证明.实验将该方法应用于Mlib浮点函数库,对库中600多个面向不同平台的浮点函数进行了测试.测试结果表明:该方法能够将出现浮点异常即中断的函数个数从90%降到0%.同时,实验结果验证了该方法的高效性.
关键词:  浮点数  数学函数  异常处理
DOI:10.13328/j.cnki.jos.004814
分类号:
基金项目:国家高技术研究发展计划(863)(2009AA012201)
Exception Handling Approach of Floating Mathematical Functions
XU Jin-Chen1,2, GUO Shao-Zhong1, HUANG Yong-Zhong1, WANG Lei1, ZHOU Bei1
1.PLA Information Engineering University, Zhengzhou 450001, China;2.State Key Laboratory of Mathematical Engineering and Advanced Computing, Wuxi 214125, 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.
Key words:  floating-point number  mathematical function  exception handling

引用本文:
【打印本页】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览次   下载  
分享到: 微信 更多
摘要:
关键词:  
DOI:
分类号:
基金项目:
Abstract:
Key words: