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
+35-2Lines changed: 35 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,44 @@ Specifies the Armv9-A architecture, where **`x`** is a required extension value
22
22
23
23
## Remarks
24
24
25
-
You may specify an ARM64 extension from Armv8.0-A through Armv8.9-A, and Armv9.0-A through Armv9.4-A. Optionally, enable one or more architecture features by appending a feature argument to the option<sup>3</sup>. For example, 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>.
25
+
You can specify an ARM64 extension from Armv8.0-A through Armv8.9-A, and Armv9.0-A through Armv9.4-A. Optionally, enable one or more architecture features by appending a feature argument to the option<sup>3</sup>. For example, 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
26
27
27
> [!NOTE]
28
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 introduced with the Armv8.1-A extension feature `FEAT_LSE`, but compiler support requires Visual Studio 2022 version 17.2 or later.
29
29
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).
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)\
31
+
32
+
The `__ARM_ARCH` macro is defined for `/arch:ARMv8.0` and higher. It indicates the ARM architecture extension level that the compiler is targeting. For example:
33
+
34
+
```cpp
35
+
// test.cpp
36
+
#defineSTRINGIZE_IMPL(X) #X
37
+
#define STRINGIZE(X) STRINGIZE_IMPL(X)
38
+
#pragma message("__ARM_ARCH is " STRINGIZE(__ARM_ARCH))
**`/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.
33
65
@@ -50,5 +82,6 @@ The `_M_ARM64` macro is defined by default when compiling for an ARM64 target. F
50
82
## See also
51
83
52
84
[`/arch` (Minimum CPU architecture)](arch-minimum-cpu-architecture.md)\
@@ -23,7 +23,8 @@ The compiler supports this predefined identifier specified by ISO C99 and ISO C+
23
23
-`__func__` The unqualified and unadorned name of the enclosing function as a function-local **static const** array of **`char`**.
24
24
25
25
```cpp
26
-
voidexample(){
26
+
voidexample()
27
+
{
27
28
printf("%s\n", __func__);
28
29
} // prints "example"
29
30
```
@@ -64,6 +65,8 @@ The compiler supports these predefined macros specified by the ISO C99, C11, C17
64
65
65
66
MSVC supports other predefined macros:
66
67
68
+
-`__ARM_ARCH` Defined as an integer literal that represents the ARM architecture version. The value is encoded in the form `Vx`, where `x` is the ARM architecture version. To set the ARM architecture version, see [`/arch`](../build/reference/arch-arm.md). If it is undefined, the value is `__ARM_ARCH`.
69
+
67
70
-`__ATOM__` Defined as 1 when the [`/favor:ATOM`](../build/reference/favor-optimize-for-architecture-specifics.md) compiler option is set and the compiler target is x86 or x64. Otherwise, undefined.
68
71
69
72
-`__AVX__` Defined as 1 when the [`/arch:AVX`](../build/reference/arch-x86.md), [`/arch:AVX2`](../build/reference/arch-x86.md), or [`/arch:AVX512`](../build/reference/arch-x86.md) compiler options are set and the compiler target is x86 or x64. Otherwise, undefined.
0 commit comments