This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -mfpmath=387 flag does not prevent gcc from using SSE/SSE2 instructions


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]