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
- The compiler cannot assume that the instructions in the asm are the ones that will actually end up executed.
1244
1244
- This effectively means that the compiler must treat the `asm!` as a black box and only take the interface specification into account, not the instructions themselves.
1245
1245
- Runtime code patching is allowed, via target-specific mechanisms.
1246
-
- However there is no guarantee that each `asm!` directly corresponds to a single instance of instructions in the object file: the compiler is free to duplicate or deduplicate `asm!` blocks.
1246
+
- However there is no guarantee that each `asm!` directly corresponds to a single instance of instructions in the object file: the compiler is free to duplicate or deduplicate the assembly code in `asm!` blocks.
1247
1247
1248
1248
r[asm.rules.stack-below-sp]
1249
1249
- Unless the `nostack` option is set, asm code is allowed to use stack space below the stack pointer.
@@ -1332,9 +1332,9 @@ r[asm.rules.arm64ec]
1332
1332
r[asm.rules.only-on-exit]
1333
1333
- The requirement of restoring the stack pointer and non-output registers to their original value only applies when exiting the assembly code.
1334
1334
- This means that assembly code that never returns (even if not marked `noreturn`) doesn't need to preserve these registers.
1335
-
- When returning to a different `asm!` block than you entered (e.g. for context switching), these registers must contain the value they had upon entering the `asm!` block that you are *exiting*.
1336
-
- You cannot exit an `asm!` block that has not been entered.
1337
-
Neither can you exit an `asm!` block that has already been exited (without first entering it again).
1335
+
- When returning to the assembly code of a different `asm!` block than you entered (e.g. for context switching), these registers must contain the value they had upon entering the `asm!` block that you are *exiting*.
1336
+
- You cannot exit the assembly code of an `asm!` block that has not been entered.
1337
+
Neither can you exit the assembly code of an `asm!` block whose assembly code has already been exited (without first entering it again).
1338
1338
- You are responsible for switching any target-specific state (e.g. thread-local storage, stack bounds).
1339
1339
- You cannot jump from an address in one `asm!` block to an address in another, even within the same function or block, without treating their contexts as potentially different and requiring context switching. You cannot assume that any particular value in those contexts (e.g. current stack pointer or temporary values below the stack pointer) will remain unchanged between the two `asm!` blocks.
1340
1340
- The set of memory locations that you may access is the intersection of those allowed by the `asm!` blocks you entered and exited.
@@ -1361,7 +1361,7 @@ In addition to all of the previous rules, the string argument to `asm!` must ult
1361
1361
after all other arguments are evaluated, formatting is performed, and operands are translated---
1362
1362
assembly that is both syntactically correct and semantically valid for the target architecture.
1363
1363
The formatting rules allow the compiler to generate assembly with correct syntax.
1364
-
Rules concerning operands permit valid translation of Rust operands into and out of `asm!`.
1364
+
Rules concerning operands permit valid translation of Rust operands into and out of the assembly code.
1365
1365
Adherence to these rules is necessary, but not sufficient, for the final expanded assembly to be
0 commit comments