Skip to content

Commit b2a020e

Browse files
Apply suggestions from code review
Co-authored-by: Josh Triplett <[email protected]>
1 parent f4eed8f commit b2a020e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/inline-assembly.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ On x86, the `.intel_syntax noprefix` mode of GAS is used by default.
8787
On ARM, the `.syntax unified` mode is used.
8888
These targets impose an additional restriction on the assembly code: any assembler state (e.g. the current section which can be changed with `.section`) must be restored to its original value at the end of the asm string.
8989
Assembly code that does not conform to the GAS syntax will result in assembler-specific behavior.
90-
Further constraints on the directives used by the assembly are indicated by [Directives Support](#directives-support).
90+
Further constraints on the directives used by inline assembly are indicated by [Directives Support](#directives-support).
9191

9292
[format-syntax]: ../std/fmt/index.html#syntax
9393
[rfc-2795]: https://github.com/rust-lang/rfcs/pull/2795
@@ -481,9 +481,11 @@ To avoid undefined behavior, these rules must be followed when using function-sc
481481
482482
### Directives Support
483483

484-
Inline ASM supports a subset of the directives supported by both GNU AS and LLVM's internal assembler, given as follows.
484+
Inline assembly supports a subset of the directives supported by both GNU AS and LLVM's internal assembler, given as follows.
485485
The result of using other directives is assembler-specific (and may cause an error, or may be accepted as-is).
486486

487+
If inline assembly includes any "stateful" directive that modifies how subsequent assembly is processed, the block must undo the effects of any such directives before the inline assembly ends.
488+
487489
The following directives are guaranteed to be supported by the assembler:
488490

489491

@@ -515,6 +517,7 @@ The following directives are guaranteed to be supported by the assembler:
515517
- `.section`
516518
- `.pushsection`
517519
- `.popsection`
520+
- `.subsection`
518521
- `.text`
519522
- `.bss`
520523
- `.data`
@@ -584,9 +587,9 @@ On targets with structured exception Handling, the following additional directiv
584587
- `.seh_stackalloc`
585588

586589

587-
##### x86
590+
##### x86 (32-bit and 64-bit)
588591

589-
On x86, the following additional directives are guaranteed to be supported:
592+
On x86 targets, both 32-bit and 64-bit, the following additional directives are guaranteed to be supported:
590593
- `.nops`
591594

592595
On x86 for `global_asm!` only, the following additional directives are guaranteed to be supported (it is unspecified whether `.code16` or `.code32` are supported for `asm!()`):
@@ -610,3 +613,4 @@ On ARM, the following additional directives are guaranteed to be supported:
610613
- `.fnend`
611614
- `.save`
612615
- `.movsp`
616+
- `.even`

0 commit comments

Comments
 (0)