mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
add clarifying comment to callee_saved
This commit is contained in:
parent
668a9d363d
commit
85afcdd011
2 changed files with 4 additions and 0 deletions
|
@ -365,6 +365,7 @@ impl CallConv<AArch64GeneralReg, AArch64FloatReg, AArch64Assembler> for AArch64C
|
|||
/// 213568: f90033fd str x29, [sp, #96]
|
||||
const SHADOW_SPACE_SIZE: u8 = 16;
|
||||
|
||||
// These are registers that a called function must save and restore if it wants to use them.
|
||||
#[inline(always)]
|
||||
fn general_callee_saved(reg: &AArch64GeneralReg) -> bool {
|
||||
matches!(
|
||||
|
|
|
@ -199,6 +199,7 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
|
|||
];
|
||||
const SHADOW_SPACE_SIZE: u8 = 0;
|
||||
|
||||
// These are registers that a called function must save and restore if it wants to use them.
|
||||
#[inline(always)]
|
||||
fn general_callee_saved(reg: &X86_64GeneralReg) -> bool {
|
||||
matches!(
|
||||
|
@ -1409,6 +1410,8 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
|
|||
];
|
||||
const SHADOW_SPACE_SIZE: u8 = 32;
|
||||
|
||||
// These are registers that a called function must save and restore if it wants to use them.
|
||||
//
|
||||
// Refer https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170#callercallee-saved-registers
|
||||
// > The x64 ABI considers registers RBX, RBP, RDI, RSI, RSP, R12, R13, R14, R15, and XMM6-XMM15 nonvolatile.
|
||||
// > They must be saved and restored by a function that uses them.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue