WinUAE icon indicating copy to clipboard operation
WinUAE copied to clipboard

Poor JIT performance on ADDX?

Open nonarkitten opened this issue 5 years ago • 4 comments

There seems to be a strong slow down with JIT when it encounters ADDX.

nonarkitten avatar Jul 02 '19 01:07 nonarkitten

I don't know (and I don't want to know, too much x86 assembly..) much about JIT but ADDX (and SUBX) appears to be fully supported without falling back to non-JIT emulation. Aranym developers probably can help more if needed, they have done JIT improvements in recent years (which I have merged).

What kind of test code you run and why do you think it is ADDX related? Which ADDX addressing mode?

tonioni avatar Jul 02 '19 18:07 tonioni

Without getting into too many specifics, it's a simple workload test. The following pattern:

addq.l #1,d5
addq.l #1,d4
add.l (a0),(a1)

Is ten times faster than

addx.l d1,d5
addq.l #1,d4
add.l (a0),(a1)

I'm guessing the extra work having to handle the X flag is the culprit here.

nonarkitten avatar Jul 02 '19 21:07 nonarkitten

Is there a way to show the emitted JIT code?

nonarkitten avatar Jul 03 '19 14:07 nonarkitten

Is there a way to show the emitted JIT code?

In aranym there is:https://github.com/aranym/aranym/blob/1328158098ddad1cafebbca27e7c493716dab688/src/uae_cpu/compiler/compemu_support.cpp#L4974-L4986

You have do compile aranym locally, with --enable-disasm and --enable-jit-debug, and then set that local variable disasm_block to true somewhere (this is not done anywhere in the code). But be aware that this will produce tons of debug output.

th-otto avatar Jul 03 '19 16:07 th-otto