Skip to content

Repo sync for protected CLA branch #3545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/assembler/masm/operator-bitwise-and.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
description: "Learn more about: operator &"
title: "operator &"
description: "Learn more about: operator &"
title: "operator &"
ms.date: "12/17/2019"
f1_keywords: ["&", "operator &"]
helpviewer_keywords: ["& operator, syntax", "AND operator", "& operator"]
ms.assetid: f3c51a54-48ba-4b99-afed-5c45177bf694
---
# operator &
# operator `&`

Bitwise **AND**. Used only within [.IF](dot-if.md), [.WHILE](dot-while.md), or [.REPEAT](dot-repeat.md) blocks and evaluated at run time, not at assembly time.

Expand Down
6 changes: 3 additions & 3 deletions docs/assembler/masm/operator-logical-and-masm-run-time.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
description: "Learn more about: operator && (MASM Run Time)"
title: "operator && (MASM Run Time)"
description: "Learn more about: operator && (MASM Run Time)"
title: "operator && (MASM Run Time)"
ms.date: "12/17/2019"
f1_keywords: ["operator &&"]
helpviewer_keywords: ["operator &&", "&& operator"]
ms.assetid: 0a633a40-114c-48f5-88ff-09bc8d9b281a
---
# operator && (MASM Run Time)
# operator `&&` (MASM Run Time)

Logical **AND**. Used only within [.IF](dot-if.md), [.WHILE](dot-while.md), or [.REPEAT](dot-repeat.md) blocks and evaluated at run time, not at assembly time.

Expand Down
4 changes: 2 additions & 2 deletions docs/atl/reference/cadapt-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ T m_T;

This **`public`** data member can be accessed directly or indirectly with [operator const T&](#operator_const_t_amp) and [operator T&](#operator_t_amp).

## <a name="operator_const_t_amp"></a> CAdapt::operator const T&amp;
## <a name="operator_const_t_amp"></a> CAdapt::operator const T&

Returns a **`const`** reference to the [m_T](#m_t) member, allowing the adapter object to be treated as if it were an object of type *T*.

Expand All @@ -104,7 +104,7 @@ operator const T&() const;

A **`const`** reference to `m_T`.

## <a name="operator_t_amp"></a> CAdapt::operator T&amp;
## <a name="operator_t_amp"></a> CAdapt::operator T&

Returns a reference to the [m_T](#m_t) member, allowing the adapter object to be treated as if it were an object of type *T*.

Expand Down
2 changes: 1 addition & 1 deletion docs/atl/reference/ccomptrbase-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ bool operator!() const throw();

Returns true if the `CComHeapPtr` pointer is equal to NULL, false otherwise.

## <a name="operator_amp"></a> CComPtrBase::operator &amp;
## <a name="operator_amp"></a> CComPtrBase::operator &

The & operator.

Expand Down
2 changes: 1 addition & 1 deletion docs/atl/reference/cheapptrbase-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ T* m_pData;

This member variable holds the pointer information.

## <a name="operator_amp"></a> CHeapPtrBase::operator &amp;
## <a name="operator_amp"></a> CHeapPtrBase::operator &

The & operator.

Expand Down
4 changes: 2 additions & 2 deletions docs/atl/reference/cpatht-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ The string to append.

Returns the updated path.

## <a name="operator_const_stringtype_amp"></a> CPathT::operator const StringType &amp;
## <a name="operator_const_stringtype_amp"></a> CPathT::operator const StringType &

This operator allows the object to be treated like a string.

Expand All @@ -622,7 +622,7 @@ operator PCXSTR() const throw();

Returns a string representing the current path managed by this object.

## <a name="operator_stringtype_amp"></a> CPathT::operator StringType &amp;
## <a name="operator_stringtype_amp"></a> CPathT::operator StringType &

This operator allows the object to be treated like a string.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/Fo`](fo-object-file-name.md) | Creates an object file. |
| [`/fp`](fp-specify-floating-point-behavior.md) | Specify floating-point behavior. |
| [`/Fp`](fp-name-dot-pch-file.md) | Specifies a precompiled header file name. |
| [`/fpcvt`](fpcvt.md) | Specify floating-point to unsigned integer conversion behavior. |
| [`/FR`](fr-fr-create-dot-sbr-file.md)<br /><br /> [`/Fr`](fr-fr-create-dot-sbr-file.md) | Generates browser files. **`/Fr`** is deprecated. |
| [`/FS`](fs-force-synchronous-pdb-writes.md) | Forces serialization of all writes to the program database (PDB) file through MSPDBSRV.EXE. |
| [`/fsanitize`](fsanitize.md) | Enables compilation of sanitizer instrumentation such as AddressSanitizer. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/clr`](clr-common-language-runtime-compilation.md) | Produces an output file to run on the common language runtime. |
| [`/EH`](eh-exception-handling-model.md) | Specifies the model of exception handling. |
| [`/fp`](fp-specify-floating-point-behavior.md) | Specifies floating-point behavior. |
| [`/fpcvt`](fpcvt.md) | Specify floating-point to unsigned integer conversion behavior. |
| [`/GA`](ga-optimize-for-windows-application.md) | Optimizes for Windows applications. |
| [`/Gd`](gd-gr-gv-gz-calling-convention.md) | Uses the **`__cdecl`** calling convention. (x86 only) |
| [`/Ge`](ge-enable-stack-probes.md) | Deprecated. Activates stack probes. |
Expand Down
35 changes: 19 additions & 16 deletions docs/build/reference/fp-specify-floating-point-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ f1_keywords: ["VC.Project.VCCLCompilerTool.floatingPointModel", "VC.Project.VCCL
helpviewer_keywords: ["-fp compiler option [C++]", "/fp compiler option [C++]"]
ms.assetid: 10469d6b-e68b-4268-8075-d073f4f5d57e
---
# /fp (Specify floating-point behavior)
# `/fp` (Specify floating-point behavior)

Specifies how the compiler treats floating-point expressions, optimizations, and exceptions. The **/fp** options specify whether the generated code allows floating-point environment changes to the rounding mode, exception masks, and subnormal behavior, and whether floating-point status checks return current, accurate results. It controls whether the compiler generates code that maintains source operation and expression ordering and conforms to the standard for NaN propagation, or if it instead generates more efficient code that may reorder or combine operations and use simplifying algebraic transformations that aren't allowed by the standard.
Specifies how the compiler treats floating-point expressions, optimizations, and exceptions. The **`/fp`** options specify whether the generated code allows floating-point environment changes to the rounding mode, exception masks, and subnormal behavior, and whether floating-point status checks return current, accurate results. It controls whether the compiler generates code that maintains source operation and expression order, and conforms to the standard for NaN propagation. Or, if it instead generates more efficient code that may reorder or combine operations and use simplifying algebraic transformations that aren't allowed by the IEEE-754 standard.

## Syntax

::: moniker range=">msvc-160"
::: moniker range=">=msvc-170"

**`/fp:contract`**\
**`/fp:except`**\[**`-`**]\
Expand All @@ -21,6 +21,7 @@ Specifies how the compiler treats floating-point expressions, optimizations, and
**`/fp:strict`**

::: moniker-end

::: moniker range="<=msvc-160"

**`/fp:except`**\[**`-`**]\
Expand All @@ -32,7 +33,7 @@ Specifies how the compiler treats floating-point expressions, optimizations, and

### Arguments

::: moniker range=">msvc-160"
::: moniker range=">=msvc-170"

#### <a name="contract"></a> `/fp:contract`

Expand All @@ -50,7 +51,7 @@ By default, the compiler uses **`/fp:precise`** behavior.

Under **`/fp:precise`**, the compiler preserves the source expression ordering and rounding properties of floating-point code when it generates and optimizes object code for the target machine. The compiler rounds to source code precision at four specific points during expression evaluation: at assignments, typecasts, when floating-point arguments get passed to a function call, and when a function call returns a floating-point value. Intermediate computations may be performed at machine precision. Typecasts can be used to explicitly round intermediate computations.

::: moniker range=">msvc-160"
::: moniker range=">=msvc-170"

The compiler doesn't perform algebraic transformations on floating-point expressions, such as reassociation or distribution, unless it can guarantee the transformation produces a bitwise identical result. Expressions that involve special values (NaN, +infinity, -infinity, -0.0) are processed according to IEEE-754 specifications. For example, `x != x` evaluates to **`true`** if `x` is NaN. Floating-point contractions aren't generated by default under **`/fp:precise`**. This behavior is new in Visual Studio 2022. Previous compiler versions could generate contractions by default under **`/fp:precise`**.

Expand All @@ -61,7 +62,7 @@ The compiler doesn't perform algebraic transformations on floating-point express

::: moniker-end

The compiler generates code intended to run in the [default floating-point environment](#the-default-floating-point-environment). It also assumes the floating-point environment isn't accessed or modified at runtime. That is, it assumes the code doesn't unmask floating-point exceptions, read or write floating-point status registers, or change rounding modes.
The compiler generates code intended to run in the [default floating-point environment](#the-default-floating-point-environment). It also assumes the floating-point environment isn't accessed or modified at runtime. That is, it assumes the code: leaves floating-point exceptions masked, doesn't read or write floating-point status registers, and doesn't change rounding modes.

If your floating-point code doesn't depend on the order of operations and expressions in your floating-point statements (for example, if you don't care whether `a * b + a * c` is computed as `(b + c) * a` or `2 * a` as `a + a`), consider the [`/fp:fast`](#fast) option, which can produce faster, more efficient code. If your code both depends on the order of operations and expressions, and accesses or alters the floating-point environment (for example, to change rounding modes or to trap floating-point exceptions), use [`/fp:strict`](#strict).

Expand All @@ -77,9 +78,9 @@ Under **`/fp:strict`**, the compiler generates code that allows the program to s

The **`/fp:fast`** option allows the compiler to reorder, combine, or simplify floating-point operations to optimize floating-point code for speed and space. The compiler may omit rounding at assignment statements, typecasts, or function calls. It may reorder operations or make algebraic transforms, for example, by use of associative and distributive laws. It may reorder code even if such transformations result in observably different rounding behavior. Because of this enhanced optimization, the result of some floating-point computations may differ from the ones produced by other **`/fp`** options. Special values (NaN, +infinity, -infinity, -0.0) may not be propagated or behave strictly according to the IEEE-754 standard. Floating-point contractions may be generated under **`/fp:fast`**. The compiler is still bound by the underlying architecture under **`/fp:fast`**, and more optimizations may be available through use of the [`/arch`](arch-minimum-cpu-architecture.md) option.

Under **`/fp:fast`**, the compiler generates code intended to run in the default floating-point environment and assumes the floating-point environment isn't accessed or modified at runtime. That is, it assumes the code doesn't unmask floating-point exceptions, read or write floating-point status registers, or change rounding modes.
Under **`/fp:fast`**, the compiler generates code intended to run in the default floating-point environment and assumes the floating-point environment isn't accessed or modified at runtime. That is, it assumes the code: leaves floating-point exceptions masked, doesn't read or write floating-point status registers, and doesn't change rounding modes.

`/fp:fast` is intended for programs that don't require strict source code ordering and rounding of floating-point expressions, and don't rely on the standard rules for handling special values such as NaN. If your floating-point code requires preservation of source code ordering and rounding, or relies on standard behavior of special values, use [`/fp:precise`](#precise). If your code accesses or modifies the floating-point environment to change rounding modes, unmask floating-point exceptions, or check floating-point status, use [`/fp:strict`](#strict).
**`/fp:fast`** is intended for programs that don't require strict source code ordering and rounding of floating-point expressions, and don't rely on the standard rules for handling special values such as `NaN`. If your floating-point code requires preservation of source code ordering and rounding, or relies on standard behavior of special values, use [`/fp:precise`](#precise). If your code accesses or modifies the floating-point environment to change rounding modes, unmask floating-point exceptions, or check floating-point status, use [`/fp:strict`](#strict).

#### <a name="except"></a> `/fp:except`

Expand All @@ -97,24 +98,26 @@ The [`/Za`](za-ze-disable-language-extensions.md) (ANSI compatibility) option is

The compiler provides three pragma directives to override the floating-point behavior specified on the command line: [`float_control`](../../preprocessor/float-control.md), [`fenv_access`](../../preprocessor/fenv-access.md), and [`fp_contract`](../../preprocessor/fp-contract.md). You can use these directives to control floating-point behavior at function-level, not within a function. These directives don't correspond directly to the **`/fp`** options. This table shows how the **`/fp`** options and pragma directives map to each other. For more information, see the documentation for the individual options and pragma directives.

::: moniker range=">msvc-160"
::: moniker range=">=msvc-170"

| Option | `float_control(precise, *)` | `float_control(except, *)` | `fenv_access(*)` | `fp_contract(*)` |
|--|--|--|--|--|
| `/fp:fast` | `off` | `off` | `off` | `on` |
| `/fp:precise` | `on` | `off` | `off` | `off`\* |
| `/fp:strict` | `on` | `on` | `on` | `off` |
| **`/fp:fast`** | `off` | `off` | `off` | `on` |
| **`/fp:precise`** | `on` | `off` | `off` | `off`\* |
| **`/fp:strict`** | `on` | `on` | `on` | `off` |

\* In versions of Visual Studio before Visual Studio 2022, the **`/fp:precise`** behavior defaulted to `fp_contract(on)`.

::: moniker-end
::: moniker range=">msvc-160"
::: moniker range="<=msvc-160"

| Option | `float_control(precise, *)` | `float_control(except, *)` | `fenv_access(*)` | `fp_contract(*)` |
|--|--|--|--|--|
| `/fp:fast` | `off` | `off` | `off` | `on` |
| `/fp:precise` | `on` | `off` | `off` | `on` |
| `/fp:strict` | `on` | `on` | `on` | `off` |
| **`/fp:fast`** | `off` | `off` | `off` | `on` |
| **`/fp:precise`** | `on` | `off` | `off` | `on`\* |
| **`/fp:strict`** | `on` | `on` | `on` | `off` |

\* In versions of Visual Studio starting with Visual Studio 2022, the **`/fp:precise`** behavior defaults to `fp_contract(off)`.

::: moniker-end

Expand Down
Loading