I have write some test code, just for testing the stack overflow
.
int MyFunc(long c)
{
char buffer[12];
return sprintf(buffer, "xxxxxxxxxxx%ld", c);
}
when I compile it to ARM64 assembly, I got the result
MyFunc(long): // @MyFunc(long)
sub sp, sp, #32 // =32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16 // =16
adrp x1, .L.str
mov x2, x0
add x1, x1, :lo12:.L.str
add x0, sp, #4 // =4
bl sprintf
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32 // =32
ret
so, what does 16-byte Folded Spill
mean? and why?
And if something on the sheet prevents filling that range, a #SPILL! error occurs. For the most part, this behavior is understandable and predictable. For instance, if your formula is expected to return more than one value, but the nearby cells are filled with some other data, simply delete that data, and an error will be gone.
What does #SPILL mean in Excel? Generally, a #SPILL! error occurs when a formula produces multiple results but cannot output them all on the sheet. Before we dive into specific use cases, let's get a general understanding of spilling in Excel.
This is considered a way to start a secretive conversation. We can think of someone saying or requesting that we “spill the tea” as an open invitation to confide in them or fill them in on anything information that they have not previously been pertinent to or informed of.
The phrase comes from “spill the T”, where “T” stands for truth. This was introduced by the famous African American drag queen, Lady Chablis, in the 1994 book “Midnight in the Garden of Good and Evil”.
Stackoverflow.com is the perfect place for stack spill questions. =)
16-byte
is because we are saving two 8-byte registers to the stack.
Folded
for this one I am going to have to guess. Folding is when math operations are simplified combined. I going to go out on a whim and say it does not apply here and that it’s just a generic compiler message that only sometimes applies. If we had several of these in a row to save many registers to the stack and incremented the stack pointer(sp) just once then it would be combined because we would be using -32+16=-16 and this does not cause any extra math.
sub sp, sp, #32
stp x27, x28, [sp]
stp x29, x30, [sp, #16] <--- folded because we decrement sp once on 1st row
Spill
is the process of saving registers to memory because we need the extra registers. This is often referred to as spilling the registers to memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With