Skip to content

Commit eb11311

Browse files
Merge pull request #5045 from MicrosoftDocs/main638526870989660243sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents de816fb + c8c247b commit eb11311

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

docs/build/reference/compiler-options-listed-alphabetically.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
197197
| [`/vmv`](vmm-vms-vmv-general-purpose-representation.md) | Declares virtual inheritance. |
198198
| [`/volatile:iso`](volatile-volatile-keyword-interpretation.md) | Acquire/release semantics not guaranteed on volatile accesses. |
199199
| [`/volatile:ms`](volatile-volatile-keyword-interpretation.md) | Acquire/release semantics guaranteed on volatile accesses. |
200-
| `/volatileMetadata` | Generate metadata on volatile memory accesses. |
200+
| [`/volatileMetadata`](volatile.md) | Generate metadata on volatile memory accesses. |
201201
| [`/w`](compiler-option-warning-level.md) | Disable all warnings. |
202202
| [`/W0`, `/W1`, `/W2`, `/W3`, `/W4`](compiler-option-warning-level.md) | Set output warning level. |
203203
| [`/w1<n>`, `/w2<n>`, `/w3<n>`, `/w4<n>`](compiler-option-warning-level.md) | Set warning level for the specified warning. |

docs/build/reference/compiler-options-listed-by-category.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ This article contains a categorical list of compiler options. For an alphabetica
262262
| [`/utf-8`](utf-8-set-source-and-executable-character-sets-to-utf-8.md) | Set source and execution character sets to UTF-8. |
263263
| [`/V`](v-version-number.md) | Deprecated. Sets the version string. |
264264
| [`/validate-charset`](validate-charset-validate-for-compatible-characters.md) | Validate UTF-8 files for only compatible characters. |
265-
| `/volatileMetadata` | Generate metadata on volatile memory accesses. |
265+
| [`/volatileMetadata`](volatile.md) | Generate metadata on volatile memory accesses. |
266266
| [`/Yc`](yc-create-precompiled-header-file.md) | Create *`.PCH`* file. |
267267
| [`/Yd`](yd-place-debug-information-in-object-file.md) | Deprecated. Places complete debugging information in all object files. Use [`/Zi`](z7-zi-zi-debug-information-format.md) instead. |
268268
| [`/Yl`](yl-inject-pch-reference-for-debug-library.md) | Injects a PCH reference when creating a debug library. |

docs/build/reference/volatile.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
description: "Learn more about: /volatileMetadata"
3+
title: "/volatileMetadata (Generate metadata on volatile memory accesses)"
4+
ms.date: 5/29/2024
5+
f1_keywords: ["/volatileMetadata"]
6+
helpviewer_keywords: ["/volatileMetadata", "-volatileMetadata compiler option", "/volatileMetadata compiler option", "volatileMetadata"]
7+
---
8+
# `/volatileMetadata` (Generate metadata on volatile memory accesses)
9+
10+
Generate metadata for volatile memory accesses to improve performance when running x64 code on ARM64.
11+
12+
## Syntax
13+
14+
```cpp
15+
/volatileMetadata[-]
16+
```
17+
18+
## Arguments
19+
20+
**`-`**\
21+
Turns off `/volatileMetadata`. This may result in worse performance when your code runs in emulation mode on ARM64 because the emulator pessimistically assumes that every load/store needs a barrier.
22+
23+
## Remarks
24+
25+
Starting with Visual Studio 2019 16.10, `/volatileMetadata` is on by default when generating x64 code. It improves the emulation performance of x64 code on ARM64 by generating metadata that identifies volatile memory addresses. An emulator can use this metadata to improve performance by not using acquire/release semantics on those accesses it knows aren't volatile. Without this metadata, the emulator assumes that all addresses are volatile and uses acquire and release semantics.
26+
27+
One side effect of `/volatileMetadata` is you may see `npad` macros used in the generated code. This macro expands to a specified number of `NOP` instructions that create an address to associate with a memory barrier. That address is then recorded in the metadata to indicate that acquire/release semantics should be used to access it.
28+
29+
`/volatileMetadata` is ignored when targeting x86.
30+
31+
`/volatileMetadata` can be disabled by using `/volatileMetadata-`.
32+
33+
`/volatileMetadata` is ignored when targeting x86.
34+
35+
## Requirements
36+
37+
Visual Studio 2019 version 16.10 or later.
38+
39+
## See also
40+
41+
[MSVC Compiler Options](compiler-options.md)\
42+
[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)

docs/build/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ items:
746746
href: ../build/reference/vmm-vms-vmv-general-purpose-representation.md
747747
- name: /volatile (volatile keyword interpretation)
748748
href: ../build/reference/volatile-volatile-keyword-interpretation.md
749+
- name: /volatileMetadata
750+
href: ../build/reference/volatile.md
749751
- name: /w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, /WX (Warning level)
750752
href: ../build/reference/compiler-option-warning-level.md
751753
- name: /WL (Enable one-line diagnostics)

0 commit comments

Comments
 (0)