lightning
[Top][All Lists]
Advanced

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

Re: [PATCH v2 0/9] mips: Fill delay slots v2


From: Paulo César Pereira de Andrade
Subject: Re: [PATCH v2 0/9] mips: Fill delay slots v2
Date: Tue, 10 Jan 2023 13:30:49 -0300

Em seg., 9 de jan. de 2023 às 20:04, Paul Cercueil
<paul@crapouillou.net> escreveu:
>
> Hi Paulo,

  Hi Paul,

> I switched to a mips64 toolchain and I could reproduce the build issues.
> Here's a revised patchset with most of them addressed.
>
> There was a combination of problems: the first one being that my
> opcode_writes_register() was incomplete (missed all of the MIPS64
> opcodes and some MIPS32 opcodes as well).
>
> The second problem was that my "no_flag" was incorrectly set after a
> jit_code_note, jit_code_name or jit_code_prolog.
>
> With this patchset applied I now have all the checks passing
> successfully, except for the "clobber" one. I am not sure what's going
> on with this one, and it's hard to debug - the disassembly results in a
> 30 MiB file, with too many differences to "diff" - because filling the
> delay slots causes the code to be smaller.

  I suggest attempting to bisect the problem by editing clobber.tst

  You can also edit the macros to add an ending new line, and run
something like:

$ gcc -E -x c -D__WORDSIZE=64 -D__LITTLE_ENDIAN -D__mips__=1
check/clobber.tst > check/clobber.i

then, run:

$ cd check
$ make debug
...
(gdb) b _jit_emit
(gdb) run -v clobber.i >& clobber.txt
...
(gdb) finish

assuming you have a build with --enable-devel-disassembler, then, you
can also add breakpoints in addresses, for example.:

(gdb) b *0xdeadbeef

and do single step to debug states. Could also just add a breakpoint in
'abort' and check from the assembly output the problem (might have
registers overwritten at abort entry).

  The clobber test case must pass.

  It validates that JIT_Rx, JIT_Vx and JIT_Fx not used in the operation
are not clobbered. That is, there are no unexpected side effects.
  Actually, clobber.tst should be extended as there are new codes since
it was implemented. It also only tests the minimal set of registers, 3 JIT_Rx,
3 JIT_Vx and 3 JIT_Fx.

> Cheers,
> -Paul
>
> Paul Cercueil (8):
>   mips: Optimize jit_eqr / jit_eqi
>   mips: Fill delay slots of JR opcodes in jit_jmpr
>   mips: Fill delay slots of JALR opcodes in jit_callr
>   mips: Fill delay slots of J in jit_jmpi
>   mips: Fill delay slots in jit_beqr / jit_beqi
>   mips: Fill delay slots in jit_bner / jit_bnei
>   mips: Fill delay slots in jit_bgtr, jit_bgti, jit_bler, jit_blei
>   mips: Fill delay slots in jit_bger, jit_bgei, jit_bltr, jit_blti
>
>  lib/jit_mips-cpu.c | 731 +++++++++++++++++++++++++--------------------
>  lib/jit_mips.c     |  87 ++++--
>  2 files changed, 466 insertions(+), 352 deletions(-)
>
> --
> 2.39.0

Thanks,
Paulo



reply via email to

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