Re: GCC's -ffast-math behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



xunxun <xunxun1982@xxxxxxxxx> writes:
> And I think it's related with -funsafe-math-optimizations
>
> If I only use the option, gcc also don't generate the symbol
>
> The fastmath other option
>
>  -fno-math-errno, -ffinite-math-only, -fno-rounding-math,
> -fno-signaling-nans, and -fcx-limited-range
>
> don't have the effect.

I presume you're compiling for i386 32-bit, which defaults to using
the legacy 387 FP unit?

If you switch to using SSE floating-point, e.g. using "-mfpmath=sse",
it will still call the library functions even when using -ffast-math
(because the SSE unit doesn't have special instructions like "fsin" or
"f2xm1").  I think SSE FP is typically faster than the 387 for many
CPUs anyway.

[If you compile for the x86_64 arch, it will default to using SSE FP.]

-miles

-- 
Guilt, n. The condition of one who is known to have committed an indiscretion,
as distinguished from the state of him who has covered his tracks.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux