[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/24] target/openrisc: Optimize l.jal to next
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 21/24] target/openrisc: Optimize l.jal to next |
Date: |
Tue, 14 Feb 2017 08:25:33 +1100 |
This allows the tcg optimizer to see, and fold, all of the
constants involved in a GOT base register load sequence.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/openrisc/translate.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
index 66064e1..cda84b6 100644
--- a/target/openrisc/translate.c
+++ b/target/openrisc/translate.c
@@ -198,7 +198,11 @@ static void gen_jump(DisasContext *dc, int32_t n26,
uint32_t reg, uint32_t op0)
tcg_gen_movi_tl(jmp_pc, tmp_pc);
break;
case 0x01: /* l.jal */
- tcg_gen_movi_tl(cpu_R[9], (dc->pc + 8));
+ tcg_gen_movi_tl(cpu_R[9], dc->pc + 8);
+ /* Optimize jal being used to load the PC for PIC. */
+ if (tmp_pc == dc->pc + 8) {
+ return;
+ }
tcg_gen_movi_tl(jmp_pc, tmp_pc);
break;
case 0x03: /* l.bnf */
--
2.9.3
- [Qemu-devel] [PULL 09/24] target/openrisc: Streamline arithmetic and OVE, (continued)
- [Qemu-devel] [PULL 09/24] target/openrisc: Streamline arithmetic and OVE, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 12/24] target/openrisc: Keep SR_F in a separate variable, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 14/24] target/openrisc: Use movcond where appropriate, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 13/24] target/openrisc: Keep SR_CY and SR_OV in a separate variables, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 16/24] target/openrisc: Enable trap, csync, msync, psync for user mode, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 15/24] target/openrisc: Set flags on helpers, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 17/24] target/openrisc: Implement msync, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 18/24] target/openrisc: Represent MACHI:MACLO as a single unit, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 20/24] target/openrisc: Fix madd, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 19/24] target/openrisc: Implement muld, muldu, macu, msbu, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 21/24] target/openrisc: Optimize l.jal to next,
Richard Henderson <=
- [Qemu-devel] [PULL 22/24] target/openrisc: Tidy ppc/npc implementation, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 23/24] target/openrisc: Tidy handling of delayed branches, Richard Henderson, 2017/02/13
- [Qemu-devel] [PULL 24/24] target/openrisc: Optimize for r0 being zero, Richard Henderson, 2017/02/13
- Re: [Qemu-devel] [PULL 00/24] target/openrisc patches, Peter Maydell, 2017/02/14