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
@@ -129,12 +129,16 @@ Several types of operands are supported:
129
129
- A mangled symbol name referring to the item is substituted into the asm template string.
130
130
- The substituted string does not include any modifiers (e.g. GOT, PLT, relocations, etc).
131
131
-`<path>` is allowed to point to a `#[thread_local]` static, in which case the asm code can combine the symbol with relocations (e.g. `@plt`, `@TPOFF`) to read from thread-local data.
132
+
*`const <expr>`
133
+
-`<expr>` must be an integer constant expression. This expression follows the same rules as inline `const` blocks.
134
+
- The type of the expression may be any integer type, but defaults to `i32` just like integer literals.
135
+
- The value of the expression is formatted as a string and substituted directly into the asm template string.
132
136
133
137
Operand expressions are evaluated from left to right, just like function call arguments.
134
138
After the `asm!` has executed, outputs are written to in left to right order.
135
139
This is significant if two outputs point to the same place: that place will contain the value of the rightmost output.
136
140
137
-
Since `global_asm!` exists outside a function, it can only use `sym` operands.
141
+
Since `global_asm!` exists outside a function, it can only use `sym`and `const`operands.
0 commit comments