Follow

Wait, what? Arguments in registers? I thought C puts them in the stack
youtu.be/lALPErFlfNQ?t=194

· · Web · 3 · 0 · 1
@matrix fastcall, aka everything in registers, is the default for x86-64
it's a mess of legacy and ABI considerations, there's way too many calling conventions, and even those get optimized to whatever registers are free to use most times

https://en.wikipedia.org/wiki/X86_calling_conventions

@matrix @cope not on expert on this, but I've always assumed that most compilers would put all arguments in registers during a function call, except when the arguments being passed would be too large to fit in a register (i.e. if you're trying to pass a particularly big struct by value)

@matrix depends on the calling convention, but modern ones put args in registers when possible.

@matrix most call setups spill them to stack, but try to fit as many as possible into registers. It's always faster to use values already in registers than to have to load them from stack and save them back.

Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.