|
| From: | Andi Kleen |
| Subject: | Re: [Qemu-devel] [PATCH 5/8] tcg: Add interpreter for bytecode |
| Date: | Sat, 17 Sep 2011 21:03:05 -0700 |
| User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Stefan Weil <address@hidden> writes:
> +
> + switch (opc) {
> + case INDEX_op_end:
> + case INDEX_op_nop:
> + break;
You could probably get some more speed out of this by using a threaded
interpreter with gcc's computed goto extension. That's typically
significantly faster than a plain switch in a loop.
static void *ops[] = {
&&op1,
&&op2,
...
};
#define NEXT() goto *ops[*tb_ptr++];
op1:
...
NEXT();
-Andi
--
address@hidden -- Speaking for myself only
| [Prev in Thread] | Current Thread | [Next in Thread] |