Does GCC have an equivalent compiler switch to VC’s floating point model switch (/fp)?
In particular, my application benefits from compiling with /fp:fast and precision is not a big deal, how should I compile it with GCC?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try
-ffast-math. On gcc 4.4.1, this turns on:-fno-math-errno– Don’t set errno for single instruction math functions.-funsafe-math-optimizations– Assume arguments and result of math operations are valid, and potentially violate standards-ffinite-math-only– Assume arguments and results are finite.-fno-rounding-math– Enable optimizations that assume default rounding. This is the default, but it could be overridden by something else.-fno-signaling-nans– Enable optimizations that can change number of math exceptions.; also default-fcx-limited-range– Assume range reduction is not needed for complex number division:__FAST_MATH__macro.You could also enable these individually.