public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/14850] New: -ffloat-store and -mieee-fp aren't doing what I assume they should do
@ 2004-04-05 11:11 gonnetp at inf dot ethz dot ch
  2004-04-05 11:24 ` [Bug target/14850] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gonnetp at inf dot ethz dot ch @ 2004-04-05 11:11 UTC (permalink / raw)
  To: gcc-bugs

I am trying to compute the IEEE-754 unit of least precision (ulp) for 64-bit
double precision numbers on an IA-32 machine with the following C-code:

    int main ( int argc , char *argv ) {

        double d, eps;

        printf("Unit of Least Precision:\n");
        d = 1.0; eps = 0.5;
        while (1.0 + eps/2 > 1.0)
            eps /= 2;
        printf("ulp = %20.16e\n\n",eps);

        }

Compiling with gcc-3.3.1 using

    gcc -O0 -ffloat-store -mieee-fp ieee.c

I get the output

    Unit of Least Precision:
    ulp = 1.0842021724855044e-19

meaning that my program is using the extra bits despite the "-ffloat-store" and
"-mieee-fp" options. Is this correct?

Using the Intel C Compiler v. 7.1 and compiling with

    icc -pc64 -O0 ieee.c

I get the correct result

    Unit of Least Precision:
    ulp = 2.2204460492503131e-16

Is there an option to gcc that forces the use of IEEE-754 64-bit operations as
in the Intel compiler? If not, is there any way to set this behaviour by hand?

Cheers and thanks
Pedro

-- 
           Summary: -ffloat-store and -mieee-fp aren't doing what I assume
                    they should do
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gonnetp at inf dot ethz dot ch
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14850


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-04-07  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-05 11:11 [Bug target/14850] New: -ffloat-store and -mieee-fp aren't doing what I assume they should do gonnetp at inf dot ethz dot ch
2004-04-05 11:24 ` [Bug target/14850] " pinskia at gcc dot gnu dot org
2004-04-07  3:36 ` pinskia at gcc dot gnu dot org
2004-04-07  9:11 ` gonnetp at inf dot ethz dot ch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).