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).
722
722
723
723
r[asm.naked-rules.reg-not-output]
724
-
- Any callee-saved registers must have the same value upon exiting the asm block as they had on entry, otherwise behavior is undefined.
724
+
- Any callee-saved registers must have the same value upon return as they had on entry, otherwise behavior is undefined.
725
725
- Caller-saved registes may be used freely, even if they are not used for the return value.
726
726
727
727
r[asm.naked-rules.unwind]
@@ -730,22 +730,13 @@ r[asm.naked-rules.unwind]
730
730
731
731
r[asm.naked-rules.noreturn]
732
732
- Behavior is undefined if execution falls through to the end of the asm block.
733
+
- the assembly code is expected to contain a return instruction or to diverge
733
734
734
735
r[asm.naked-rules.mem-same-as-ffi]
735
736
- The set of memory locations that assembly code is allowed to read and write are the same as those allowed for an FFI function.
736
737
- Refer to the unsafe code guidelines for the exact rules.
737
738
- These rules do not apply to memory which is private to the asm code, such as stack space allocated within the asm block.
738
739
739
-
r[asm.naked-rules.black-box]
740
-
- The compiler cannot assume that the instructions in the asm are the ones that will actually end up executed.
741
-
- 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.
742
-
- Runtime code patching is allowed, via target-specific mechanisms.
743
-
- 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.
744
-
745
-
r[asm.naked-rules.not-exactly-once]
746
-
- You cannot assume that an `naked_asm!` block will appear exactly once in the output binary.
747
-
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