[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 24/24] WIP: Try to patch longer branches
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [RFC v2 24/24] WIP: Try to patch longer branches |
Date: |
Wed, 28 Nov 2018 12:39:54 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
On 11/27/18 1:10 PM, Alistair Francis wrote:
> + if (short_jmp) {
> + reloc_sbimm12(code_ptr, (tcg_insn_unit *)value);
> + } else {
> + /* Invert the condition */
> + insn = insn ^ (1 << 12);
> + /* Clear the offset */
> + insn &= 0xFFF;
> + /* Set the offset to the PC + 8 */
> + insn |= ((unsigned int)(code_ptr + 8)) << 12;
This isn't a pc-relative value you're storing.
reloc_sbimm12(code_ptr, code_ptr + 2);
> + /* Overwrite the NOP with jal x0,value */
> + insn = encode_uj(OPC_JAL, TCG_REG_ZERO, value);
This isn't pc-relative either. Perhaps best as
code_ptr[1] = encode_uj(OPC_JAL, TCG_REG_ZERO, 0);
reloc_jimm20(code_ptr + 1, (tcg_insn_unit *)value);
r~
- [Qemu-devel] [RFC v2 18/24] riscv: tcg-target: Add the prologue generation and register the JIT, (continued)
- [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
- [Qemu-devel] [RFC v2 22/24] configure: Add support for building RISC-V host, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 23/24] WIP: Add missing instructions, Alistair Francis, 2018/11/27
- [Qemu-devel] [RFC v2 24/24] WIP: Try to patch longer branches, Alistair Francis, 2018/11/27
- Re: [Qemu-devel] [RFC v2 24/24] WIP: Try to patch longer branches,
Richard Henderson <=
- Re: [Qemu-devel] [RFC v2 00/24] Add RISC-V TCG backend support, Alistair Francis, 2018/11/27
- Re: [Qemu-devel] [RFC v2 00/24] Add RISC-V TCG backend support, no-reply, 2018/11/29