Everything

 

-relaxed_math [V2.00.00 or later]


This option generates a floating-point calculation code with efficiency given precedence over strictness.

[Specification format]

-relaxed_math

 

-

Interpretation when omitted

None

[Detailed description]

-

For floating-point calculations, this option generates a calculation code that is not in strict accordance with the C-language standard or IEEE754, but is efficient with respect to the code size and execution speed.

-

The following options are assumed to be simultaneously specified.

-

-Xuse_fmaf

-

-use_recipf

-

-approximate [V2.02.00 or later]

-

If this option is specified more than once, it has the same meaning as when this option is specified once. No warning is output in this case.

[Remark]

When this option is specified, floating-point calculations are performed in the following manner and sometimes the operation result will differ from that obtained by calculations strictly in accordance with the C-language standard or IEEE754.

-

The meaning of the sign of 0.0 is ignored.

-

Expressions are deformed by using algebraic characteristics, assuming that an exception or precision error is not generated by calculations.

-

It is assumed that a calculation does not result in I/O of a NaN or infinity in a comparison calculation or other calculations.
A program that handles these values might cause an unexpected execution result. Therefore, care must be taken when using this option.

Example:
Generally, if x or y is a NaN, this program does not call function func2.
However, if this option is specified, an efficient codeNote is generated instead of assuming NaN input. As a result, function func2 must be called.

Note

The performance remarkably changes when the -Xfloat=soft option is specified.

 

void func1(double x, double y) {
  if (x < y) {
    func2();
  }
}