This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


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

Resetting ix86 FPU precision



To whom it may concern;

I'm running a calculationally intensive piece of fortran code on several
different platforms (ix86/Linux/RH6.0, Alpha/OSF4.0, Solaris).  As
expected, results across platforms differ slightly with each other despite
using the exact same inputs.  I would like to remove one "variable" in
this effect by resetting the x86 FPU precision to DOUBLE mode instead of
the default EXTENDED.

According to the g77 info page, this can be done through the __SETFPUCW
command by linking the following piece of code with the rest of my source
code:

#include <fpu_control.h>
static void __attribute__ ((constructor))
     libieee_dbl()
{
  __setfpucw ((_FPU_DEFAULT & ~_FPU_EXTENDED) | _FPU_DOUBLE);
}


I compile this subroutine with the command:
 
gcc -o libieee_dbl.a libieee_dbl.c

and I made certain that libc.a and fpu_control.h were in gcc's search
path.

When I run this command, I get the following error message:

/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
/tmp/cck3Fl2l.o: In function `libieee_dbl':
/tmp/cck3Fl2l.o(.text+0xf): undefined reference to `__setfpucw'
collect2: ld returned 1 exit status

Can anyone please help me understand what this means, what I'm doing
wrong and how I can get it working?

Thanks,

TONY  


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