unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: patching gcc to allow other calling conventions
Date: Fri, 15 Jun 2012 20:47:11 +0200	[thread overview]
Message-ID: <CAGua6m0pvGLjHLfmoHCe_b5Qy4uKjewL9QPpOJVSVk5hSbHj8g@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2449 bytes --]

Hi,

After poking around with inline assembler I conclude that it's possible to
use inline assembler and macrology
to implement some kind of other calling convention that s suitable for
guile. at -O0.

But we want -O3, and then we are sold with this approach.

Another option is perhaps to follow the clues in wingo:s link e.g.

   http://atgreen.github.com/ggx/

And make specific arch with our calling mechansim or perhaps even better
extend gcc to allow us to mix
c-call convention and guile specific.

Anyway currently most of the porting of SBCL assembler for x86-64 is done
and with this tool I'm experimenting
with a simple JIT engine.

You can follow the progress at https://gitorious.org/aschm/aschm

Currently I can build code to a byte vector and execute it and now most of
the assembler works.

My plan is to keep the current byte-code as a on file media and then allow
to compile the code to a simple native format
(Say a 10-20x increase in size). I plan add a new type of  objectcode
datastructure where we will run the code in native mode
If a new function is evaluated that is not compiled to native it will
compile it and use that so that the usual lazyness will be employed.
The complications of this method will be very low. It will basically branch
off to support code for expensive instructions and try to emit at most say
10 native instructions for every byte opcode. In all not much more then a
glorified virtual engine. However I would expect some loops with simple
instructions to be as fast as what wingo just posted on the list e.g. A
simple loop will do 250-500M turns in a second.

My personal view is that improvement of our code base has to be
incrementally and that experiments of reasonable size and scope should be
done, then we can learn and at some point carve out a step forward.

I think this is a doable experiment. I have a question here. I would need
to add some code to guile in order to hook in this machine and it would
be nice to try that out in a guile branch. Shall I do all this in a local
repo or do you want to join. I fell like adding another guile repo in
github or gitorious is pushing things a litle and maybe we could start a
guile-wipedy-jit branch.

The reason I wanted to fork sbcl is that it has assemblers for
x86,x86-64,alpha,hppa,sparc,ppc,mips e.g a few targets. It would be nice to
know what targets to focus on or if we need to add anyone else to the list!

Anyway have fun!

/Stefan

[-- Attachment #2: Type: text/html, Size: 2692 bytes --]

             reply	other threads:[~2012-06-15 18:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 18:47 Stefan Israelsson Tampe [this message]
2012-06-17 21:54 ` patching gcc to allow other calling conventions Ludovic Courtès
2012-06-18  0:43   ` Noah Lavine
2012-06-18 16:59     ` Stefan Israelsson Tampe
2012-06-18 22:30       ` Noah Lavine
2012-06-18 22:55         ` Ludovic Courtès
2012-06-21 12:32         ` Stefan Israelsson Tampe
2012-06-21 17:14           ` Daniel Krueger
2012-06-21 17:50             ` Stefan Israelsson Tampe
2012-06-21 17:57               ` Daniel Krueger
2012-06-21 18:53                 ` Stefan Israelsson Tampe
2012-06-21 21:01             ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGua6m0pvGLjHLfmoHCe_b5Qy4uKjewL9QPpOJVSVk5hSbHj8g@mail.gmail.com \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).