Skip to content

Commit b74825d

Browse files
authored
Merge pull request rust-lang#1191 from fw-immunant/patch-1
Inline assembly: Clarify references to quoted regs
2 parents 1d3f08f + f63b37b commit b74825d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/inline-assembly.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The following ABNF specifies the general syntax:
4141
```text
4242
format_string := STRING_LITERAL / RAW_STRING_LITERAL
4343
dir_spec := "in" / "out" / "lateout" / "inout" / "inlateout"
44-
reg_spec := <register class> / "<explicit register>"
44+
reg_spec := <register class> / "\"" <explicit register> "\""
4545
operand_expr := expr / "_" / expr "=>" expr / expr "=>" "_"
4646
reg_operand := dir_spec "(" reg_spec ")" operand_expr
4747
operand := reg_operand
@@ -186,7 +186,7 @@ Here is the list of currently supported register classes:
186186
>
187187
> - On x86-64 the high byte registers (e.g. `ah`) are not available in the `reg_byte` register class.
188188
>
189-
> - Some register classes are marked as "Only clobbers" which means that they cannot be used for inputs or outputs, only clobbers of the form `out("reg") _` or `lateout("reg") _`.
189+
> - Some register classes are marked as "Only clobbers" which means that registers in these classes cannot be used for inputs or outputs, only clobbers of the form `out(<explicit register>) _` or `lateout(<explicit register>) _`.
190190
191191
Each register class has constraints on which value types they can be used with.
192192
This is necessary because the way a value is loaded into a register depends on its type.
@@ -358,7 +358,7 @@ If all references to an operand already have modifiers then the warning is suppr
358358
## ABI clobbers
359359

360360
The `clobber_abi` keyword can be used to apply a default set of clobbers to an `asm!` block.
361-
This will automatically insert the necessary clobber constraints as needed for calling a function with a particular calling convention: if the calling convention does not fully preserve the value of a register across a call then a `lateout("reg") _` is implicitly added to the operands list.
361+
This will automatically insert the necessary clobber constraints as needed for calling a function with a particular calling convention: if the calling convention does not fully preserve the value of a register across a call then `lateout("...") _` is implicitly added to the operands list (where the `...` is replaced by the register's name).
362362

363363
`clobber_abi` may be specified any number of times. It will insert a clobber for all unique registers in the union of all specified calling conventions.
364364

0 commit comments

Comments
 (0)