[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcod
From: |
Paulo César Pereira de Andrade |
Subject: |
Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes |
Date: |
Fri, 12 Aug 2022 10:03:15 -0300 |
Em sex., 12 de ago. de 2022 às 09:43, Paul Cercueil
<paul@crapouillou.net> escreveu:
>
>
>
> Le ven., août 12 2022 at 09:40:30 -0300, Paulo César Pereira de
> Andrade <paulo.cesar.pereira.de.andrade@gmail.com> a écrit :
> > Em sex., 12 de ago. de 2022 às 09:26, Paul Cercueil
> > <paul@crapouillou.net> escreveu:
> >>
> >>
> >> [...]
> >>
> >> >> Actually that case would be fine. It's for the case where the
> >> LABEL
> >> >> is
> >> >> between the ldr_ui and the bswapr_ui. I do check the previous
> >> >> opcode,
> >> >> because that's where the jit_flag_patch seems to be.
> >> >
> >> > I see. The logic is just checking if the previous node is a
> >> label
> >> > or an
> >> > epilog implicit patch.
> >>
> >> Actually it looks like the detection code is broken. With the
> >> example
> >> code of my previous email, if I add a jit_label() between the
> >> jit_ldr_ui() and the jit_bswapr_ui(), it still converts to the LWBRX
> >> opcode and Lightning eventually fails an assert() in jit_address().
> >
> > It should not fail if you use jit_indirect() instead of
> > jit_label(). Using
> > jit_label() is subject to optimization, if there is no jump to it. The
> > assertion is because the label is not used.
>
> I used jit_address() though, is that not considered as using the label?
If you did use jit_print() or jit_disassembly(), it would not show the label,
as it should been removed from the linked list, due to no jump targeting it.
It is done in lightning.c:sequential_labels()
> > I will apply the patch, and possibly add a small further patch with
> > a comment about moving it to another place if a backend specific
> > optimization pass is implemented.
>
> Great, thanks!
>
> Cheers,
> -Paul
>
>
- [PATCH] ppc: Add optimization to generate endian-swapping load opcodes, Paul Cercueil, 2022/08/10
- Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes, Paulo César Pereira de Andrade, 2022/08/11
- Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes, Paul Cercueil, 2022/08/11
- Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes, Paulo César Pereira de Andrade, 2022/08/11
- Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes, Paul Cercueil, 2022/08/11
- Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes, Paul Cercueil, 2022/08/12
- Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes, Paul Cercueil, 2022/08/12
- Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes, Paulo César Pereira de Andrade, 2022/08/12
- Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes, Paul Cercueil, 2022/08/12
- Re: [PATCH] ppc: Add optimization to generate endian-swapping load opcodes,
Paulo César Pereira de Andrade <=