For Programmers: Free Programming Magazines  


Home > Archive > Fortran > April 2005 > Wrapping ieee exception handling not possible?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Wrapping ieee exception handling not possible?
Stig Kildegård Andersen

2005-04-01, 8:57 am

Hello,

I am having some diffculties in adding support for ieee exception handling
to a module where I have wrapped the exception handling functions for the
CVF compiler. It appears to me that wrapping ieee exception handling is
impossible because the halting mode (and rounding mode, and underflow mode)
is "not sticky", i.e. it is reset when the sub program that called
ieee_set_halting_mode returns. If I understand correctly then a subprogram
such as:

subroutine SetNoHaltingOnExceptions
use, intrinsic :: ieee_exceptions
call ieee_set_halting_mode(ieee_all, .false.)
end subroutine

is useless because it cannot change the halting mode in the calling sub
program.

If I want to customize the halting mode, rounding mode, and underflow mode I
either have to copy and paste a block of subroutine calls to the ieee
subroutines into the places where I need to set the modes, or I can set the
modes once and then store the floating point status somewhere using
ieee_get_status so that I only need to call ieee_set_status when I need my
custom modes. But either way I will not be able to wrap the ieee subroutine
calls so instead I have to try to change my exception handling module for
CVF so that it looks like the ieee exception handling in order to avoid
plastering my code with preprocessor statements in order to have exception
handling both on CVF and on compilers that support ieee exception handling
(and elsewhere).

Is this correct, or am I overlooking something?

Thank You in advance,
Stig Kildegård


robert.corbett@sun.com

2005-04-02, 3:57 am

> Is this correct, or am I overlooking something?

You are correct.

The IEEE modules in f2k3 were designed to work this way. CVF is
simply implementing what is in the Fortran standard.


Sincerely,
Bob
Corbett

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com