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
* [Bug target/14850] -ffloat-store and -mieee-fp aren't doing what I assume they should do
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 ` 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
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-05 11:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-05 11:24 -------
If you have a pentium4 or higher (including amd64), you can use the following options: "-mfpmath=sse
-msse -msse2".
The other thing you can do is manually change the rounding mode which I assume is what the option
passed to ICC does.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14850
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/14850] -ffloat-store and -mieee-fp aren't doing what I assume they should do
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
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-07 3:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-07 03:36 -------
Actually they are documented as what they do. What you need to do is to change the
FPU's internal precission to 64bit from the defualt of 80bits.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14850
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/14850] -ffloat-store and -mieee-fp aren't doing what I assume they should do
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
2 siblings, 0 replies; 4+ messages in thread
From: gonnetp at inf dot ethz dot ch @ 2004-04-07 9:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gonnetp at inf dot ethz dot ch 2004-04-07 09:11 -------
Subject: Re: -ffloat-store and -mieee-fp aren't doing
what I assume they should do
Hmm... Do you know how to do this?
Is there a way of submitting this as a feature request (i.e. for an
icc-like command line option)? The problem is that adding any special
library calls to set the FPU precision will mess-up portability :(
Cheers and many thanks,
Pedro
On Wed, 2004-04-07 at 04:36, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-07 03:36 -------
> Actually they are documented as what they do. What you need to do is to change the
> FPU's internal precission to 64bit from the defualt of 80bits.
--
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).