This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: mul + div with 64 bit signed ints on IA32
- To: "Jan Hubicka" <jh at suse dot cz>
- Subject: Re: mul + div with 64 bit signed ints on IA32
- From: "Tim Prince" <tprince at computer dot org>
- Date: Wed, 5 Sep 2001 05:49:15 -0700
- Cc: "Frank Klemm" <pfk at fuchs dot offl dot uni-jena dot de>, "Jan Hubicka" <jh at suse dot cz>, <gcc at gcc dot gnu dot org>
- References: <20010827004731.G2544@fuchs.offl.uni-jena.de> <20010827121624.D8568@atrey.karlin.mff.cuni.cz> <20010827143032.C636@fuchs.offl.uni-jena.de> <20010827173025.F11402@atrey.karlin.mff.cuni.cz> <20010901202854.A7713@fuchs.offl.uni-jena.de> <20010902000000.C27182@atrey.karlin.mff.cuni.cz> <20010902024104.F7713@fuchs.offl.uni-jena.de> <20010903171717.E13574@atrey.karlin.mff.cuni.cz> <20010904215156.C438@fuchs.offl.uni-jena.de> <007001c1358e$6f53b6f0$7edd18ac@amr.corp.intel.com> <20010905134405.G15564@atrey.karlin.mff.cuni.cz>
----- Original Message -----
From: "Jan Hubicka" <jh@suse.cz>
To: "Tim Prince" <tprince@computer.org>
Cc: "Frank Klemm" <pfk@fuchs.offl.uni-jena.de>; "Jan Hubicka"
<jh@suse.cz>; <gcc@gcc.gnu.org>
Sent: Wednesday, September 05, 2001 4:44 AM
Subject: Re: mul + div with 64 bit signed ints on IA32
> > > Option proposals:
> > >
> > > -fsaverc
> > > -ffastrc
> > > -fsavecld ; the same for the cld flag
> > > -ffastcld
> > >
> > glibc includes implementations of lrint() and the like. I'd
like
> > to see something like -ffast-rint to support g77 (Fortran
> > spelling -ffast-nint), which has a precedent in the MipsPro
> > compilers. That only modifies the code to accept IEEE style
> > round-to-nearest in place of Fortran style round-to-nearest.
>
> This appears to be requested commonly enought and make perfect
sense for 3d
> software, where converison to integer is perofrmance cirtical
and IEEE
> behaviour secondary. With my new 3.1 mode switching
implementation it can be
> easy to make gcc expect "round towards zero" CW setting, so I
can implement it.
>
> Insead of -ffast-rint, I think we can name
it -mround-towards-zero, as it
> will make user to more think what the switch actually does.
> When compiling it can make fast fp->int converison to be
generated and we
> can manage spec file to link in an library to actually set the
switch,
> as we do on other platforms for -ffast-math.
>
> Sounds sensible?
>
> Honza
> >
My personal belief is that code should be using the C99 or f77
round-to-nearest functions where they are wanted or at least
acceptable, and that compilers should provide means for in-line
compilation of such round-to-nearest operations. I don't find
the Intel compiler option which substitutes round-to-nearest for
all (int) casts so suitable. Evidently, others differ with me.
These problems with performance of (int) casts have received
enough attention lately, that future CPU families are likely to
take care of them with hardware instructions.