All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: Stefan Weil <weil@mail.berlios.de>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 6/8] tcg: Add bytecode generator for tcg interpreter
Date: Sat, 01 Oct 2011 18:54:54 +0200	[thread overview]
Message-ID: <4E8745DE.5030007@web.de> (raw)
In-Reply-To: <1316289634-18786-6-git-send-email-weil@mail.berlios.de>

Am 17.09.2011 22:00, schrieb Stefan Weil:
> Unlike other tcg target code generators, this one does not generate
> machine code for some cpu. It generates machine independent bytecode
> which is interpreted later.
>
> This allows running QEMU on any host.
>
> Interpreted bytecode is slower than direct execution of generated
> machine code.
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
[...]
> diff --git a/tcg/bytecode/README b/tcg/bytecode/README
> new file mode 100644
> index 0000000..6fe9755
> --- /dev/null
> +++ b/tcg/bytecode/README
> @@ -0,0 +1,129 @@
> +TCG Interpreter (TCI) - Copyright (c) 2011 Stefan Weil.
> +
> +This file is released under GPL 2 or later.
> +
> +1) Introduction
> +
> +TCG (Tiny Code Generator) is a code generator which translates
> +code fragments ("basic blocks") from target code (any of the
> +targets supported by QEMU) to a code representation which
> +can be run on a host.
> +
> +QEMU can create native code for some hosts (arm, hppa, i386, ia64, ppc, ppc64,
> +s390, sparc, x86_64). For others, unofficial host support was written.
> +
> +By adding a code generator for a virtual machine and using an
> +interpreter for the generated bytecode, it is possible to
> +support (almost) any host.
> +
> +This is what TCI (Tiny Code Interpreter) does.
> +
> +2) Implementation
> +
> +Like each TCG host frontend, TCI implements the code generator in
> +tcg-target.c, tcg-target.h. Both files are in directory tcg/bytecode.
> +
> +The additional file tcg/tci.c adds the interpreter.
> +
> +The bytecode consists of opcodes (same numeric values as those used by
> +TCG), command length and arguments of variable size and number.

While reusing TCG opcode values certainly makes things easy to
implement, have you evaluated using LLVM bitcode as alternative to a
fully custom intermediate code format?

Andreas

  parent reply	other threads:[~2011-10-01 16:56 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-17 19:59 [Qemu-devel] [PATCH 0/8] tcg/interpreter: Add TCG + interpreter for bytecode (virtual machine) Stefan Weil
2011-09-17 20:00 ` [Qemu-devel] [PATCH 1/8] tcg: Declare TCG_TARGET_REG_BITS in tcg.h Stefan Weil
2011-09-17 20:00 ` [Qemu-devel] [PATCH 2/8] tcg: Don't declare TCG_TARGET_REG_BITS in tcg-target.h Stefan Weil
2011-09-17 20:00 ` [Qemu-devel] [PATCH 3/8] tcg: Add forward declarations for local functions Stefan Weil
2011-09-17 21:40   ` Peter Maydell
2011-09-17 20:00 ` [Qemu-devel] [PATCH 4/8] tcg: Add some assertions Stefan Weil
2011-09-17 20:00 ` [Qemu-devel] [PATCH 5/8] tcg: Add interpreter for bytecode Stefan Weil
2011-09-18  4:03   ` Andi Kleen
2011-09-18  5:49     ` Stefan Weil
2011-09-18  7:22       ` Paolo Bonzini
2011-09-18 17:54         ` Avi Kivity
2011-09-19  6:52           ` Andi Kleen
2011-09-19 11:56             ` Avi Kivity
2011-09-19 14:48               ` Andi Kleen
2011-09-18 10:18   ` Blue Swirl
2011-09-19 16:43   ` Richard Henderson
2011-09-19 20:24   ` Stuart Brady
2011-10-16 21:54     ` Stuart Brady
2011-09-17 20:00 ` [Qemu-devel] [PATCH 6/8] tcg: Add bytecode generator for tcg interpreter Stefan Weil
2011-09-18 10:03   ` Blue Swirl
2011-09-19 22:28     ` Stuart Brady
2011-10-01 16:54   ` Andreas Färber [this message]
2011-10-01 21:25     ` Stefan Weil
2011-10-09 16:19       ` Andreas Färber
2011-09-17 20:00 ` [Qemu-devel] [PATCH 7/8] tcg: Add tcg interpreter to configure / make Stefan Weil
2011-09-18  9:37   ` Blue Swirl
2011-09-18 10:14     ` Stefan Weil
2011-09-17 20:00 ` [Qemu-devel] [PATCH 8/8] ppc: Support tcg interpreter on ppc hosts Stefan Weil
2011-09-17 21:31   ` Peter Maydell
2011-09-17 21:33     ` Stefan Weil
2011-09-18 10:26 ` [Qemu-devel] [PATCH 0/8] tcg/interpreter: Add TCG + interpreter for bytecode (virtual machine) Blue Swirl
2011-09-18 10:49   ` malc
2011-09-18 12:12     ` Blue Swirl
2011-09-18 12:46       ` malc
2011-09-18 13:00         ` Blue Swirl
2011-09-18 13:13           ` malc
2011-09-18 13:26             ` Blue Swirl
2011-09-25 20:37           ` Stefan Weil
2011-10-01 12:02             ` Blue Swirl
2011-09-18 15:02 ` Mulyadi Santosa
2011-09-18 15:13   ` Stefan Weil
2011-09-18 16:39     ` Mulyadi Santosa
2011-09-18 20:15       ` Stefan Weil
2011-09-19 15:14         ` Mulyadi Santosa
2011-09-19  8:40     ` David Gilbert
2011-09-19 10:20       ` Stefan Hajnoczi
2011-09-19 10:27         ` David Gilbert
2011-09-18 18:02 ` Avi Kivity

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

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

  git send-email \
    --in-reply-to=4E8745DE.5030007@web.de \
    --to=andreas.faerber@web.de \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.