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
Notably it is not the same as an LLVM `undef` which can have a different value every time you read it (since such a concept does not exist in assembly code).
720
720
721
721
r[asm.naked-rules.reg-not-output]
722
-
- Any callee-saved registers must have the same value upon exiting the asm block as they had on entry, otherwise behavior is undefined.
722
+
- Any callee-saved registers must have the same value upon return as they had on entry, otherwise behavior is undefined.
723
723
- Caller-saved registes may be used freely, even if they are not used for the return value.
724
724
725
725
r[asm.naked-rules.unwind]
@@ -728,22 +728,13 @@ r[asm.naked-rules.unwind]
728
728
729
729
r[asm.naked-rules.noreturn]
730
730
- Behavior is undefined if execution falls through to the end of the asm block.
731
+
- the assembly code is expected to contain a return instruction or to diverge
731
732
732
733
r[asm.naked-rules.mem-same-as-ffi]
733
734
- The set of memory locations that assembly code is allowed to read and write are the same as those allowed for an FFI function.
734
735
- Refer to the unsafe code guidelines for the exact rules.
735
736
- These rules do not apply to memory which is private to the asm code, such as stack space allocated within the asm block.
736
737
737
-
r[asm.naked-rules.black-box]
738
-
- The compiler cannot assume that the instructions in the asm are the ones that will actually end up executed.
739
-
- This effectively means that the compiler must treat the `naked_asm!` as a black box and only take the interface specification into account, not the instructions themselves.
740
-
- Runtime code patching is allowed, via target-specific mechanisms.
741
-
- However there is no guarantee that each `naked_asm!` directly corresponds to a single instance of instructions in the object file: the compiler is free to duplicate or deduplicate `naked_asm!` blocks.
742
-
743
-
r[asm.naked-rules.not-exactly-once]
744
-
- You cannot assume that an `naked_asm!` block will appear exactly once in the output binary.
745
-
The compiler is allowed to instantiate multiple copies of the `naked_asm!` block, for example when the function containing it is inlined in multiple places.
0 commit comments