Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat inline-assembly chapter as a spec chapter. #1523

Closed
wants to merge 32 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7f86242
Start reformat for inline-assembly chapter
chorman0773 Jun 19, 2024
72df943
Remove rule prefix from section header ids
chorman0773 Jul 2, 2024
5a75b51
Add [dynamic.asm.template] and [dynamic.asm.operands]
chorman0773 Jul 3, 2024
0397d44
Add dynamic.asm.options
chorman0773 Jul 4, 2024
2fdf1fb
Finish dynamic.asm.evaluation and dynamic.asm.directives
chorman0773 Jul 9, 2024
320b414
Format dynamic.asm.registers
chorman0773 Jul 9, 2024
80bf3cf
Format dynamic.asm.template
chorman0773 Jul 9, 2024
bf615a9
Add examples/tests to the inline-assembly chapter
chorman0773 Jul 9, 2024
6512bc6
Fix doc links in dynamic.asm.operands.types
chorman0773 Jul 9, 2024
2a9f58d
Edit styling of dynamic.asm and fix test failures
chorman0773 Jul 10, 2024
1d9770f
Merge branch 'master' into spec-reformat-asm
chorman0773 Jul 10, 2024
c3af3ca
Change chapter identifier to be `asm` rather than `dynamic.asm`
chorman0773 Jul 11, 2024
a82d8f9
Switch link for `__m128` and `__m256`
chorman0773 Jul 11, 2024
3563e5a
Remove colour from .target-specific
chorman0773 Jul 16, 2024
38d2dae
Fix inline assembly tests to be handled "properly" off of x86_64
chorman0773 Jul 16, 2024
a464e1a
Apply suggestions from PR Review
chorman0773 Jul 17, 2024
f69509b
Apply suggestions from code review
chorman0773 Jul 17, 2024
15db17f
Finish applying suggestions from PR review
chorman0773 Jul 17, 2024
b362778
Change wording for asm.safety note
chorman0773 Jul 18, 2024
3633034
Use `that` instead of `which` in asm.safety note
chorman0773 Jul 18, 2024
7a320d3
Fix global_asm tests to actually run
chorman0773 Jul 18, 2024
012d7f6
Use *asm block* and *global asm block* instead of "Expansion of [`cor…
chorman0773 Jul 18, 2024
f886a47
Fix extraneous `r` in "Template Modifiers" header
chorman0773 Jul 18, 2024
b6f4bbb
Apply suggestions from code review
chorman0773 Jul 18, 2024
88a3964
Fix code block formatting and use "fails to compile" instead of "ill-…
chorman0773 Jul 18, 2024
13884d0
Remove trailing spaces from markdown source lines
chorman0773 Jul 18, 2024
5c0e505
Don't link to a rule that does not yet exist
chorman0773 Jul 18, 2024
e2a7a47
Properly fix end of line spaces
chorman0773 Jul 18, 2024
457e1d6
Change link to inline-assembly.html to point to asm.evaluation
chorman0773 Jul 18, 2024
d59ad1f
Update src/inline-assembly.md
chorman0773 Jul 25, 2024
9b78523
Merge branch 'master' into spec-reformat-asm
chorman0773 Jul 25, 2024
90ef108
Remove added claims from inline-assembly document.
chorman0773 Jul 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Eric Huss <[email protected]>
  • Loading branch information
chorman0773 and ehuss authored Jul 18, 2024
commit b6f4bbb80f55e5a7feed63c71da3ddc6b6a6bfa1
15 changes: 8 additions & 7 deletions src/inline-assembly.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ r[asm.invocation.format-string]
Unless the `raw` option is specified, each `format_string` input to the [`core::arch::asm!`] and [`core::arch::global_asm!`] macros shall be an expanded string literal for which the content matches the `asm_string_piece` production.

> [!NOTE]
> an expanded string literal is a string literal (after expanding macros like [`core::concat!`]) that has had every unicode escape sequence replaced with the (appropriately escaped as needed) matching character, and which has been normalized from a raw string literal.
> An expanded string literal is a string literal (after expanding macros like [`core::concat!`]) that has had every unicode escape sequence replaced with the (appropriately escaped as needed) matching character, and which has been normalized from a raw string literal.


r[asm.invocation.concat]
Expand Down Expand Up @@ -191,7 +191,7 @@ r[asm.invocation.expansion]
If the `raw` option is not specified, the *joined asm-string* is expanded as defined in [asm.operands.expansion], replacing each `format_specifier` with the appropriate expansion for the operand. The resulting string is called the *expanded asm-string*. If the `raw` option is specified, the *expanded asm-string* is the *joined asm-string* verbatim.

r[asm.invocation.syntax]
The syntax of the *expanded asm-string* is a subset of the GNU AS syntax for the target. Invoking the macro with a *expanded asm-string* that does not match syntax requirements is *conditionally supported* and has *assembler dependent behaviour*. Invoking a directive that is not specified by [asm.directives] is *conditionally supported* and has *assembler dependent behaviour*.
The syntax of the *expanded asm-string* is a subset of the GNU AS syntax for the target. Invoking the macro with a *expanded asm-string* that does not match syntax requirements is *conditionally supported* and has *assembler dependent behavior*. Invoking a directive that is not specified by [asm.directives] is *conditionally supported* and has *assembler dependent behavior*.

> [!TARGET-SPECIFIC]
> On x86 and x86_64 targets, the syntax of the *expanded asm-string* acts as though the directive `.intel_syntax noprefix` is issued before parsing the *expanded asm-string*, except that the `option(att_syntax)` causes the syntax to act as though the directive `.att_syntax prefix` is issued before parsing the *expanded asm-string* instead.
Expand All @@ -201,8 +201,9 @@ r[asm.invocation.duplication]
The number of times, locations, and the order in which a given *asm block* appears in the binary is unspecified.

```rust,ignore
// The following code may have suprising results, and may fail to compile or link.
// The results, including whether it succesfully compiles, may depend on non-local use sites of the function, and on optimization settings.
// The following code may have surprising results, and may fail to compile or
// link. The results, including whether it successfully compiles, may depend on
// non-local use sites of the function, and on optimization settings.
# #[cfg(target_arch = "x86_64")] { unsafe{
let x: i32;
core::arch::asm!("foo: jmp foo");
Expand Down Expand Up @@ -244,7 +245,7 @@ The *expanded asm-string* of *global-asm-block* invocation acts as though a `.se


r[asm.invocation.prefix-instr]
An *expanded asm-string* shall not end with an instruction that is interpreted as a prefix on the architecture. No Diagnostic is required
An *expanded asm-string* shall not end with an instruction that is interpreted as a prefix on the architecture. No diagnostic is required.

> [!TARGET-SPECIFIC]
> On x86 and x86-64, the `lock`, `repnz`, `rep`, `repz`, as well as GNU AS specific address-size, data-size, and explicit rex, vex, and evex prefixes.
Expand Down Expand Up @@ -356,7 +357,7 @@ r[asm.operands.in-expr]
An `input_expr` shall be a value expression of an *asm operand type* or an *input coerceable type*. If the expression is of an *input coerceable type*, it is coerced to an *asm operand type*.

r[asm.operands.out-expr]
An `output_expr` shall be the placeholder expression `_` or a (potentially unitialized) place expression of an *asm operand type*. If the place expression is initialized, it shall be a mutable place.
An `output_expr` shall be the placeholder expression `_` or a (potentially uninitialized) place expression of an *asm operand type*. If the place expression is initialized, it shall be a mutable place.

```rust,compile_fail
# #[cfg(target_arch = "x86_64")] { unsafe{
Expand Down Expand Up @@ -831,7 +832,7 @@ r[asm.options.general]
An options-spec provided in the *asm block* places constraints on the *asm block*.

r[asm.options.att_syntax]
The `att_syntax` option may be specfied on the x86 and x86_64 target. The program shall not specify the `att_syntax` option on any other target.
The `att_syntax` option may be specified on the x86 and x86_64 target. The program shall not specify the `att_syntax` option on any other target.

> [!TARGET-SPECIFIC]
> The `att_syntax` option modifies the syntax used to parse the *expanded asm-string* as though the `.att_syntax prefix` directive was issued before parsing the *expanded asm-string*, and modifies the expansion of register operands to include a `%` prefix.
Expand Down
Loading