diff --git a/docs/LangRef.html b/docs/LangRef.html index cfc1c7d298b..fc202b7f8fc 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -55,6 +55,7 @@
  • Volatile Memory Accesses
  • Memory Model for Concurrent Operations
  • Atomic Memory Ordering Constraints
  • +
  • Fast-Math Flags
  • Type System @@ -1751,6 +1752,54 @@ in signal handlers).

    + +

    + Fast-Math Flags +

    + +
    + +

    LLVM IR floating-point binary ops (fadd, +fsub, fmul, fdiv, +frem) instructions have the following flags +that can set to enable otherwise unsafe floating point operations

    + +
    nnan
    +
    + No NaNs - Allow optimizations to assume the arguments and result are not +NaN. Such optimizations are required to retain defined behavior over NaNs, but +the value of the result is undefined. +
    + +
    ninf
    +
    + No Infs - Allow optimizations to assume the arguments and result are not ++/-Inf. Such optimizations are required to retain defined behavior over +/-Inf, +but the value of the result is undefined. +
    + +
    nsz
    +
    + No Signed Zeros - Allow optimizations to treat the sign of a zero argument or +result as insignificant. +
    + +
    arcp
    +
    + Allow Reciprocal - Allow optimizations to use the reciprocal of an argument +rather than perform division. +
    + +
    fast +
    + Fast - Allow algebraically equivalent transformations that may dramatically +change results in floating point (e.g. reassociate). This flag implies all the +others. +
    + +
    + @@ -3982,28 +4031,10 @@ IfUnequal: floating point values. Both arguments must have identical types.

    Semantics:
    -

    The value produced is the floating point sum of the two operands. This - instruction can also take any number of fast-math flags, which are - optimization hints to enable otherwise unsafe floating point - optimizations:

    -
      - -
    1. nnan: No NaNs - Allow optimizations to assume the arguments and - result are not NaN. Such optimizations are required to retain defined behavior - over NaNs, but the value of the result is undefined.
    2. - -
    3. ninf: No Inf - Allow optimizations to assume the arguments and - result are not +/-Inf. Such optimizations are required to retain defined - behavior over +/-Inf, but the value of the result is undefined.
    4. - -
    5. nsz: No Signed Zeros: Allow optimizations to treat the - sign of a zero argument or result as insignificant.
    6. - -
    7. fast: Allow algebraically equivalent transformations that may - dramatically change results in floating point (e.g. reassociate). This flag - implies all the others.
    8. - -
    +

    The value produced is the floating point sum of the two operands. This + instruction can also take any number of fast-math + flags, which are optimization hints to enable otherwise unsafe floating + point optimizations:

    Example:
    @@ -4090,28 +4121,10 @@ IfUnequal:
        floating point values.  Both arguments must have identical types.

    Semantics:
    -

    The value produced is the floating point difference of the two operands. This - instruction can also take any number of fast-math flags, which are - optimization hints to enable otherwise unsafe floating point - optimizations:

    -
      - -
    1. nnan: No NaNs - Allow optimizations to assume the arguments and - result are not NaN. Such optimizations are required to retain defined behavior - over NaNs, but the value of the result is undefined.
    2. - -
    3. ninf: No Inf - Allow optimizations to assume the arguments and - result are not +/-Inf. Such optimizations are required to retain defined - behavior over +/-Inf, but the value of the result is undefined.
    4. - -
    5. nsz: No Signed Zeros: Allow optimizations to treat the - sign of a zero argument or result as insignificant.
    6. - -
    7. fast: Allow algebraically equivalent transformations that may - dramatically change results in floating point (e.g. reassociate). This flag - implies all the others.
    8. - -
    +

    The value produced is the floating point difference of the two operands. + This instruction can also take any number of fast-math + flags, which are optimization hints to enable otherwise unsafe floating + point optimizations:

    Example:
    @@ -4192,28 +4205,10 @@ IfUnequal:
        floating point values.  Both arguments must have identical types.

    Semantics:
    -

    The value produced is the floating point product of the two operands. This - instruction can also take any number of fast-math flags, which are - optimization hints to enable otherwise unsafe floating point - optimizations:

    -
      - -
    1. nnan: No NaNs - Allow optimizations to assume the arguments and - result are not NaN. Such optimizations are required to retain defined behavior - over NaNs, but the value of the result is undefined.
    2. - -
    3. ninf: No Inf - Allow optimizations to assume the arguments and - result are not +/-Inf. Such optimizations are required to retain defined - behavior over +/-Inf, but the value of the result is undefined.
    4. - -
    5. nsz: No Signed Zeros: Allow optimizations to treat the - sign of a zero argument or result as insignificant.
    6. - -
    7. fast: Allow algebraically equivalent transformations that may - dramatically change results in floating point (e.g. reassociate). This flag - implies all the others.
    8. - -
    +

    The value produced is the floating point product of the two operands. This + instruction can also take any number of fast-math + flags, which are optimization hints to enable otherwise unsafe floating + point optimizations:

    Example:
    @@ -4327,31 +4322,10 @@ IfUnequal:
        floating point values.  Both arguments must have identical types.

    Semantics:
    -

    The value produced is the floating point quotient of the two operands. This - instruction can also take any number of fast-math flags, which are - optimization hints to enable otherwise unsafe floating point - optimizations:

    -
      - -
    1. nnan: No NaNs - Allow optimizations to assume the arguments and - result are not NaN. Such optimizations are required to retain defined behavior - over NaNs, but the value of the result is undefined.
    2. - -
    3. ninf: No Inf - Allow optimizations to assume the arguments and - result are not +/-Inf. Such optimizations are required to retain defined - behavior over +/-Inf, but the value of the result is undefined.
    4. - -
    5. nsz: No Signed Zeros: Allow optimizations to treat the - sign of a zero argument or result as insignificant.
    6. - -
    7. arcp: Allow Reciprocal: Allow optimizations to use the reciprocal - of an argument rather than perform division.
    8. - -
    9. fast: Allow algebraically equivalent transformations that may - dramatically change results in floating point (e.g. reassociate). This flag - implies all the others.
    10. - -
    +

    The value produced is the floating point quotient of the two operands. This + instruction can also take any number of fast-math + flags, which are optimization hints to enable otherwise unsafe floating + point optimizations:

    Example:
    @@ -4474,30 +4448,8 @@ IfUnequal:
    Semantics:

    This instruction returns the remainder of a division. The remainder has the same sign as the dividend. This instruction can also take any number - of fast-math flags, which are optimization hints to enable otherwise unsafe - floating point optimizations:

    - -
      - -
    1. nnan: No NaNs - Allow optimizations to assume the arguments and - result are not NaN. Such optimizations are required to retain defined behavior - over NaNs, but the value of the result is undefined.
    2. - -
    3. ninf: No Inf - Allow optimizations to assume the arguments and - result are not +/-Inf. Such optimizations are required to retain defined - behavior over +/-Inf, but the value of the result is undefined.
    4. - -
    5. nsz: No Signed Zeros: Allow optimizations to treat the - sign of a zero argument or result as insignificant.
    6. - -
    7. arcp: Allow Reciprocal: Allow optimizations to use the reciprocal - of an argument rather than perform division.
    8. - -
    9. fast: Allow algebraically equivalent transformations that may - dramatically change results in floating point (e.g. reassociate). This flag - implies all the others.
    10. - -
    + of fast-math flags, which are optimization hints to + enable otherwise unsafe floating point optimizations:

    Example: