Skip to content

Commit a0f69ed

Browse files
chorman0773joshtriplett
authored andcommitted
Fix changes unintentional reverted in d5d3d80
This reverts commit d5ded80.
1 parent bcd134f commit a0f69ed

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/inline-assembly.md

Lines changed: 10 additions & 10 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,11 +481,12 @@ 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-
The following directives are guaranteed to be supported by the assembler:
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.
488488

489+
The following directives are guaranteed to be supported by the assembler:
489490

490491
- `.2byte`
491492
- `.4byte`
@@ -532,8 +533,6 @@ The following directives are guaranteed to be supported by the assembler:
532533
- `.uleb128`
533534
- `.word`
534535

535-
536-
537536
The following directives are guaranteed to be supported for `global_asm` only:
538537

539538
- `.alt_entry`
@@ -587,21 +586,22 @@ On targets with structured exception Handling, the following additional directiv
587586
- `.seh_stackalloc`
588587

589588

590-
##### x86
589+
##### x86 (32-bit and 64-bit)
591590

592-
On x86, the following additional directives are guaranteed to be supported:
591+
On x86 targets, both 32-bit and 64-bit, the following additional directives are guaranteed to be supported:
593592
- `.att_syntax`
594593
- `.intel_syntax`
595594
- `.nops`
596595

597596
Use of the `.att_syntax` and `.intel_syntax` with no parameters is supported, but the syntax must be restored to the option at entry (`.intel_syntax` without the `att_syntax` asm option, or `.att_syntax` with that option) or the behaviour is undefined (the output of the compiler may be corrupted as a result). Use of `.att_syntax` and `.intel_syntax` with an option (such as `.intel_syntax prefix` or `.att_syntax noprefix`) is unsupported and results in assembler-dependant behaviour. If operand interpolations are used between setting the syntax mode with one of these directives, and restoring it to the block's default, the behaviour is undefined.
598597

599-
On x86 for `global_asm!` only, the following additional directives are guaranteed to be supported:
598+
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!()`):
599+
600600
- `.code16`
601601
- `.code32`
602602

603603

604-
##### ARM (32-bit only)
604+
##### ARM
605605

606606
On ARM for `global_asm!` only, the following additional directives are guaranteed to be supported:
607607

@@ -615,6 +615,6 @@ On ARM, the following additional directives are guaranteed to be supported:
615615
- `.even`
616616
- `.fnstart`
617617
- `.fnend`
618-
- `.movsp`
619618
- `.save`
619+
- `.movsp`
620620

0 commit comments

Comments
 (0)