Re: [Tack-devel] Assembler and linker
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: David G. <dg...@co...> - 2022-10-29 18:26:02
|
On Sat, 29 Oct 2022 at 17:09, Sorav Bansal <sb...@ii...> wrote: > Again, thanks a lot George and David for the detailed and helpful > responses! Yes I was able to access the man page and it was helpful! > > One more question: as far as I can tell, the ACK implements and respects > the cdecl calling convention on the "linux386" machine, is that correct? > However I also see that ACK does not align the stack to a 16-byte boundary, > as required by the cdecl calling conventions on Linux (since GCC-4.5). Is > there any documentation on the calling conventions supported/implemented? > If it's cdecl compatible, it's likely to be by accident only and you probably shouldn't rely on it --- EM bytecode actually has a standard calling convention which has to be used by all ack architectures. See page 9 of the EM document. It's not complicated but is kinda inefficient as it involves passing all parameters on the stack, even on register-centric systems. There is only one calling convention. The EM bytecode system is both the ack's secret weapon but also its greatest weakness at the same time. It allows generic tools that work on all architectures, but also means that all architectures have to follow the same lowest-common-denominator model, even if it makes no sense for that architecture, and the calling convention's one of the things which suffers. It's mainly designed around older memory-centric CPUs with small numbers of registers. There are a couple of modern architecture backends, but it's really not comfortable there! |