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: src/inline-assembly.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ On x86, the `.intel_syntax noprefix` mode of GAS is used by default.
87
87
On ARM, the `.syntax unified` mode is used.
88
88
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.
89
89
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).
@@ -481,11 +481,12 @@ To avoid undefined behavior, these rules must be followed when using function-sc
481
481
482
482
### Directives Support
483
483
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.
485
485
The result of using other directives is assembler-specific (and may cause an error, or may be accepted as-is).
486
486
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.
488
488
489
+
The following directives are guaranteed to be supported by the assembler:
489
490
490
491
-`.2byte`
491
492
-`.4byte`
@@ -532,8 +533,6 @@ The following directives are guaranteed to be supported by the assembler:
532
533
-`.uleb128`
533
534
-`.word`
534
535
535
-
536
-
537
536
The following directives are guaranteed to be supported for `global_asm` only:
538
537
539
538
-`.alt_entry`
@@ -587,21 +586,22 @@ On targets with structured exception Handling, the following additional directiv
587
586
-`.seh_stackalloc`
588
587
589
588
590
-
##### x86
589
+
##### x86 (32-bit and 64-bit)
591
590
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:
593
592
-`.att_syntax`
594
593
-`.intel_syntax`
595
594
-`.nops`
596
595
597
596
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.
598
597
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
+
600
600
-`.code16`
601
601
-`.code32`
602
602
603
603
604
-
##### ARM (32-bit only)
604
+
##### ARM
605
605
606
606
On ARM for `global_asm!` only, the following additional directives are guaranteed to be supported:
607
607
@@ -615,6 +615,6 @@ On ARM, the following additional directives are guaranteed to be supported:
0 commit comments