4 ms·
I know from having to implement va_start/va_arg/va_end and it comes down to ABI. The challenge is how you would have either the caller or callee have a consiste
by boulos 7y ago
I know from having to implement va_start/va_arg/va_end and it comes down to ABI. The challenge is how you would have either the caller or callee have a consistent piece of code for pushing/popping the stack.
The int case is pretty clear, because whatever you go with a 32-bit register like most args in the C-family of ABIs, and it only matters for the register pressure (you're really just zero extending for char and short). I do find the float/double case clumsy, as is the int64 case, but it falls out of the rules for casting as mentioned and the ABI churn for both floating point and AMD64.