[PATCH] D12633: Implement ACLE 2.0 macros of chapters 6.6 and 6.7 for [ARM] and [Aarch64] targets

Alexandros Lamprineas via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 22 05:53:20 PDT 2015

labrinea added a comment.

GCC online docs <https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Optimize-Options.html>  state:

> -ffast-math

>  Might allow some programs designed to not be too dependent on IEEE behavior for floating-point to run faster, or die trying. Sets -funsafe-math-optimizations, -ffinite-math-only, and -fno-trapping-math.


> -funsafe-math-optimizations

>  Allow optimizations that may be give incorrect results for certain IEEE inputs.


> -ffinite-math-only

> Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs.


> -fno-trapping-math

>  Allow the compiler to assume that floating-point arithmetic will not generate traps on any inputs. This is useful, for example, when running a program using IEEE "non-stop" floating-point arithmetic.

Does this mean, define _ARM_FP_FAST when all these three flags are set (-funsafe-math-optimizations, -ffinite-math-only, and -fno-trapping-math)? We are currently checking ("-ffast-math" or "-ffinite-math-only").

ACLE docs state:

> __ARM_FP_FAST is defined to 1 if floating-point optimizations may occur such that the computed results are different from those prescribed by the order of operations according to the C standard. Examples of such optimizations would be reassociation of expressions to reduce depth, and replacement of a division by constant with multiplication by its reciprocal.


More information about the cfe-commits mailing list