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
Inline assembly: Clarify references to quoted regs
For `lateout` and similar operand direction specifiers, a quoted argument must be an explicit register name, per the EBNF grammar we give. As such, we should not use quotes when describing syntax used with register classes.
Further, correct the EBNF: in EBNF, quoted strings are always terminals, but `"<explicit register>"` is intended to be a nonterminal surrounded by literal (terminal) quotation marks. Moving the quotes to their own terminal symbols does require escaping, but makes the terminal/nonterminal distinction clearer. The only other place double-quotes are present in the grammar is inside `STRING_LITERAL`/`RAW_STRING_LITERAL`, so calling attention to this case is worthwhile for clarity.
@@ -184,7 +184,7 @@ Here is the list of currently supported register classes:
184
184
>
185
185
> - On x86-64 the high byte registers (e.g. `ah`) are not available in the `reg_byte` register class.
186
186
>
187
-
> - 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") _`.
187
+
> - 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(<register class>) _` or `lateout(<register class>) _`.
188
188
189
189
Each register class has constraints on which value types they can be used with.
190
190
This is necessary because the way a value is loaded into a register depends on its type.
@@ -356,7 +356,7 @@ If all references to an operand already have modifiers then the warning is suppr
356
356
## ABI clobbers
357
357
358
358
The `clobber_abi` keyword can be used to apply a default set of clobbers to an `asm!` block.
359
-
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.
359
+
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).
360
360
361
361
`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.
0 commit comments