Am 18.09.2011 06:03, schrieb Andi Kleen:
Stefan Weil <w...@mail.berlios.de> 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