Re: [Qemu-devel] [RFC v2 14/24] riscv: tcg-target: Add branch and jump instructions

2018-11-28 Thread Richard Henderson
On 11/28/18 5:06 PM, Alistair Francis wrote: > On Wed, Nov 28, 2018 at 12:15 PM Richard Henderson > wrote: >> >> On 11/27/18 1:08 PM, Alistair Francis wrote: >>> +static inline void tcg_out_goto_long(TCGContext *s, tcg_insn_unit *target) >>> +{ >>> +ptrdiff_t offset = tcg_pcrel_diff(s, target)

Re: [Qemu-devel] [RFC v2 14/24] riscv: tcg-target: Add branch and jump instructions

2018-11-28 Thread Alistair Francis
On Wed, Nov 28, 2018 at 12:15 PM Richard Henderson wrote: > > On 11/27/18 1:08 PM, Alistair Francis wrote: > > +static inline void tcg_out_goto_long(TCGContext *s, tcg_insn_unit *target) > > +{ > > +ptrdiff_t offset = tcg_pcrel_diff(s, target); > > + > > +if (offset == sextract64(offset, 0

Re: [Qemu-devel] [RFC v2 14/24] riscv: tcg-target: Add branch and jump instructions

2018-11-28 Thread Richard Henderson
On 11/27/18 1:08 PM, Alistair Francis wrote: > +static inline void tcg_out_goto_long(TCGContext *s, tcg_insn_unit *target) > +{ > +ptrdiff_t offset = tcg_pcrel_diff(s, target); > + > +if (offset == sextract64(offset, 0, 26)) { > +tcg_out_opc_jump(s, OPC_JAL, TCG_REG_ZERO, offset); >

[Qemu-devel] [RFC v2 14/24] riscv: tcg-target: Add branch and jump instructions

2018-11-27 Thread Alistair Francis
Signed-off-by: Alistair Francis Signed-off-by: Michael Clark --- tcg/riscv/tcg-target.inc.c | 141 + 1 file changed, 141 insertions(+) diff --git a/tcg/riscv/tcg-target.inc.c b/tcg/riscv/tcg-target.inc.c index cac4a4b615..97831bfb9d 100644 --- a/tcg/riscv/tcg