qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/8] tcg: Add interpreter for bytecode


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH 5/8] tcg: Add interpreter for bytecode
Date: Sun, 18 Sep 2011 07:49:15 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13

Am 18.09.2011 06:03, schrieb Andi Kleen:
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

Is there really any difference in the generated code?
gcc already uses a jump table internally to handle the
switch cases.

- Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]