Skip to contentSkip to conversation

Performance bug in tcg/i386 output:

Qemu-devel Chad 2 participants 2 messages Nov 8, 2009

lore
Share & tools
lore

Chad

author
#0 lore raw

Running qemu[-i386] with -d out_asm and looking at qemu.out shows this test/j**/jmp pattern repeatedly:

0xb1aa40f6:  test   %ecx,%ecx
0xb1aa40f8:  jne    0xb1aa4115
0xb1aa40fe:  jmp    0xb1aa4103
0xb1aa4103:  mov    $0xc0bf,%eax

Therefore there's a bug in the tcg generator creating many unnecessary jmps. It might get optimized out by the CPU, but it might not and it bloats the asm output in any case...

- Chad

#1 lore raw
Quoted 11 lines · Chad

Running qemu[-i386] with -d out_asm and looking at qemu.out shows this test/j**/jmp pattern repeatedly:

0xb1aa40f6:  test   %ecx,%ecx
0xb1aa40f8:  jne    0xb1aa4115
0xb1aa40fe:  jmp    0xb1aa4103
0xb1aa4103:  mov    $0xc0bf,%eax

Therefore there's a bug in the tcg generator creating many unnecessary jmps.  It might get optimized out by the CPU, but it might not and it bloats the asm output in any case...

Some of these jumps are patched later when the target block is translated (block chaining).

If you want to see the real output, you'll have to disassemble after execution.

Laurent