Skip to content

Commit dcdfaa2

Browse files
chorman0773joshtriplett
authored andcommitted
Unify global_asm/asm directive list
1 parent f818b84 commit dcdfaa2

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

src/inline-assembly.md

+15-19
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ The following directives are guaranteed to be supported by the assembler:
494494
- `.align`
495495
- `.ascii`
496496
- `.asciz`
497+
- `.alt_entry`
497498
- `.balign`
498499
- `.balignl`
499500
- `.balignw`
@@ -512,11 +513,14 @@ The following directives are guaranteed to be supported by the assembler:
512513
- `.eqv`
513514
- `.fill`
514515
- `.float`
516+
- `.globl`
517+
- `.global`
515518
- `.lcomm`
516519
- `.inst`
517520
- `.long`
518521
- `.octa`
519522
- `.option`
523+
- `.private_extern`
520524
- `.p2align`
521525
- `.pushsection`
522526
- `.popsection`
@@ -525,22 +529,16 @@ The following directives are guaranteed to be supported by the assembler:
525529
- `.section`
526530
- `.set`
527531
- `.short`
532+
- `.size`
528533
- `.skip`
529534
- `.sleb128`
530535
- `.space`
531536
- `.string`
532537
- `.text`
538+
- `.type`
533539
- `.uleb128`
534540
- `.word`
535541

536-
The following directives are guaranteed to be supported for `global_asm` only:
537-
538-
- `.alt_entry`
539-
- `.globl`
540-
- `.global`
541-
- `.private_extern`
542-
- `.size`
543-
- `.type`
544542

545543

546544
#### Target Specific Directive Support
@@ -592,23 +590,17 @@ On x86 targets, both 32-bit and 64-bit, the following additional directives are
592590
- `.att_syntax`
593591
- `.intel_syntax`
594592
- `.nops`
595-
596-
Use of the `.att_syntax` and `.intel_syntax` directives with no parameters (or with parameters equivalent to the defaults) 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 behavior is undefined (the compiled output may be corrupted as a result). Use of `.att_syntax` and `.intel_syntax` with a non-default option (such as `.intel_syntax prefix` or `.att_syntax noprefix`) is unsupported. 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.
597-
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-
600593
- `.code16`
601594
- `.code32`
595+
- `.code64`
602596

597+
Use of the `.att_syntax` and `.intel_syntax` directives with no parameters (or with parameters equivalent to the defaults) 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 behavior is undefined (the compiled output may be corrupted as a result). Use of `.att_syntax` and `.intel_syntax` with a non-default option (such as `.intel_syntax prefix` or `.att_syntax noprefix`) is unsupported. 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.
603598

604-
##### ARM (32-bit)
605-
606-
On ARM for `global_asm!` only, the following additional directives are guaranteed to be supported:
599+
Use of `.code16`, `.code32`, and `.code64` directives are only supported if the state is reset to the default before exiting the assembly block.
600+
32-bit x86 uses `.code32` by default, and x86_64 uses `.code64` by default.
607601

608-
- `.code`
609-
- `.thumb`
610-
- `.thumb_func`
611602

603+
##### ARM (32-bit)
612604

613605
On ARM, the following additional directives are guaranteed to be supported:
614606

@@ -617,4 +609,8 @@ On ARM, the following additional directives are guaranteed to be supported:
617609
- `.fnend`
618610
- `.save`
619611
- `.movsp`
612+
- `.code`
613+
- `.thumb`
614+
- `.thumb_func`
615+
620616

0 commit comments

Comments
 (0)