This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90



On 29 Aug 2009, at 09:51, Janne Blomqvist wrote:


Steve Kargl wrote:
On Fri, Aug 28, 2009 at 11:06:31AM +0100, IainS wrote:
if I want to add a subroutine to libgfortran which is

FOO(BAR)
LOGICAL, INTENT(OUT) :: BAR

do I need to provide a series of c functions (in libgfortran/ intrinsics/ ) viz:

See the scripts in the m4/ subdirectory. You basically need
to write a foo.m4 script that when processed will generated all of the possible functions for the target. The generated
files are placed into the generated/ directory.

Again, this is a case where one shouldn't repeat the mistakes of the past. In most cases we should have as few library functions as possible and the frontend doing any type casting before calling the library. E.g. for LOGICAL arguments, the library should just contain a single function that takes a logical of default kind (GFC_LOGICAL_4), and the frontend being responsible for creating a logical(kind=4) temporary in case the user calls the intrinsic with a logical of some other kind. Of course, for floating point arguments, we still need multiple library functions.


Again, see http://gcc.gnu.org/wiki/LibgfortranAbiCleanup

noted, and read (I might be out of my depth with code-generation in the FE - but I'll try and find an example to follow before screaming for help).


For the functions changing/querying mode I can't (immediately) see any performance-critical issue.

I can see reasons that testing for NAN etc. might be used in performance sensitive areas (but it's likely that such could be a FE inline anyway).

this is clearly going to take more time than writing a handful of asm functions ;-)

Iain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]