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
For naked functions, let's break out the rules for callee and caller
saved registers and name the rule identifiers more clearly.
For the caller saved registers, let's drop the caveat about "even if
they are not used for the return value", as it doesn't really add
anything to the rule.
- Any registers not used for function inputs according to the calling convention and function signature will contain an undefined value on entry to the `naked_asm!` block.
1391
1391
- An "undefined value" in the context of inline assembly means that the register can (non-deterministically) have any one of the possible values allowed by the architecture. 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).
1392
1392
1393
-
r[asm.naked-rules.reg-not-output]
1394
-
- Any callee-saved registers must have the same value upon return as they had on entry.
1395
-
- Caller-saved registers may be used freely, even if they are not used for the return value.
1393
+
r[asm.naked-rules.callee-saved-registers]
1394
+
- All callee-saved registers must have the same value upon return as they had on entry.
1395
+
1396
+
r[asm.naked-rules.caller-saved-registers]
1397
+
- Caller-saved registers may be used freely.
1396
1398
1397
1399
r[asm.naked-rules.noreturn]
1398
1400
- Behavior is undefined if execution falls through past the end of the assembly code.
0 commit comments