You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/reference/arch-arm64.md
+18-7Lines changed: 18 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,31 @@
1
1
---
2
2
description: "Learn more about: /arch (ARM64)"
3
3
title: "/arch (ARM64)"
4
-
ms.date: 08/30/2022
4
+
ms.date: 05/24/2024
5
5
---
6
6
# `/arch` (ARM64)
7
7
8
-
Specifies the architecture for code generation on ARM64. For more information on **`/arch`** for other target architectures, see [`/arch` (x86)](arch-x86.md), [`/arch` (x64)](arch-x64.md), and [`/arch` (ARM)](arch-arm.md).
8
+
Specifies the Arm A-Profile architecture extension for code generation on ARM64. For more information on **`/arch`** for other target architectures, see [`/arch` (x86)](arch-x86.md), [`/arch` (x64)](arch-x64.md), and [`/arch` (ARM)](arch-arm.md).
Optional. Specifies minimum CPU extension requirements for ARMv8.x-A. The default is **`/arch:armv8.0`**.
17
+
**`/arch:armv8.x`**\
18
+
Specifies the Armv8-A architecture, where **`x`** is a required extension value from **`0`** to **`9`**<sup>1</sup>. By default, the compiler uses the **`/arch:armv8.0`** behavior if no architecture is specified.
19
+
20
+
**`/arch:armv9.x`**<sup>2</sup>\
21
+
Specifies the Armv9-A architecture, where **`x`** is a required extension value from **`0`** to **`4`**. By default, the compiler uses the **`/arch:armv8.0`** behavior if no architecture is specified.
18
22
19
23
## Remarks
20
24
21
-
You may specify a CPU extension requirement from Armv8.0-A through Armv8.8-A. However, depending on your version of Visual Studio, the compiler may not yet generate instructions from all feature sets required by the extension level you specify. For example, **`/arch:armv8.1`** allows the `_Interlocked*` intrinsic functions to use the appropriate atomic instruction that was introduced with the ARMv8.1 extension, FEAT_LSE, but compiler support requires Visual Studio 2022 version 17.2 or later.
25
+
You may specify an ARM64 extension from Armv8.0-A through Armv8.9-A and Armv9.0-A through Armv9.4-A. Optionally, one or more architecture features can be enabled by appending a feature argument to the option<sup>3</sup>. For example, in order to target Armv8.0-A and enable feature FEAT_LSE, append feature argument **`lse`** so that the option becomes **`/arch:armv8.0+lse`**. For more information about available features and their requirements, see [`/feature` (ARM64)](feature-arm64.md)<sup>3</sup>.
26
+
27
+
> [!NOTE]
28
+
> Depending on your version of Visual Studio, the compiler may not yet generate instructions from all feature sets required by the extension level you specify. For example, **`/arch:armv8.1`** allows the `*Interlocked*` intrinsic functions to use the appropriate atomic instruction that was introduced with the Armv8.1-A extension feature FEAT_LSE, but compiler support requires Visual Studio 2022 version 17.2 or later.
22
29
23
30
The `_M_ARM64` macro is defined by default when compiling for an ARM64 target. For more information, see [Predefined macros](../../preprocessor/predefined-macros.md).
24
31
@@ -30,12 +37,16 @@ When you use [`/clr`](clr-common-language-runtime-compilation.md) to compile, **
Copy file name to clipboardExpand all lines: docs/build/reference/compiler-options-listed-alphabetically.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
16
16
|[`/?`](help-compiler-command-line-help.md)| Lists the compiler options. |
17
17
|[`/AI<dir>`](ai-specify-metadata-directories.md)| Specifies a directory to search to resolve file references passed to the [`#using`](../../preprocessor/hash-using-directive-cpp.md) directive. |
Optionally specify one or more Arm A-Profile architecture features to enable for an ARM64 extension specified by **`/arch`** (ARM64). For more information on **`/arch`** (ARM64), see [`/arch` (ARM64)](arch-arm64.md).
9
+
10
+
## Syntax
11
+
12
+
> **`/feature:<arg1>`**[**`+arg2`**]
13
+
14
+
## Arguments
15
+
Specify one or more of the following available features to enable if a targeted ARM64 extension supports it.
16
+
17
+
| Feature argument | Feature identifier | Optional from | Enabled by default | Description |
18
+
|--|--|--|--|--|
19
+
|**`lse`**| FEAT_LSE | Armv8.0 | Armv8.1 | Large System Extensions. |
Example usage: to enable FEAT_LSE, use feature argument **`lse`** so that the option is **`/feature:lse`**.
25
+
26
+
If there are conflicting feature arguments specified by **`/feature`**, the right-most feature is enabled. Enabling a feature that is not supported by a targeted architecture may cause unexpected behavior, especially if a CPU does not implement the feature.
27
+
28
+
You can use either **`/feature`** or only **`/arch`** (ARM64) to specify features. For example, if you want to enable FEAT_LSE when targeting Armv8.0-A, you can either use both **`/feature:lse`** and **`/arch:armv8.0`** or only use **`/arch:armv8.0+lse`**. **`/feature`** exists as another way to specify features without having to specify them in **`/arch`** (ARM64).
29
+
30
+
### To set the `/feature` compiler option in Visual Studio
31
+
32
+
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).
0 commit comments