Skip to content

Commit 4517932

Browse files
author
JiayueHu
authored
Merge pull request MicrosoftDocs#2380 from MicrosoftDocs/master
10/2 publishing
2 parents a361362 + d02226c commit 4517932

17 files changed

+150
-106
lines changed

docs/build/cmake-projects-in-visual-studio.md

Lines changed: 23 additions & 45 deletions
Large diffs are not rendered by default.

docs/build/reference/analyze-code-analysis.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "/analyze (Code Analysis)"
3-
ms.date: "04/26/2018"
3+
ms.date: "10/01/2019"
44
f1_keywords: ["VC.Project.VCCLCompilerTool.EnablePREfast", "/analyze", "VC.Project.VCCLCompilerTool.PREfastAdditionalOptions", "VC.Project.VCCLCompilerTool.PREfastAdditionalPlugins"]
55
helpviewer_keywords: ["/analyze compiler option [C++]", "-analyze compiler option [C++]", "analyze compiler option [C++]"]
66
ms.assetid: 81da536a-e030-4bd4-be18-383927597d08
@@ -30,7 +30,7 @@ Detailed analyzer results are written as XML to the file that is specified by `f
3030
Turns off analyzer output to the **Output** window.
3131

3232
/analyze:stacksize `number`
33-
The `number` parameter that is used with this option specifies the size, in bytes, of the stack frame for which warning [C6262](/visualstudio/code-quality/c6262) is generated. If this parameter is not specified, the stack frame size is 16KB by default.
33+
The `number` parameter that is used with this option specifies the size, in bytes, of the stack frame for which warning [C6262](/visualstudio/code-quality/c6262) is generated. The space before `number` is optional. If this parameter is not specified, the stack frame size is 16KB by default.
3434

3535
/analyze:max_paths `number`
3636
The `number` parameter that is used with this option specifies the maximum number of code paths to be analyzed. If this parameter is not specified, the number is 256 by default. Larger values perform more thorough checking, but the analysis might take longer.

docs/build/reference/arch-x64.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "/arch (x64)"
3-
ms.date: "11/04/2016"
3+
ms.date: "10/01/2019"
44
ms.assetid: ecda22bf-5bed-43f4-99fb-88aedd83d9d8
55
---
66
# /arch (x64)
@@ -10,7 +10,7 @@ Specifies the architecture for code generation on x64. Also see [/arch (x86)](ar
1010
## Syntax
1111

1212
```
13-
/arch:[AVX|AVX2]
13+
/arch:[AVX|AVX2|AVX512]
1414
```
1515

1616
## Arguments
@@ -21,21 +21,38 @@ Enables the use of Intel Advanced Vector Extensions instructions.
2121
**/arch:AVX2**<br/>
2222
Enables the use of Intel Advanced Vector Extensions 2 instructions.
2323

24+
**/arch:AVX512**<br/>
25+
Enables the use of Intel Advanced Vector Extensions 512 instructions.
26+
2427
## Remarks
2528

29+
The **/arch** option enables the use of certain instruction set extensions, particularly for vector calculation, available in processors from Intel and AMD. In general, more recently introduced processors may support additional extensions over those supported by older processors, although you should consult the documentation for a particular processor or test for instruction set extension support using [__cpuid](../../intrinsics/cpuid-cpuidex.md) before executing code using an instruction set extension.
30+
2631
**/arch** only affects code generation for native functions. When you use [/clr](clr-common-language-runtime-compilation.md) to compile, **/arch** has no effect on code generation for managed functions.
2732

28-
The `__AVX__` preprocessor symbol is defined when the **/arch:AVX** compiler option is specified. The `__AVX2__` preprocessor symbol is defined when the **/arch:AVX2** compiler option is specified. For more information, see [Predefined Macros](../../preprocessor/predefined-macros.md). The **/arch:AVX2** option was introduced in Visual Studio 2013 Update 2, version 12.0.34567.1.
33+
The processor extensions have the following characteristics:
34+
35+
- The default mode uses SSE2 instructions for scalar floating-point and vector calculations. These instructions allow calculation with 128-bit vectors of single-precision, double-precision and 1, 2, 4 or 8 byte integer values, as well as single-precision and double-precision scalar floating-point values.
36+
37+
- **AVX** introduced an alternative instruction encoding for vector and floating-point scalar instructions that allows vectors of either 128 bits or 256 bits, and zero-extends all vector results to the full vector size. (For legacy compatibility, SSE-style vector instructions preserve all bits beyond bit 127.) Most floating-point operations are extended to 256 bits.
38+
39+
- **AVX2** extends most integer operations to 256-bit vectors and enables use of Fused Multiply-Add (FMA) instructions.
40+
41+
- **AVX-512** introduced another instruction encoding form that allows 512-bit vectors, plus certain other optional features. Instructions for additional operations were also added.
42+
43+
Each **/arch** option may also enable the use of other non-vector instructions that are associated with that option. An example is the use of certain BMI instructions when **/arch:AVX2** is specified.
44+
45+
The `__AVX__` preprocessor symbol is defined when the **/arch:AVX**, **/arch:AVX2** or **/arch:AVX512** compiler option is specified. The `__AVX2__` preprocessor symbol is defined when the **/arch:AVX2** or **/arch:AVX512** compiler option is specified. The `__AVX512F__`, `__AVX512CD__`, `__AVX512BW__`, `__AVX512DQ__` and `__AVX512VL__` preprocessor symbols are defined when the **/arch:AVX512** compiler option is specified. For more information, see [Predefined Macros](../../preprocessor/predefined-macros.md). The **/arch:AVX2** option was introduced in Visual Studio 2013 Update 2, version 12.0.34567.1. Limited support for **/arch:AVX512** was added in Visual Studio 2017, and expanded in Visual Studio 2019.
2946

30-
### To set the /arch:AVX or /arch:AVX2 compiler option in Visual Studio
47+
### To set the /arch:AVX, /arch:AVX2 or /arch:AVX512 compiler option in Visual Studio
3148

3249
1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
3350

3451
1. Select the **Configuration Properties**, **C/C++** folder.
3552

3653
1. Select the **Code Generation** property page.
3754

38-
1. In the **Enable Enhanced Instruction Set** drop-down box, choose **Advanced Vector Extensions (/arch:AVX)** or **Advanced Vector Extensions 2 (/arch:AVX2)**.
55+
1. In the **Enable Enhanced Instruction Set** drop-down box, choose **Advanced Vector Extensions (/arch:AVX)**, **Advanced Vector Extensions 2 (/arch:AVX2)** or **Advanced Vector Extensions 512 (/arch:AVX512)**.
3956

4057
### To set this compiler option programmatically
4158

docs/build/reference/arch-x86.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "/arch (x86)"
3-
ms.date: "11/04/2016"
3+
ms.date: "10/01/2019"
44
ms.assetid: 9dd5a75d-06e4-4674-aade-33228486078d
55
---
66
# /arch (x86)
@@ -10,7 +10,7 @@ Specifies the architecture for code generation on x86. Also see [/arch (x64)](ar
1010
## Syntax
1111

1212
```
13-
/arch:[IA32|SSE|SSE2|AVX|AVX2]
13+
/arch:[IA32|SSE|SSE2|AVX|AVX2|AVX512]
1414
```
1515

1616
## Arguments
@@ -30,35 +30,62 @@ Enables the use of Intel Advanced Vector Extensions instructions.
3030
**/arch:AVX2**<br/>
3131
Enables the use of Intel Advanced Vector Extensions 2 instructions.
3232

33+
**/arch:AVX512**<br/>
34+
Enables the use of Intel Advanced Vector Extensions 512 instructions.
35+
3336
## Remarks
3437

35-
The SSE and SSE2 instructions exist on various Intel and AMD processors. The AVX instructions exist on Intel Sandy Bridge processors and AMD Bulldozer processors. AVX2 instructions are supported by Intel Haswell and Broadwell processors and AMD Excavator-based processors.
38+
The **/arch** option enables or disables the use of certain instruction set extensions, particularly for vector calculation, available in processors from Intel and AMD. In general, more recently introduced processors may support additional extensions over those supported by older processors, although you should consult the documentation for a particular processor or test for instruction set extension support using [__cpuid](../../intrinsics/cpuid-cpuidex.md) before executing code using an instruction set extension.
39+
40+
**/arch** only affects code generation for native functions. When you use [/clr](clr-common-language-runtime-compilation.md) to compile, **/arch** has no effect on code generation for managed functions.
3641

37-
The `_M_IX86_FP`, `__AVX__` and `__AVX2__` macros indicate which, if any, **/arch** compiler option was used. For more information, see [Predefined Macros](../../preprocessor/predefined-macros.md). The **/arch:AVX2** option and `__AVX2__` macro were introduced in Visual Studio 2013 Update 2, version 12.0.34567.1.
42+
The **/arch** options refer to instruction set extensions with the following characteristics:
3843

39-
The optimizer chooses when and how to use the SSE and SSE2 instructions when **/arch** is specified. It uses SSE and SSE2 instructions for some scalar floating-point computations when it determines that it is faster to use the SSE/SSE2 instructions and registers instead of the x87 floating-point register stack. As a result, your code may actually use a mixture of both x87 and SSE/SSE2 for floating-point computations. Also, with **/arch:SSE2**, SSE2 instructions can be used for some 64-bit integer operations.
44+
- **IA32** is the legacy 32-bit x86 instruction set without any vector operations and using x87 for floating-point calculations.
4045

41-
In addition to using the SSE and SSE2 instructions, the compiler also uses other instructions that are present on the processor revisions that support SSE and SSE2. An example is the CMOV instruction that first appeared on the Pentium Pro revision of the Intel processors.
46+
- **SSE** allows calculation with vectors of up to four single-precision floating-point values. Corresponding scalar floating-point instructions were added as well.
4247

43-
Because the x86 compiler generates code that uses SSE2 instructions by default, you must specify **/arch:IA32** to disable generation of SSE and SSE2 instructions for x86 processors.
48+
- **SSE2** allows calculation with 128-bit vectors of single-precision, double-precision and 1, 2, 4 or 8 byte integer values. Double-precision scalar instructions were also added.
4449

45-
**/arch** only affects code generation for native functions. When you use [/clr](clr-common-language-runtime-compilation.md) to compile, **/arch** has no effect on code generation for managed functions.
50+
- **AVX** introduced an alternative instruction encoding for vector and floating-point scalar instructions that allows vectors of either 128 bits or 256 bits, and zero-extends all vector results to the full vector size. (For legacy compatibility, SSE-style vector instructions preserve all bits beyond bit 127.) Most floating-point operations are extended to 256 bits.
51+
52+
- **AVX2** extends most integer operations to 256-bit vectors, and enables use of Fused Multiply-Add (FMA) instructions.
53+
54+
- **AVX512** introduced another instruction encoding form that allows 512-bit vectors, plus certain other optional features. Instructions for additional operations were also added.
55+
56+
The optimizer chooses when and how to use vector instructions depending on which **/arch** is specified. Scalar floating-point computations are performed with SSE or AVX instructions when available. Some calling conventions specify passing floating-point arguments on the x87 stack, and as a result, your code may use a mixture of both x87 and SSE/AVX instructions for floating-point computations. Integer vector instructions can also be used for some 64-bit integer operations when available.
4657

47-
**/arch** and [/QIfist](qifist-suppress-ftol.md) cannot be used on the same compiland. In particular, if you do not use `_controlfp` to modify the FP control word, then the run-time startup code sets the x87 FPU control word precision-control field to 53-bits. Therefore, every float and double operation in an expression uses a 53-bit significand and a 15-bit exponent. However, every SSE single-precision operation uses a 24-bit significand and an 8-bit exponent, and SSE2 double-precision operations use a 53-bit significand and an 11-bit exponent. For more information, see [_control87, _controlfp, \__control87_2](../../c-runtime-library/reference/control87-controlfp-control87-2.md). These differences are possible in one expression tree, but not in cases where a user assignment is involved after each subexpression. Consider the following:
58+
In addition to the vector and floating-point scalar instructions, each **/arch** option may also enable the use of other non-vector instructions that are associated with that option. An example is the CMOVcc instruction family that first appeared on the Intel Pentium Pro processors. Because SSE instructions were introduced with the subsequent Intel Pentium III processor, CMOVcc instructions may be generated except when **/arch:IA32** is specified.
59+
60+
Floating-point operations are normally rounded to double-precision (64-bit) in x87 code, but you can use `_controlfp` to modify the FP control word, including setting the precision control to extended precision (80-bit) or single-precision (32-bit). For more information, see [_control87, _controlfp, \__control87_2](../../c-runtime-library/reference/control87-controlfp-control87-2.md). SSE and AVX have separate single-precision and double-precision instructions for each operation, so there is no equivalent for SSE/AVX code. This can change how results are rounded when the result of a floating-point operation is used directly in further calculation instead of assigning it to a user variable. Consider the following:
4861

4962
```cpp
5063
r = f1 * f2 + d; // Different results are possible on SSE/SSE2.
5164
```
5265

53-
Compare:
66+
With explicit assignment:
5467

5568
```cpp
5669
t = f1 * f2; // Do f1 * f2, round to the type of t.
5770
r = t + d; // This should produce the same overall result
5871
// whether x87 stack is used or SSE/SSE2 is used.
5972
```
6073

61-
### To set this compiler option for AVX, AVX2, IA32, SSE, or SSE2 in Visual Studio
74+
**/arch** and [/QIfist](qifist-suppress-ftol.md) cannot be used on the same compiland. The **/QIfist** option changes the rounding behavior of floating-point to integer conversion. The default behavior is to truncate (round toward zero), whereas the **/QIfist** option specifies use of the floating-point environment rounding mode. Because this changes the behavior of all floating-point to integer conversions, this flag has been deprecated. When compiling for SSE or AVX you can round a floating-point value to an integer using the floating-point environment rounding mode by using an intrinsic function sequence:
75+
76+
```cpp
77+
int convert_float_to_int(float x) {
78+
return _mm_cvtss_si32(_mm_set_ss(x));
79+
}
80+
81+
int convert_double_to_int(double x) {
82+
return _mm_cvtsd_si32(_mm_set_sd(x));
83+
}
84+
```
85+
86+
The `_M_IX86_FP`, `__AVX__`, `__AVX2__`, `__AVX512F__`, `__AVX512CD__`, `__AVX512BW__`, `__AVX512DQ__` and `__AVX512VL__` macros indicate which, if any, **/arch** compiler option was used. For more information, see [Predefined Macros](../../preprocessor/predefined-macros.md). The **/arch:AVX2** option and `__AVX2__` macro were introduced in Visual Studio 2013 Update 2, version 12.0.34567.1. Limited support for **/arch:AVX512** was added in Visual Studio 2017, and expanded in Visual Studio 2019.
87+
88+
### To set this compiler option for AVX, AVX2, AVX512, IA32, SSE, or SSE2 in Visual Studio
6289
6390
1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
6491

docs/cppcx/platform-collections-map-class.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: "Platform::Collections::Map Class"
3-
ms.date: "03/27/2019"
3+
ms.date: "10/01/2019"
44
ms.topic: "reference"
55
f1_keywords: ["COLLECTION/Platform::Collections::Map::Map", "COLLECTION/Platform::Collections::Map::Clear", "COLLECTION/Platform::Collections::Map::First", "COLLECTION/Platform::Collections::Map::GetView", "COLLECTION/Platform::Collections::Map::HasKey", "COLLECTION/Platform::Collections::Map::Insert", "COLLECTION/Platform::Collections::Map::Lookup", "COLLECTION/Platform::Collections::Map::Remove", "COLLECTION/Platform::Collections::Map::Size"]
66
helpviewer_keywords: ["Map Class (C++/Cx)"]
77
ms.assetid: 2b8cf968-1167-4898-a149-1195b32c1785
88
---
99
# Platform::Collections::Map Class
1010

11-
Represents a *map*, which is a collection of key-value pairs.
11+
Represents a *map*, which is a collection of key-value pairs. Implements [Windows::Foundation::Collections::IObservableMap](/uwp/api/windows.foundation.collections.iobservablemap_k_v_) to help with XAML [data binding](/windows/uwp/data-binding/data-binding-in-depth).
1212

1313
## Syntax
1414

@@ -280,5 +280,6 @@ The number of elements in the Map.
280280

281281
## See also
282282

283+
[Collections (C++/CX)](collections-c-cx.md)<br/>
283284
[Platform Namespace](platform-namespace-c-cx.md)<br/>
284285
[Creating Windows Runtime Components in C++](/windows/uwp/winrt-components/creating-windows-runtime-components-in-cpp)

docs/cppcx/platform-collections-vector-class.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: "Platform::Collections::Vector Class"
3-
ms.date: "12/30/2016"
3+
ms.date: "10/01/2019"
44
ms.topic: "reference"
55
f1_keywords: ["COLLECTION/Platform::Collections::Vector::Vector", "COLLECTION/Platform::Collections::Vector::Append", "COLLECTION/Platform::Collections::Vector::Clear", "COLLECTION/Platform::Collections::Vector::First", "COLLECTION/Platform::Collections::Vector::GetAt", "COLLECTION/Platform::Collections::Vector::GetMany", "COLLECTION/Platform::Collections::Vector::GetView", "COLLECTION/Platform::Collections::Vector::IndexOf", "COLLECTION/Platform::Collections::Vector::InsertAt", "COLLECTION/Platform::Collections::Vector::ReplaceAll", "COLLECTION/Platform::Collections::Vector::RemoveAt", "COLLECTION/Platform::Collections::Vector::RemoveAtEnd", "COLLECTION/Platform::Collections::Vector::SetAt", "COLLECTION/Platform::Collections::Vector::Size", "COLLECTION/Platform::Collections::Vector::VectorChanged"]
66
helpviewer_keywords: ["Vector Class (C++/Cx)"]
77
ms.assetid: aee8c076-9700-47c3-99b6-799fd3edb0ca
88
---
99
# Platform::Collections::Vector Class
1010

11-
Represents a sequential collection of objects that can be individually accessed by index.
11+
Represents a sequential collection of objects that can be individually accessed by index. Implements [Windows::Foundation::Collections::IObservableVector](/uwp/api/Windows.Foundation.Collections.IObservableVector_T_) to help with XAML [data binding](/windows/uwp/data-binding/data-binding-in-depth).
1212

1313
## Syntax
1414

@@ -370,5 +370,6 @@ The last element in a sequence of objects that are used to initialize the curren
370370
371371
## See also
372372
373+
[Collections (C++/CX)](collections-c-cx.md)<br/>
373374
[Platform Namespace](platform-namespace-c-cx.md)<br/>
374375
[Creating Windows Runtime Components in C++](/windows/uwp/winrt-components/creating-windows-runtime-components-in-cpp)

docs/cppcx/platform-guid-value-class.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.assetid: 25c0bfb2-7f93-44d8-bdf4-ef4fbac3424a
88
---
99
# Platform::Guid value class
1010

11-
Represents a [GUID](/previous-versions/aa373931\(v=vs.80\)) type in the Windows Runtime type system.
11+
Represents a [GUID](/previous-versions/cc317743(v%3dmsdn.10)) type in the Windows Runtime type system.
1212

1313
## Syntax
1414

@@ -107,7 +107,7 @@ The next byte of the `GUID`.
107107
The next byte of the `GUID`.
108108

109109
*m*<br/>
110-
A `GUID` in the form a [GUID structure](/previous-versions/aa373931\(v=vs.80\)).
110+
A `GUID` in the form a [GUID structure](/previous-versions/cc317743(v%3dmsdn.10)).
111111

112112
*n*<br/>
113113
The remaining 8 bytes of the `GUID`.
@@ -187,7 +187,7 @@ This operator is provided so that `Guid` objects can be more easily consumed by
187187

188188
## <a name="operator-call"></a> Guid::operator() Operator
189189

190-
Implicitly converts a `Platform::Guid` to a [GUID structure](/previous-versions/aa373931\(v=vs.80\)).
190+
Implicitly converts a `Platform::Guid` to a [GUID structure](/previous-versions/cc317743(v%3dmsdn.10)).
191191

192192
### Syntax
193193

@@ -197,7 +197,7 @@ const GUID& Platform::Guid::operator();
197197

198198
### Return Value
199199

200-
A [GUID structure](/previous-versions/aa373931\(v=vs.80\)).
200+
A [GUID structure](/previous-versions/cc317743(v%3dmsdn.10)).
201201

202202
## See also
203203

0 commit comments

Comments
 (0)