[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 14/24] riscv: tcg-target: Add branch and jump i
From: |
Alistair Francis |
Subject: |
Re: [Qemu-devel] [RFC v2 14/24] riscv: tcg-target: Add branch and jump instructions |
Date: |
Wed, 28 Nov 2018 17:06:38 -0800 |
On Wed, Nov 28, 2018 at 12:15 PM Richard Henderson
<address@hidden> 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, 26)) {
> > + tcg_out_opc_jump(s, OPC_JAL, TCG_REG_ZERO, offset);
> > + } else {
> > + tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_TMP0, (intptr_t)target);
> > + tcg_out_opc_jump(s, OPC_JAL, TCG_REG_TMP0, 0);
> > + }
> > +}
> > +
> > +static void tcg_out_call_int(TCGContext *s, tcg_insn_unit *arg, bool tail)
> > +{
> > + TCGReg link = tail ? TCG_REG_ZERO : TCG_REG_RA;
> > + ptrdiff_t offset = tcg_pcrel_diff(s, arg);
> > + if (offset == sextract64(offset, 1, 20) << 1) {
>
> s/20/26/
>
> Seems like there ought to be more shared code between tcg_out_call_int and
> tcg_out_goto_long, really.
I think tcg_out_goto_long can just be removed and replaced with
tcg_out_call() right?
Alistair
>
>
> r~
- Re: [Qemu-devel] [RFC v2 08/24] riscv: tcg-target: Add the immediate encoders, (continued)
- [Qemu-devel] [RFC v2 09/24] riscv: tcg-target: Add the instruction emitters, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 10/24] riscv: tcg-target: Add the relocation functions, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 11/24] riscv: tcg-target: Add the mov and movi instruction, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 12/24] riscv: tcg-target: Add the extract instructions, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 13/24] riscv: tcg-target: Add the out load and store instructions, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 14/24] riscv: tcg-target: Add branch and jump instructions, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 15/24] riscv: tcg-target: Add slowpath load and store instructions, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 16/24] riscv: tcg-target: Add direct load and store instructions, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 17/24] riscv: tcg-target: Add the out op decoder, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 18/24] riscv: tcg-target: Add the prologue generation and register the JIT, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 19/24] riscv: tcg-target: Add the target init code, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 20/24] tcg: Add RISC-V cpu signal handler, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 21/24] dias: Add RISC-V support, Alistair Francis, 2018/11/27