Re: x86-64 and calling conventions

James Harris <james.harris.1@googlemail.com>
Mon, 12 May 2008 04:12:03 -0700 (PDT)

          From comp.compilers

Related articles
x86-64 and calling conventions cr88192@hotmail.com (cr88192) (2008-05-12)
Re: x86-64 and calling conventions cr88192@hotmail.com (cr88192) (2008-05-12)
Re: x86-64 and calling conventions james.harris.1@googlemail.com (James Harris) (2008-05-12)
Re: x86-64 and calling conventions vidar.hokstad@gmail.com (Vidar Hokstad) (2008-05-12)
Re: x86-64 and calling conventions daveparker@flamingthunder.com (Dave Parker) (2008-05-12)
Re: x86-64 and calling conventions cr88192@hotmail.com (cr88192) (2008-05-13)
Re: x86-64 and calling conventions cr88192@hotmail.com (cr88192) (2008-05-13)
Re: x86-64 and calling conventions gah@ugcs.caltech.edu (glen herrmannsfeldt) (2008-05-13)
Re: x86-64 and calling conventions james.harris.1@googlemail.com (James Harris) (2008-05-14)
[8 later articles]
| List of all articles for this month |
From: James Harris <james.harris.1@googlemail.com>
Newsgroups: comp.compilers
Date: Mon, 12 May 2008 04:12:03 -0700 (PDT)
Organization: Compilers Central
References: 08-05-031
Keywords: architecture, C, comment
Posted-Date: 12 May 2008 21:01:14 EDT

On 12 May, 00:44, "cr88192" <cr88...@hotmail.com> wrote:
> Well, I have my own compiler, however, I don't as of yet target x86-64.
>
> one of the main reasons:
> the calling conventions used in Linux and friends are, scary...


I'm working on a language where the call conventions are to be filled-
in after compilation. Each function is to compile to also use virtual
registers rather than real ones. Then only when one function calls
another do we set up the registers for both functions, the calling
conventions to pass data between them, and decide which regs to either
spill or save.


I should say this is work in progress. I'm not sure how well it will
work but expect that for small called functions there may be useful
gains. Oh, yes, the decision as to whether to inline small functions
will happen at the same time (based on optimisation speed/space
goals).


Not sure if that's any help. If it works it would illustrate that
subroutine and OS calling conventions can be plugged in after and are
distinct from code generation. OS calls are just function calls where
the callee's needs have already been decided - stack for Windows, regs
for Linux etc.


--
James
[How do you plan to handle function pointers? -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.