This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -mfpmath=387 flag does not prevent gcc from using SSE/SSE2 instructions
- From: Jan Hubicka <jh at suse dot cz>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: Andrew Derrick Balsa <andrebalsa at mailingaddress dot org>,gcc-bugs at gcc dot gnu dot org, Andi Kleen <ak at suse dot de>,Jan Hubicka <jh at suse dot cz>
- Date: Fri, 2 May 2003 12:23:38 +0200
- Subject: Re: -mfpmath=387 flag does not prevent gcc from using SSE/SSE2 instructions
- References: <200305020714.50606.andrebalsa@mailingaddress.org> <u88ytq0wh1.fsf@gromit.moeb>
> Andrew Derrick Balsa <andrebalsa@mailingaddress.org> writes:
>
> > Hi,
> >
> > gcc-3.2.3, glibc 2.3.1, binutils 2.13.2.1, target is x86_64
> >
> > Even with -mfpmath=387 flag, compiler generates CVTSI2SD_VsdEd (SSE2
> > instruction), probably while compiling the following source:
> >
> > ...
> > printf("%-20s %9ld %9ld %9ld %3ld%% %s\n",
> > device,
> > (long) (s.f_blocks * (s.f_bsize /
> > (double)KILOBYTE)),
> > (long) ((s.f_blocks -
> > s.f_bfree)*(s.f_bsize/(double)KILOBYT
> > (long) (s.f_bavail * (s.f_bsize /
> > (double)KILOBYTE)),
> > blocks_percent_used, mount_point);
> > ...
> >
> > I thought the behaviour would be not to generate any SSE/SSE2 instruction with
> > this flag. Am I wrong, or could this be a (small) bug?
>
> I think -mfpmath should be disabled on x86-64. Honza, what do you
> think? You would break the ABI otherwise,
It is same as to 386. -mfpmath=387 breaks rounding mandated by 386 abi,
-mfpmath=sse breaks rounding mandated by SSE abi.
Still there is some code that executes fater when compiled for 387, so I
would keep that option as working...
Honza
>
> Andreas
> --
> Andreas Jaeger
> SuSE Labs aj@suse.de
> private aj@arthur.inka.de
> http://www.suse.de/~aj