Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Uncle George <gatgul@voicenet.com>
To: axp-list@redhat.com
Subject: Re: Alpha/Linux FP denormal processing
Date: Wed, 20 Sep 2000 02:53:21 -0500	[thread overview]
Message-ID: <39C86CF1.A65D3819@voicenet.com> (raw)
In-Reply-To: 200009192302.SAA12426@polya.math.purdue.edu

I was thinking more of this:
int main()
{
  double div = 1.0, dis = 2.0;
  start( div, dis );
}

start( double div, double dis )
{
  double x;
  for (x = div; x != 0.0; x /= dis)
    printf("%e\n", x);
}

even with -O2, it fails here.

Brad Lucier wrote:

> >
> > >
> > > -O2 converts the divide by 2 to a multiplication by 0.5, and so
> > > avoids the error.
> >
> > Yes, indeed. Even '-O' is good enough and '-O0' will expose the problem.
> >
> > OTOH compiling anything with gcc and without optimization is a pure
> > masochism and only a check that a code generator indeed does exist;
> > so I did not even considered that somebody may want to use that
> > to compile something for running.
> >
> >   Michal
>
> Huh?  This fails with -O2, too:
>
> popov-325% cat denormtest.c
> #include <stdio.h>
> #include <stdlib.h>
>
> int main(int argc, char **argv)
> {
>   double x = 1.0;
>   double y;
>   y = atof(argv[1]);
>   for (x = 1.0; x != 0.0; x /= y)
>     printf("%e\n", x);
>   return 0;
> }
> popov-326% gcc -O2 -Wall -o denormtest denormtest.c
> popov-327% ./denormtest 2.0 | tail
> 1.139238e-305
> 5.696189e-306
> 2.848095e-306
> 1.424047e-306
> 7.120236e-307
> 3.560118e-307
> 1.780059e-307
> 8.900295e-308
> 4.450148e-308
> 2.225074e-308
>
> Brad Lucier
>
> _______________________________________________
> Axp-list mailing list
> Axp-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/axp-list






  parent reply	other threads:[~2000-09-20  8:04 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-16 23:58 OT: gcc on DU5 Larry Snyder
2000-09-17  1:15 ` Peter Petrakis
2000-09-17 17:26   ` J Bacher
2000-09-18  3:29 ` Peter Rival
2000-09-17 16:21   ` Larry Snyder
2000-09-17 23:15   ` Richard Henderson
2000-09-19  0:59     ` Alpha/Linux FP denormal processing Uncle George
2000-09-19  1:54       ` Brad Lucier
2000-09-19  9:29         ` Uncle George
2000-09-19 13:03           ` Greg Lindahl
2000-09-19 16:48             ` Richard Henderson
2000-09-19 14:16           ` Brad Lucier
2000-09-19 14:31             ` Uncle George
2000-09-19 16:25               ` Michal Jaegermann
2000-09-19 17:27                 ` Jeff Sturm
2000-09-19 17:43                   ` Michal Jaegermann
2000-09-19 19:10                     ` Uncle George
2000-09-19 19:30                       ` Michal Jaegermann
2000-09-19 19:46                         ` Brad Lucier
2000-09-19 20:03                           ` Uncle George
2000-09-19 20:16                             ` Brad Lucier
2000-09-19 21:09                               ` Michal Jaegermann
2000-09-19 21:48                                 ` Brad Lucier
2000-09-19 22:41                                   ` Uncle George
2000-09-20  7:00                                   ` Christian Iseli
2000-09-19 22:09                                 ` Brad Lucier
2000-09-19 22:42                                   ` Michal Jaegermann
2000-09-19 23:02                                     ` Brad Lucier
2000-09-19 23:55                                       ` Michal Jaegermann
2000-09-20  1:39                                         ` W Bauske
2000-09-20  8:24                                           ` Helge Kreutzmann
2000-09-20  0:12                                       ` Brad Lucier
2000-09-20  7:53                                       ` Uncle George [this message]
2000-09-19 20:33                           ` Michal Jaegermann
2000-09-19 16:52               ` Richard Henderson
2000-09-20  2:23                 ` Richard Henderson
2000-09-20  3:58                   ` David S. Miller
2000-09-21 21:17                     ` Richard Henderson
2000-09-21 21:50                       ` David S. Miller
2000-09-22  2:25                         ` Did MySQL ever get the port completed? Rich Peters
2000-09-22  5:27                           ` Rich Peters
2000-09-22  5:27                         ` Rich Peters
2000-09-19 12:10       ` Alpha/Linux FP denormal processing Jeff Sturm
  -- strict thread matches above, loose matches on Subject: below --
2000-09-19 21:26 Arkadiy Chapkis - Arc
2000-09-19 23:06 ` Uncle George
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox